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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 // context menu (if any). | 50 // context menu (if any). |
51 void AddObserver(StatusIconObserver* observer); | 51 void AddObserver(StatusIconObserver* observer); |
52 void RemoveObserver(StatusIconObserver* observer); | 52 void RemoveObserver(StatusIconObserver* observer); |
53 | 53 |
54 // Returns true if there are registered click observers. | 54 // Returns true if there are registered click observers. |
55 bool HasObservers() const; | 55 bool HasObservers() const; |
56 | 56 |
57 // Dispatches a click event to the observers. | 57 // Dispatches a click event to the observers. |
58 void DispatchClickEvent(); | 58 void DispatchClickEvent(); |
59 | 59 |
| 60 void DispatchBalloonClickEvent(); |
| 61 |
60 protected: | 62 protected: |
61 // Invoked after a call to SetContextMenu() to let the platform-specific | 63 // Invoked after a call to SetContextMenu() to let the platform-specific |
62 // subclass update the native context menu based on the new model. If NULL is | 64 // subclass update the native context menu based on the new model. If NULL is |
63 // passed, subclass should destroy the native context menu. | 65 // passed, subclass should destroy the native context menu. |
64 virtual void UpdatePlatformContextMenu(ui::MenuModel* model) = 0; | 66 virtual void UpdatePlatformContextMenu(ui::MenuModel* model) = 0; |
65 | 67 |
66 private: | 68 private: |
67 ObserverList<StatusIconObserver> observers_; | 69 ObserverList<StatusIconObserver> observers_; |
68 | 70 |
69 // Context menu, if any. | 71 // Context menu, if any. |
70 scoped_ptr<ui::MenuModel> context_menu_contents_; | 72 scoped_ptr<ui::MenuModel> context_menu_contents_; |
71 | 73 |
72 DISALLOW_COPY_AND_ASSIGN(StatusIcon); | 74 DISALLOW_COPY_AND_ASSIGN(StatusIcon); |
73 }; | 75 }; |
74 | 76 |
75 #endif // CHROME_BROWSER_STATUS_ICONS_STATUS_ICON_H_ | 77 #endif // CHROME_BROWSER_STATUS_ICONS_STATUS_ICON_H_ |
OLD | NEW |