summaryrefslogtreecommitdiffstats
path: root/chrome/browser/dom_ui
diff options
context:
space:
mode:
authorarv@chromium.org <arv@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-23 01:32:37 +0000
committerarv@chromium.org <arv@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-23 01:32:37 +0000
commitec68b62ec102d43e2559da1e1c3a022cf191403a (patch)
treecd345067936c29b8983453c7c774800129add213 /chrome/browser/dom_ui
parent03d36e3330a3e1ea60c37a6843293499acd38934 (diff)
downloadchromium_src-ec68b62ec102d43e2559da1e1c3a022cf191403a.zip
chromium_src-ec68b62ec102d43e2559da1e1c3a022cf191403a.tar.gz
chromium_src-ec68b62ec102d43e2559da1e1c3a022cf191403a.tar.bz2
Adds a theme promo in the lower right corner
BUG=None TEST=The theme promo should show up in the lower right corner and when clicked should navigate to the Chrome theme gallery. The promo should go away after 5 runs of chrome Review URL: http://codereview.chromium.org/217020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26894 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/dom_ui')
-rw-r--r--chrome/browser/dom_ui/dom_ui_theme_source.cc5
-rw-r--r--chrome/browser/dom_ui/new_tab_ui.cc15
2 files changed, 16 insertions, 4 deletions
diff --git a/chrome/browser/dom_ui/dom_ui_theme_source.cc b/chrome/browser/dom_ui/dom_ui_theme_source.cc
index bcdc813..b956c3e 100644
--- a/chrome/browser/dom_ui/dom_ui_theme_source.cc
+++ b/chrome/browser/dom_ui/dom_ui_theme_source.cc
@@ -180,6 +180,11 @@ void DOMUIThemeSource::InitNewTabCSS() {
subst2.push_back(SkColorToRGBAString(color_link_underline)); // $$6
subst2.push_back(SkColorToRGBAString(color_section_link_underline)); // $$7
+ if (profile_->GetPrefs()->GetInteger(prefs::kNTPThemePromoRemaining) > 0)
+ subst2.push_back(UTF8ToUTF16("block")); // $$8
+ else
+ subst2.push_back(UTF8ToUTF16("none")); // $$8
+
// Get our template.
static const base::StringPiece new_tab_theme_css(
ResourceBundle::GetSharedInstance().GetRawDataResource(
diff --git a/chrome/browser/dom_ui/new_tab_ui.cc b/chrome/browser/dom_ui/new_tab_ui.cc
index 93fc8cb..f59259f 100644
--- a/chrome/browser/dom_ui/new_tab_ui.cc
+++ b/chrome/browser/dom_ui/new_tab_ui.cc
@@ -395,7 +395,8 @@ void NewTabHTMLSource::InitFullHTML() {
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,9 +410,15 @@ void NewTabHTMLSource::InitFullHTML() {
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 =