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

Side by Side 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: rip out broken customlogo code Created 8 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/webui/ntp/ntp_login_handler.h" 5 #include "chrome/browser/ui/webui/ntp/ntp_login_handler.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 return false; 250 return false;
251 251
252 return profile->GetOriginalProfile()->IsSyncAccessible(); 252 return profile->GetOriginalProfile()->IsSyncAccessible();
253 #endif 253 #endif
254 } 254 }
255 255
256 // static 256 // static
257 void NTPLoginHandler::GetLocalizedValues(Profile* profile, 257 void NTPLoginHandler::GetLocalizedValues(Profile* profile,
258 DictionaryValue* values) { 258 DictionaryValue* values) {
259 PrefService* prefs = profile->GetPrefs(); 259 PrefService* prefs = profile->GetPrefs();
260 if (prefs->GetString(prefs::kGoogleServicesUsername).empty() || 260 bool hide_sync = prefs->GetString(prefs::kGoogleServicesUsername).empty() ||
261 !prefs->GetBoolean(prefs::kSyncPromoShowNTPBubble)) { 261 !prefs->GetBoolean(prefs::kSyncPromoShowNTPBubble);
262 return;
263 }
264 262
265 values->SetString("login_status_message", 263 values->SetString("login_status_message",
264 hide_sync ? string16() :
266 l10n_util::GetStringFUTF16(IDS_SYNC_PROMO_NTP_BUBBLE_MESSAGE, 265 l10n_util::GetStringFUTF16(IDS_SYNC_PROMO_NTP_BUBBLE_MESSAGE,
267 l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_NAME))); 266 l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_NAME)));
268 values->SetString("login_status_url", chrome::kSyncLearnMoreURL); 267 values->SetString("login_status_url",
269 values->SetString("login_status_learn_more", 268 hide_sync ? std::string() : chrome::kSyncLearnMoreURL);
270 l10n_util::GetStringUTF16(IDS_LEARN_MORE));
271 values->SetString("login_status_advanced", 269 values->SetString("login_status_advanced",
270 hide_sync ? string16() :
272 l10n_util::GetStringUTF16(IDS_SYNC_PROMO_NTP_BUBBLE_ADVANCED)); 271 l10n_util::GetStringUTF16(IDS_SYNC_PROMO_NTP_BUBBLE_ADVANCED));
273 values->SetString("login_status_dismiss", 272 values->SetString("login_status_dismiss",
273 hide_sync ? string16() :
274 l10n_util::GetStringUTF16(IDS_SYNC_PROMO_NTP_BUBBLE_OK)); 274 l10n_util::GetStringUTF16(IDS_SYNC_PROMO_NTP_BUBBLE_OK));
275 } 275 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698