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

Side by Side Diff: chrome/browser/extensions/api/extension_action/extension_actions_api.cc

Issue 10823143: Make the getAttention badge grey. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move the Grant/Appearance code into the switch Created 8 years, 4 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/api/extension_action/extension_page_actions_api.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/api/extension_action/extension_actions_api.h " 5 #include "chrome/browser/extensions/api/extension_action/extension_actions_api.h "
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/string_number_conversions.h" 9 #include "base/string_number_conversions.h"
10 #include "base/string_piece.h" 10 #include "base/string_piece.h"
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 return false; 175 return false;
176 if (color_ints[i] > 255 || color_ints[i] < 0) 176 if (color_ints[i] > 255 || color_ints[i] < 0)
177 return false; 177 return false;
178 } 178 }
179 179
180 *result = SkColorSetARGB(255, color_ints[0], color_ints[1], color_ints[2]); 180 *result = SkColorSetARGB(255, color_ints[0], color_ints[1], color_ints[2]);
181 return true; 181 return true;
182 } 182 }
183 183
184 bool ExtensionActionFunction::SetVisible(bool visible) { 184 bool ExtensionActionFunction::SetVisible(bool visible) {
185 extension_action_->SetIsVisible(tab_id_, visible); 185 extension_action_->SetAppearance(
186 tab_id_, visible ? ExtensionAction::ACTIVE : ExtensionAction::INVISIBLE);
186 NotifyChange(); 187 NotifyChange();
187 return true; 188 return true;
188 } 189 }
189 190
190 extensions::TabHelper& ExtensionActionFunction::tab_helper() const { 191 extensions::TabHelper& ExtensionActionFunction::tab_helper() const {
191 CHECK(contents_); 192 CHECK(contents_);
192 return *contents_->extension_tab_helper(); 193 return *contents_->extension_tab_helper();
193 } 194 }
194 195
195 bool ExtensionActionShowFunction::RunExtensionAction() { 196 bool ExtensionActionShowFunction::RunExtensionAction() {
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 bool ExtensionActionGetBadgeBackgroundColorFunction::RunExtensionAction() { 309 bool ExtensionActionGetBadgeBackgroundColorFunction::RunExtensionAction() {
309 ListValue* list = new ListValue(); 310 ListValue* list = new ListValue();
310 SkColor color = extension_action_->GetBadgeBackgroundColor(tab_id_); 311 SkColor color = extension_action_->GetBadgeBackgroundColor(tab_id_);
311 list->Append(Value::CreateIntegerValue(SkColorGetR(color))); 312 list->Append(Value::CreateIntegerValue(SkColorGetR(color)));
312 list->Append(Value::CreateIntegerValue(SkColorGetG(color))); 313 list->Append(Value::CreateIntegerValue(SkColorGetG(color)));
313 list->Append(Value::CreateIntegerValue(SkColorGetB(color))); 314 list->Append(Value::CreateIntegerValue(SkColorGetB(color)));
314 list->Append(Value::CreateIntegerValue(SkColorGetA(color))); 315 list->Append(Value::CreateIntegerValue(SkColorGetA(color)));
315 SetResult(list); 316 SetResult(list);
316 return true; 317 return true;
317 } 318 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/api/extension_action/extension_page_actions_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698