Commit 6e7d226c authored by Jaeyong Bae's avatar Jaeyong Bae Committed by Commit Bot

Remove prefs::kReverseAutologinEnabled & DisableOneClickSignIn

This patch means removing the preference and functions
that reference it.
Because preference is set but never read, that is indeed obsolete.

Bug: 889908
Cq-Include-Trybots: luci.chromium.try:ios-simulator-cronet;luci.chromium.try:ios-simulator-full-configs
Change-Id: I22a80bed2387b08480dae9c930bb1d329dd8c45d
Reviewed-on: https://chromium-review.googlesource.com/c/1264343
Commit-Queue: Sylvain Defresne <sdefresne@chromium.org>
Reviewed-by: default avatarGabriel Charette <gab@chromium.org>
Reviewed-by: default avatarMihai Sardarescu <msarda@chromium.org>
Reviewed-by: default avatarSylvain Defresne <sdefresne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#599200}
parent bb5802e5
...@@ -373,6 +373,9 @@ const char kLastWelcomedOSVersion[] = "browser.last_welcomed_os_version"; ...@@ -373,6 +373,9 @@ const char kLastWelcomedOSVersion[] = "browser.last_welcomed_os_version";
const char kSupervisedUserCreationAllowed[] = const char kSupervisedUserCreationAllowed[] =
"profile.managed_user_creation_allowed"; "profile.managed_user_creation_allowed";
// Deprecated 10/2018
const char kReverseAutologinEnabled[] = "reverse_autologin.enabled";
// Register prefs used only for migration (clearing or moving to a new key). // Register prefs used only for migration (clearing or moving to a new key).
void RegisterProfilePrefsForMigration( void RegisterProfilePrefsForMigration(
user_prefs::PrefRegistrySyncable* registry) { user_prefs::PrefRegistrySyncable* registry) {
...@@ -396,6 +399,8 @@ void RegisterProfilePrefsForMigration( ...@@ -396,6 +399,8 @@ void RegisterProfilePrefsForMigration(
registry->RegisterIntegerPref(kOptionsWindowLastTabIndex, 0); registry->RegisterIntegerPref(kOptionsWindowLastTabIndex, 0);
registry->RegisterStringPref(kTrustedDownloadSources, std::string()); registry->RegisterStringPref(kTrustedDownloadSources, std::string());
registry->RegisterBooleanPref(kSupervisedUserCreationAllowed, true); registry->RegisterBooleanPref(kSupervisedUserCreationAllowed, true);
registry->RegisterBooleanPref(kReverseAutologinEnabled, true);
} }
} // namespace } // namespace
...@@ -851,4 +856,7 @@ void MigrateObsoleteProfilePrefs(Profile* profile) { ...@@ -851,4 +856,7 @@ void MigrateObsoleteProfilePrefs(Profile* profile) {
profile_prefs->ClearPref(kOptionsWindowLastTabIndex); profile_prefs->ClearPref(kOptionsWindowLastTabIndex);
profile_prefs->ClearPref(kTrustedDownloadSources); profile_prefs->ClearPref(kTrustedDownloadSources);
profile_prefs->ClearPref(kSupervisedUserCreationAllowed); profile_prefs->ClearPref(kSupervisedUserCreationAllowed);
// Added 10/2018
profile_prefs->ClearPref(kReverseAutologinEnabled);
} }
...@@ -274,7 +274,6 @@ class InlineLoginUIBrowserTest : public InProcessBrowserTest { ...@@ -274,7 +274,6 @@ class InlineLoginUIBrowserTest : public InProcessBrowserTest {
void SetUpSigninManager(const std::string& username); void SetUpSigninManager(const std::string& username);
void EnableSigninAllowed(bool enable); void EnableSigninAllowed(bool enable);
void EnableOneClick(bool enable);
void AddEmailToOneClickRejectedList(const std::string& email); void AddEmailToOneClickRejectedList(const std::string& email);
void AllowSigninCookies(bool enable); void AllowSigninCookies(bool enable);
void SetAllowedUsernamePattern(const std::string& pattern); void SetAllowedUsernamePattern(const std::string& pattern);
...@@ -297,11 +296,6 @@ void InlineLoginUIBrowserTest::EnableSigninAllowed(bool enable) { ...@@ -297,11 +296,6 @@ void InlineLoginUIBrowserTest::EnableSigninAllowed(bool enable) {
pref_service->SetBoolean(prefs::kSigninAllowed, enable); pref_service->SetBoolean(prefs::kSigninAllowed, enable);
} }
void InlineLoginUIBrowserTest::EnableOneClick(bool enable) {
PrefService* pref_service = browser()->profile()->GetPrefs();
pref_service->SetBoolean(prefs::kReverseAutologinEnabled, enable);
}
void InlineLoginUIBrowserTest::AddEmailToOneClickRejectedList( void InlineLoginUIBrowserTest::AddEmailToOneClickRejectedList(
const std::string& email) { const std::string& email) {
PrefService* pref_service = browser()->profile()->GetPrefs(); PrefService* pref_service = browser()->profile()->GetPrefs();
...@@ -380,13 +374,10 @@ IN_PROC_BROWSER_TEST_F(InlineLoginUIBrowserTest, CanOfferNoProfile) { ...@@ -380,13 +374,10 @@ IN_PROC_BROWSER_TEST_F(InlineLoginUIBrowserTest, CanOfferNoProfile) {
} }
IN_PROC_BROWSER_TEST_F(InlineLoginUIBrowserTest, CanOffer) { IN_PROC_BROWSER_TEST_F(InlineLoginUIBrowserTest, CanOffer) {
EnableOneClick(true);
EXPECT_TRUE(CanOfferSignin(browser()->profile(), EXPECT_TRUE(CanOfferSignin(browser()->profile(),
CAN_OFFER_SIGNIN_FOR_ALL_ACCOUNTS, "12345", CAN_OFFER_SIGNIN_FOR_ALL_ACCOUNTS, "12345",
"user@gmail.com", NULL)); "user@gmail.com", NULL));
EnableOneClick(false);
std::string error_message; std::string error_message;
EXPECT_TRUE(CanOfferSignin(browser()->profile(), EXPECT_TRUE(CanOfferSignin(browser()->profile(),
......
...@@ -392,10 +392,6 @@ const std::string& SigninManager::GetUsernameForAuthInProgress() const { ...@@ -392,10 +392,6 @@ const std::string& SigninManager::GetUsernameForAuthInProgress() const {
return possibly_invalid_email_; return possibly_invalid_email_;
} }
void SigninManager::DisableOneClickSignIn(PrefService* prefs) {
prefs->SetBoolean(prefs::kReverseAutologinEnabled, false);
}
void SigninManager::MergeSigninCredentialIntoCookieJar() { void SigninManager::MergeSigninCredentialIntoCookieJar() {
if (account_consistency_ == signin::AccountConsistencyMethod::kMirror) if (account_consistency_ == signin::AccountConsistencyMethod::kMirror)
return; return;
...@@ -457,8 +453,6 @@ void SigninManager::OnSignedIn() { ...@@ -457,8 +453,6 @@ void SigninManager::OnSignedIn() {
signin_metrics::LogSigninProfile(client_->IsFirstRun(), signin_metrics::LogSigninProfile(client_->IsFirstRun(),
client_->GetInstallDate()); client_->GetInstallDate());
DisableOneClickSignIn(client_->GetPrefs()); // Don't ever offer again.
PostSignedIn(); PostSignedIn();
} }
......
...@@ -181,11 +181,6 @@ class SigninManager : public SigninManagerBase, ...@@ -181,11 +181,6 @@ class SigninManager : public SigninManagerBase,
// authenticated. Returns an empty string if no auth is in progress. // authenticated. Returns an empty string if no auth is in progress.
const std::string& GetUsernameForAuthInProgress() const; const std::string& GetUsernameForAuthInProgress() const;
// Set the preference to turn off one-click sign-in so that it won't ever
// show it again for the user associated with |prefs| (even if the user tries
// a new account).
static void DisableOneClickSignIn(PrefService* prefs);
protected: protected:
// The sign out process which is started by SigninClient::PreSignOut() // The sign out process which is started by SigninClient::PreSignOut()
virtual void OnSignoutDecisionReached( virtual void OnSignoutDecisionReached(
......
...@@ -53,7 +53,6 @@ void SigninManagerBase::RegisterProfilePrefs(PrefRegistrySimple* registry) { ...@@ -53,7 +53,6 @@ void SigninManagerBase::RegisterProfilePrefs(PrefRegistrySimple* registry) {
registry->RegisterStringPref(prefs::kGoogleServicesUserAccountId, registry->RegisterStringPref(prefs::kGoogleServicesUserAccountId,
std::string()); std::string());
registry->RegisterBooleanPref(prefs::kAutologinEnabled, true); registry->RegisterBooleanPref(prefs::kAutologinEnabled, true);
registry->RegisterBooleanPref(prefs::kReverseAutologinEnabled, true);
registry->RegisterListPref(prefs::kReverseAutologinRejectedEmailList, registry->RegisterListPref(prefs::kReverseAutologinRejectedEmailList,
std::make_unique<base::ListValue>()); std::make_unique<base::ListValue>());
registry->RegisterBooleanPref(prefs::kSigninAllowed, true); registry->RegisterBooleanPref(prefs::kSigninAllowed, true);
......
...@@ -77,9 +77,6 @@ const char kGoogleServicesUsername[] = "google.services.username"; ...@@ -77,9 +77,6 @@ const char kGoogleServicesUsername[] = "google.services.username";
const char kGoogleServicesUsernamePattern[] = const char kGoogleServicesUsernamePattern[] =
"google.services.username_pattern"; "google.services.username_pattern";
// Boolean identifying whether reverse auto-logins is enabled.
const char kReverseAutologinEnabled[] = "reverse_autologin.enabled";
// List to keep track of emails for which the user has rejected one-click // List to keep track of emails for which the user has rejected one-click
// sign-in. // sign-in.
const char kReverseAutologinRejectedEmailList[] = const char kReverseAutologinRejectedEmailList[] =
......
...@@ -23,7 +23,6 @@ extern const char kGoogleServicesSigninScopedDeviceId[]; ...@@ -23,7 +23,6 @@ extern const char kGoogleServicesSigninScopedDeviceId[];
extern const char kGoogleServicesUserAccountId[]; extern const char kGoogleServicesUserAccountId[];
extern const char kGoogleServicesUsername[]; extern const char kGoogleServicesUsername[];
extern const char kGoogleServicesUsernamePattern[]; extern const char kGoogleServicesUsernamePattern[];
extern const char kReverseAutologinEnabled[];
extern const char kReverseAutologinRejectedEmailList[]; extern const char kReverseAutologinRejectedEmailList[];
extern const char kSignedInTime[]; extern const char kSignedInTime[];
extern const char kSigninAllowed[]; extern const char kSigninAllowed[];
......
...@@ -62,6 +62,10 @@ ...@@ -62,6 +62,10 @@
#error "This file requires ARC support." #error "This file requires ARC support."
#endif #endif
namespace {
const char kReverseAutologinEnabled[] = "reverse_autologin.enabled";
}
void RegisterLocalStatePrefs(PrefRegistrySimple* registry) { void RegisterLocalStatePrefs(PrefRegistrySimple* registry) {
BrowserStateInfoCache::RegisterPrefs(registry); BrowserStateInfoCache::RegisterPrefs(registry);
flags_ui::PrefServiceFlagsStorage::RegisterPrefs(registry); flags_ui::PrefServiceFlagsStorage::RegisterPrefs(registry);
...@@ -164,6 +168,8 @@ void RegisterBrowserStatePrefs(user_prefs::PrefRegistrySyncable* registry) { ...@@ -164,6 +168,8 @@ void RegisterBrowserStatePrefs(user_prefs::PrefRegistrySyncable* registry) {
// Register prefs used by Clear Browsing Data UI. // Register prefs used by Clear Browsing Data UI.
browsing_data::prefs::RegisterBrowserUserPrefs(registry); browsing_data::prefs::RegisterBrowserUserPrefs(registry);
registry->RegisterBooleanPref(kReverseAutologinEnabled, true);
} }
// This method should be periodically pruned of year+ old migrations. // This method should be periodically pruned of year+ old migrations.
...@@ -183,4 +189,7 @@ void MigrateObsoleteBrowserStatePrefs(PrefService* prefs) { ...@@ -183,4 +189,7 @@ void MigrateObsoleteBrowserStatePrefs(PrefService* prefs) {
// Added 8/2018. // Added 8/2018.
autofill::prefs::MigrateDeprecatedAutofillPrefs(prefs); autofill::prefs::MigrateDeprecatedAutofillPrefs(prefs);
// Added 10/2018.
prefs->ClearPref(kReverseAutologinEnabled);
} }
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