summaryrefslogtreecommitdiffstats
path: root/chrome/browser/browser_theme_provider.cc
diff options
context:
space:
mode:
authorarv@google.com <arv@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-03 16:55:32 +0000
committerarv@google.com <arv@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-03 16:55:32 +0000
commit2299ae1d5660727729bc326669ea73da92054b1e (patch)
tree5c41ae00226a4265ca0a5b832bc82b4709c79668 /chrome/browser/browser_theme_provider.cc
parenta42b559451a78a1fc1a8d1f2bfe129d51924a3c0 (diff)
downloadchromium_src-2299ae1d5660727729bc326669ea73da92054b1e.zip
chromium_src-2299ae1d5660727729bc326669ea73da92054b1e.tar.gz
chromium_src-2299ae1d5660727729bc326669ea73da92054b1e.tar.bz2
NNTP: Fix link and link underline colors
The fall back color for the link underline is the link color with the alpha channel set to 1/3 of the link color. BUG=20697 TEST=All links on the NTP should have different underline color. Also, try with different themes. Review URL: http://codereview.chromium.org/194004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25318 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_theme_provider.cc')
-rw-r--r--chrome/browser/browser_theme_provider.cc27
1 files changed, 25 insertions, 2 deletions
diff --git a/chrome/browser/browser_theme_provider.cc b/chrome/browser/browser_theme_provider.cc
index 4d1e2d2..29adcc0 100644
--- a/chrome/browser/browser_theme_provider.cc
+++ b/chrome/browser/browser_theme_provider.cc
@@ -47,10 +47,13 @@ const char* BrowserThemeProvider::kColorBookmarkText = "bookmark_text";
const char* BrowserThemeProvider::kColorNTPBackground = "ntp_background";
const char* BrowserThemeProvider::kColorNTPText = "ntp_text";
const char* BrowserThemeProvider::kColorNTPLink = "ntp_link";
+const char* BrowserThemeProvider::kColorNTPLinkUnderline = "ntp_link_underline";
const char* BrowserThemeProvider::kColorNTPHeader = "ntp_header";
const char* BrowserThemeProvider::kColorNTPSection = "ntp_section";
const char* BrowserThemeProvider::kColorNTPSectionText = "ntp_section_text";
const char* BrowserThemeProvider::kColorNTPSectionLink = "ntp_section_link";
+const char* BrowserThemeProvider::kColorNTPSectionLinkUnderline =
+ "ntp_section_link_underline";
const char* BrowserThemeProvider::kColorControlBackground =
"control_background";
const char* BrowserThemeProvider::kColorButtonBackground = "button_background";
@@ -108,7 +111,7 @@ const SkColor BrowserThemeProvider::kDefaultColorNTPBackground =
const SkColor BrowserThemeProvider::kDefaultColorNTPText =
SkColorSetRGB(0, 0, 0);
const SkColor BrowserThemeProvider::kDefaultColorNTPLink =
- SkColorSetRGB(0, 0, 0);
+ SkColorSetRGB(6, 55, 116);
const SkColor BrowserThemeProvider::kDefaultColorNTPHeader =
SkColorSetRGB(75, 140, 220);
const SkColor BrowserThemeProvider::kDefaultColorNTPSection =
@@ -116,7 +119,7 @@ const SkColor BrowserThemeProvider::kDefaultColorNTPSection =
const SkColor BrowserThemeProvider::kDefaultColorNTPSectionText =
SkColorSetRGB(0, 0, 0);
const SkColor BrowserThemeProvider::kDefaultColorNTPSectionLink =
- SkColorSetRGB(0, 0, 204);
+ SkColorSetRGB(6, 55, 116);
const SkColor BrowserThemeProvider::kDefaultColorControlBackground = NULL;
const SkColor BrowserThemeProvider::kDefaultColorButtonBackground = NULL;
@@ -330,6 +333,8 @@ const std::string BrowserThemeProvider::GetColorKey(int id) {
return kColorNTPText;
case COLOR_NTP_LINK:
return kColorNTPLink;
+ case COLOR_NTP_LINK_UNDERLINE:
+ return kColorNTPLinkUnderline;
case COLOR_NTP_HEADER:
return kColorNTPHeader;
case COLOR_NTP_SECTION:
@@ -338,6 +343,8 @@ const std::string BrowserThemeProvider::GetColorKey(int id) {
return kColorNTPSectionText;
case COLOR_NTP_SECTION_LINK:
return kColorNTPSectionLink;
+ case COLOR_NTP_SECTION_LINK_UNDERLINE:
+ return kColorNTPSectionLinkUnderline;
case COLOR_CONTROL_BACKGROUND:
return kColorControlBackground;
case COLOR_BUTTON_BACKGROUND:
@@ -403,6 +410,22 @@ SkColor BrowserThemeProvider::GetColor(int id) {
return GetDefaultColor(id);
}
+ // Special case the underline colors to use semi transparent in case not
+ // defined.
+ if (id == COLOR_NTP_SECTION_LINK_UNDERLINE) {
+ if (colors_.find(kColorNTPSectionLinkUnderline) != colors_.end())
+ return colors_[kColorNTPSectionLinkUnderline];
+ SkColor color_section_link = GetColor(COLOR_NTP_SECTION_LINK);
+ return SkColorSetA(color_section_link, SkColorGetA(color_section_link) / 3);
+ }
+
+ if (id == COLOR_NTP_LINK_UNDERLINE) {
+ if (colors_.find(kColorNTPLinkUnderline) != colors_.end())
+ return colors_[kColorNTPLinkUnderline];
+ SkColor color_link = GetColor(COLOR_NTP_LINK);
+ return SkColorSetA(color_link, SkColorGetA(color_link) / 3);
+ }
+
// TODO(glen): Figure out if we need to tint these. http://crbug.com/11578
ColorMap::iterator color_iter = colors_.find(GetColorKey(id));
if (color_iter != colors_.end())