OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_STATUS_ICONS_STATUS_ICON_H_ | 5 #ifndef CHROME_BROWSER_STATUS_ICONS_STATUS_ICON_H_ |
6 #define CHROME_BROWSER_STATUS_ICONS_STATUS_ICON_H_ | 6 #define CHROME_BROWSER_STATUS_ICONS_STATUS_ICON_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/observer_list.h" | 10 #include "base/observer_list.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 | 27 |
28 // Sets the image associated with this status icon. | 28 // Sets the image associated with this status icon. |
29 virtual void SetImage(const gfx::ImageSkia& image) = 0; | 29 virtual void SetImage(const gfx::ImageSkia& image) = 0; |
30 | 30 |
31 // Sets the image associated with this status icon when pressed. | 31 // Sets the image associated with this status icon when pressed. |
32 virtual void SetPressedImage(const gfx::ImageSkia& image) = 0; | 32 virtual void SetPressedImage(const gfx::ImageSkia& image) = 0; |
33 | 33 |
34 // Sets the hover text for this status icon. | 34 // Sets the hover text for this status icon. |
35 virtual void SetToolTip(const string16& tool_tip) = 0; | 35 virtual void SetToolTip(const string16& tool_tip) = 0; |
36 | 36 |
| 37 // Sets the label for the menu item which is created as a replacement for the |
| 38 // status icon click action on platforms that do not support custom click |
| 39 // actions for the status icon (e.g. Ubuntu Unity). Since only a few platforms |
| 40 // would need this, the default action is to ignore the call. |
| 41 virtual void SetClickActionLabel(const string16& label); |
| 42 |
37 // Displays a notification balloon with the specified contents. | 43 // Displays a notification balloon with the specified contents. |
38 // Depending on the platform it might not appear by the icon tray. | 44 // Depending on the platform it might not appear by the icon tray. |
39 virtual void DisplayBalloon(const gfx::ImageSkia& icon, | 45 virtual void DisplayBalloon(const gfx::ImageSkia& icon, |
40 const string16& title, | 46 const string16& title, |
41 const string16& contents) = 0; | 47 const string16& contents) = 0; |
42 | 48 |
43 // Set the context menu for this icon. The icon takes ownership of the passed | 49 // Set the context menu for this icon. The icon takes ownership of the passed |
44 // context menu. Passing NULL results in no menu at all. | 50 // context menu. Passing NULL results in no menu at all. |
45 void SetContextMenu(ui::MenuModel* menu); | 51 void SetContextMenu(ui::MenuModel* menu); |
46 | 52 |
(...skipping 22 matching lines...) Expand all Loading... |
69 private: | 75 private: |
70 ObserverList<StatusIconObserver> observers_; | 76 ObserverList<StatusIconObserver> observers_; |
71 | 77 |
72 // Context menu, if any. | 78 // Context menu, if any. |
73 scoped_ptr<ui::MenuModel> context_menu_contents_; | 79 scoped_ptr<ui::MenuModel> context_menu_contents_; |
74 | 80 |
75 DISALLOW_COPY_AND_ASSIGN(StatusIcon); | 81 DISALLOW_COPY_AND_ASSIGN(StatusIcon); |
76 }; | 82 }; |
77 | 83 |
78 #endif // CHROME_BROWSER_STATUS_ICONS_STATUS_ICON_H_ | 84 #endif // CHROME_BROWSER_STATUS_ICONS_STATUS_ICON_H_ |
OLD | NEW |