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

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

Issue 2920853004: [sync] Display an error when sync settings aren't confirmed (Closed)
Patch Set: Reformat, remove browser_options change Created 3 years, 6 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/sync_ui_util.h ('k') | chrome/browser/sync/sync_ui_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/sync_ui_util.cc
diff --git a/chrome/browser/sync/sync_ui_util.cc b/chrome/browser/sync/sync_ui_util.cc
index ce4e1fe76785f402bebb365f9bcf63cf77f1fd55..761e1dd3b99d3c35545112c5c86a64cafe341414 100644
--- a/chrome/browser/sync/sync_ui_util.cc
+++ b/chrome/browser/sync/sync_ui_util.cc
@@ -323,11 +323,22 @@ MessageType GetStatusInfo(Profile* profile,
link_label, action_type);
}
} else if (signin.IsAuthenticated()) {
- // The user is signed in, but sync has been stopped.
- result_type = PRE_SYNCED;
- if (status_label) {
- status_label->assign(
- l10n_util::GetStringUTF16(IDS_SIGNED_IN_WITH_SYNC_SUPPRESSED));
+ if (service->IsSyncConfirmationNeeded()) {
+ if (status_label && link_label) {
+ status_label->assign(
+ l10n_util::GetStringUTF16(IDS_SYNC_SETTINGS_NOT_CONFIRMED));
+ link_label->assign(l10n_util::GetStringUTF16(
+ IDS_SYNC_ERROR_USER_MENU_CONFIRM_SYNC_SETTINGS_BUTTON));
+ }
+ *action_type = CONFIRM_SYNC_SETTINGS;
+ result_type = SYNC_ERROR;
+ } else {
+ // The user is signed in, but sync has been stopped.
+ result_type = PRE_SYNCED;
+ if (status_label) {
+ status_label->assign(
+ l10n_util::GetStringUTF16(IDS_SIGNED_IN_WITH_SYNC_SUPPRESSED));
+ }
}
}
}
@@ -401,9 +412,11 @@ MessageType GetStatusLabelsForNewTabPage(Profile* profile,
}
#if !defined(OS_CHROMEOS)
-AvatarSyncErrorType GetMessagesForAvatarSyncError(Profile* profile,
- int* content_string_id,
- int* button_string_id) {
+AvatarSyncErrorType GetMessagesForAvatarSyncError(
+ Profile* profile,
+ const SigninManagerBase& signin,
+ int* content_string_id,
+ int* button_string_id) {
ProfileSyncService* service =
ProfileSyncServiceFactory::GetForProfile(profile);
@@ -469,6 +482,13 @@ AvatarSyncErrorType GetMessagesForAvatarSyncError(Profile* profile,
*button_string_id = IDS_SYNC_ERROR_USER_MENU_PASSPHRASE_BUTTON;
return PASSPHRASE_ERROR;
}
+
+ // Check for a sync confirmation error.
+ if (signin.IsAuthenticated() && service->IsSyncConfirmationNeeded()) {
+ *content_string_id = IDS_SYNC_SETTINGS_NOT_CONFIRMED;
+ *button_string_id = IDS_SYNC_ERROR_USER_MENU_CONFIRM_SYNC_SETTINGS_BUTTON;
+ return SETTINGS_UNCONFIRMED_ERROR;
+ }
}
// There is no error.
« no previous file with comments | « chrome/browser/sync/sync_ui_util.h ('k') | chrome/browser/sync/sync_ui_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698