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 #ifndef CHROME_BROWSER_UI_VIEWS_TOOLBAR_BROWSER_ACTION_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_TOOLBAR_BROWSER_ACTION_VIEW_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_TOOLBAR_BROWSER_ACTION_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_TOOLBAR_BROWSER_ACTION_VIEW_H_ |
7 | 7 |
8 #include "chrome/browser/ui/views/extensions/extension_action_view_controller.h" | 8 #include "chrome/browser/ui/views/extensions/extension_action_view_controller.h" |
9 #include "chrome/browser/ui/views/extensions/extension_action_view_delegate.h" | 9 #include "chrome/browser/ui/views/extensions/extension_action_view_delegate.h" |
10 #include "content/public/browser/notification_observer.h" | 10 #include "content/public/browser/notification_observer.h" |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 virtual ExtensionActionViewController* GetPreferredPopupViewController() | 162 virtual ExtensionActionViewController* GetPreferredPopupViewController() |
163 OVERRIDE; | 163 OVERRIDE; |
164 virtual views::View* GetReferenceViewForPopup() OVERRIDE; | 164 virtual views::View* GetReferenceViewForPopup() OVERRIDE; |
165 virtual views::MenuButton* GetContextMenuButton() OVERRIDE; | 165 virtual views::MenuButton* GetContextMenuButton() OVERRIDE; |
166 virtual content::WebContents* GetCurrentWebContents() OVERRIDE; | 166 virtual content::WebContents* GetCurrentWebContents() OVERRIDE; |
167 virtual void HideActivePopup() OVERRIDE; | 167 virtual void HideActivePopup() OVERRIDE; |
168 virtual void OnIconUpdated() OVERRIDE; | 168 virtual void OnIconUpdated() OVERRIDE; |
169 virtual void OnPopupShown(bool grant_tab_permissions) OVERRIDE; | 169 virtual void OnPopupShown(bool grant_tab_permissions) OVERRIDE; |
170 virtual void CleanupPopup() OVERRIDE; | 170 virtual void CleanupPopup() OVERRIDE; |
171 | 171 |
| 172 // A lock to keep the MenuButton pressed when a menu or popup is visible. |
| 173 // This needs to be destroyed after |view_controller_|, because |
| 174 // |view_controller_|'s destructor can call CleanupPopup(), which uses this |
| 175 // object. |
| 176 scoped_ptr<views::MenuButton::PressedLock> pressed_lock_; |
| 177 |
172 // The controller for this ExtensionAction view. | 178 // The controller for this ExtensionAction view. |
173 scoped_ptr<ExtensionActionViewController> view_controller_; | 179 scoped_ptr<ExtensionActionViewController> view_controller_; |
174 | 180 |
175 // Delegate that usually represents a container for BrowserActionView. | 181 // Delegate that usually represents a container for BrowserActionView. |
176 BrowserActionView::Delegate* delegate_; | 182 BrowserActionView::Delegate* delegate_; |
177 | 183 |
178 // Used to make sure we only register the command once. | 184 // Used to make sure we only register the command once. |
179 bool called_registered_extension_command_; | 185 bool called_registered_extension_command_; |
180 | 186 |
181 content::NotificationRegistrar registrar_; | 187 content::NotificationRegistrar registrar_; |
182 | 188 |
183 // The observer that we need to notify when the icon of the button has been | 189 // The observer that we need to notify when the icon of the button has been |
184 // updated. | 190 // updated. |
185 IconObserver* icon_observer_; | 191 IconObserver* icon_observer_; |
186 | 192 |
187 // A lock to keep the MenuButton pressed when a menu or popup is visible. | |
188 scoped_ptr<views::MenuButton::PressedLock> pressed_lock_; | |
189 | |
190 DISALLOW_COPY_AND_ASSIGN(BrowserActionView); | 193 DISALLOW_COPY_AND_ASSIGN(BrowserActionView); |
191 }; | 194 }; |
192 | 195 |
193 #endif // CHROME_BROWSER_UI_VIEWS_TOOLBAR_BROWSER_ACTION_VIEW_H_ | 196 #endif // CHROME_BROWSER_UI_VIEWS_TOOLBAR_BROWSER_ACTION_VIEW_H_ |
OLD | NEW |