diff options
author | mpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-19 21:08:30 +0000 |
---|---|---|
committer | mpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-19 21:08:30 +0000 |
commit | 0f5a3da9fbc074bbb9c63163866ba5d806919d0d (patch) | |
tree | 17520be691546c964cfe7a4d2aa1afbeb07be5fb /chrome/browser/extensions | |
parent | 8b37ca19491d189fe6db3ca9a5a124722373f94e (diff) | |
download | chromium_src-0f5a3da9fbc074bbb9c63163866ba5d806919d0d.zip chromium_src-0f5a3da9fbc074bbb9c63163866ba5d806919d0d.tar.gz chromium_src-0f5a3da9fbc074bbb9c63163866ba5d806919d0d.tar.bz2 |
Implement badges for page actions. Also add badge text color API.
Also change color APIs from wanting ARGB to RGBA.
BUG=24635
BUG=24644
BUG=25215
Review URL: http://codereview.chromium.org/291003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29457 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions')
-rw-r--r-- | chrome/browser/extensions/extension_browser_actions_api.cc | 4 | ||||
-rw-r--r-- | chrome/browser/extensions/extension_page_actions_module.cc | 9 |
2 files changed, 8 insertions, 5 deletions
diff --git a/chrome/browser/extensions/extension_browser_actions_api.cc b/chrome/browser/extensions/extension_browser_actions_api.cc index 5cf68e8..6c83ee0 100644 --- a/chrome/browser/extensions/extension_browser_actions_api.cc +++ b/chrome/browser/extensions/extension_browser_actions_api.cc @@ -115,8 +115,8 @@ bool BrowserActionSetBadgeBackgroundColorFunction::RunImpl() { EXTENSION_FUNCTION_VALIDATE(list->GetInteger(i, &color_array[i])); } - SkColor color = SkColorSetARGB(color_array[0], color_array[1], color_array[2], - color_array[3]); + SkColor color = SkColorSetARGB(color_array[3], color_array[0], color_array[1], + color_array[2]); Extension* extension = dispatcher()->GetExtension(); if (!extension->browser_action()) { diff --git a/chrome/browser/extensions/extension_page_actions_module.cc b/chrome/browser/extensions/extension_page_actions_module.cc index 60eb86a..743e0a5 100644 --- a/chrome/browser/extensions/extension_page_actions_module.cc +++ b/chrome/browser/extensions/extension_page_actions_module.cc @@ -212,8 +212,8 @@ bool PageActionSetBadgeBackgroundColorFunction::RunImpl() { for (size_t i = 0; i < arraysize(color_array); ++i) EXTENSION_FUNCTION_VALIDATE(color_value->GetInteger(i, &color_array[i])); - SkColor color = SkColorSetARGB(color_array[0], color_array[1], color_array[2], - color_array[3]); + SkColor color = SkColorSetARGB(color_array[3], color_array[0], color_array[1], + color_array[2]); state_->set_badge_background_color(color); contents_->PageActionStateChanged(); return true; @@ -236,7 +236,10 @@ bool PageActionSetBadgeTextColorFunction::RunImpl() { for (size_t i = 0; i < arraysize(color_array); ++i) EXTENSION_FUNCTION_VALIDATE(color_value->GetInteger(i, &color_array[i])); - // TODO(mpcomplete): implement text coloring. + SkColor color = SkColorSetARGB(color_array[3], color_array[0], color_array[1], + color_array[2]); + state_->set_badge_text_color(color); + contents_->PageActionStateChanged(); return true; } |