diff options
Diffstat (limited to 'chrome/browser/sync')
-rw-r--r-- | chrome/browser/sync/engine/syncapi.cc | 2 | ||||
-rw-r--r-- | chrome/browser/sync/profile_sync_service.cc | 19 | ||||
-rw-r--r-- | chrome/browser/sync/profile_sync_service.h | 4 | ||||
-rw-r--r-- | chrome/browser/sync/resources/firstpassphrase.html | 151 | ||||
-rw-r--r-- | chrome/browser/sync/resources/setup_flow.html | 6 | ||||
-rw-r--r-- | chrome/browser/sync/sync_setup_flow.cc | 18 | ||||
-rw-r--r-- | chrome/browser/sync/sync_setup_flow.h | 7 | ||||
-rw-r--r-- | chrome/browser/sync/sync_setup_flow_handler.h | 1 | ||||
-rw-r--r-- | chrome/browser/sync/sync_setup_wizard.cc | 3 | ||||
-rw-r--r-- | chrome/browser/sync/sync_setup_wizard.h | 3 | ||||
-rw-r--r-- | chrome/browser/sync/sync_setup_wizard_unittest.cc | 18 |
11 files changed, 8 insertions, 224 deletions
diff --git a/chrome/browser/sync/engine/syncapi.cc b/chrome/browser/sync/engine/syncapi.cc index 1efdb26..44e7024 100644 --- a/chrome/browser/sync/engine/syncapi.cc +++ b/chrome/browser/sync/engine/syncapi.cc @@ -1989,6 +1989,8 @@ void SyncManager::SyncInternal::SetPassphrase( // TODO(tim): If this is the first time the user has entered a passphrase // since the protocol changed to store passphrase preferences in the cloud, // make sure we update this preference. See bug 62103. + // TODO(jhawkins): Verify that this logic may be removed now that the + // migration is no longer supported. if (is_explicit) SetUsingExplicitPassphrasePrefForMigration(&trans); diff --git a/chrome/browser/sync/profile_sync_service.cc b/chrome/browser/sync/profile_sync_service.cc index 798d305..932d4cf 100644 --- a/chrome/browser/sync/profile_sync_service.cc +++ b/chrome/browser/sync/profile_sync_service.cc @@ -69,7 +69,6 @@ ProfileSyncService::ProfileSyncService(ProfileSyncFactory* factory, const std::string& cros_user) : last_auth_error_(AuthError::None()), passphrase_required_reason_(sync_api::REASON_PASSPHRASE_NOT_REQUIRED), - passphrase_migration_in_progress_(false), factory_(factory), profile_(profile), cros_user_(cros_user), @@ -720,9 +719,11 @@ void ProfileSyncService::ShowErrorUI() { if (IsUsingSecondaryPassphrase()) PromptForExistingPassphrase(); else - SigninForPassphraseMigration(); + NOTREACHED(); // Migration no longer supported. + return; } + const GoogleServiceAuthError& error = GetAuthError(); if (error.state() == GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS || error.state() == GoogleServiceAuthError::CAPTCHA_REQUIRED || @@ -755,11 +756,6 @@ void ProfileSyncService::PromptForExistingPassphrase() { wizard_.Step(SyncSetupWizard::ENTER_PASSPHRASE); } -void ProfileSyncService::SigninForPassphraseMigration() { - passphrase_migration_in_progress_ = true; - ShowLoginDialog(); -} - SyncBackendHost::StatusSummary ProfileSyncService::QuerySyncStatusSummary() { if (backend_.get() && backend_initialized_) return backend_->GetStatusSummary(); @@ -1245,15 +1241,6 @@ void ProfileSyncService::Observe(NotificationType type, // becomes a no-op. tried_implicit_gaia_remove_when_bug_62103_fixed_ = true; SetPassphrase(successful->password, false, true); - - // If this signin was to initiate a passphrase migration (on the - // first computer, thus not for decryption), continue the migration. - if (passphrase_migration_in_progress_ && - !IsPassphraseRequiredForDecryption()) { - wizard_.Step(SyncSetupWizard::PASSPHRASE_MIGRATION); - passphrase_migration_in_progress_ = false; - } - break; } case NotificationType::GOOGLE_SIGNIN_FAILED: { diff --git a/chrome/browser/sync/profile_sync_service.h b/chrome/browser/sync/profile_sync_service.h index 490d050..7c3b34f 100644 --- a/chrome/browser/sync/profile_sync_service.h +++ b/chrome/browser/sync/profile_sync_service.h @@ -253,7 +253,6 @@ class ProfileSyncService : public browser_sync::SyncFrontend, void ShowConfigure(bool sync_everything); void PromptForExistingPassphrase(); - void SigninForPassphraseMigration(); // Pretty-printed strings for a given StatusSummary. static std::string BuildSyncStatusSummaryText( @@ -525,9 +524,6 @@ class ProfileSyncService : public browser_sync::SyncFrontend, // because a new passphrase is required? sync_api::PassphraseRequiredReason passphrase_required_reason_; - // Is the user in a passphrase migration? - bool passphrase_migration_in_progress_; - private: friend class ProfileSyncServicePasswordTest; friend class TestProfileSyncService; diff --git a/chrome/browser/sync/resources/firstpassphrase.html b/chrome/browser/sync/resources/firstpassphrase.html deleted file mode 100644 index adb8b42..0000000 --- a/chrome/browser/sync/resources/firstpassphrase.html +++ /dev/null @@ -1,151 +0,0 @@ -<html i18n-values="dir:textdirection;"> -<head> -<title></title> -<style type="text/css"> -body { - line-height: 1.5em; - background: #FFFFFF; - font-size: 11pt; -} -html[os='mac'] body { - line-height: 1.5em; - background: #FFFFFF; -} -form { - -webkit-user-select: none; -} -.error { - color: red; - font-size: 10pt; - } -.sync-header { - font-size: 1.2em; - font-weight: bold; - margin-bottom: 10px; -} -.sync-instructions { - margin-top: 10px; - margin-bottom: 10px; -} -.sync-footer { - position: fixed; - right: 0px; - bottom: 0px; - margin-right: 10px; - margin-bottom: 10px; -} -.sync-section { - background: #EEE; - margin: 5px; - padding: 10px; -} - -#learn-more-link { - float: right; -} -html[dir='rtl'] #learn-more-link { - float: left; -} -html[dir='rtl'] .sync-footer { - text-align: left; - left: 0px; - bottom: 0px; - margin-left: 20px; -} -input[type='button'], -input[type='submit'] { - min-width: 87px; - min-height: 26px; - margin-left: 7px; -} -html[os='mac'] input[type='button'], -html[os='mac'] input[type='submit'] { - font-size: 12pt; -} - -#passphrase { - margin-top: 5px; -} - -</style> -<script src="chrome://resources/js/cr.js"></script> -<script> - var currentMode; - - // Called once, when this html/js is loaded. - function setupDialog(args) { - // Allow platform specific rules - if (cr.isMac) { - document.documentElement.setAttribute('os', 'mac'); - } else if (!cr.isWindows) { - document.documentElement.setAttribute('os', 'linux'); - } - - switchToMode(""); - } - - function switchToMode(mode) { - document.getElementById("section-explicit").style.display = "none"; - - if (mode == "explicit") { - document.getElementById("section-explicit").style.display = "block"; - } - } - - function getRadioCheckedValue() { - var f = document.getElementById("form"); - for (var i = 0; i < f.option.length; ++i) { - if (f.option[i].checked) { - return f.option[i].value; - } - } - return undefined; - } - - function onRadioChange() { - switchToMode(getRadioCheckedValue()); - } - - function checkPassphraseMatch() { - var emptyError = document.getElementById("emptyerror"); - var mismatchError = document.getElementById("mismatcherror"); - emptyError.style.display = "none"; - mismatchError.style.display = "none"; - - if (getRadioCheckedValue() != "explicit") { - return true; - } - var f = document.getElementById("form"); - if (f.passphrase.value.length == 0) { - emptyError.style.display = "block"; - return false; - } - if (f.confirmpassphrase.value != f.passphrase.value) { - mismatchError.style.display = "block"; - return false; - } - return true; - } - - function sendValuesAndClose() { - var f = document.getElementById("form"); - if (!checkPassphraseMatch()) { - return false; - } - - var result = JSON.stringify({"option": getRadioCheckedValue(), - "passphrase": f.passphrase.value}); - chrome.send("FirstPassphrase", [result]); - } - - function optOutOfPasswordsAndClose() { - var result = JSON.stringify({"option": "nothanks", - "passphrase": ""}); - chrome.send("FirstPassphrase", [result]); - } -</script> -</head> -<body i18n-values=".style.fontFamily:fontfamily" onload="setupDialog();"> - -</body> -</html> diff --git a/chrome/browser/sync/resources/setup_flow.html b/chrome/browser/sync/resources/setup_flow.html index 495828f..d37f436 100644 --- a/chrome/browser/sync/resources/setup_flow.html +++ b/chrome/browser/sync/resources/setup_flow.html @@ -4,7 +4,7 @@ <script type="text/javascript"> function hideAllPages() { var pages = ['login', 'configure', 'passphrase', - 'settingup', 'done', 'firstpassphrase']; + 'settingup', 'done']; for (var i = 0; i < pages.length; ++i) { document.getElementById(pages[i]).style.display = 'none'; document.getElementById(pages[i]).tabIndex = -1; @@ -22,7 +22,6 @@ function showPassphrase() { showPage('passphrase'); } function showSettingUp() { showPage('settingup'); } function showSetupDone() { showPage('done'); } - function showFirstPassphrase() { showPage('firstpassphrase'); } // Called once, when this html/js is loaded. function showTheRightIframe() { @@ -47,8 +46,5 @@ <iframe id="done" frameborder="0" width="100%" scrolling="no" height="100%" src="chrome://syncresources/setupdone" style="display:none" tabindex="-1"></iframe> - <iframe id="firstpassphrase" frameborder="0" width="100%" scrolling="no" - height="100%" src="chrome://syncresources/firstpassphrase" - style="display:none" tabindex="-1"></iframe> </body> </html> diff --git a/chrome/browser/sync/sync_setup_flow.cc b/chrome/browser/sync/sync_setup_flow.cc index 837d74d..88368be 100644 --- a/chrome/browser/sync/sync_setup_flow.cc +++ b/chrome/browser/sync/sync_setup_flow.cc @@ -64,8 +64,6 @@ SyncSetupFlow* SyncSetupFlow::Run(ProfileSyncService* service, SyncSetupFlow::GetArgsForConfigure(service, &args); else if (start == SyncSetupWizard::ENTER_PASSPHRASE) SyncSetupFlow::GetArgsForEnterPassphrase(false, false, &args); - else if (start == SyncSetupWizard::PASSPHRASE_MIGRATION) - args.SetString("iframeToShow", "firstpassphrase"); std::string json_args; base::JSONWriter::Write(&args, false, &json_args); @@ -259,12 +257,6 @@ void SyncSetupFlow::OnPassphraseCancel() { Advance(SyncSetupWizard::SETTING_UP); } -// TODO(jhawkins): Remove this method. -void SyncSetupFlow::OnFirstPassphraseEntry(const std::string& option, - const std::string& passphrase) { - NOTREACHED(); -} - // TODO(jhawkins): Use this method instead of a direct link in the html. void SyncSetupFlow::OnGoToDashboard() { BrowserList::GetLastActive()->OpenPrivacyDashboardTabAndActivate(); @@ -303,8 +295,6 @@ bool SyncSetupFlow::ShouldAdvance(SyncSetupWizard::State state) { return current_state_ == SyncSetupWizard::SYNC_EVERYTHING || current_state_ == SyncSetupWizard::CONFIGURE || current_state_ == SyncSetupWizard::SETTING_UP; - case SyncSetupWizard::PASSPHRASE_MIGRATION: - return current_state_ == SyncSetupWizard::GAIA_LOGIN; case SyncSetupWizard::SETUP_ABORTED_BY_PENDING_CLEAR: DCHECK(current_state_ != SyncSetupWizard::GAIA_LOGIN && current_state_ != SyncSetupWizard::GAIA_SUCCESS); @@ -312,8 +302,7 @@ bool SyncSetupFlow::ShouldAdvance(SyncSetupWizard::State state) { case SyncSetupWizard::SETTING_UP: return current_state_ == SyncSetupWizard::SYNC_EVERYTHING || current_state_ == SyncSetupWizard::CONFIGURE || - current_state_ == SyncSetupWizard::ENTER_PASSPHRASE || - current_state_ == SyncSetupWizard::PASSPHRASE_MIGRATION; + current_state_ == SyncSetupWizard::ENTER_PASSPHRASE; case SyncSetupWizard::FATAL_ERROR: return true; // You can always hit the panic button. case SyncSetupWizard::DONE: @@ -362,11 +351,6 @@ void SyncSetupFlow::ActivateState(SyncSetupWizard::State state) { flow_handler_->ShowPassphraseEntry(args); break; } - case SyncSetupWizard::PASSPHRASE_MIGRATION: { - DictionaryValue args; - flow_handler_->ShowFirstPassphrase(args); - break; - } case SyncSetupWizard::SETUP_ABORTED_BY_PENDING_CLEAR: { DictionaryValue args; SyncSetupFlow::GetArgsForConfigure(service_, &args); diff --git a/chrome/browser/sync/sync_setup_flow.h b/chrome/browser/sync/sync_setup_flow.h index 377df17..6531387 100644 --- a/chrome/browser/sync/sync_setup_flow.h +++ b/chrome/browser/sync/sync_setup_flow.h @@ -89,12 +89,6 @@ class SyncSetupFlow { // The user canceled the passphrase entry without supplying a passphrase. void OnPassphraseCancel(); - // The 'first passphrase' screen is for users migrating from a build - // without passwords, who are prompted to make a passphrase choice. - // TODO(jhawkins): This is no longer used; remove this method. - void OnFirstPassphraseEntry(const std::string& option, - const std::string& passphrase); - void OnGoToDashboard(); void OnDialogClosed(const std::string& json_retval); @@ -111,7 +105,6 @@ class SyncSetupFlow { FRIEND_TEST_ALL_PREFIXES(SyncSetupWizardTest, DiscreteRunChooseDataTypesAbortedByPendingClear); FRIEND_TEST_ALL_PREFIXES(SyncSetupWizardTest, EnterPassphraseRequired); - FRIEND_TEST_ALL_PREFIXES(SyncSetupWizardTest, PassphraseMigration); // Use static Run method to get an instance. SyncSetupFlow(SyncSetupWizard::State start_state, diff --git a/chrome/browser/sync/sync_setup_flow_handler.h b/chrome/browser/sync/sync_setup_flow_handler.h index 2c1d30a..4d95ccb 100644 --- a/chrome/browser/sync/sync_setup_flow_handler.h +++ b/chrome/browser/sync/sync_setup_flow_handler.h @@ -21,7 +21,6 @@ class SyncSetupFlowHandler { virtual void ShowGaiaSuccessAndSettingUp() = 0; virtual void ShowConfigure(const DictionaryValue& args) = 0; virtual void ShowPassphraseEntry(const DictionaryValue& args) = 0; - virtual void ShowFirstPassphrase(const DictionaryValue& args) = 0; virtual void ShowSettingUp() = 0; virtual void ShowSetupDone(const std::wstring& user) = 0; diff --git a/chrome/browser/sync/sync_setup_wizard.cc b/chrome/browser/sync/sync_setup_wizard.cc index d266976..0faab72 100644 --- a/chrome/browser/sync/sync_setup_wizard.cc +++ b/chrome/browser/sync/sync_setup_wizard.cc @@ -78,8 +78,7 @@ SyncSetupWizard::State SyncSetupWizard::GetEndStateForDiscreteRun( result = GAIA_SUCCESS; } else if (start_state == ENTER_PASSPHRASE || start_state == SYNC_EVERYTHING || - start_state == CONFIGURE || - start_state == PASSPHRASE_MIGRATION) { + start_state == CONFIGURE) { result = DONE; } DCHECK_NE(FATAL_ERROR, result) << diff --git a/chrome/browser/sync/sync_setup_wizard.h b/chrome/browser/sync/sync_setup_wizard.h index c51d2ab..1305bed 100644 --- a/chrome/browser/sync/sync_setup_wizard.h +++ b/chrome/browser/sync/sync_setup_wizard.h @@ -34,9 +34,6 @@ class SyncSetupWizard { CONFIGURE, // Show the screen that prompts for your passphrase ENTER_PASSPHRASE, - // Show the passphrase "first time" screen for migrating users, where all - // is explained and they choose between google password/custom passphrase. - PASSPHRASE_MIGRATION, // The panic switch. Something went terribly wrong during setup and we // can't recover. FATAL_ERROR, diff --git a/chrome/browser/sync/sync_setup_wizard_unittest.cc b/chrome/browser/sync/sync_setup_wizard_unittest.cc index 073ca89..6b646f0 100644 --- a/chrome/browser/sync/sync_setup_wizard_unittest.cc +++ b/chrome/browser/sync/sync_setup_wizard_unittest.cc @@ -351,24 +351,6 @@ TEST_F(SyncSetupWizardTest, DISABLED_EnterPassphraseRequired) { #endif } -TEST_F(SyncSetupWizardTest, DISABLED_PassphraseMigration) { - SKIP_TEST_ON_MACOSX(); - wizard_->Step(SyncSetupWizard::PASSPHRASE_MIGRATION); -#if 0 - ListValue value; - value.Append(new StringValue("{\"option\":\"explicit\"," - "\"passphrase\":\"myPassphrase\"}")); - test_window_->flow()->flow_handler_->HandleFirstPassphrase(&value); - EXPECT_EQ("myPassphrase", service_->passphrase_); - - ListValue value2; - value2.Append(new StringValue("{\"option\":\"nothanks\"," - "\"passphrase\":\"myPassphrase\"}")); - test_window_->flow()->flow_handler_->HandleFirstPassphrase(&value2); - EXPECT_EQ(service_->chosen_data_types_.count(syncable::PASSWORDS), 0U); -#endif -} - TEST_F(SyncSetupWizardTest, DISABLED_DialogCancelled) { SKIP_TEST_ON_MACOSX(); wizard_->Step(SyncSetupWizard::GAIA_LOGIN); |