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

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

Issue 159305: First pass at NNTP theming.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 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/browser_theme_provider.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/dom_ui_theme_source.cc
===================================================================
--- chrome/browser/dom_ui/dom_ui_theme_source.cc (revision 21313)
+++ chrome/browser/dom_ui/dom_ui_theme_source.cc (working copy)
@@ -100,6 +100,14 @@
SkColor color_section_link =
tp->GetColor(BrowserThemeProvider::COLOR_NTP_SECTION_LINK);
+ // Generate a lighter color.
+ skia::HSL section_lighter;
+ skia::SkColorToHSL(color_section, section_lighter);
+ section_lighter.l += (1 - section_lighter.l) * 0.33;
+ section_lighter.s += (1 - section_lighter.s) * 0.1;
+ SkColor color_section_lighter =
+ skia::HSLToSkColor(SkColorGetA(color_section), section_lighter);
+
// Generate the replacements.
std::vector<string16> subst;
// A second list of replacements, each of which must be in $$x format,
@@ -108,19 +116,20 @@
// Cache-buster for background.
subst.push_back(UTF8ToUTF16(IntToString(static_cast<int>(
- base::Time::Now().ToDoubleT()))));
+ base::Time::Now().ToDoubleT())))); // $1
// Colors.
- subst.push_back(SkColorToRGBAString(color_background));
- subst.push_back(UTF8ToUTF16(GetNewTabBackgroundCSS(false)));
- subst.push_back(UTF8ToUTF16(GetNewTabBackgroundCSS(true)));
- subst.push_back(SkColorToRGBAString(color_text));
- subst.push_back(SkColorToRGBAString(color_link));
- subst.push_back(SkColorToRGBAString(color_section));
- subst.push_back(SkColorToRGBAString(color_section_text));
- subst.push_back(SkColorToRGBAString(color_section_link));
+ subst.push_back(SkColorToRGBAString(color_background)); // $2
+ subst.push_back(UTF8ToUTF16(GetNewTabBackgroundCSS(false))); // $3
+ subst.push_back(UTF8ToUTF16(GetNewTabBackgroundCSS(true))); // $4
+ subst.push_back(UTF8ToUTF16(GetNewTabBackgroundTilingCSS())); // $5
+ subst.push_back(SkColorToRGBAString(color_section)); // $6
+ subst.push_back(SkColorToRGBAString(color_section_lighter)); // $7
+ subst.push_back(SkColorToRGBAString(color_text)); // $8
+ subst.push_back(SkColorToRGBAString(color_link)); // $9
- subst2.push_back(UTF8ToUTF16(GetNewTabBackgroundTilingCSS()));
+ subst2.push_back(SkColorToRGBAString(color_section_text)); // $$1
+ subst2.push_back(SkColorToRGBAString(color_section_link)); // $$2
// Get our template.
static const StringPiece new_tab_theme_css(
@@ -177,6 +186,14 @@
int offset = 0;
#endif
+ // TODO(glen): This is a quick workaround to hide the notused.png image when
+ // no image is provided - we don't have time right now to figure out why
+ // this is painting as white.
+ // http://crbug.com/17593
+ if (!profile_->GetThemeProvider()->HasCustomImage(IDR_THEME_NTP_BACKGROUND)) {
+ return "-64px";
+ }
+
if (alignment & BrowserThemeProvider::ALIGN_TOP) {
if (alignment & BrowserThemeProvider::ALIGN_LEFT)
return "0% " + IntToString(-offset) + "px";
« no previous file with comments | « chrome/browser/browser_theme_provider.cc ('k') | chrome/browser/resources/new_new_tab.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698