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

Unified Diff: chrome/common/extensions/extension.cc

Issue 119025: Add ability to theme our buttons.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 7 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/views/toolbar_view.cc ('k') | skia/ext/image_operations.h » ('j') | 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 17327)
+++ chrome/common/extensions/extension.cc (working copy)
@@ -542,14 +542,27 @@
std::string val;
int color = 0;
ListValue* color_list;
- if (!colors_value->GetList(*iter, &color_list) ||
- color_list->GetSize() != 3 ||
- !color_list->GetInteger(0, &color) ||
- !color_list->GetInteger(1, &color) ||
- !color_list->GetInteger(2, &color)) {
- *error = kInvalidThemeColorsError;
- return false;
+ if (colors_value->GetList(*iter, &color_list)) {
+ if (color_list->GetSize() == 3 ||
Ben Goodger (Google) 2009/06/03 18:03:57 btw, this function has become so long its stupid.
+ color_list->GetSize() == 4) {
+ if (color_list->GetInteger(0, &color) &&
+ color_list->GetInteger(1, &color) &&
+ color_list->GetInteger(2, &color)) {
+ if (color_list->GetSize() == 4) {
+ double alpha;
+ if (color_list->GetReal(3, &alpha)) {
+ ++iter;
+ continue;
+ }
+ } else {
+ ++iter;
+ continue;
+ }
+ }
+ }
}
+ *error = kInvalidThemeColorsError;
+ return false;
++iter;
}
theme_colors_.reset(
« no previous file with comments | « chrome/browser/views/toolbar_view.cc ('k') | skia/ext/image_operations.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698