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_OBSERVER_H_ | 5 #ifndef CHROME_BROWSER_STATUS_ICONS_STATUS_ICON_OBSERVER_H_ |
6 #define CHROME_BROWSER_STATUS_ICONS_STATUS_ICON_OBSERVER_H_ | 6 #define CHROME_BROWSER_STATUS_ICONS_STATUS_ICON_OBSERVER_H_ |
7 | 7 |
| 8 #include "build/build_config.h" |
| 9 |
8 class StatusIconObserver { | 10 class StatusIconObserver { |
9 public: | 11 public: |
10 // Called when the user clicks on the system tray icon. Clicks that result | 12 // Called when the user clicks on the system tray icon. Clicks that result |
11 // in the context menu being displayed will not be passed to this observer | 13 // in the context menu being displayed will not be passed to this observer |
12 // (i.e. if there's a context menu set on this status icon, and the user | 14 // (i.e. if there's a context menu set on this status icon, and the user |
13 // right clicks on the icon to display the context menu, OnStatusIconClicked() | 15 // right clicks on the icon to display the context menu, OnStatusIconClicked() |
14 // will not be called). | 16 // will not be called). |
15 // Note: Chrome OS displays the context menu on left button clicks. | 17 // Note: Chrome OS displays the context menu on left button clicks. |
16 // This will only be fired for this platform if no context menu is present. | 18 // This will only be fired for this platform if no context menu is present. |
17 virtual void OnStatusIconClicked() = 0; | 19 virtual void OnStatusIconClicked() = 0; |
18 | 20 |
19 #if defined(OS_WIN) | 21 #if defined(OS_WIN) |
20 // Called when the user clicks on a balloon generated for a system tray icon. | 22 // Called when the user clicks on a balloon generated for a system tray icon. |
21 // TODO(dewittj): Implement on platforms other than Windows. Currently this | 23 // TODO(dewittj): Implement on platforms other than Windows. Currently this |
22 // event will never fire on non-Windows platforms. | 24 // event will never fire on non-Windows platforms. |
23 virtual void OnBalloonClicked() {} | 25 virtual void OnBalloonClicked() {} |
24 #endif | 26 #endif |
25 | 27 |
26 protected: | 28 protected: |
27 virtual ~StatusIconObserver() {} | 29 virtual ~StatusIconObserver() {} |
28 }; | 30 }; |
29 | 31 |
30 #endif // CHROME_BROWSER_STATUS_ICONS_STATUS_ICON_OBSERVER_H_ | 32 #endif // CHROME_BROWSER_STATUS_ICONS_STATUS_ICON_OBSERVER_H_ |
OLD | NEW |