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/drive/drive_observer.h"
17 #include "ash/system/ime/ime_observer.h"
18 #include "ash/system/locale/locale_observer.h"
19 #include "ash/system/tray_accessibility.h"
20 #include "ash/system/user/update_observer.h"
21 #include "ash/system/user/user_observer.h"
22 #include "base/observer_list.h"
24 #if defined(OS_CHROMEOS)
25 #include "ash/system/chromeos/enterprise/enterprise_domain_observer.h"
26 #include "ash/system/chromeos/network/network_observer.h"
27 #include "ash/system/chromeos/network/network_portal_detector_observer.h"
28 #include "ash/system/chromeos/screen_security/screen_capture_observer.h"
29 #include "ash/system/chromeos/screen_security/screen_share_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 "base/time/time.h"
37 #if defined(OS_CHROMEOS)
38 class NetworkStateNotifier
;
41 class ASH_EXPORT SystemTrayNotifier
{
44 ~SystemTrayNotifier();
46 void AddAccessibilityObserver(AccessibilityObserver
* observer
);
47 void RemoveAccessibilityObserver(AccessibilityObserver
* observer
);
49 void AddAudioObserver(AudioObserver
* observer
);
50 void RemoveAudioObserver(AudioObserver
* observer
);
52 void AddBluetoothObserver(BluetoothObserver
* observer
);
53 void RemoveBluetoothObserver(BluetoothObserver
* observer
);
55 void AddClockObserver(ClockObserver
* observer
);
56 void RemoveClockObserver(ClockObserver
* observer
);
58 void AddDriveObserver(DriveObserver
* observer
);
59 void RemoveDriveObserver(DriveObserver
* observer
);
61 void AddIMEObserver(IMEObserver
* observer
);
62 void RemoveIMEObserver(IMEObserver
* observer
);
64 void AddLocaleObserver(LocaleObserver
* observer
);
65 void RemoveLocaleObserver(LocaleObserver
* observer
);
67 void AddTracingObserver(TracingObserver
* observer
);
68 void RemoveTracingObserver(TracingObserver
* observer
);
70 void AddUpdateObserver(UpdateObserver
* observer
);
71 void RemoveUpdateObserver(UpdateObserver
* observer
);
73 void AddUserObserver(UserObserver
* observer
);
74 void RemoveUserObserver(UserObserver
* observer
);
76 #if defined(OS_CHROMEOS)
77 void AddLogoutButtonObserver(LogoutButtonObserver
* observer
);
78 void RemoveLogoutButtonObserver(LogoutButtonObserver
* observer
);
80 void AddSessionLengthLimitObserver(SessionLengthLimitObserver
* observer
);
81 void RemoveSessionLengthLimitObserver(SessionLengthLimitObserver
* observer
);
83 void AddNetworkObserver(NetworkObserver
* observer
);
84 void RemoveNetworkObserver(NetworkObserver
* observer
);
86 void AddNetworkPortalDetectorObserver(
87 NetworkPortalDetectorObserver
* observer
);
88 void RemoveNetworkPortalDetectorObserver(
89 NetworkPortalDetectorObserver
* observer
);
91 void AddEnterpriseDomainObserver(EnterpriseDomainObserver
* observer
);
92 void RemoveEnterpriseDomainObserver(EnterpriseDomainObserver
* observer
);
94 void AddScreenCaptureObserver(ScreenCaptureObserver
* observer
);
95 void RemoveScreenCaptureObserver(ScreenCaptureObserver
* observer
);
97 void AddScreenShareObserver(ScreenShareObserver
* observer
);
98 void RemoveScreenShareObserver(ScreenShareObserver
* observer
);
101 void NotifyAccessibilityModeChanged(
102 AccessibilityNotificationVisibility notify
);
103 void NotifyAudioOutputVolumeChanged();
104 void NotifyAudioOutputMuteChanged();
105 void NotifyAudioNodesChanged();
106 void NotifyAudioActiveOutputNodeChanged();
107 void NotifyAudioActiveInputNodeChanged();
108 void NotifyTracingModeChanged(bool value
);
109 void NotifyRefreshBluetooth();
110 void NotifyBluetoothDiscoveringChanged();
111 void NotifyRefreshClock();
112 void NotifyDateFormatChanged();
113 void NotifySystemClockTimeUpdated();
114 void NotifyDriveJobUpdated(const DriveOperationStatus
& status
);
115 void NotifyRefreshIME();
116 void NotifyLocaleChanged(LocaleObserver::Delegate
* delegate
,
117 const std::string
& cur_locale
,
118 const std::string
& from_locale
,
119 const std::string
& to_locale
);
120 void NotifyUpdateRecommended(UpdateObserver::UpdateSeverity severity
);
121 void NotifyUserUpdate();
122 void NotifyUserAddedToSession();
123 #if defined(OS_CHROMEOS)
124 void NotifyShowLoginButtonChanged(bool show_login_button
);
125 void NotifyLogoutDialogDurationChanged(base::TimeDelta duration
);
126 void NotifySessionStartTimeChanged();
127 void NotifySessionLengthLimitChanged();
128 void NotifyRequestToggleWifi();
129 void NotifyOnCaptivePortalDetected(const std::string
& service_path
);
130 void NotifyEnterpriseDomainChanged();
131 void NotifyScreenCaptureStart(const base::Closure
& stop_callback
,
132 const base::string16
& sharing_app_name
);
133 void NotifyScreenCaptureStop();
134 void NotifyScreenShareStart(const base::Closure
& stop_callback
,
135 const base::string16
& helper_name
);
136 void NotifyScreenShareStop();
138 NetworkStateNotifier
* network_state_notifier() {
139 return network_state_notifier_
.get();
144 ObserverList
<AccessibilityObserver
> accessibility_observers_
;
145 ObserverList
<AudioObserver
> audio_observers_
;
146 ObserverList
<BluetoothObserver
> bluetooth_observers_
;
147 ObserverList
<ClockObserver
> clock_observers_
;
148 ObserverList
<DriveObserver
> drive_observers_
;
149 ObserverList
<IMEObserver
> ime_observers_
;
150 ObserverList
<LocaleObserver
> locale_observers_
;
151 ObserverList
<TracingObserver
> tracing_observers_
;
152 ObserverList
<UpdateObserver
> update_observers_
;
153 ObserverList
<UserObserver
> user_observers_
;
154 #if defined(OS_CHROMEOS)
155 ObserverList
<LogoutButtonObserver
> logout_button_observers_
;
156 ObserverList
<SessionLengthLimitObserver
> session_length_limit_observers_
;
157 ObserverList
<NetworkObserver
> network_observers_
;
158 ObserverList
<NetworkPortalDetectorObserver
>
159 network_portal_detector_observers_
;
160 ObserverList
<EnterpriseDomainObserver
> enterprise_domain_observers_
;
161 ObserverList
<ScreenCaptureObserver
> screen_capture_observers_
;
162 ObserverList
<ScreenShareObserver
> screen_share_observers_
;
163 scoped_ptr
<NetworkStateNotifier
> network_state_notifier_
;
166 DISALLOW_COPY_AND_ASSIGN(SystemTrayNotifier
);
171 #endif // ASH_SYSTEM_TRAY_SYSTEM_TRAY_NOTIFIER_H_