Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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() || |
|
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
| |
| 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 } |
| OLD | NEW |