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

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

Issue 275183002: patch from issue 218843002 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 6 years, 7 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/toolbar/browser_action_view.h" 5 #include "chrome/browser/ui/views/toolbar/browser_action_view.h"
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "chrome/browser/chrome_notification_types.h" 8 #include "chrome/browser/chrome_notification_types.h"
9 #include "chrome/browser/extensions/api/commands/command_service.h" 9 #include "chrome/browser/extensions/api/commands/command_service.h"
10 #include "chrome/browser/extensions/extension_action.h" 10 #include "chrome/browser/extensions/extension_action.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 state->name = l10n_util::GetStringUTF16( 74 state->name = l10n_util::GetStringUTF16(
75 IDS_ACCNAME_EXTENSIONS_BROWSER_ACTION); 75 IDS_ACCNAME_EXTENSIONS_BROWSER_ACTION);
76 state->role = ui::AX_ROLE_GROUP; 76 state->role = ui::AX_ROLE_GROUP;
77 } 77 }
78 78
79 gfx::Size BrowserActionView::GetPreferredSize() { 79 gfx::Size BrowserActionView::GetPreferredSize() {
80 return gfx::Size(BrowserActionsContainer::IconWidth(false), 80 return gfx::Size(BrowserActionsContainer::IconWidth(false),
81 BrowserActionsContainer::IconHeight()); 81 BrowserActionsContainer::IconHeight());
82 } 82 }
83 83
84 void BrowserActionView::PaintChildren(gfx::Canvas* canvas) { 84 void BrowserActionView::PaintChildren(gfx::Canvas* canvas,
85 View::PaintChildren(canvas); 85 const views::CullSet& cull_set) {
86 View::PaintChildren(canvas, cull_set);
86 ExtensionAction* action = button()->browser_action(); 87 ExtensionAction* action = button()->browser_action();
87 int tab_id = delegate_->GetCurrentTabId(); 88 int tab_id = delegate_->GetCurrentTabId();
88 if (tab_id >= 0) 89 if (tab_id >= 0)
89 action->PaintBadge(canvas, GetLocalBounds(), tab_id); 90 action->PaintBadge(canvas, GetLocalBounds(), tab_id);
90 } 91 }
91 92
92 //////////////////////////////////////////////////////////////////////////////// 93 ////////////////////////////////////////////////////////////////////////////////
93 // BrowserActionButton 94 // BrowserActionButton
94 95
95 BrowserActionButton::BrowserActionButton(const Extension* extension, 96 BrowserActionButton::BrowserActionButton(const Extension* extension,
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 extensions::Command browser_action_command; 421 extensions::Command browser_action_command;
421 if (!only_if_active || !command_service->GetBrowserActionCommand( 422 if (!only_if_active || !command_service->GetBrowserActionCommand(
422 extension_->id(), 423 extension_->id(),
423 extensions::CommandService::ACTIVE_ONLY, 424 extensions::CommandService::ACTIVE_ONLY,
424 &browser_action_command, 425 &browser_action_command,
425 NULL)) { 426 NULL)) {
426 GetFocusManager()->UnregisterAccelerator(*keybinding_.get(), this); 427 GetFocusManager()->UnregisterAccelerator(*keybinding_.get(), this);
427 keybinding_.reset(NULL); 428 keybinding_.reset(NULL);
428 } 429 }
429 } 430 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/toolbar/browser_action_view.h ('k') | ui/app_list/views/app_list_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698