OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "chrome/browser/browser_list.h" | 8 #include "chrome/browser/browser_list.h" |
9 #include "chrome/browser/extensions/extension_browser_event_router.h" | 9 #include "chrome/browser/extensions/extension_browser_event_router.h" |
10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 // Make the menu appear below the button. | 132 // Make the menu appear below the button. |
133 menu_origin.Offset(0, height()); | 133 menu_origin.Offset(0, height()); |
134 ShowContextMenu(menu_origin, true); | 134 ShowContextMenu(menu_origin, true); |
135 return; | 135 return; |
136 } | 136 } |
137 | 137 |
138 ExecuteAction(button, false); // inspect_with_devtools | 138 ExecuteAction(button, false); // inspect_with_devtools |
139 } | 139 } |
140 | 140 |
141 bool PageActionImageView::OnKeyPressed(const views::KeyEvent& e) { | 141 bool PageActionImageView::OnKeyPressed(const views::KeyEvent& e) { |
142 if (e.GetKeyCode() == app::VKEY_SPACE || | 142 if (e.GetKeyCode() == ui::VKEY_SPACE || |
143 e.GetKeyCode() == app::VKEY_RETURN) { | 143 e.GetKeyCode() == ui::VKEY_RETURN) { |
144 ExecuteAction(1, false); | 144 ExecuteAction(1, false); |
145 return true; | 145 return true; |
146 } | 146 } |
147 return false; | 147 return false; |
148 } | 148 } |
149 | 149 |
150 void PageActionImageView::ShowContextMenu(const gfx::Point& p, | 150 void PageActionImageView::ShowContextMenu(const gfx::Point& p, |
151 bool is_mouse_gesture) { | 151 bool is_mouse_gesture) { |
152 const Extension* extension = profile_->GetExtensionService()-> | 152 const Extension* extension = profile_->GetExtensionService()-> |
153 GetExtensionById(page_action()->extension_id(), false); | 153 GetExtensionById(page_action()->extension_id(), false); |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 void PageActionImageView::ExtensionPopupIsClosing(ExtensionPopup* popup) { | 237 void PageActionImageView::ExtensionPopupIsClosing(ExtensionPopup* popup) { |
238 DCHECK_EQ(popup_, popup); | 238 DCHECK_EQ(popup_, popup); |
239 // ExtensionPopup is ref-counted, so we don't need to delete it. | 239 // ExtensionPopup is ref-counted, so we don't need to delete it. |
240 popup_ = NULL; | 240 popup_ = NULL; |
241 } | 241 } |
242 | 242 |
243 void PageActionImageView::HidePopup() { | 243 void PageActionImageView::HidePopup() { |
244 if (popup_) | 244 if (popup_) |
245 popup_->Close(); | 245 popup_->Close(); |
246 } | 246 } |
OLD | NEW |