OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "base/values.h" | 7 #include "base/values.h" |
8 #include "chrome/browser/browser.h" | |
9 #include "chrome/browser/browser_list.h" | 8 #include "chrome/browser/browser_list.h" |
| 9 #include "chrome/browser/ui/browser.h" |
10 #include "chrome/common/extensions/extension.h" | 10 #include "chrome/common/extensions/extension.h" |
11 #include "chrome/common/notification_service.h" | 11 #include "chrome/common/notification_service.h" |
12 #include "chrome/common/render_messages.h" | 12 #include "chrome/common/render_messages.h" |
13 | 13 |
14 namespace { | 14 namespace { |
15 // Errors. | 15 // Errors. |
16 const char kNoBrowserActionError[] = | 16 const char kNoBrowserActionError[] = |
17 "This extension has no browser action specified."; | 17 "This extension has no browser action specified."; |
18 const char kIconIndexOutOfBounds[] = | 18 const char kIconIndexOutOfBounds[] = |
19 "Browser action icon index out of bounds."; | 19 "Browser action icon index out of bounds."; |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 for (size_t i = 0; i < arraysize(color_array); ++i) { | 90 for (size_t i = 0; i < arraysize(color_array); ++i) { |
91 EXTENSION_FUNCTION_VALIDATE(list->GetInteger(i, &color_array[i])); | 91 EXTENSION_FUNCTION_VALIDATE(list->GetInteger(i, &color_array[i])); |
92 } | 92 } |
93 | 93 |
94 SkColor color = SkColorSetARGB(color_array[3], color_array[0], color_array[1], | 94 SkColor color = SkColorSetARGB(color_array[3], color_array[0], color_array[1], |
95 color_array[2]); | 95 color_array[2]); |
96 browser_action_->SetBadgeBackgroundColor(tab_id_, color); | 96 browser_action_->SetBadgeBackgroundColor(tab_id_, color); |
97 | 97 |
98 return true; | 98 return true; |
99 } | 99 } |
OLD | NEW |