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 "chrome/browser/browser.h" | 8 #include "chrome/browser/browser.h" |
8 #include "chrome/browser/browser_list.h" | 9 #include "chrome/browser/browser_list.h" |
9 #include "chrome/common/extensions/extension.h" | 10 #include "chrome/common/extensions/extension.h" |
10 #include "chrome/common/notification_service.h" | 11 #include "chrome/common/notification_service.h" |
11 #include "chrome/common/render_messages.h" | 12 #include "chrome/common/render_messages.h" |
12 | 13 |
13 namespace { | 14 namespace { |
14 // Errors. | 15 // Errors. |
15 const char kNoBrowserActionError[] = | 16 const char kNoBrowserActionError[] = |
16 "This extension has no browser action specified."; | 17 "This extension has no browser action specified."; |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 for (size_t i = 0; i < arraysize(color_array); ++i) { | 90 for (size_t i = 0; i < arraysize(color_array); ++i) { |
90 EXTENSION_FUNCTION_VALIDATE(list->GetInteger(i, &color_array[i])); | 91 EXTENSION_FUNCTION_VALIDATE(list->GetInteger(i, &color_array[i])); |
91 } | 92 } |
92 | 93 |
93 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], |
94 color_array[2]); | 95 color_array[2]); |
95 browser_action_->SetBadgeBackgroundColor(tab_id_, color); | 96 browser_action_->SetBadgeBackgroundColor(tab_id_, color); |
96 | 97 |
97 return true; | 98 return true; |
98 } | 99 } |
OLD | NEW |