| 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_TOOLBAR_TOOLBAR_ACTION_VIEW_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_ACTION_VIEW_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_ACTION_VIEW_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_ACTION_VIEW_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include "base/strings/string16.h" | 8 #include "base/strings/string16.h" |
| 9 #include "ui/gfx/image/image.h" | 9 #include "ui/gfx/image/image.h" |
| 10 | 10 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 // The basic controller class for an action that is shown on the toolbar - | 25 // The basic controller class for an action that is shown on the toolbar - |
| 26 // an extension action (like browser actions) or a component action (like | 26 // an extension action (like browser actions) or a component action (like |
| 27 // chromecast). | 27 // chromecast). |
| 28 class ToolbarActionViewController { | 28 class ToolbarActionViewController { |
| 29 public: | 29 public: |
| 30 virtual ~ToolbarActionViewController() {} | 30 virtual ~ToolbarActionViewController() {} |
| 31 | 31 |
| 32 // Returns the unique ID of this particular action. For extensions, this is | 32 // Returns the unique ID of this particular action. For extensions, this is |
| 33 // the extension id; for component actions, this is the name of the component. | 33 // the extension id; for component actions, this is the name of the component. |
| 34 virtual const std::string& GetId() const = 0; | 34 virtual std::string GetId() const = 0; |
| 35 | 35 |
| 36 // Sets the view delegate, which can handle most of the front-end logic. | 36 // Sets the view delegate, which can handle most of the front-end logic. |
| 37 virtual void SetDelegate(ToolbarActionViewDelegate* delegate) = 0; | 37 virtual void SetDelegate(ToolbarActionViewDelegate* delegate) = 0; |
| 38 | 38 |
| 39 // Returns the icon to use for the given |web_contents| and |size|. | 39 // Returns the icon to use for the given |web_contents| and |size|. |
| 40 virtual gfx::Image GetIcon(content::WebContents* web_contents, | 40 virtual gfx::Image GetIcon(content::WebContents* web_contents, |
| 41 const gfx::Size& size) = 0; | 41 const gfx::Size& size) = 0; |
| 42 | 42 |
| 43 // Returns the name of the action, which can be separate from the accessible | 43 // Returns the name of the action, which can be separate from the accessible |
| 44 // name or name for the tooltip. | 44 // name or name for the tooltip. |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 // context menu. | 94 // context menu. |
| 95 virtual bool DisabledClickOpensMenu() const = 0; | 95 virtual bool DisabledClickOpensMenu() const = 0; |
| 96 | 96 |
| 97 // Registers an accelerator. Called when the view is added to the hierarchy. | 97 // Registers an accelerator. Called when the view is added to the hierarchy. |
| 98 // Unregistering any commands is the responsibility of the controller. | 98 // Unregistering any commands is the responsibility of the controller. |
| 99 virtual void RegisterCommand() { | 99 virtual void RegisterCommand() { |
| 100 } | 100 } |
| 101 }; | 101 }; |
| 102 | 102 |
| 103 #endif // CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_ACTION_VIEW_CONTROLLER_H_ | 103 #endif // CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_ACTION_VIEW_CONTROLLER_H_ |
| OLD | NEW |