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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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) | 59 #if defined(OS_WIN) |
60 void DispatchBalloonClickEvent(); | 60 void DispatchBalloonClickEvent(); |
61 #endif | 61 #endif |
62 | 62 |
63 // Attempts to make the status icon directly visible on system UI. Currently | |
64 // this only applies to Windows, where status icons are hidden by default | |
65 // inside an overflow window. | |
66 // WARNING: This currently uses undocumented Windows APIs and spawns a worker | |
67 // thread to do it. Use sparingly. | |
68 virtual void ForceVisible(); | |
69 | |
70 protected: | 63 protected: |
71 // Invoked after a call to SetContextMenu() to let the platform-specific | 64 // Invoked after a call to SetContextMenu() to let the platform-specific |
72 // 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 |
73 // passed, subclass should destroy the native context menu. | 66 // passed, subclass should destroy the native context menu. |
74 virtual void UpdatePlatformContextMenu(StatusIconMenuModel* model) = 0; | 67 virtual void UpdatePlatformContextMenu(StatusIconMenuModel* model) = 0; |
75 | 68 |
76 private: | 69 private: |
77 ObserverList<StatusIconObserver> observers_; | 70 ObserverList<StatusIconObserver> observers_; |
78 | 71 |
79 // Context menu, if any. | 72 // Context menu, if any. |
80 scoped_ptr<StatusIconMenuModel> context_menu_contents_; | 73 scoped_ptr<StatusIconMenuModel> context_menu_contents_; |
81 | 74 |
82 DISALLOW_COPY_AND_ASSIGN(StatusIcon); | 75 DISALLOW_COPY_AND_ASSIGN(StatusIcon); |
83 }; | 76 }; |
84 | 77 |
85 #endif // CHROME_BROWSER_STATUS_ICONS_STATUS_ICON_H_ | 78 #endif // CHROME_BROWSER_STATUS_ICONS_STATUS_ICON_H_ |
OLD | NEW |