Index: chrome/browser/ui/webui/ntp/ntp_login_handler.cc |
diff --git a/chrome/browser/ui/webui/ntp/ntp_login_handler.cc b/chrome/browser/ui/webui/ntp/ntp_login_handler.cc |
index e182bd6ca28f3c95f67983a204c7df7a374097b6..ac18e6d6488873ab17c0547f395517b5ea5fe370 100644 |
--- a/chrome/browser/ui/webui/ntp/ntp_login_handler.cc |
+++ b/chrome/browser/ui/webui/ntp/ntp_login_handler.cc |
@@ -263,17 +263,20 @@ bool NTPLoginHandler::ShouldShow(Profile* profile) { |
void NTPLoginHandler::GetLocalizedValues(Profile* profile, |
DictionaryValue* values) { |
PrefService* prefs = profile->GetPrefs(); |
- bool hide_sync = prefs->GetString(prefs::kGoogleServicesUsername).empty() || |
- !prefs->GetBoolean(prefs::kSyncPromoShowNTPBubble); |
+ std::string error_message = prefs->GetString(prefs::kSyncPromoErrorMessage); |
+ bool hide_sync = !prefs->GetBoolean(prefs::kSyncPromoShowNTPBubble); |
Andrew T Wilson (Slow)
2012/12/03 14:54:49
Will this have unexpected side effects with old pr
Roger Tawa OOO till Jul 10th
2012/12/03 22:26:54
The bubble clears the error message once the user
|
- values->SetString("login_status_message", |
+ string16 message = |
hide_sync ? string16() : |
- l10n_util::GetStringFUTF16(IDS_SYNC_PROMO_NTP_BUBBLE_MESSAGE, |
- l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_NAME))); |
+ !error_message.empty() ? UTF8ToUTF16(error_message) : |
+ l10n_util::GetStringFUTF16(IDS_SYNC_PROMO_NTP_BUBBLE_MESSAGE, |
+ l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_NAME)); |
+ |
+ values->SetString("login_status_message", message); |
values->SetString("login_status_url", |
hide_sync ? std::string() : chrome::kSyncLearnMoreURL); |
values->SetString("login_status_advanced", |
- hide_sync ? string16() : |
+ hide_sync || !error_message.empty() ? string16() : |
l10n_util::GetStringUTF16(IDS_SYNC_PROMO_NTP_BUBBLE_ADVANCED)); |
values->SetString("login_status_dismiss", |
hide_sync ? string16() : |