Chromium Code Reviews| 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 <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "chrome/browser/extensions/extension_action_icon_factory.h" | 10 #include "chrome/browser/extensions/extension_action_icon_factory.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 50 | 50 |
| 51 // Called when the user clicks on the browser action icon. | 51 // Called when the user clicks on the browser action icon. |
| 52 virtual void OnBrowserActionExecuted(BrowserActionButton* button) = 0; | 52 virtual void OnBrowserActionExecuted(BrowserActionButton* button) = 0; |
| 53 | 53 |
| 54 // Called when a browser action becomes visible/hidden. | 54 // Called when a browser action becomes visible/hidden. |
| 55 virtual void OnBrowserActionVisibilityChanged() = 0; | 55 virtual void OnBrowserActionVisibilityChanged() = 0; |
| 56 | 56 |
| 57 // Whether the container for this button is shown inside a menu. | 57 // Whether the container for this button is shown inside a menu. |
| 58 virtual bool ShownInsideMenu() const = 0; | 58 virtual bool ShownInsideMenu() const = 0; |
| 59 | 59 |
| 60 // Notifies that a drag completed. Note this will only happen if the view | |
| 61 // wasn't removed during the drag-and-drop process (which happens if there | |
|
Finnur
2014/07/18 15:53:51
s/which happens if/not when/
Right?
Devlin
2014/07/18 18:58:52
Yeah, that looks better. Done.
| |
| 62 // was a move in the browser actions, since we re-create the views each | |
| 63 // time we re-order the browser actions). | |
| 64 virtual void OnBrowserActionViewDragDone() = 0; | |
| 65 | |
| 60 protected: | 66 protected: |
| 61 virtual ~Delegate() {} | 67 virtual ~Delegate() {} |
| 62 }; | 68 }; |
| 63 | 69 |
| 64 BrowserActionView(const extensions::Extension* extension, | 70 BrowserActionView(const extensions::Extension* extension, |
| 65 Browser* browser, | 71 Browser* browser, |
| 66 Delegate* delegate); | 72 Delegate* delegate); |
| 67 virtual ~BrowserActionView(); | 73 virtual ~BrowserActionView(); |
| 68 | 74 |
| 69 BrowserActionButton* button() { return button_; } | 75 BrowserActionButton* button() { return button_; } |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 194 // Gets the icon of this button and its badge. | 200 // Gets the icon of this button and its badge. |
| 195 gfx::ImageSkia GetIconWithBadge(); | 201 gfx::ImageSkia GetIconWithBadge(); |
| 196 | 202 |
| 197 // Returns button icon so it can be accessed during tests. | 203 // Returns button icon so it can be accessed during tests. |
| 198 gfx::ImageSkia GetIconForTest(); | 204 gfx::ImageSkia GetIconForTest(); |
| 199 | 205 |
| 200 protected: | 206 protected: |
| 201 // Overridden from views::View: | 207 // Overridden from views::View: |
| 202 virtual void ViewHierarchyChanged( | 208 virtual void ViewHierarchyChanged( |
| 203 const ViewHierarchyChangedDetails& details) OVERRIDE; | 209 const ViewHierarchyChangedDetails& details) OVERRIDE; |
| 210 virtual void OnDragDone() OVERRIDE; | |
| 204 | 211 |
| 205 private: | 212 private: |
| 206 virtual ~BrowserActionButton(); | 213 virtual ~BrowserActionButton(); |
| 207 | 214 |
| 208 // Register an extension command if the extension has an active one. | 215 // Register an extension command if the extension has an active one. |
| 209 void MaybeRegisterExtensionCommand(); | 216 void MaybeRegisterExtensionCommand(); |
| 210 | 217 |
| 211 // Unregisters an extension command, if the extension has registered one and | 218 // Unregisters an extension command, if the extension has registered one and |
| 212 // it is active. | 219 // it is active. |
| 213 void MaybeUnregisterExtensionCommand(bool only_if_active); | 220 void MaybeUnregisterExtensionCommand(bool only_if_active); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 247 // The observer that we need to notify when the icon of the button has been | 254 // The observer that we need to notify when the icon of the button has been |
| 248 // updated. | 255 // updated. |
| 249 IconObserver* icon_observer_; | 256 IconObserver* icon_observer_; |
| 250 | 257 |
| 251 friend class base::DeleteHelper<BrowserActionButton>; | 258 friend class base::DeleteHelper<BrowserActionButton>; |
| 252 | 259 |
| 253 DISALLOW_COPY_AND_ASSIGN(BrowserActionButton); | 260 DISALLOW_COPY_AND_ASSIGN(BrowserActionButton); |
| 254 }; | 261 }; |
| 255 | 262 |
| 256 #endif // CHROME_BROWSER_UI_VIEWS_TOOLBAR_BROWSER_ACTION_VIEW_H_ | 263 #endif // CHROME_BROWSER_UI_VIEWS_TOOLBAR_BROWSER_ACTION_VIEW_H_ |
| OLD | NEW |