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
3 // found in the LICENSE file.
5 #ifndef ASH_SYSTEM_TRAY_SYSTEM_TRAY_NOTIFIER_H_
6 #define ASH_SYSTEM_TRAY_SYSTEM_TRAY_NOTIFIER_H_
11 #include "ash/ash_export.h"
12 #include "ash/system/audio/audio_observer.h"
13 #include "ash/system/bluetooth/bluetooth_observer.h"
14 #include "ash/system/chromeos/tray_tracing.h"
15 #include "ash/system/date/clock_observer.h"
16 #include "ash/system/ime/ime_observer.h"
17 #include "ash/system/locale/locale_observer.h"
18 #include "ash/system/tray_accessibility.h"
19 #include "ash/system/user/update_observer.h"
20 #include "ash/system/user/user_observer.h"
21 #include "base/observer_list.h"
23 #if defined(OS_CHROMEOS)
24 #include "ash/system/chromeos/enterprise/enterprise_domain_observer.h"
25 #include "ash/system/chromeos/network/network_observer.h"
26 #include "ash/system/chromeos/network/network_portal_detector_observer.h"
27 #include "ash/system/chromeos/screen_security/screen_capture_observer.h"
28 #include "ash/system/chromeos/screen_security/screen_share_observer.h"
29 #include "ash/system/chromeos/session/last_window_closed_observer.h"
30 #include "ash/system/chromeos/session/logout_button_observer.h"
31 #include "ash/system/chromeos/session/session_length_limit_observer.h"
32 #include "ash/system/chromeos/virtual_keyboard/virtual_keyboard_observer.h"
33 #include "ash/system/tray/media_security/media_capture_observer.h"
34 #include "base/time/time.h"
41 #if defined(OS_CHROMEOS)
42 class NetworkStateNotifier
;
45 class ASH_EXPORT SystemTrayNotifier
{
48 ~SystemTrayNotifier();
50 void AddAccessibilityObserver(AccessibilityObserver
* observer
);
51 void RemoveAccessibilityObserver(AccessibilityObserver
* observer
);
53 void AddAudioObserver(AudioObserver
* observer
);
54 void RemoveAudioObserver(AudioObserver
* observer
);
56 void AddBluetoothObserver(BluetoothObserver
* observer
);
57 void RemoveBluetoothObserver(BluetoothObserver
* observer
);
59 void AddClockObserver(ClockObserver
* observer
);
60 void RemoveClockObserver(ClockObserver
* observer
);
62 void AddIMEObserver(IMEObserver
* observer
);
63 void RemoveIMEObserver(IMEObserver
* observer
);
65 void AddLocaleObserver(LocaleObserver
* observer
);
66 void RemoveLocaleObserver(LocaleObserver
* observer
);
68 void AddTracingObserver(TracingObserver
* observer
);
69 void RemoveTracingObserver(TracingObserver
* observer
);
71 void AddUpdateObserver(UpdateObserver
* observer
);
72 void RemoveUpdateObserver(UpdateObserver
* observer
);
74 void AddUserObserver(UserObserver
* observer
);
75 void RemoveUserObserver(UserObserver
* observer
);
77 #if defined(OS_CHROMEOS)
78 void AddLogoutButtonObserver(LogoutButtonObserver
* observer
);
79 void RemoveLogoutButtonObserver(LogoutButtonObserver
* observer
);
81 void AddSessionLengthLimitObserver(SessionLengthLimitObserver
* observer
);
82 void RemoveSessionLengthLimitObserver(SessionLengthLimitObserver
* observer
);
84 void AddNetworkObserver(NetworkObserver
* observer
);
85 void RemoveNetworkObserver(NetworkObserver
* observer
);
87 void AddNetworkPortalDetectorObserver(
88 NetworkPortalDetectorObserver
* observer
);
89 void RemoveNetworkPortalDetectorObserver(
90 NetworkPortalDetectorObserver
* observer
);
92 void AddEnterpriseDomainObserver(EnterpriseDomainObserver
* observer
);
93 void RemoveEnterpriseDomainObserver(EnterpriseDomainObserver
* observer
);
95 void AddMediaCaptureObserver(MediaCaptureObserver
* observer
);
96 void RemoveMediaCaptureObserver(MediaCaptureObserver
* observer
);
98 void AddScreenCaptureObserver(ScreenCaptureObserver
* observer
);
99 void RemoveScreenCaptureObserver(ScreenCaptureObserver
* observer
);
101 void AddScreenShareObserver(ScreenShareObserver
* observer
);
102 void RemoveScreenShareObserver(ScreenShareObserver
* observer
);
104 void AddLastWindowClosedObserver(LastWindowClosedObserver
* observer
);
105 void RemoveLastWindowClosedObserver(LastWindowClosedObserver
* observer
);
107 void AddVirtualKeyboardObserver(VirtualKeyboardObserver
* observer
);
108 void RemoveVirtualKeyboardObserver(VirtualKeyboardObserver
* observer
);
111 void NotifyAccessibilityModeChanged(
112 ui::AccessibilityNotificationVisibility notify
);
113 void NotifyAudioOutputVolumeChanged(uint64_t node_id
, double volume
);
114 void NotifyAudioOutputMuteChanged(bool mute_on
, bool system_adjust
);
115 void NotifyAudioNodesChanged();
116 void NotifyAudioActiveOutputNodeChanged();
117 void NotifyAudioActiveInputNodeChanged();
118 void NotifyTracingModeChanged(bool value
);
119 void NotifyRefreshBluetooth();
120 void NotifyBluetoothDiscoveringChanged();
121 void NotifyRefreshClock();
122 void NotifyDateFormatChanged();
123 void NotifySystemClockTimeUpdated();
124 void NotifySystemClockCanSetTimeChanged(bool can_set_time
);
125 void NotifyRefreshIME();
126 void NotifyLocaleChanged(LocaleObserver::Delegate
* delegate
,
127 const std::string
& cur_locale
,
128 const std::string
& from_locale
,
129 const std::string
& to_locale
);
130 void NotifyUpdateRecommended(const UpdateInfo
& info
);
131 void NotifyUserUpdate();
132 void NotifyUserAddedToSession();
133 #if defined(OS_CHROMEOS)
134 void NotifyShowLoginButtonChanged(bool show_login_button
);
135 void NotifyLogoutDialogDurationChanged(base::TimeDelta duration
);
136 void NotifySessionStartTimeChanged();
137 void NotifySessionLengthLimitChanged();
138 void NotifyRequestToggleWifi();
139 void NotifyOnCaptivePortalDetected(const std::string
& service_path
);
140 void NotifyEnterpriseDomainChanged();
141 void NotifyMediaCaptureChanged();
142 void NotifyScreenCaptureStart(const base::Closure
& stop_callback
,
143 const base::string16
& sharing_app_name
);
144 void NotifyScreenCaptureStop();
145 void NotifyScreenShareStart(const base::Closure
& stop_callback
,
146 const base::string16
& helper_name
);
147 void NotifyScreenShareStop();
148 void NotifyLastWindowClosed();
149 void NotifyVirtualKeyboardSuppressionChanged(bool suppressed
);
153 base::ObserverList
<AccessibilityObserver
> accessibility_observers_
;
154 base::ObserverList
<AudioObserver
> audio_observers_
;
155 base::ObserverList
<BluetoothObserver
> bluetooth_observers_
;
156 base::ObserverList
<ClockObserver
> clock_observers_
;
157 base::ObserverList
<IMEObserver
> ime_observers_
;
158 base::ObserverList
<LocaleObserver
> locale_observers_
;
159 base::ObserverList
<TracingObserver
> tracing_observers_
;
160 base::ObserverList
<UpdateObserver
> update_observers_
;
161 base::ObserverList
<UserObserver
> user_observers_
;
162 #if defined(OS_CHROMEOS)
163 base::ObserverList
<LogoutButtonObserver
> logout_button_observers_
;
164 base::ObserverList
<SessionLengthLimitObserver
>
165 session_length_limit_observers_
;
166 base::ObserverList
<NetworkObserver
> network_observers_
;
167 base::ObserverList
<NetworkPortalDetectorObserver
>
168 network_portal_detector_observers_
;
169 base::ObserverList
<EnterpriseDomainObserver
> enterprise_domain_observers_
;
170 base::ObserverList
<MediaCaptureObserver
> media_capture_observers_
;
171 base::ObserverList
<ScreenCaptureObserver
> screen_capture_observers_
;
172 base::ObserverList
<ScreenShareObserver
> screen_share_observers_
;
173 base::ObserverList
<LastWindowClosedObserver
> last_window_closed_observers_
;
174 base::ObserverList
<VirtualKeyboardObserver
> virtual_keyboard_observers_
;
177 DISALLOW_COPY_AND_ASSIGN(SystemTrayNotifier
);
182 #endif // ASH_SYSTEM_TRAY_SYSTEM_TRAY_NOTIFIER_H_