Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3621)

Unified Diff: chrome/browser/sync/profile_sync_service.cc

Issue 7466024: [Sync] Support receiving early passphrase required information in Sync UI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments addressed + fix unit test Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/sync/engine/syncapi.cc ('k') | chrome/browser/sync/sync_setup_flow.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/profile_sync_service.cc
diff --git a/chrome/browser/sync/profile_sync_service.cc b/chrome/browser/sync/profile_sync_service.cc
index 0cd4727cfd6179eab7a59fb92aa22b22c20ea223..84f255a1b412a64d8623690fa1fe017acc7d1bc1 100644
--- a/chrome/browser/sync/profile_sync_service.cc
+++ b/chrome/browser/sync/profile_sync_service.cc
@@ -725,6 +725,8 @@ void ProfileSyncService::OnPassphraseRequired(
return;
}
+ VLOG(1) << "Passphrase required with reason: "
+ << sync_api::PassphraseRequiredReasonToString(reason);
passphrase_required_reason_ = reason;
// We will skip the passphrase prompt and suppress the warning if the
@@ -778,16 +780,13 @@ void ProfileSyncService::OnPassphraseAccepted() {
if (data_type_manager_.get()) {
// Unblock the data type manager if necessary.
+ // This will always trigger a SYNC_CONFIGURE_DONE on completion, which will
+ // step the UI wizard into DONE state (even if no datatypes have changed).
data_type_manager_->Configure(types,
sync_api::CONFIGURE_REASON_RECONFIGURATION);
}
NotifyObservers();
-
- // TODO(tim): We shouldn't call this if !HasSyncSetupCompleted and the user
- // isn't actually at the ENTER_PASSPHRASE screen. It results in a
- // LOG(WARNING) currently.
- wizard_.Step(SyncSetupWizard::DONE);
}
void ProfileSyncService::OnEncryptionComplete(
@@ -1114,12 +1113,10 @@ void ProfileSyncService::ConfigureDataTypeManager() {
GetPreferredDataTypes(&types);
if (IsPassphraseRequiredForDecryption()) {
if (IsEncryptedDatatypeEnabled()) {
- // We need a passphrase still. Prompt the user for a passphrase, and
- // DataTypeManager::Configure() will get called once the passphrase is
- // accepted.
- VLOG(0) << "ProfileSyncService::ConfigureDataTypeManager bailing out "
+ // We need a passphrase still. We don't bother to attempt to configure
+ // until we receive an OnPassphraseAccepted (which triggers a configure).
+ VLOG(1) << "ProfileSyncService::ConfigureDataTypeManager bailing out "
<< "because a passphrase required";
- OnPassphraseRequired(passphrase_required_reason_);
return;
} else {
// We've been informed that a passphrase is required for decryption, but
@@ -1205,6 +1202,8 @@ void ProfileSyncService::SetPassphrase(const std::string& passphrase,
bool is_explicit,
bool is_creation) {
if (ShouldPushChanges() || IsPassphraseRequired()) {
+ VLOG(1) << "Setting " << (is_explicit ? "explicit" : "implicit")
+ << " passphrase " << (is_creation ? " for creation" : "");
backend_->SetPassphrase(passphrase, is_explicit);
} else {
if (is_explicit) {
« no previous file with comments | « chrome/browser/sync/engine/syncapi.cc ('k') | chrome/browser/sync/sync_setup_flow.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698