Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(710)

Side by Side Diff: ash/common/system/tray/system_tray_notifier.h

Issue 2558043006: ash: Use system tray mojo interface to show system update tray icon (Closed)
Patch Set: fix gcc Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_NOTIFIER_H_ 5 #ifndef ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_NOTIFIER_H_
6 #define ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_NOTIFIER_H_ 6 #define ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_NOTIFIER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "ash/ash_export.h" 10 #include "ash/ash_export.h"
11 #include "ash/common/accessibility_types.h" 11 #include "ash/common/accessibility_types.h"
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "base/observer_list.h" 13 #include "base/observer_list.h"
14 14
15 #if defined(OS_CHROMEOS) 15 #if defined(OS_CHROMEOS)
16 #include "base/strings/string16.h" 16 #include "base/strings/string16.h"
17 #include "base/time/time.h" 17 #include "base/time/time.h"
18 #endif 18 #endif
19 19
20 namespace ash { 20 namespace ash {
21 21
22 class AccessibilityObserver; 22 class AccessibilityObserver;
23 class ClockObserver; 23 class ClockObserver;
24 class IMEObserver; 24 class IMEObserver;
25 struct UpdateInfo;
26 class UpdateObserver;
27 class UserObserver; 25 class UserObserver;
28 26
29 #if defined(OS_CHROMEOS) 27 #if defined(OS_CHROMEOS)
30 class BluetoothObserver; 28 class BluetoothObserver;
31 class EnterpriseDomainObserver; 29 class EnterpriseDomainObserver;
32 class LastWindowClosedObserver; 30 class LastWindowClosedObserver;
33 class LogoutButtonObserver; 31 class LogoutButtonObserver;
34 class MediaCaptureObserver; 32 class MediaCaptureObserver;
35 class NetworkObserver; 33 class NetworkObserver;
36 class NetworkPortalDetectorObserver; 34 class NetworkPortalDetectorObserver;
37 class ScreenCaptureObserver; 35 class ScreenCaptureObserver;
38 class ScreenShareObserver; 36 class ScreenShareObserver;
39 class SessionLengthLimitObserver; 37 class SessionLengthLimitObserver;
40 class TracingObserver; 38 class TracingObserver;
41 class VirtualKeyboardObserver; 39 class VirtualKeyboardObserver;
42 #endif 40 #endif
43 41
42 namespace mojom {
43 enum class UpdateSeverity;
44 }
45
44 // Observer and notification manager for the ash system tray. 46 // Observer and notification manager for the ash system tray.
45 class ASH_EXPORT SystemTrayNotifier { 47 class ASH_EXPORT SystemTrayNotifier {
46 public: 48 public:
47 SystemTrayNotifier(); 49 SystemTrayNotifier();
48 ~SystemTrayNotifier(); 50 ~SystemTrayNotifier();
49 51
50 // Accessibility. 52 // Accessibility.
51 void AddAccessibilityObserver(AccessibilityObserver* observer); 53 void AddAccessibilityObserver(AccessibilityObserver* observer);
52 void RemoveAccessibilityObserver(AccessibilityObserver* observer); 54 void RemoveAccessibilityObserver(AccessibilityObserver* observer);
53 void NotifyAccessibilityModeChanged( 55 void NotifyAccessibilityModeChanged(
54 AccessibilityNotificationVisibility notify); 56 AccessibilityNotificationVisibility notify);
55 57
56 // Date and time. 58 // Date and time.
57 void AddClockObserver(ClockObserver* observer); 59 void AddClockObserver(ClockObserver* observer);
58 void RemoveClockObserver(ClockObserver* observer); 60 void RemoveClockObserver(ClockObserver* observer);
59 void NotifyRefreshClock(); 61 void NotifyRefreshClock();
60 void NotifyDateFormatChanged(); 62 void NotifyDateFormatChanged();
61 void NotifySystemClockTimeUpdated(); 63 void NotifySystemClockTimeUpdated();
62 void NotifySystemClockCanSetTimeChanged(bool can_set_time); 64 void NotifySystemClockCanSetTimeChanged(bool can_set_time);
63 65
64 // Input methods. 66 // Input methods.
65 void AddIMEObserver(IMEObserver* observer); 67 void AddIMEObserver(IMEObserver* observer);
66 void RemoveIMEObserver(IMEObserver* observer); 68 void RemoveIMEObserver(IMEObserver* observer);
67 void NotifyRefreshIME(); 69 void NotifyRefreshIME();
68 void NotifyRefreshIMEMenu(bool is_active); 70 void NotifyRefreshIMEMenu(bool is_active);
69 71
70 // OS updates.
71 void AddUpdateObserver(UpdateObserver* observer);
72 void RemoveUpdateObserver(UpdateObserver* observer);
73 void NotifyUpdateRecommended(const UpdateInfo& info);
74
75 // User. 72 // User.
76 void AddUserObserver(UserObserver* observer); 73 void AddUserObserver(UserObserver* observer);
77 void RemoveUserObserver(UserObserver* observer); 74 void RemoveUserObserver(UserObserver* observer);
78 void NotifyUserUpdate(); 75 void NotifyUserUpdate();
79 void NotifyUserAddedToSession(); 76 void NotifyUserAddedToSession();
80 77
81 #if defined(OS_CHROMEOS) 78 #if defined(OS_CHROMEOS)
82 // Bluetooth. 79 // Bluetooth.
83 void AddBluetoothObserver(BluetoothObserver* observer); 80 void AddBluetoothObserver(BluetoothObserver* observer);
84 void RemoveBluetoothObserver(BluetoothObserver* observer); 81 void RemoveBluetoothObserver(BluetoothObserver* observer);
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 // Virtual keyboard. 143 // Virtual keyboard.
147 void AddVirtualKeyboardObserver(VirtualKeyboardObserver* observer); 144 void AddVirtualKeyboardObserver(VirtualKeyboardObserver* observer);
148 void RemoveVirtualKeyboardObserver(VirtualKeyboardObserver* observer); 145 void RemoveVirtualKeyboardObserver(VirtualKeyboardObserver* observer);
149 void NotifyVirtualKeyboardSuppressionChanged(bool suppressed); 146 void NotifyVirtualKeyboardSuppressionChanged(bool suppressed);
150 #endif 147 #endif
151 148
152 private: 149 private:
153 base::ObserverList<AccessibilityObserver> accessibility_observers_; 150 base::ObserverList<AccessibilityObserver> accessibility_observers_;
154 base::ObserverList<ClockObserver> clock_observers_; 151 base::ObserverList<ClockObserver> clock_observers_;
155 base::ObserverList<IMEObserver> ime_observers_; 152 base::ObserverList<IMEObserver> ime_observers_;
156 base::ObserverList<UpdateObserver> update_observers_;
157 base::ObserverList<UserObserver> user_observers_; 153 base::ObserverList<UserObserver> user_observers_;
158 154
159 #if defined(OS_CHROMEOS) 155 #if defined(OS_CHROMEOS)
160 base::ObserverList<BluetoothObserver> bluetooth_observers_; 156 base::ObserverList<BluetoothObserver> bluetooth_observers_;
161 base::ObserverList<EnterpriseDomainObserver> enterprise_domain_observers_; 157 base::ObserverList<EnterpriseDomainObserver> enterprise_domain_observers_;
162 base::ObserverList<LastWindowClosedObserver> last_window_closed_observers_; 158 base::ObserverList<LastWindowClosedObserver> last_window_closed_observers_;
163 base::ObserverList<LogoutButtonObserver> logout_button_observers_; 159 base::ObserverList<LogoutButtonObserver> logout_button_observers_;
164 base::ObserverList<MediaCaptureObserver> media_capture_observers_; 160 base::ObserverList<MediaCaptureObserver> media_capture_observers_;
165 base::ObserverList<NetworkObserver> network_observers_; 161 base::ObserverList<NetworkObserver> network_observers_;
166 base::ObserverList<NetworkPortalDetectorObserver> 162 base::ObserverList<NetworkPortalDetectorObserver>
167 network_portal_detector_observers_; 163 network_portal_detector_observers_;
168 base::ObserverList<ScreenCaptureObserver> screen_capture_observers_; 164 base::ObserverList<ScreenCaptureObserver> screen_capture_observers_;
169 base::ObserverList<ScreenShareObserver> screen_share_observers_; 165 base::ObserverList<ScreenShareObserver> screen_share_observers_;
170 base::ObserverList<SessionLengthLimitObserver> 166 base::ObserverList<SessionLengthLimitObserver>
171 session_length_limit_observers_; 167 session_length_limit_observers_;
172 base::ObserverList<TracingObserver> tracing_observers_; 168 base::ObserverList<TracingObserver> tracing_observers_;
173 base::ObserverList<VirtualKeyboardObserver> virtual_keyboard_observers_; 169 base::ObserverList<VirtualKeyboardObserver> virtual_keyboard_observers_;
174 #endif 170 #endif
175 171
176 DISALLOW_COPY_AND_ASSIGN(SystemTrayNotifier); 172 DISALLOW_COPY_AND_ASSIGN(SystemTrayNotifier);
177 }; 173 };
178 174
179 } // namespace ash 175 } // namespace ash
180 176
181 #endif // ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_NOTIFIER_H_ 177 #endif // ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_NOTIFIER_H_
OLDNEW
« no previous file with comments | « ash/common/system/tray/system_tray_item.h ('k') | ash/common/system/tray/system_tray_notifier.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698