summaryrefslogtreecommitdiffstats
path: root/chrome/browser/sync/sync_setup_flow.cc
diff options
context:
space:
mode:
authoratwilson@chromium.org <atwilson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-16 17:59:35 +0000
committeratwilson@chromium.org <atwilson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-16 17:59:35 +0000
commit7d855571d93760388020b3621169b6690e86060a (patch)
tree75d6acc8b6537d2d853d3967bb6f8a7cf4221c62 /chrome/browser/sync/sync_setup_flow.cc
parent7ca9c3f63a1b4b66d6c04520a42ceb4f4178508b (diff)
downloadchromium_src-7d855571d93760388020b3621169b6690e86060a.zip
chromium_src-7d855571d93760388020b3621169b6690e86060a.tar.gz
chromium_src-7d855571d93760388020b3621169b6690e86060a.tar.bz2
Moved UI state from ProfileSyncService to SyncUserFlow so it doesn't inappropriately persist.
BUG=74645 TEST=see instructions in bug Review URL: http://codereview.chromium.org/6686023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78392 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sync/sync_setup_flow.cc')
-rw-r--r--chrome/browser/sync/sync_setup_flow.cc22
1 files changed, 16 insertions, 6 deletions
diff --git a/chrome/browser/sync/sync_setup_flow.cc b/chrome/browser/sync/sync_setup_flow.cc
index bc69654..5d20ee7 100644
--- a/chrome/browser/sync/sync_setup_flow.cc
+++ b/chrome/browser/sync/sync_setup_flow.cc
@@ -390,7 +390,9 @@ SyncSetupFlow::SyncSetupFlow(SyncSetupWizard::State start_state,
flow_handler_(new FlowHandler()),
owns_flow_handler_(true),
service_(service),
- html_dialog_window_(NULL) {
+ html_dialog_window_(NULL),
+ tried_creating_explicit_passphrase_(false),
+ tried_setting_explicit_passphrase_(false) {
flow_handler_->set_flow(this);
}
@@ -509,12 +511,14 @@ void SyncSetupFlow::GetArgsForGaiaLogin(const ProfileSyncService* service,
// static
void SyncSetupFlow::GetArgsForEnterPassphrase(
- const ProfileSyncService* service, DictionaryValue* args) {
+ bool tried_creating_explicit_passphrase,
+ bool tried_setting_explicit_passphrase,
+ DictionaryValue* args) {
args->SetString("iframeToShow", "passphrase");
args->SetBoolean("passphrase_creation_rejected",
- service->tried_creating_explicit_passphrase());
+ tried_creating_explicit_passphrase);
args->SetBoolean("passphrase_setting_rejected",
- service->tried_setting_explicit_passphrase());
+ tried_setting_explicit_passphrase);
}
// static
@@ -639,7 +643,10 @@ void SyncSetupFlow::Advance(SyncSetupWizard::State advance_state) {
}
case SyncSetupWizard::ENTER_PASSPHRASE: {
DictionaryValue args;
- SyncSetupFlow::GetArgsForEnterPassphrase(service_, &args);
+ SyncSetupFlow::GetArgsForEnterPassphrase(
+ tried_creating_explicit_passphrase_,
+ tried_setting_explicit_passphrase_,
+ &args);
flow_handler_->ShowPassphraseEntry(args);
break;
}
@@ -712,7 +719,7 @@ SyncSetupFlow* SyncSetupFlow::Run(ProfileSyncService* service,
else if (start == SyncSetupWizard::CONFIGURE)
SyncSetupFlow::GetArgsForConfigure(service, &args);
else if (start == SyncSetupWizard::ENTER_PASSPHRASE)
- SyncSetupFlow::GetArgsForEnterPassphrase(service, &args);
+ SyncSetupFlow::GetArgsForEnterPassphrase(false, false, &args);
else if (start == SyncSetupWizard::PASSPHRASE_MIGRATION)
args.SetString("iframeToShow", "firstpassphrase");
@@ -760,6 +767,7 @@ void SyncSetupFlow::OnUserConfigured(const SyncConfiguration& configuration) {
if (configuration.use_secondary_passphrase &&
!service_->IsUsingSecondaryPassphrase()) {
service_->SetPassphrase(configuration.secondary_passphrase, true, true);
+ tried_creating_explicit_passphrase_ = true;
}
service_->OnUserChoseDatatypes(configuration.sync_everything,
@@ -769,6 +777,7 @@ void SyncSetupFlow::OnUserConfigured(const SyncConfiguration& configuration) {
void SyncSetupFlow::OnPassphraseEntry(const std::string& passphrase) {
Advance(SyncSetupWizard::SETTING_UP);
service_->SetPassphrase(passphrase, true, false);
+ tried_setting_explicit_passphrase_ = true;
}
void SyncSetupFlow::OnPassphraseCancel() {
@@ -786,6 +795,7 @@ void SyncSetupFlow::OnFirstPassphraseEntry(const std::string& option,
if (option == "explicit") {
service_->SetPassphrase(passphrase, true, true);
+ tried_creating_explicit_passphrase_ = true;
} else if (option == "nothanks") {
// User opted out of encrypted sync, need to turn off encrypted
// data types.