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

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

Issue 7551024: [Sync] Fix encryption/passphrase handling. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
Index: chrome/browser/sync/sync_setup_flow.cc
diff --git a/chrome/browser/sync/sync_setup_flow.cc b/chrome/browser/sync/sync_setup_flow.cc
index 8230ce96c11912a24bd9a7cb17de81e3ea2e3c16..bcc1e9b00f8dbd1fc53e1a36589c231c19291ef4 100644
--- a/chrome/browser/sync/sync_setup_flow.cc
+++ b/chrome/browser/sync/sync_setup_flow.cc
@@ -262,10 +262,17 @@ void SyncSetupFlow::OnUserConfigured(const SyncConfiguration& configuration) {
// Go to the "loading..." screen.
Advance(SyncSetupWizard::SETTING_UP);
+ // Note: encryption calls must be made before OnUserChoseDatatypes.
+ // TODO(zea): Fix this.
if (configuration.encrypt_all) {
syncable::ModelTypeSet data_types;
service_->GetRegisteredDataTypes(&data_types);
service_->EncryptDataTypes(data_types);
+ } else {
+ // Necessary in case we had attempted to encrypt datatypes previously
+ // but were unable to complete and the user wants to cancel out (for
+ // example due to needing a passphrase).
+ service_->EncryptDataTypes(syncable::ModelTypeSet());
}
// If we are activating the passphrase, we need to have one supplied.
« chrome/browser/sync/profile_sync_service.cc ('K') | « chrome/browser/sync/profile_sync_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698