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

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

Issue 6350008: Create a new code path to generate sync strings for the new tab page differen... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 11 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') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/sync_ui_util.cc
===================================================================
--- chrome/browser/sync/sync_ui_util.cc (revision 71966)
+++ chrome/browser/sync/sync_ui_util.cc (working copy)
@@ -107,21 +107,20 @@
} else if (service->observed_passphrase_required()) {
if (service->passphrase_required_for_decryption()) {
// NOT first machine.
- // Show a link and present as an error ("needs attention").
+ // Show a link and present as an error ("needs attention"),
+ // but still indicate the current synced status.
if (status_label && link_label) {
- status_label->assign(string16());
+ status_label->assign(GetSyncedStateStatusLabel(service));
link_label->assign(
- l10n_util::GetStringUTF16(IDS_SYNC_CONFIGURE_ENCRYPTION));
+ l10n_util::GetStringUTF16(IDS_SYNC_PASSWORD_SYNC_ATTENTION));
}
result_type = SYNC_ERROR;
} else {
// First machine. Show as a promotion.
if (status_label && link_label) {
- status_label->assign(
- l10n_util::GetStringFUTF16(IDS_SYNC_NTP_PASSWORD_PROMO,
- l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)));
+ status_label->assign(GetSyncedStateStatusLabel(service));
link_label->assign(
- l10n_util::GetStringUTF16(IDS_SYNC_NTP_PASSWORD_ENABLE));
+ l10n_util::GetStringUTF16(IDS_SYNC_NEW_PASSWORD_SYNC));
}
result_type = SYNC_PROMO;
}
@@ -176,6 +175,43 @@
return result_type;
}
+// Returns the status info for use on the new tab page, where we want slightly
+// different information than in the settings panel.
+MessageType GetStatusInfoForNewTabPage(ProfileSyncService* service,
+ string16* status_label,
+ string16* link_label) {
+ DCHECK(status_label);
+ DCHECK(link_label);
+
+ if (service->HasSyncSetupCompleted() &&
+ service->observed_passphrase_required()) {
+ if (!service->passphrase_required_for_decryption()) {
+ // First machine migrating to passwords. Show as a promotion.
+ if (status_label && link_label) {
+ status_label->assign(
+ l10n_util::GetStringFUTF16(
+ IDS_SYNC_NTP_PASSWORD_PROMO,
+ l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)));
+ link_label->assign(
+ l10n_util::GetStringUTF16(IDS_SYNC_NTP_PASSWORD_ENABLE));
+ }
+ return SYNC_PROMO;
+ } else {
+ // NOT first machine.
+ // Show a link and present as an error ("needs attention").
+ if (status_label && link_label) {
+ status_label->assign(string16());
+ link_label->assign(
+ l10n_util::GetStringUTF16(IDS_SYNC_CONFIGURE_ENCRYPTION));
+ }
+ return SYNC_ERROR;
+ }
+ }
+
+ // Fallback to default.
+ return GetStatusInfo(service, status_label, link_label);
+}
+
} // namespace
// Returns an HTML chunk for a login prompt related to encryption.
@@ -200,6 +236,15 @@
return sync_ui_util::GetStatusInfo(service, status_label, link_label);
}
+MessageType GetStatusLabelsForNewTabPage(ProfileSyncService* service,
+ string16* status_label,
+ string16* link_label) {
+ DCHECK(status_label);
+ DCHECK(link_label);
+ return sync_ui_util::GetStatusInfoForNewTabPage(
+ service, status_label, link_label);
+}
+
MessageType GetStatus(ProfileSyncService* service) {
return sync_ui_util::GetStatusInfo(service, NULL, NULL);
}
« no previous file with comments | « chrome/browser/sync/sync_ui_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698