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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 // being called, otherwise, both left and right clicks will display the | 49 // being called, otherwise, both left and right clicks will display the |
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 #if defined(OS_WIN) |
| 60 void DispatchBalloonClickEvent(); |
| 61 #endif |
59 | 62 |
60 protected: | 63 protected: |
61 // Invoked after a call to SetContextMenu() to let the platform-specific | 64 // 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 | 65 // subclass update the native context menu based on the new model. If NULL is |
63 // passed, subclass should destroy the native context menu. | 66 // passed, subclass should destroy the native context menu. |
64 virtual void UpdatePlatformContextMenu(ui::MenuModel* model) = 0; | 67 virtual void UpdatePlatformContextMenu(ui::MenuModel* model) = 0; |
65 | 68 |
66 private: | 69 private: |
67 ObserverList<StatusIconObserver> observers_; | 70 ObserverList<StatusIconObserver> observers_; |
68 | 71 |
69 // Context menu, if any. | 72 // Context menu, if any. |
70 scoped_ptr<ui::MenuModel> context_menu_contents_; | 73 scoped_ptr<ui::MenuModel> context_menu_contents_; |
71 | 74 |
72 DISALLOW_COPY_AND_ASSIGN(StatusIcon); | 75 DISALLOW_COPY_AND_ASSIGN(StatusIcon); |
73 }; | 76 }; |
74 | 77 |
75 #endif // CHROME_BROWSER_STATUS_ICONS_STATUS_ICON_H_ | 78 #endif // CHROME_BROWSER_STATUS_ICONS_STATUS_ICON_H_ |
OLD | NEW |