diff options
author | atwilson@chromium.org <atwilson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-13 02:54:03 +0000 |
---|---|---|
committer | atwilson@chromium.org <atwilson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-13 02:54:03 +0000 |
commit | 74867e2326dff99ca0876378c26ffbb7534a2be7 (patch) | |
tree | 053cb8417efc9fba5a2306235a7bbc8b9247c394 /chrome/browser/sync/sync_ui_util.cc | |
parent | 459fba846839922dc77873aa3181a2684cd03e0c (diff) | |
download | chromium_src-74867e2326dff99ca0876378c26ffbb7534a2be7.zip chromium_src-74867e2326dff99ca0876378c26ffbb7534a2be7.tar.gz chromium_src-74867e2326dff99ca0876378c26ffbb7534a2be7.tar.bz2 |
No longer wait for all data types to be synced in IsUsingExplicitPassphrase()
Changed SyncBackendHost::IsUsingExplicitPassphrase() to no longer return false
if all data types have not yet been downloaded.
Also added DCHECKs in various places to ensure the backend has been initialized
before we try to get the passphrase state - this is better than the old
behavior, where we would just return "false" from the various routines. Much
better to enforce that it's not legal to call those routines if the backend
is uninitialized.
BUG=99641
TEST=Follow steps in http://crbug.com/99641
Review URL: http://codereview.chromium.org/8216030
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105248 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sync/sync_ui_util.cc')
-rw-r--r-- | chrome/browser/sync/sync_ui_util.cc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/chrome/browser/sync/sync_ui_util.cc b/chrome/browser/sync/sync_ui_util.cc index 8181d16..6627d60 100644 --- a/chrome/browser/sync/sync_ui_util.cc +++ b/chrome/browser/sync/sync_ui_util.cc @@ -569,9 +569,14 @@ void ConstructAboutInformation(ProfileSyncService* service, sync_ui_util::AddIntSyncDetail(details, "Useful Sync Cycles", full_status.useful_sync_cycles); - sync_ui_util::AddBoolSyncDetail(details, - "Explicit Passphrase", - service->IsUsingSecondaryPassphrase()); + // Only safe to call IsUsingSecondaryPassphrase() if the backend is + // initialized already - otherwise, we have no idea whether we are + // using a secondary passphrase or not. + if (service->sync_initialized()) { + sync_ui_util::AddBoolSyncDetail(details, + "Explicit Passphrase", + service->IsUsingSecondaryPassphrase()); + } sync_ui_util::AddBoolSyncDetail(details, "Passphrase Required", service->IsPassphraseRequired()); |