OLD | NEW |
1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_PAGE_ACTION_IMAGE_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_PAGE_ACTION_IMAGE_VIEW_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_PAGE_ACTION_IMAGE_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_PAGE_ACTION_IMAGE_VIEW_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
11 | 11 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 virtual void InspectPopup(ExtensionAction* action) OVERRIDE; | 61 virtual void InspectPopup(ExtensionAction* action) OVERRIDE; |
62 | 62 |
63 // Overridden from views::Widget::Observer | 63 // Overridden from views::Widget::Observer |
64 virtual void OnWidgetClosing(views::Widget* widget) OVERRIDE; | 64 virtual void OnWidgetClosing(views::Widget* widget) OVERRIDE; |
65 | 65 |
66 // content::NotificationObserver implementation. | 66 // content::NotificationObserver implementation. |
67 virtual void Observe(int type, | 67 virtual void Observe(int type, |
68 const content::NotificationSource& source, | 68 const content::NotificationSource& source, |
69 const content::NotificationDetails& details) OVERRIDE; | 69 const content::NotificationDetails& details) OVERRIDE; |
70 | 70 |
| 71 // Overridden from ui::AcceleratorTarget. |
| 72 virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE; |
| 73 virtual bool CanHandleAccelerators() const OVERRIDE; |
| 74 |
71 // Called to notify the PageAction that it should determine whether to be | 75 // Called to notify the PageAction that it should determine whether to be |
72 // visible or hidden. |contents| is the TabContents that is active, |url| is | 76 // visible or hidden. |contents| is the TabContents that is active, |url| is |
73 // the current page URL. | 77 // the current page URL. |
74 void UpdateVisibility(content::WebContents* contents, const GURL& url); | 78 void UpdateVisibility(content::WebContents* contents, const GURL& url); |
75 | 79 |
76 // Either notify listeners or show a popup depending on the page action. | 80 // Either notify listeners or show a popup depending on the page action. |
77 void ExecuteAction(int button, bool inspect_with_devtools); | 81 void ExecuteAction(int button, bool inspect_with_devtools); |
78 | 82 |
79 private: | 83 private: |
80 // Hides the active popup, if there is one. | 84 // Hides the active popup, if there is one. |
(...skipping 25 matching lines...) Expand all Loading... |
106 | 110 |
107 // This is used for post-install visual feedback. The page_action icon is | 111 // This is used for post-install visual feedback. The page_action icon is |
108 // briefly shown even if it hasn't been enabled by its extension. | 112 // briefly shown even if it hasn't been enabled by its extension. |
109 bool preview_enabled_; | 113 bool preview_enabled_; |
110 | 114 |
111 // The current popup and the button it came from. NULL if no popup. | 115 // The current popup and the button it came from. NULL if no popup. |
112 ExtensionPopup* popup_; | 116 ExtensionPopup* popup_; |
113 | 117 |
114 content::NotificationRegistrar registrar_; | 118 content::NotificationRegistrar registrar_; |
115 | 119 |
| 120 // The extension keybinding accelerator this page action is listening for (to |
| 121 // show the popup). |
| 122 scoped_ptr<ui::Accelerator> keybinding_; |
| 123 |
116 scoped_ptr<views::MenuRunner> menu_runner_; | 124 scoped_ptr<views::MenuRunner> menu_runner_; |
117 | 125 |
118 DISALLOW_IMPLICIT_CONSTRUCTORS(PageActionImageView); | 126 DISALLOW_IMPLICIT_CONSTRUCTORS(PageActionImageView); |
119 }; | 127 }; |
120 | 128 |
121 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_PAGE_ACTION_IMAGE_VIEW_H_ | 129 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_PAGE_ACTION_IMAGE_VIEW_H_ |
OLD | NEW |