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

Unified Diff: chrome/browser/extensions/extension_page_actions_module.cc

Issue 291003: Implement badges for page actions. Also add badge text color API. (Closed)
Patch Set: argb Created 11 years, 2 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
Index: chrome/browser/extensions/extension_page_actions_module.cc
diff --git a/chrome/browser/extensions/extension_page_actions_module.cc b/chrome/browser/extensions/extension_page_actions_module.cc
index 60eb86abf875c96279f83dbd758b404dbbd63d08..743e0a5febb169ed90bc33d602db91716a01a143 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;
}
« no previous file with comments | « chrome/browser/extensions/extension_browser_actions_api.cc ('k') | chrome/browser/gtk/location_bar_view_gtk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698