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

Side by Side Diff: chrome/browser/ui/views/browser_action_view.cc

Issue 10855154: Update browserAction.setIcon and pageAction.setIcon for hidpi (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 3 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
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/ui/views/browser_action_view.h" 5 #include "chrome/browser/ui/views/browser_action_view.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chrome/browser/extensions/api/commands/command_service.h" 8 #include "chrome/browser/extensions/api/commands/command_service.h"
9 #include "chrome/browser/extensions/api/commands/command_service_factory.h" 9 #include "chrome/browser/extensions/api/commands/command_service_factory.h"
10 #include "chrome/browser/extensions/extension_context_menu_model.h" 10 #include "chrome/browser/extensions/extension_context_menu_model.h"
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 371
372 void BrowserActionButton::SetButtonNotPushed() { 372 void BrowserActionButton::SetButtonNotPushed() {
373 SetState(views::CustomButton::BS_NORMAL); 373 SetState(views::CustomButton::BS_NORMAL);
374 menu_visible_ = false; 374 menu_visible_ = false;
375 } 375 }
376 376
377 bool BrowserActionButton::IsEnabled(int tab_id) const { 377 bool BrowserActionButton::IsEnabled(int tab_id) const {
378 return browser_action_->GetIsVisible(tab_id); 378 return browser_action_->GetIsVisible(tab_id);
379 } 379 }
380 380
381 gfx::ImageSkia BrowserActionButton::GetIconForTest() {
382 return icon();
383 }
384
381 BrowserActionButton::~BrowserActionButton() { 385 BrowserActionButton::~BrowserActionButton() {
382 } 386 }
383 387
384 void BrowserActionButton::MaybeRegisterExtensionCommand() { 388 void BrowserActionButton::MaybeRegisterExtensionCommand() {
385 extensions::CommandService* command_service = 389 extensions::CommandService* command_service =
386 extensions::CommandServiceFactory::GetForProfile(browser_->profile()); 390 extensions::CommandServiceFactory::GetForProfile(browser_->profile());
387 extensions::Command browser_action_command; 391 extensions::Command browser_action_command;
388 if (command_service->GetBrowserActionCommand( 392 if (command_service->GetBrowserActionCommand(
389 extension_->id(), 393 extension_->id(),
390 extensions::CommandService::ACTIVE_ONLY, 394 extensions::CommandService::ACTIVE_ONLY,
(...skipping 15 matching lines...) Expand all
406 410
407 extensions::Command browser_action_command; 411 extensions::Command browser_action_command;
408 if (!only_if_active || !command_service->GetBrowserActionCommand( 412 if (!only_if_active || !command_service->GetBrowserActionCommand(
409 extension_->id(), 413 extension_->id(),
410 extensions::CommandService::ACTIVE_ONLY, 414 extensions::CommandService::ACTIVE_ONLY,
411 &browser_action_command, 415 &browser_action_command,
412 NULL)) { 416 NULL)) {
413 GetFocusManager()->UnregisterAccelerator(*keybinding_.get(), this); 417 GetFocusManager()->UnregisterAccelerator(*keybinding_.get(), this);
414 } 418 }
415 } 419 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/browser_action_view.h ('k') | chrome/common/extensions/api/browser_action.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698