Commit 5cad0d0e authored by James Cook's avatar James Cook Committed by Commit Bot

cros: Remove --use-unconsented-primary-account

Replace the only check with a check for SplitSettingsSync. Enough
features have been converted to work with the unconsented primary
account that I don't need a separate flag for it any more.

Bug: 1042400
Test: existing signin tests
Change-Id: Iaf3690027737fd0ac674dad20d7da6107bb6b1b0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2035862
Commit-Queue: Xiyuan Xia <xiyuan@chromium.org>
Auto-Submit: James Cook <jamescook@chromium.org>
Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#737870}
parent 67eeca7d
......@@ -1421,8 +1421,7 @@ void UserSessionManager::InitProfilePreferences(
->FindExtendedAccountInfoForAccountWithRefreshTokenByGaiaId(
gaia_id);
DCHECK(account_info.has_value());
// TODO(jamescook): Replace switch with IsSplitSettingsSyncEnabled().
if (switches::UseUnconsentedPrimaryAccount()) {
if (features::IsSplitSettingsSyncEnabled()) {
if (is_new_profile) {
if (!identity_manager->HasPrimaryAccount()) {
// Set the account without recording browser sync consent.
......@@ -1435,7 +1434,7 @@ void UserSessionManager::InitProfilePreferences(
gaia_id);
} else {
// Set a primary account here because the profile might have been
// created with switches::UseUnconsentedPrimaryAccount set. Then the
// created with the feature SplitSettingsSync enabled. Then the
// profile might only have an unconsented primary account.
identity_manager->GetPrimaryAccountMutator()->SetPrimaryAccount(
account_info->account_id);
......
......@@ -495,13 +495,6 @@ const char kTetherHostScansIgnoreWiredConnections[] =
// Shows all Bluetooth devices in UI (System Tray/Settings Page.)
const char kUnfilteredBluetoothDevices[] = "unfiltered-bluetooth-devices";
// Skips the call to IdentityManager SetPrimaryAccount() on login, using
// SetUnconsentedPrimaryAccount() instead. This marks the primary account as
// *not* consented to browser sync, allowing consent to be set later. Used for
// manual testing, not intended for production. See also
// chromeos::features::kSplitSettingsSync.
const char kUseUnconsentedPrimaryAccount[] = "use-unconsented-primary-account";
// Used to tell the policy infrastructure to not let profile initialization
// complete until policy is manually set by a test. This is used to provide
// backward compatibility with a few tests that incorrectly use the
......@@ -594,10 +587,5 @@ bool IsUnfilteredBluetoothDevicesEnabled() {
kUnfilteredBluetoothDevices);
}
bool UseUnconsentedPrimaryAccount() {
return base::CommandLine::ForCurrentProcess()->HasSwitch(
kUseUnconsentedPrimaryAccount);
}
} // namespace switches
} // namespace chromeos
......@@ -198,8 +198,6 @@ extern const char kWaitForInitialPolicyFetchForTest[];
COMPONENT_EXPORT(CHROMEOS_CONSTANTS) extern const char kWakeOnWifiPacket[];
COMPONENT_EXPORT(CHROMEOS_CONSTANTS)
extern const char kUnfilteredBluetoothDevices[];
COMPONENT_EXPORT(CHROMEOS_CONSTANTS)
extern const char kUseUnconsentedPrimaryAccount[];
////////////////////////////////////////////////////////////////////////////////
......@@ -252,9 +250,6 @@ COMPONENT_EXPORT(CHROMEOS_CONSTANTS) bool IsArcCpuRestrictionDisabled();
// Returns true if all Bluetooth devices in UI (System Tray/Settings Page.)
COMPONENT_EXPORT(CHROMEOS_CONSTANTS) bool IsUnfilteredBluetoothDevicesEnabled();
// See kUseUnconsentedPrimaryAccount.
COMPONENT_EXPORT(CHROMEOS_CONSTANTS) bool UseUnconsentedPrimaryAccount();
} // namespace switches
} // namespace chromeos
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment