OLD | NEW |
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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 void BrowserActionView::Layout() { | 69 void BrowserActionView::Layout() { |
70 button_->SetBounds(0, y(), width(), height()); | 70 button_->SetBounds(0, y(), width(), height()); |
71 } | 71 } |
72 | 72 |
73 void BrowserActionView::GetAccessibleState(ui::AXViewState* state) { | 73 void BrowserActionView::GetAccessibleState(ui::AXViewState* state) { |
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() const { |
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 const views::CullSet& cull_set) { | 85 const views::CullSet& cull_set) { |
86 View::PaintChildren(canvas, cull_set); | 86 View::PaintChildren(canvas, cull_set); |
87 ExtensionAction* action = button()->browser_action(); | 87 ExtensionAction* action = button()->browser_action(); |
88 int tab_id = delegate_->GetCurrentTabId(); | 88 int tab_id = delegate_->GetCurrentTabId(); |
89 if (tab_id >= 0) | 89 if (tab_id >= 0) |
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 extensions::Command browser_action_command; | 421 extensions::Command browser_action_command; |
422 if (!only_if_active || !command_service->GetBrowserActionCommand( | 422 if (!only_if_active || !command_service->GetBrowserActionCommand( |
423 extension_->id(), | 423 extension_->id(), |
424 extensions::CommandService::ACTIVE_ONLY, | 424 extensions::CommandService::ACTIVE_ONLY, |
425 &browser_action_command, | 425 &browser_action_command, |
426 NULL)) { | 426 NULL)) { |
427 GetFocusManager()->UnregisterAccelerator(*keybinding_.get(), this); | 427 GetFocusManager()->UnregisterAccelerator(*keybinding_.get(), this); |
428 keybinding_.reset(NULL); | 428 keybinding_.reset(NULL); |
429 } | 429 } |
430 } | 430 } |
OLD | NEW |