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

Unified Diff: chrome/browser/browser_theme_provider.cc

Issue 160093: Let theme values that previous had to be real be specified as ints.... (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 | « no previous file | chrome/common/extensions/extension.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browser_theme_provider.cc
===================================================================
--- chrome/browser/browser_theme_provider.cc (revision 21515)
+++ chrome/browser/browser_theme_provider.cc (working copy)
@@ -39,7 +39,7 @@
const char* BrowserThemeProvider::kColorToolbar = "toolbar";
const char* BrowserThemeProvider::kColorTabText = "tab_text";
const char* BrowserThemeProvider::kColorBackgroundTabText =
- "background_tab_text";
+ "tab_background_text";
const char* BrowserThemeProvider::kColorBookmarkText = "bookmark_text";
const char* BrowserThemeProvider::kColorNTPBackground = "ntp_background";
const char* BrowserThemeProvider::kColorNTPText = "ntp_text";
@@ -536,9 +536,14 @@
color_list->GetInteger(2, &b);
if (color_list->GetSize() == 4) {
double alpha;
- color_list->GetReal(3, &alpha);
- colors_[WideToUTF8(*iter)] = SkColorSetARGB(
- static_cast<int>(alpha * 255), r, g, b);
+ int alpha_int;
+ if (color_list->GetReal(3, &alpha)) {
+ colors_[WideToUTF8(*iter)] = SkColorSetARGB(
+ static_cast<int>(alpha * 255), r, g, b);
+ } else if (color_list->GetInteger(3, &alpha_int)) {
+ colors_[WideToUTF8(*iter)] = SkColorSetARGB(
+ alpha_int * 255, r, g, b);
+ }
} else {
colors_[WideToUTF8(*iter)] = SkColorSetRGB(r, g, b);
}
@@ -559,10 +564,14 @@
if (tints_value->GetList(*iter, &tint_list) &&
tint_list->GetSize() == 3) {
skia::HSL hsl = { -1, -1, -1 };
- // TODO(glen): Make this work with integer values.
- tint_list->GetReal(0, &hsl.h);
- tint_list->GetReal(1, &hsl.s);
- tint_list->GetReal(2, &hsl.l);
+ int value = 0;
+ if (!tint_list->GetReal(0, &hsl.h) && tint_list->GetInteger(0, &value))
+ hsl.h = value;
+ if (!tint_list->GetReal(1, &hsl.s) && tint_list->GetInteger(1, &value))
+ hsl.s = value;
+ if (!tint_list->GetReal(2, &hsl.l) && tint_list->GetInteger(2, &value))
+ hsl.l = value;
+
tints_[WideToUTF8(*iter)] = hsl;
}
++iter;
« no previous file with comments | « no previous file | chrome/common/extensions/extension.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698