diff options
author | glen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-04 02:31:02 +0000 |
---|---|---|
committer | glen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-04 02:31:02 +0000 |
commit | 6e853c3ad131fe6713ce8efbac2270fee26ab5b2 (patch) | |
tree | d0c9c8a5d1949cbdd108059add44b86b989514f4 /chrome/common/extensions/extension.cc | |
parent | 26e99ffd2a4179aefe5dbf8cbd5da74c0bc7a76b (diff) | |
download | chromium_src-6e853c3ad131fe6713ce8efbac2270fee26ab5b2.zip chromium_src-6e853c3ad131fe6713ce8efbac2270fee26ab5b2.tar.gz chromium_src-6e853c3ad131fe6713ce8efbac2270fee26ab5b2.tar.bz2 |
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
Diffstat (limited to 'chrome/common/extensions/extension.cc')
-rw-r--r-- | chrome/common/extensions/extension.cc | 27 |
1 files changed, 20 insertions, 7 deletions
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( |