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" |
11 #include "base/strings/string16.h" | 11 #include "base/strings/string16.h" |
12 #include "chrome/browser/status_icons/status_icon_menu_model.h" | 12 #include "chrome/browser/status_icons/status_icon_menu_model.h" |
13 | 13 |
14 namespace gfx { | 14 namespace gfx { |
15 class ImageSkia; | 15 class ImageSkia; |
16 } | 16 } |
17 | 17 |
18 class StatusIconObserver; | 18 class StatusIconObserver; |
19 | 19 |
20 class StatusIcon { | 20 class StatusIcon { |
21 public: | 21 public: |
22 StatusIcon(); | 22 StatusIcon(); |
23 virtual ~StatusIcon(); | 23 virtual ~StatusIcon(); |
24 | 24 |
25 // Sets the image associated with this status icon. | 25 // Sets the image associated with this status icon. |
26 virtual void SetImage(const gfx::ImageSkia& image) = 0; | 26 virtual void SetImage(const gfx::ImageSkia& image) = 0; |
27 | 27 |
28 // Sets the image associated with this status icon when pressed. | |
29 virtual void SetPressedImage(const gfx::ImageSkia& image) = 0; | |
30 | |
31 // Sets the hover text for this status icon. This is also used as the label | 28 // Sets the hover text for this status icon. This is also used as the label |
32 // for the menu item which is created as a replacement for the status icon | 29 // for the menu item which is created as a replacement for the status icon |
33 // click action on platforms that do not support custom click actions for the | 30 // click action on platforms that do not support custom click actions for the |
34 // status icon (e.g. Ubuntu Unity). | 31 // status icon (e.g. Ubuntu Unity). |
35 virtual void SetToolTip(const base::string16& tool_tip) = 0; | 32 virtual void SetToolTip(const base::string16& tool_tip) = 0; |
36 | 33 |
37 // Displays a notification balloon with the specified contents. | 34 // Displays a notification balloon with the specified contents. |
38 // Depending on the platform it might not appear by the icon tray. | 35 // Depending on the platform it might not appear by the icon tray. |
39 virtual void DisplayBalloon(const gfx::ImageSkia& icon, | 36 virtual void DisplayBalloon(const gfx::ImageSkia& icon, |
40 const base::string16& title, | 37 const base::string16& title, |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 private: | 73 private: |
77 ObserverList<StatusIconObserver> observers_; | 74 ObserverList<StatusIconObserver> observers_; |
78 | 75 |
79 // Context menu, if any. | 76 // Context menu, if any. |
80 scoped_ptr<StatusIconMenuModel> context_menu_contents_; | 77 scoped_ptr<StatusIconMenuModel> context_menu_contents_; |
81 | 78 |
82 DISALLOW_COPY_AND_ASSIGN(StatusIcon); | 79 DISALLOW_COPY_AND_ASSIGN(StatusIcon); |
83 }; | 80 }; |
84 | 81 |
85 #endif // CHROME_BROWSER_STATUS_ICONS_STATUS_ICON_H_ | 82 #endif // CHROME_BROWSER_STATUS_ICONS_STATUS_ICON_H_ |
OLD | NEW |