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

Unified Diff: chrome/browser/dom_ui/new_tab_ui.cc

Issue 217020: Add theme promo to NTP (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 3 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/dom_ui/dom_ui_theme_source.cc ('k') | chrome/browser/resources/new_new_tab.css » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/dom_ui/new_tab_ui.cc
===================================================================
--- chrome/browser/dom_ui/new_tab_ui.cc (revision 26789)
+++ chrome/browser/dom_ui/new_tab_ui.cc (working copy)
@@ -395,7 +395,8 @@
l10n_util::GetString(IDS_NEW_TAB_CLOSE_FIRST_RUN_NOTIFICATION));
localized_strings.SetString(L"makethishomepage",
l10n_util::GetString(IDS_NEW_TAB_MAKE_THIS_HOMEPAGE));
-
+ localized_strings.SetString(L"themelink",
+ l10n_util::GetString(IDS_THEMES_GALLERY_URL));
// Don't initiate the sync related message passing with the page if the sync
// code is not present.
if (profile_->GetProfileSyncService())
@@ -409,10 +410,16 @@
SetFontAndTextDirection(&localized_strings);
// Let the tab know whether it's the first tab being viewed.
- localized_strings.SetString(L"firstview",
- first_view_ ? L"true" : std::wstring());
- first_view_ = false;
+ if (first_view_) {
+ localized_strings.SetString(L"firstview", L"true");
+ // Decrement ntp promo counter; the default value is specified in
+ // Browser::RegisterUserPrefs.
+ profile_->GetPrefs()->SetInteger(prefs::kNTPThemePromoRemaining,
+ profile_->GetPrefs()->GetInteger(prefs::kNTPThemePromoRemaining) - 1);
+ first_view_ = false;
+ }
+
// Control fade and resize animations.
std::wstring anim =
Animation::ShouldRenderRichAnimation() ? L"true" : L"false";
« no previous file with comments | « chrome/browser/dom_ui/dom_ui_theme_source.cc ('k') | chrome/browser/resources/new_new_tab.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698