| Index: chrome/browser/sync/profile_sync_service.cc
|
| ===================================================================
|
| --- chrome/browser/sync/profile_sync_service.cc (revision 71271)
|
| +++ chrome/browser/sync/profile_sync_service.cc (working copy)
|
| @@ -66,6 +66,8 @@
|
| Profile* profile,
|
| const std::string& cros_user)
|
| : last_auth_error_(AuthError::None()),
|
| + tried_creating_explicit_passphrase_(false),
|
| + tried_setting_explicit_passphrase_(false),
|
| observed_passphrase_required_(false),
|
| passphrase_required_for_decryption_(false),
|
| factory_(factory),
|
| @@ -1019,13 +1021,20 @@
|
| }
|
|
|
| void ProfileSyncService::SetPassphrase(const std::string& passphrase,
|
| - bool is_explicit) {
|
| + bool is_explicit,
|
| + bool is_creation) {
|
| if (ShouldPushChanges() || observed_passphrase_required_) {
|
| backend_->SetPassphrase(passphrase, is_explicit);
|
| } else {
|
| cached_passphrase_.value = passphrase;
|
| cached_passphrase_.is_explicit = is_explicit;
|
| + cached_passphrase_.is_creation = is_creation;
|
| }
|
| +
|
| + if (is_explicit && is_creation)
|
| + tried_creating_explicit_passphrase_ = true;
|
| + else if (is_explicit)
|
| + tried_setting_explicit_passphrase_ = true;
|
| }
|
|
|
| void ProfileSyncService::Observe(NotificationType type,
|
| @@ -1053,7 +1062,8 @@
|
| if (!cached_passphrase_.value.empty()) {
|
| // Don't hold on to the passphrase in raw form longer than needed.
|
| SetPassphrase(cached_passphrase_.value,
|
| - cached_passphrase_.is_explicit);
|
| + cached_passphrase_.is_explicit,
|
| + cached_passphrase_.is_creation);
|
| cached_passphrase_ = CachedPassphrase();
|
| }
|
|
|
| @@ -1072,7 +1082,8 @@
|
|
|
| if (!cached_passphrase_.value.empty()) {
|
| SetPassphrase(cached_passphrase_.value,
|
| - cached_passphrase_.is_explicit);
|
| + cached_passphrase_.is_explicit,
|
| + cached_passphrase_.is_creation);
|
| cached_passphrase_ = CachedPassphrase();
|
| break;
|
| }
|
| @@ -1101,6 +1112,8 @@
|
|
|
| FOR_EACH_OBSERVER(Observer, observers_, OnStateChanged());
|
| observed_passphrase_required_ = false;
|
| + tried_setting_explicit_passphrase_ = false;
|
| + tried_creating_explicit_passphrase_ = false;
|
|
|
| wizard_.Step(SyncSetupWizard::DONE);
|
| break;
|
| @@ -1126,7 +1139,7 @@
|
| // actually change), or the user has an explicit passphrase set so this
|
| // becomes a no-op.
|
| tried_implicit_gaia_remove_when_bug_62103_fixed_ = true;
|
| - SetPassphrase(successful->password, false);
|
| + SetPassphrase(successful->password, false, true);
|
| break;
|
| }
|
| case NotificationType::GOOGLE_SIGNIN_FAILED: {
|
|
|