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

Unified Diff: chrome/common/extensions/extension.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 | « chrome/browser/browser_theme_provider.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/extension.cc
===================================================================
--- chrome/common/extensions/extension.cc (revision 21515)
+++ chrome/common/extensions/extension.cc (working copy)
@@ -637,7 +637,9 @@
color_list->GetInteger(2, &color)) {
if (color_list->GetSize() == 4) {
double alpha;
- if (color_list->GetReal(3, &alpha)) {
+ int alpha_int;
+ if (color_list->GetReal(3, &alpha) ||
+ color_list->GetInteger(3, &alpha_int)) {
++iter;
continue;
}
@@ -662,12 +664,13 @@
DictionaryValue::key_iterator iter = tints_value->begin_keys();
while (iter != tints_value->end_keys()) {
ListValue* tint_list;
- double hue = 0;
+ double v = 0;
+ int vi = 0;
if (!tints_value->GetList(*iter, &tint_list) ||
tint_list->GetSize() != 3 ||
- !tint_list->GetReal(0, &hue) ||
- !tint_list->GetReal(1, &hue) ||
- !tint_list->GetReal(2, &hue)) {
+ !(tint_list->GetReal(0, &v) || tint_list->GetInteger(0, &vi)) ||
+ !(tint_list->GetReal(1, &v) || tint_list->GetInteger(1, &vi)) ||
+ !(tint_list->GetReal(2, &v) || tint_list->GetInteger(2, &vi))) {
*error = errors::kInvalidThemeTints;
return false;
}
« no previous file with comments | « chrome/browser/browser_theme_provider.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698