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

Side by Side Diff: chrome/browser/extensions/extension_browser_actions_api.cc

Issue 306059: Merge 29556 - Revert "Revert 29457, because this is making ExtensionBrowserTe... (Closed) Base URL: svn://chrome-svn/chrome/branches/223/src/
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_page_actions_module.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Modified: svn:mergeinfo
Merged /trunk/src/chrome/browser/extensions/extension_browser_actions_api.cc:r29556
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/extensions/extension_browser_actions_api.h" 5 #include "chrome/browser/extensions/extension_browser_actions_api.h"
6 6
7 #include "chrome/browser/browser.h" 7 #include "chrome/browser/browser.h"
8 #include "chrome/browser/browser_list.h" 8 #include "chrome/browser/browser_list.h"
9 #include "chrome/common/notification_service.h" 9 #include "chrome/common/notification_service.h"
10 #include "chrome/common/render_messages.h" 10 #include "chrome/common/render_messages.h"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 108
109 ListValue* list = NULL; 109 ListValue* list = NULL;
110 EXTENSION_FUNCTION_VALIDATE(details->GetList(L"color", &list)); 110 EXTENSION_FUNCTION_VALIDATE(details->GetList(L"color", &list));
111 EXTENSION_FUNCTION_VALIDATE(list->GetSize() == 4); 111 EXTENSION_FUNCTION_VALIDATE(list->GetSize() == 4);
112 112
113 int color_array[4] = {0}; 113 int color_array[4] = {0};
114 for (size_t i = 0; i < arraysize(color_array); ++i) { 114 for (size_t i = 0; i < arraysize(color_array); ++i) {
115 EXTENSION_FUNCTION_VALIDATE(list->GetInteger(i, &color_array[i])); 115 EXTENSION_FUNCTION_VALIDATE(list->GetInteger(i, &color_array[i]));
116 } 116 }
117 117
118 SkColor color = SkColorSetARGB(color_array[0], color_array[1], color_array[2], 118 SkColor color = SkColorSetARGB(color_array[3], color_array[0], color_array[1],
119 color_array[3]); 119 color_array[2]);
120 120
121 Extension* extension = dispatcher()->GetExtension(); 121 Extension* extension = dispatcher()->GetExtension();
122 if (!extension->browser_action()) { 122 if (!extension->browser_action()) {
123 error_ = kNoBrowserActionError; 123 error_ = kNoBrowserActionError;
124 return false; 124 return false;
125 } 125 }
126 126
127 extension->browser_action_state()->set_badge_background_color(color); 127 extension->browser_action_state()->set_badge_background_color(color);
128 128
129 NotificationService::current()->Notify( 129 NotificationService::current()->Notify(
130 NotificationType::EXTENSION_BROWSER_ACTION_UPDATED, 130 NotificationType::EXTENSION_BROWSER_ACTION_UPDATED,
131 Source<ExtensionAction>(extension->browser_action()), 131 Source<ExtensionAction>(extension->browser_action()),
132 Details<ExtensionActionState>(extension->browser_action_state())); 132 Details<ExtensionActionState>(extension->browser_action_state()));
133 return true; 133 return true;
134 } 134 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_page_actions_module.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698