summaryrefslogtreecommitdiffstats
path: root/chrome/browser/sync/sync_ui_util.cc
diff options
context:
space:
mode:
authorrsimha@chromium.org <rsimha@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-03 18:23:53 +0000
committerrsimha@chromium.org <rsimha@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-03 18:23:53 +0000
commit88dee5e7f00ebf94465d3bf4399ef50484e9d8a2 (patch)
tree3d78765b6df67fdfa5da0100d3866decb695822c /chrome/browser/sync/sync_ui_util.cc
parentccd3f34cec0d317059d66a7d0f165a99d341b23d (diff)
downloadchromium_src-88dee5e7f00ebf94465d3bf4399ef50484e9d8a2.zip
chromium_src-88dee5e7f00ebf94465d3bf4399ef50484e9d8a2.tar.gz
chromium_src-88dee5e7f00ebf94465d3bf4399ef50484e9d8a2.tar.bz2
Add method IsPassphraseRequiredForDecryption to ProfileSyncService
ProfileSyncService needs to know in multiple places whether a passphrase is required for decryption. Right now, the logic involves checking passphrase_required_reason_ against a couple of states. This patch refactors this logic into the methods: IsPassphraseRequired IsPassphraseRequiredForDecryption BUG=81313, 81341, 81018 TEST=sync_integration_tests Review URL: http://codereview.chromium.org/6910012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83923 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sync/sync_ui_util.cc')
-rw-r--r--chrome/browser/sync/sync_ui_util.cc11
1 files changed, 4 insertions, 7 deletions
diff --git a/chrome/browser/sync/sync_ui_util.cc b/chrome/browser/sync/sync_ui_util.cc
index e894e1b7..989a996 100644
--- a/chrome/browser/sync/sync_ui_util.cc
+++ b/chrome/browser/sync/sync_ui_util.cc
@@ -103,7 +103,7 @@ MessageType GetStatusInfo(ProfileSyncService* service,
// Either show auth error information with a link to re-login, auth in prog,
// or note that everything is OK with the last synced time.
- if (status.authenticated && !service->ObservedPassphraseRequired()) {
+ if (status.authenticated && !service->IsPassphraseRequired()) {
// Everything is peachy.
if (status_label) {
status_label->assign(GetSyncedStateStatusLabel(service));
@@ -115,11 +115,8 @@ MessageType GetStatusInfo(ProfileSyncService* service,
l10n_util::GetStringUTF16(IDS_SYNC_AUTHENTICATING_LABEL));
}
result_type = PRE_SYNCED;
- } else if (service->ObservedPassphraseRequired()) {
- if (service->passphrase_required_reason() ==
- sync_api::REASON_DECRYPTION ||
- service->passphrase_required_reason() ==
- sync_api::REASON_SET_PASSPHRASE_FAILED) {
+ } else if (service->IsPassphraseRequired()) {
+ if (service->IsPassphraseRequiredForDecryption()) {
// NOT first machine.
// Show a link ("needs attention"), but still indicate the
// current synced status. Return SYNC_PROMO so that
@@ -190,7 +187,7 @@ MessageType GetStatusInfoForNewTabPage(ProfileSyncService* service,
DCHECK(link_label);
if (service->HasSyncSetupCompleted() &&
- service->ObservedPassphraseRequired()) {
+ service->IsPassphraseRequired()) {
if (service->passphrase_required_reason() == sync_api::REASON_ENCRYPTION) {
// First machine migrating to passwords. Show as a promotion.
if (status_label && link_label) {