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

Unified Diff: chrome/browser/ui/webui/sync_setup_handler.cc

Issue 10387158: Merge 136934 - Notify sync observers whenever preferred types change (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1132/src/
Patch Set: Created 8 years, 7 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/profile_sync_service_harness.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/sync_setup_handler.cc
===================================================================
--- chrome/browser/ui/webui/sync_setup_handler.cc (revision 137481)
+++ chrome/browser/ui/webui/sync_setup_handler.cc (working copy)
@@ -720,16 +720,31 @@
}
}
+ bool user_was_prompted_for_passphrase =
+ service->IsPassphraseRequiredForDecryption();
service->OnUserChoseDatatypes(configuration.sync_everything,
configuration.data_types);
// Need to call IsPassphraseRequiredForDecryption() *after* calling
// OnUserChoseDatatypes() because the user may have just disabled the
- // encrypted datatypes.
+ // encrypted datatypes (in which case we just want to exit, not prompt the
+ // user for a passphrase).
if (passphrase_failed || service->IsPassphraseRequiredForDecryption()) {
// We need a passphrase, or the user's attempt to set a passphrase failed -
- // prompt them again.
- DisplayConfigureSync(true, passphrase_failed);
+ // prompt them again. This covers a few subtle cases:
+ // 1) The user enters an incorrect passphrase *and* disabled the encrypted
+ // data types. In that case we want to notify the user that the
+ // passphrase was incorrect even though there are no longer any encrypted
+ // types enabled (IsPassphraseRequiredForDecryption() == false).
+ // 2) The user doesn't enter any passphrase. In this case, we won't call
+ // SetDecryptionPassphrase() (passphrase_failed == false), but we still
+ // want to display an error message to let the user know that their
+ // blank passphrase entry is not acceptable.
+ // 3) The user just enabled an encrypted data type - in this case we don't
+ // want to display an "invalid passphrase" error, since it's the first
+ // time the user is seeing the prompt.
+ DisplayConfigureSync(
+ true, passphrase_failed || user_was_prompted_for_passphrase);
} else {
// No passphrase is required from the user so mark the configuration as
// complete and close the sync setup overlay.
« no previous file with comments | « chrome/browser/sync/profile_sync_service_harness.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698