| 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 21 matching lines...) Expand all Loading... |
| 32 | 32 |
| 33 // Sets the view delegate, which can handle most of the front-end logic. | 33 // Sets the view delegate, which can handle most of the front-end logic. |
| 34 virtual void SetDelegate(ToolbarActionViewDelegate* delegate) = 0; | 34 virtual void SetDelegate(ToolbarActionViewDelegate* delegate) = 0; |
| 35 | 35 |
| 36 // Returns the icon to use for the given |web_contents|. | 36 // Returns the icon to use for the given |web_contents|. |
| 37 virtual gfx::Image GetIcon(content::WebContents* web_contents) = 0; | 37 virtual gfx::Image GetIcon(content::WebContents* web_contents) = 0; |
| 38 | 38 |
| 39 // Returns the icon and the badge, if any, for the current tab. | 39 // Returns the icon and the badge, if any, for the current tab. |
| 40 virtual gfx::ImageSkia GetIconWithBadge() = 0; | 40 virtual gfx::ImageSkia GetIconWithBadge() = 0; |
| 41 | 41 |
| 42 // Returns the name of the action, which can be separate from the accessible |
| 43 // name or name for the tooltip. |
| 44 virtual base::string16 GetActionName() const = 0; |
| 45 |
| 42 // Returns the accessible name to use for the given |web_contents|. | 46 // Returns the accessible name to use for the given |web_contents|. |
| 43 virtual base::string16 GetAccessibleName(content::WebContents* web_contents) | 47 virtual base::string16 GetAccessibleName(content::WebContents* web_contents) |
| 44 const = 0; | 48 const = 0; |
| 45 | 49 |
| 46 // Returns the tooltip to use for the given |web_contents|. | 50 // Returns the tooltip to use for the given |web_contents|. |
| 47 virtual base::string16 GetTooltip(content::WebContents* web_contents) | 51 virtual base::string16 GetTooltip(content::WebContents* web_contents) |
| 48 const = 0; | 52 const = 0; |
| 49 | 53 |
| 50 // Returns true if the action should be enabled on the given |web_contents|. | 54 // Returns true if the action should be enabled on the given |web_contents|. |
| 51 virtual bool IsEnabled(content::WebContents* web_contents) const = 0; | 55 virtual bool IsEnabled(content::WebContents* web_contents) const = 0; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 80 content::WebContents* web_contents) const { | 84 content::WebContents* web_contents) const { |
| 81 } | 85 } |
| 82 | 86 |
| 83 // Registers an accelerator. Called when the view is added to the hierarchy. | 87 // Registers an accelerator. Called when the view is added to the hierarchy. |
| 84 // Unregistering any commands is the responsibility of the controller. | 88 // Unregistering any commands is the responsibility of the controller. |
| 85 virtual void RegisterCommand() { | 89 virtual void RegisterCommand() { |
| 86 } | 90 } |
| 87 }; | 91 }; |
| 88 | 92 |
| 89 #endif // CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_ACTION_VIEW_CONTROLLER_H_ | 93 #endif // CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_ACTION_VIEW_CONTROLLER_H_ |
| OLD | NEW |