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

Unified Diff: chrome/browser/ui/webui/ntp/ntp_login_handler.cc

Issue 10141005: switch ntp to jstemplate v2 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update test Created 8 years, 8 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
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 b349d052d2d8578bc189c4d68987a768b9ce7a29..ec17dc2b6d6d5ec4d9a4f2abc9eeebb92c206cc6 100644
--- a/chrome/browser/ui/webui/ntp/ntp_login_handler.cc
+++ b/chrome/browser/ui/webui/ntp/ntp_login_handler.cc
@@ -257,19 +257,19 @@ bool NTPLoginHandler::ShouldShow(Profile* profile) {
void NTPLoginHandler::GetLocalizedValues(Profile* profile,
DictionaryValue* values) {
PrefService* prefs = profile->GetPrefs();
- if (prefs->GetString(prefs::kGoogleServicesUsername).empty() ||
- !prefs->GetBoolean(prefs::kSyncPromoShowNTPBubble)) {
- return;
- }
+ bool hide_sync = prefs->GetString(prefs::kGoogleServicesUsername).empty() ||
Dan Beam 2012/04/25 23:13:12 why did you change this?
Evan Stade 2012/04/26 00:44:56 because http://code.google.com/p/chromium/issues/d
+ !prefs->GetBoolean(prefs::kSyncPromoShowNTPBubble);
values->SetString("login_status_message",
+ hide_sync ? string16() :
l10n_util::GetStringFUTF16(IDS_SYNC_PROMO_NTP_BUBBLE_MESSAGE,
l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_NAME)));
- values->SetString("login_status_url", chrome::kSyncLearnMoreURL);
- values->SetString("login_status_learn_more",
- l10n_util::GetStringUTF16(IDS_LEARN_MORE));
+ values->SetString("login_status_url",
+ hide_sync ? std::string() : chrome::kSyncLearnMoreURL);
values->SetString("login_status_advanced",
+ hide_sync ? string16() :
l10n_util::GetStringUTF16(IDS_SYNC_PROMO_NTP_BUBBLE_ADVANCED));
values->SetString("login_status_dismiss",
+ hide_sync ? string16() :
l10n_util::GetStringUTF16(IDS_SYNC_PROMO_NTP_BUBBLE_OK));
}

Powered by Google App Engine
This is Rietveld 408576698