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

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

Issue 2576133002: chromeos: Remove OS ifdefs from ash/common/system/tray (Closed)
Patch Set: review comments 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
« no previous file with comments | « ash/common/system/tray/system_tray.cc ('k') | ash/common/system/tray/system_tray_notifier.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
15 #if defined(OS_CHROMEOS)
16 #include "base/strings/string16.h" 14 #include "base/strings/string16.h"
17 #include "base/time/time.h" 15 #include "base/time/time.h"
18 #endif
19 16
20 namespace ash { 17 namespace ash {
21 18
22 class AccessibilityObserver; 19 class AccessibilityObserver;
20 class BluetoothObserver;
23 class ClockObserver; 21 class ClockObserver;
22 class EnterpriseDomainObserver;
24 class IMEObserver; 23 class IMEObserver;
25 class UserObserver;
26
27 #if defined(OS_CHROMEOS)
28 class BluetoothObserver;
29 class EnterpriseDomainObserver;
30 class LastWindowClosedObserver; 24 class LastWindowClosedObserver;
31 class LogoutButtonObserver; 25 class LogoutButtonObserver;
32 class NetworkObserver; 26 class NetworkObserver;
33 class NetworkPortalDetectorObserver; 27 class NetworkPortalDetectorObserver;
34 class ScreenCaptureObserver; 28 class ScreenCaptureObserver;
35 class ScreenShareObserver; 29 class ScreenShareObserver;
36 class SessionLengthLimitObserver; 30 class SessionLengthLimitObserver;
37 class TracingObserver; 31 class TracingObserver;
32 class UserObserver;
38 class VirtualKeyboardObserver; 33 class VirtualKeyboardObserver;
39 #endif
40 34
41 namespace mojom { 35 namespace mojom {
42 enum class UpdateSeverity; 36 enum class UpdateSeverity;
43 } 37 }
44 38
45 // Observer and notification manager for the ash system tray. 39 // Observer and notification manager for the ash system tray.
46 class ASH_EXPORT SystemTrayNotifier { 40 class ASH_EXPORT SystemTrayNotifier {
47 public: 41 public:
48 SystemTrayNotifier(); 42 SystemTrayNotifier();
49 ~SystemTrayNotifier(); 43 ~SystemTrayNotifier();
50 44
51 // Accessibility. 45 // Accessibility.
52 void AddAccessibilityObserver(AccessibilityObserver* observer); 46 void AddAccessibilityObserver(AccessibilityObserver* observer);
53 void RemoveAccessibilityObserver(AccessibilityObserver* observer); 47 void RemoveAccessibilityObserver(AccessibilityObserver* observer);
54 void NotifyAccessibilityModeChanged( 48 void NotifyAccessibilityModeChanged(
55 AccessibilityNotificationVisibility notify); 49 AccessibilityNotificationVisibility notify);
56 50
51 // Bluetooth.
52 void AddBluetoothObserver(BluetoothObserver* observer);
53 void RemoveBluetoothObserver(BluetoothObserver* observer);
54 void NotifyRefreshBluetooth();
55 void NotifyBluetoothDiscoveringChanged();
56
57 // Date and time. 57 // Date and time.
58 void AddClockObserver(ClockObserver* observer); 58 void AddClockObserver(ClockObserver* observer);
59 void RemoveClockObserver(ClockObserver* observer); 59 void RemoveClockObserver(ClockObserver* observer);
60 void NotifyRefreshClock(); 60 void NotifyRefreshClock();
61 void NotifyDateFormatChanged(); 61 void NotifyDateFormatChanged();
62 void NotifySystemClockTimeUpdated(); 62 void NotifySystemClockTimeUpdated();
63 void NotifySystemClockCanSetTimeChanged(bool can_set_time); 63 void NotifySystemClockCanSetTimeChanged(bool can_set_time);
64 64
65 // Enterprise domain.
66 void AddEnterpriseDomainObserver(EnterpriseDomainObserver* observer);
67 void RemoveEnterpriseDomainObserver(EnterpriseDomainObserver* observer);
68 void NotifyEnterpriseDomainChanged();
69
65 // Input methods. 70 // Input methods.
66 void AddIMEObserver(IMEObserver* observer); 71 void AddIMEObserver(IMEObserver* observer);
67 void RemoveIMEObserver(IMEObserver* observer); 72 void RemoveIMEObserver(IMEObserver* observer);
68 void NotifyRefreshIME(); 73 void NotifyRefreshIME();
69 void NotifyRefreshIMEMenu(bool is_active); 74 void NotifyRefreshIMEMenu(bool is_active);
70 75
71 // User.
72 void AddUserObserver(UserObserver* observer);
73 void RemoveUserObserver(UserObserver* observer);
74 void NotifyUserUpdate();
75 void NotifyUserAddedToSession();
76
77 #if defined(OS_CHROMEOS)
78 // Bluetooth.
79 void AddBluetoothObserver(BluetoothObserver* observer);
80 void RemoveBluetoothObserver(BluetoothObserver* observer);
81 void NotifyRefreshBluetooth();
82 void NotifyBluetoothDiscoveringChanged();
83
84 // Enterprise domain.
85 void AddEnterpriseDomainObserver(EnterpriseDomainObserver* observer);
86 void RemoveEnterpriseDomainObserver(EnterpriseDomainObserver* observer);
87 void NotifyEnterpriseDomainChanged();
88
89 // Last window closed. 76 // Last window closed.
90 void AddLastWindowClosedObserver(LastWindowClosedObserver* observer); 77 void AddLastWindowClosedObserver(LastWindowClosedObserver* observer);
91 void RemoveLastWindowClosedObserver(LastWindowClosedObserver* observer); 78 void RemoveLastWindowClosedObserver(LastWindowClosedObserver* observer);
92 void NotifyLastWindowClosed(); 79 void NotifyLastWindowClosed();
93 80
94 // Logout button. 81 // Logout button.
95 void AddLogoutButtonObserver(LogoutButtonObserver* observer); 82 void AddLogoutButtonObserver(LogoutButtonObserver* observer);
96 void RemoveLogoutButtonObserver(LogoutButtonObserver* observer); 83 void RemoveLogoutButtonObserver(LogoutButtonObserver* observer);
97 void NotifyShowLoginButtonChanged(bool show_login_button); 84 void NotifyShowLoginButtonChanged(bool show_login_button);
98 void NotifyLogoutDialogDurationChanged(base::TimeDelta duration); 85 void NotifyLogoutDialogDurationChanged(base::TimeDelta duration);
(...skipping 28 matching lines...) Expand all
127 void AddSessionLengthLimitObserver(SessionLengthLimitObserver* observer); 114 void AddSessionLengthLimitObserver(SessionLengthLimitObserver* observer);
128 void RemoveSessionLengthLimitObserver(SessionLengthLimitObserver* observer); 115 void RemoveSessionLengthLimitObserver(SessionLengthLimitObserver* observer);
129 void NotifySessionStartTimeChanged(); 116 void NotifySessionStartTimeChanged();
130 void NotifySessionLengthLimitChanged(); 117 void NotifySessionLengthLimitChanged();
131 118
132 // Tracing. 119 // Tracing.
133 void AddTracingObserver(TracingObserver* observer); 120 void AddTracingObserver(TracingObserver* observer);
134 void RemoveTracingObserver(TracingObserver* observer); 121 void RemoveTracingObserver(TracingObserver* observer);
135 void NotifyTracingModeChanged(bool value); 122 void NotifyTracingModeChanged(bool value);
136 123
124 // User.
125 void AddUserObserver(UserObserver* observer);
126 void RemoveUserObserver(UserObserver* observer);
127 void NotifyUserUpdate();
128 void NotifyUserAddedToSession();
129
137 // Virtual keyboard. 130 // Virtual keyboard.
138 void AddVirtualKeyboardObserver(VirtualKeyboardObserver* observer); 131 void AddVirtualKeyboardObserver(VirtualKeyboardObserver* observer);
139 void RemoveVirtualKeyboardObserver(VirtualKeyboardObserver* observer); 132 void RemoveVirtualKeyboardObserver(VirtualKeyboardObserver* observer);
140 void NotifyVirtualKeyboardSuppressionChanged(bool suppressed); 133 void NotifyVirtualKeyboardSuppressionChanged(bool suppressed);
141 #endif
142 134
143 private: 135 private:
144 base::ObserverList<AccessibilityObserver> accessibility_observers_; 136 base::ObserverList<AccessibilityObserver> accessibility_observers_;
137 base::ObserverList<BluetoothObserver> bluetooth_observers_;
145 base::ObserverList<ClockObserver> clock_observers_; 138 base::ObserverList<ClockObserver> clock_observers_;
139 base::ObserverList<EnterpriseDomainObserver> enterprise_domain_observers_;
146 base::ObserverList<IMEObserver> ime_observers_; 140 base::ObserverList<IMEObserver> ime_observers_;
147 base::ObserverList<UserObserver> user_observers_;
148
149 #if defined(OS_CHROMEOS)
150 base::ObserverList<BluetoothObserver> bluetooth_observers_;
151 base::ObserverList<EnterpriseDomainObserver> enterprise_domain_observers_;
152 base::ObserverList<LastWindowClosedObserver> last_window_closed_observers_; 141 base::ObserverList<LastWindowClosedObserver> last_window_closed_observers_;
153 base::ObserverList<LogoutButtonObserver> logout_button_observers_; 142 base::ObserverList<LogoutButtonObserver> logout_button_observers_;
154 base::ObserverList<NetworkObserver> network_observers_; 143 base::ObserverList<NetworkObserver> network_observers_;
155 base::ObserverList<NetworkPortalDetectorObserver> 144 base::ObserverList<NetworkPortalDetectorObserver>
156 network_portal_detector_observers_; 145 network_portal_detector_observers_;
157 base::ObserverList<ScreenCaptureObserver> screen_capture_observers_; 146 base::ObserverList<ScreenCaptureObserver> screen_capture_observers_;
158 base::ObserverList<ScreenShareObserver> screen_share_observers_; 147 base::ObserverList<ScreenShareObserver> screen_share_observers_;
159 base::ObserverList<SessionLengthLimitObserver> 148 base::ObserverList<SessionLengthLimitObserver>
160 session_length_limit_observers_; 149 session_length_limit_observers_;
161 base::ObserverList<TracingObserver> tracing_observers_; 150 base::ObserverList<TracingObserver> tracing_observers_;
151 base::ObserverList<UserObserver> user_observers_;
162 base::ObserverList<VirtualKeyboardObserver> virtual_keyboard_observers_; 152 base::ObserverList<VirtualKeyboardObserver> virtual_keyboard_observers_;
163 #endif
164 153
165 DISALLOW_COPY_AND_ASSIGN(SystemTrayNotifier); 154 DISALLOW_COPY_AND_ASSIGN(SystemTrayNotifier);
166 }; 155 };
167 156
168 } // namespace ash 157 } // namespace ash
169 158
170 #endif // ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_NOTIFIER_H_ 159 #endif // ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_NOTIFIER_H_
OLDNEW
« no previous file with comments | « ash/common/system/tray/system_tray.cc ('k') | ash/common/system/tray/system_tray_notifier.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698