OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_EXTENSIONS_EXTENSION_ACTION_VIEW_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_ACTION_VIEW_CONTROLLER_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_ACTION_VIEW_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_ACTION_VIEW_CONTROLLER_H_ |
7 | 7 |
8 #include "chrome/browser/extensions/extension_action_icon_factory.h" | 8 #include "chrome/browser/extensions/extension_action_icon_factory.h" |
9 #include "chrome/browser/extensions/extension_context_menu_model.h" | 9 #include "chrome/browser/extensions/extension_context_menu_model.h" |
10 #include "chrome/browser/ui/views/extensions/extension_popup.h" | 10 #include "chrome/browser/ui/views/extensions/extension_popup.h" |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 | 110 |
111 // views::ContextMenuController: | 111 // views::ContextMenuController: |
112 virtual void ShowContextMenuForView(views::View* source, | 112 virtual void ShowContextMenuForView(views::View* source, |
113 const gfx::Point& point, | 113 const gfx::Point& point, |
114 ui::MenuSourceType source_type) OVERRIDE; | 114 ui::MenuSourceType source_type) OVERRIDE; |
115 | 115 |
116 // Shows the context menu for extension action. | 116 // Shows the context menu for extension action. |
117 void DoShowContextMenu(ui::MenuSourceType source_type); | 117 void DoShowContextMenu(ui::MenuSourceType source_type); |
118 | 118 |
119 // Shows the popup for the extension action, given the associated |popup_url|. | 119 // Shows the popup for the extension action, given the associated |popup_url|. |
| 120 // |grant_tab_permissions| is true if active tab permissions should be given |
| 121 // to the extension; this is only true if the popup is opened through a user |
| 122 // action. |
120 // Returns true if a popup is successfully shown. | 123 // Returns true if a popup is successfully shown. |
121 bool ShowPopupWithUrl(ExtensionPopup::ShowAction show_action, | 124 bool ShowPopupWithUrl(ExtensionPopup::ShowAction show_action, |
122 const GURL& popup_url); | 125 const GURL& popup_url, |
| 126 bool grant_tab_permissions); |
123 | 127 |
124 // Populates |command| with the command associated with |extension|, if one | 128 // Populates |command| with the command associated with |extension|, if one |
125 // exists. Returns true if |command| was populated. | 129 // exists. Returns true if |command| was populated. |
126 bool GetExtensionCommand(extensions::Command* command); | 130 bool GetExtensionCommand(extensions::Command* command); |
127 | 131 |
128 // Closes the currently-active menu, if needed. This is the case when there | 132 // Closes the currently-active menu, if needed. This is the case when there |
129 // is an active menu that wouldn't close automatically when a new one is | 133 // is an active menu that wouldn't close automatically when a new one is |
130 // opened. | 134 // opened. |
131 // Returns true if a menu was closed, false otherwise. | 135 // Returns true if a menu was closed, false otherwise. |
132 bool CloseActiveMenuIfNeeded(); | 136 bool CloseActiveMenuIfNeeded(); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 // If non-NULL, this is the next ExtensionActionViewController context menu | 172 // If non-NULL, this is the next ExtensionActionViewController context menu |
169 // which wants to run once the current owner (this one) is done. | 173 // which wants to run once the current owner (this one) is done. |
170 base::Closure followup_context_menu_task_; | 174 base::Closure followup_context_menu_task_; |
171 | 175 |
172 base::WeakPtrFactory<ExtensionActionViewController> weak_factory_; | 176 base::WeakPtrFactory<ExtensionActionViewController> weak_factory_; |
173 | 177 |
174 DISALLOW_COPY_AND_ASSIGN(ExtensionActionViewController); | 178 DISALLOW_COPY_AND_ASSIGN(ExtensionActionViewController); |
175 }; | 179 }; |
176 | 180 |
177 #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_ACTION_VIEW_CONTROLLER_H
_ | 181 #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_ACTION_VIEW_CONTROLLER_H
_ |
OLD | NEW |