| OLD | NEW |
| 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/location_bar/page_action_image_view.h" | 5 #include "chrome/browser/ui/views/location_bar/page_action_image_view.h" |
| 6 | 6 |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "chrome/browser/extensions/extension_action.h" | 8 #include "chrome/browser/extensions/extension_action.h" |
| 9 #include "chrome/browser/platform_util.h" | 9 #include "chrome/browser/platform_util.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 extensions::ExtensionRegistry::Get(browser->profile())-> | 30 extensions::ExtensionRegistry::Get(browser->profile())-> |
| 31 enabled_extensions().GetByID(page_action->extension_id()), | 31 enabled_extensions().GetByID(page_action->extension_id()), |
| 32 browser, | 32 browser, |
| 33 page_action, | 33 page_action, |
| 34 nullptr)), | 34 nullptr)), |
| 35 owner_(owner), | 35 owner_(owner), |
| 36 preview_enabled_(false) { | 36 preview_enabled_(false) { |
| 37 // There should be an associated focus manager so that we can safely register | 37 // There should be an associated focus manager so that we can safely register |
| 38 // accelerators for commands. | 38 // accelerators for commands. |
| 39 DCHECK(GetFocusManagerForAccelerator()); | 39 DCHECK(GetFocusManagerForAccelerator()); |
| 40 SetAccessibilityFocusable(true); | 40 SetFocusBehavior(FocusBehavior::ACCESSIBLE_ONLY); |
| 41 view_controller_->SetDelegate(this); | 41 view_controller_->SetDelegate(this); |
| 42 view_controller_->RegisterCommand(); | 42 view_controller_->RegisterCommand(); |
| 43 set_context_menu_controller(this); | 43 set_context_menu_controller(this); |
| 44 } | 44 } |
| 45 | 45 |
| 46 PageActionImageView::~PageActionImageView() { | 46 PageActionImageView::~PageActionImageView() { |
| 47 } | 47 } |
| 48 | 48 |
| 49 const char* PageActionImageView::GetClassName() const { | 49 const char* PageActionImageView::GetClassName() const { |
| 50 return kViewClassName; | 50 return kViewClassName; |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 nullptr, // No menu button for page action views. | 157 nullptr, // No menu button for page action views. |
| 158 gfx::Rect(screen_loc, size()), | 158 gfx::Rect(screen_loc, size()), |
| 159 views::MENU_ANCHOR_TOPLEFT, | 159 views::MENU_ANCHOR_TOPLEFT, |
| 160 source_type) == views::MenuRunner::MENU_DELETED) { | 160 source_type) == views::MenuRunner::MENU_DELETED) { |
| 161 return; | 161 return; |
| 162 } | 162 } |
| 163 | 163 |
| 164 menu_runner_.reset(); | 164 menu_runner_.reset(); |
| 165 view_controller_->OnContextMenuClosed(); | 165 view_controller_->OnContextMenuClosed(); |
| 166 } | 166 } |
| OLD | NEW |