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

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

Issue 2570033004: Reland: ash: Use system tray mojo interface to show system update tray icon (Closed)
Patch Set: fix build 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 NetworkObserver; 32 class NetworkObserver;
35 class NetworkPortalDetectorObserver; 33 class NetworkPortalDetectorObserver;
36 class ScreenCaptureObserver; 34 class ScreenCaptureObserver;
37 class ScreenShareObserver; 35 class ScreenShareObserver;
38 class SessionLengthLimitObserver; 36 class SessionLengthLimitObserver;
39 class TracingObserver; 37 class TracingObserver;
40 class VirtualKeyboardObserver; 38 class VirtualKeyboardObserver;
41 #endif 39 #endif
42 40
41 namespace mojom {
42 enum class UpdateSeverity;
43 }
44
43 // Observer and notification manager for the ash system tray. 45 // Observer and notification manager for the ash system tray.
44 class ASH_EXPORT SystemTrayNotifier { 46 class ASH_EXPORT SystemTrayNotifier {
45 public: 47 public:
46 SystemTrayNotifier(); 48 SystemTrayNotifier();
47 ~SystemTrayNotifier(); 49 ~SystemTrayNotifier();
48 50
49 // Accessibility. 51 // Accessibility.
50 void AddAccessibilityObserver(AccessibilityObserver* observer); 52 void AddAccessibilityObserver(AccessibilityObserver* observer);
51 void RemoveAccessibilityObserver(AccessibilityObserver* observer); 53 void RemoveAccessibilityObserver(AccessibilityObserver* observer);
52 void NotifyAccessibilityModeChanged( 54 void NotifyAccessibilityModeChanged(
53 AccessibilityNotificationVisibility notify); 55 AccessibilityNotificationVisibility notify);
54 56
55 // Date and time. 57 // Date and time.
56 void AddClockObserver(ClockObserver* observer); 58 void AddClockObserver(ClockObserver* observer);
57 void RemoveClockObserver(ClockObserver* observer); 59 void RemoveClockObserver(ClockObserver* observer);
58 void NotifyRefreshClock(); 60 void NotifyRefreshClock();
59 void NotifyDateFormatChanged(); 61 void NotifyDateFormatChanged();
60 void NotifySystemClockTimeUpdated(); 62 void NotifySystemClockTimeUpdated();
61 void NotifySystemClockCanSetTimeChanged(bool can_set_time); 63 void NotifySystemClockCanSetTimeChanged(bool can_set_time);
62 64
63 // Input methods. 65 // Input methods.
64 void AddIMEObserver(IMEObserver* observer); 66 void AddIMEObserver(IMEObserver* observer);
65 void RemoveIMEObserver(IMEObserver* observer); 67 void RemoveIMEObserver(IMEObserver* observer);
66 void NotifyRefreshIME(); 68 void NotifyRefreshIME();
67 void NotifyRefreshIMEMenu(bool is_active); 69 void NotifyRefreshIMEMenu(bool is_active);
68 70
69 // OS updates.
70 void AddUpdateObserver(UpdateObserver* observer);
71 void RemoveUpdateObserver(UpdateObserver* observer);
72 void NotifyUpdateRecommended(const UpdateInfo& info);
73
74 // User. 71 // User.
75 void AddUserObserver(UserObserver* observer); 72 void AddUserObserver(UserObserver* observer);
76 void RemoveUserObserver(UserObserver* observer); 73 void RemoveUserObserver(UserObserver* observer);
77 void NotifyUserUpdate(); 74 void NotifyUserUpdate();
78 void NotifyUserAddedToSession(); 75 void NotifyUserAddedToSession();
79 76
80 #if defined(OS_CHROMEOS) 77 #if defined(OS_CHROMEOS)
81 // Bluetooth. 78 // Bluetooth.
82 void AddBluetoothObserver(BluetoothObserver* observer); 79 void AddBluetoothObserver(BluetoothObserver* observer);
83 void RemoveBluetoothObserver(BluetoothObserver* observer); 80 void RemoveBluetoothObserver(BluetoothObserver* observer);
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 // Virtual keyboard. 137 // Virtual keyboard.
141 void AddVirtualKeyboardObserver(VirtualKeyboardObserver* observer); 138 void AddVirtualKeyboardObserver(VirtualKeyboardObserver* observer);
142 void RemoveVirtualKeyboardObserver(VirtualKeyboardObserver* observer); 139 void RemoveVirtualKeyboardObserver(VirtualKeyboardObserver* observer);
143 void NotifyVirtualKeyboardSuppressionChanged(bool suppressed); 140 void NotifyVirtualKeyboardSuppressionChanged(bool suppressed);
144 #endif 141 #endif
145 142
146 private: 143 private:
147 base::ObserverList<AccessibilityObserver> accessibility_observers_; 144 base::ObserverList<AccessibilityObserver> accessibility_observers_;
148 base::ObserverList<ClockObserver> clock_observers_; 145 base::ObserverList<ClockObserver> clock_observers_;
149 base::ObserverList<IMEObserver> ime_observers_; 146 base::ObserverList<IMEObserver> ime_observers_;
150 base::ObserverList<UpdateObserver> update_observers_;
151 base::ObserverList<UserObserver> user_observers_; 147 base::ObserverList<UserObserver> user_observers_;
152 148
153 #if defined(OS_CHROMEOS) 149 #if defined(OS_CHROMEOS)
154 base::ObserverList<BluetoothObserver> bluetooth_observers_; 150 base::ObserverList<BluetoothObserver> bluetooth_observers_;
155 base::ObserverList<EnterpriseDomainObserver> enterprise_domain_observers_; 151 base::ObserverList<EnterpriseDomainObserver> enterprise_domain_observers_;
156 base::ObserverList<LastWindowClosedObserver> last_window_closed_observers_; 152 base::ObserverList<LastWindowClosedObserver> last_window_closed_observers_;
157 base::ObserverList<LogoutButtonObserver> logout_button_observers_; 153 base::ObserverList<LogoutButtonObserver> logout_button_observers_;
158 base::ObserverList<NetworkObserver> network_observers_; 154 base::ObserverList<NetworkObserver> network_observers_;
159 base::ObserverList<NetworkPortalDetectorObserver> 155 base::ObserverList<NetworkPortalDetectorObserver>
160 network_portal_detector_observers_; 156 network_portal_detector_observers_;
161 base::ObserverList<ScreenCaptureObserver> screen_capture_observers_; 157 base::ObserverList<ScreenCaptureObserver> screen_capture_observers_;
162 base::ObserverList<ScreenShareObserver> screen_share_observers_; 158 base::ObserverList<ScreenShareObserver> screen_share_observers_;
163 base::ObserverList<SessionLengthLimitObserver> 159 base::ObserverList<SessionLengthLimitObserver>
164 session_length_limit_observers_; 160 session_length_limit_observers_;
165 base::ObserverList<TracingObserver> tracing_observers_; 161 base::ObserverList<TracingObserver> tracing_observers_;
166 base::ObserverList<VirtualKeyboardObserver> virtual_keyboard_observers_; 162 base::ObserverList<VirtualKeyboardObserver> virtual_keyboard_observers_;
167 #endif 163 #endif
168 164
169 DISALLOW_COPY_AND_ASSIGN(SystemTrayNotifier); 165 DISALLOW_COPY_AND_ASSIGN(SystemTrayNotifier);
170 }; 166 };
171 167
172 } // namespace ash 168 } // namespace ash
173 169
174 #endif // ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_NOTIFIER_H_ 170 #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