From 6e853c3ad131fe6713ce8efbac2270fee26ab5b2 Mon Sep 17 00:00:00 2001 From: "glen@chromium.org" Date: Thu, 4 Jun 2009 02:31:02 +0000 Subject: Add ability to theme our buttons. BUG=12762 TEST=Verify that buttons can be themed. Review URL: http://codereview.chromium.org/119025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17586 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/common/extensions/extension.cc | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) (limited to 'chrome/common/extensions/extension.cc') diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc index 5c55341..f6a579b 100644 --- a/chrome/common/extensions/extension.cc +++ b/chrome/common/extensions/extension.cc @@ -549,14 +549,27 @@ bool Extension::InitFromValue(const DictionaryValue& source, bool require_id, 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 || + 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( -- cgit v1.1