| OLD | NEW |
| 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 AudioObserver; | |
| 24 class ClockObserver; | 23 class ClockObserver; |
| 25 class IMEObserver; | 24 class IMEObserver; |
| 26 struct UpdateInfo; | 25 struct UpdateInfo; |
| 27 class UpdateObserver; | 26 class UpdateObserver; |
| 28 class UserObserver; | 27 class UserObserver; |
| 29 | 28 |
| 30 #if defined(OS_CHROMEOS) | 29 #if defined(OS_CHROMEOS) |
| 30 class AudioObserver; |
| 31 class BluetoothObserver; | 31 class BluetoothObserver; |
| 32 class EnterpriseDomainObserver; | 32 class EnterpriseDomainObserver; |
| 33 class LastWindowClosedObserver; | 33 class LastWindowClosedObserver; |
| 34 class LogoutButtonObserver; | 34 class LogoutButtonObserver; |
| 35 class MediaCaptureObserver; | 35 class MediaCaptureObserver; |
| 36 class NetworkObserver; | 36 class NetworkObserver; |
| 37 class NetworkPortalDetectorObserver; | 37 class NetworkPortalDetectorObserver; |
| 38 class ScreenCaptureObserver; | 38 class ScreenCaptureObserver; |
| 39 class ScreenShareObserver; | 39 class ScreenShareObserver; |
| 40 class SessionLengthLimitObserver; | 40 class SessionLengthLimitObserver; |
| 41 class TracingObserver; | 41 class TracingObserver; |
| 42 class VirtualKeyboardObserver; | 42 class VirtualKeyboardObserver; |
| 43 #endif | 43 #endif |
| 44 | 44 |
| 45 // Observer and notification manager for the ash system tray. | 45 // Observer and notification manager for the ash system tray. |
| 46 class ASH_EXPORT SystemTrayNotifier { | 46 class ASH_EXPORT SystemTrayNotifier { |
| 47 public: | 47 public: |
| 48 SystemTrayNotifier(); | 48 SystemTrayNotifier(); |
| 49 ~SystemTrayNotifier(); | 49 ~SystemTrayNotifier(); |
| 50 | 50 |
| 51 // Accessibility. | 51 // Accessibility. |
| 52 void AddAccessibilityObserver(AccessibilityObserver* observer); | 52 void AddAccessibilityObserver(AccessibilityObserver* observer); |
| 53 void RemoveAccessibilityObserver(AccessibilityObserver* observer); | 53 void RemoveAccessibilityObserver(AccessibilityObserver* observer); |
| 54 void NotifyAccessibilityModeChanged( | 54 void NotifyAccessibilityModeChanged( |
| 55 AccessibilityNotificationVisibility notify); | 55 AccessibilityNotificationVisibility notify); |
| 56 | 56 |
| 57 // Audio. | |
| 58 void AddAudioObserver(AudioObserver* observer); | |
| 59 void RemoveAudioObserver(AudioObserver* observer); | |
| 60 void NotifyAudioOutputVolumeChanged(uint64_t node_id, double volume); | |
| 61 void NotifyAudioOutputMuteChanged(bool mute_on, bool system_adjust); | |
| 62 void NotifyAudioNodesChanged(); | |
| 63 void NotifyAudioActiveOutputNodeChanged(); | |
| 64 void NotifyAudioActiveInputNodeChanged(); | |
| 65 | |
| 66 // Date and time. | 57 // Date and time. |
| 67 void AddClockObserver(ClockObserver* observer); | 58 void AddClockObserver(ClockObserver* observer); |
| 68 void RemoveClockObserver(ClockObserver* observer); | 59 void RemoveClockObserver(ClockObserver* observer); |
| 69 void NotifyRefreshClock(); | 60 void NotifyRefreshClock(); |
| 70 void NotifyDateFormatChanged(); | 61 void NotifyDateFormatChanged(); |
| 71 void NotifySystemClockTimeUpdated(); | 62 void NotifySystemClockTimeUpdated(); |
| 72 void NotifySystemClockCanSetTimeChanged(bool can_set_time); | 63 void NotifySystemClockCanSetTimeChanged(bool can_set_time); |
| 73 | 64 |
| 74 // Input methods. | 65 // Input methods. |
| 75 void AddIMEObserver(IMEObserver* observer); | 66 void AddIMEObserver(IMEObserver* observer); |
| 76 void RemoveIMEObserver(IMEObserver* observer); | 67 void RemoveIMEObserver(IMEObserver* observer); |
| 77 void NotifyRefreshIME(); | 68 void NotifyRefreshIME(); |
| 78 void NotifyRefreshIMEMenu(bool is_active); | 69 void NotifyRefreshIMEMenu(bool is_active); |
| 79 | 70 |
| 80 // OS updates. | 71 // OS updates. |
| 81 void AddUpdateObserver(UpdateObserver* observer); | 72 void AddUpdateObserver(UpdateObserver* observer); |
| 82 void RemoveUpdateObserver(UpdateObserver* observer); | 73 void RemoveUpdateObserver(UpdateObserver* observer); |
| 83 void NotifyUpdateRecommended(const UpdateInfo& info); | 74 void NotifyUpdateRecommended(const UpdateInfo& info); |
| 84 | 75 |
| 85 // User. | 76 // User. |
| 86 void AddUserObserver(UserObserver* observer); | 77 void AddUserObserver(UserObserver* observer); |
| 87 void RemoveUserObserver(UserObserver* observer); | 78 void RemoveUserObserver(UserObserver* observer); |
| 88 void NotifyUserUpdate(); | 79 void NotifyUserUpdate(); |
| 89 void NotifyUserAddedToSession(); | 80 void NotifyUserAddedToSession(); |
| 90 | 81 |
| 91 #if defined(OS_CHROMEOS) | 82 #if defined(OS_CHROMEOS) |
| 83 // Audio. |
| 84 void AddAudioObserver(AudioObserver* observer); |
| 85 void RemoveAudioObserver(AudioObserver* observer); |
| 86 void NotifyAudioOutputVolumeChanged(uint64_t node_id, double volume); |
| 87 void NotifyAudioOutputMuteChanged(bool mute_on, bool system_adjust); |
| 88 void NotifyAudioNodesChanged(); |
| 89 void NotifyAudioActiveOutputNodeChanged(); |
| 90 void NotifyAudioActiveInputNodeChanged(); |
| 91 |
| 92 // Bluetooth. | 92 // Bluetooth. |
| 93 void AddBluetoothObserver(BluetoothObserver* observer); | 93 void AddBluetoothObserver(BluetoothObserver* observer); |
| 94 void RemoveBluetoothObserver(BluetoothObserver* observer); | 94 void RemoveBluetoothObserver(BluetoothObserver* observer); |
| 95 void NotifyRefreshBluetooth(); | 95 void NotifyRefreshBluetooth(); |
| 96 void NotifyBluetoothDiscoveringChanged(); | 96 void NotifyBluetoothDiscoveringChanged(); |
| 97 | 97 |
| 98 // Enterprise domain. | 98 // Enterprise domain. |
| 99 void AddEnterpriseDomainObserver(EnterpriseDomainObserver* observer); | 99 void AddEnterpriseDomainObserver(EnterpriseDomainObserver* observer); |
| 100 void RemoveEnterpriseDomainObserver(EnterpriseDomainObserver* observer); | 100 void RemoveEnterpriseDomainObserver(EnterpriseDomainObserver* observer); |
| 101 void NotifyEnterpriseDomainChanged(); | 101 void NotifyEnterpriseDomainChanged(); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 void NotifyTracingModeChanged(bool value); | 154 void NotifyTracingModeChanged(bool value); |
| 155 | 155 |
| 156 // Virtual keyboard. | 156 // Virtual keyboard. |
| 157 void AddVirtualKeyboardObserver(VirtualKeyboardObserver* observer); | 157 void AddVirtualKeyboardObserver(VirtualKeyboardObserver* observer); |
| 158 void RemoveVirtualKeyboardObserver(VirtualKeyboardObserver* observer); | 158 void RemoveVirtualKeyboardObserver(VirtualKeyboardObserver* observer); |
| 159 void NotifyVirtualKeyboardSuppressionChanged(bool suppressed); | 159 void NotifyVirtualKeyboardSuppressionChanged(bool suppressed); |
| 160 #endif | 160 #endif |
| 161 | 161 |
| 162 private: | 162 private: |
| 163 base::ObserverList<AccessibilityObserver> accessibility_observers_; | 163 base::ObserverList<AccessibilityObserver> accessibility_observers_; |
| 164 base::ObserverList<AudioObserver> audio_observers_; | |
| 165 base::ObserverList<ClockObserver> clock_observers_; | 164 base::ObserverList<ClockObserver> clock_observers_; |
| 166 base::ObserverList<IMEObserver> ime_observers_; | 165 base::ObserverList<IMEObserver> ime_observers_; |
| 167 base::ObserverList<UpdateObserver> update_observers_; | 166 base::ObserverList<UpdateObserver> update_observers_; |
| 168 base::ObserverList<UserObserver> user_observers_; | 167 base::ObserverList<UserObserver> user_observers_; |
| 169 | 168 |
| 170 #if defined(OS_CHROMEOS) | 169 #if defined(OS_CHROMEOS) |
| 170 base::ObserverList<AudioObserver> audio_observers_; |
| 171 base::ObserverList<BluetoothObserver> bluetooth_observers_; | 171 base::ObserverList<BluetoothObserver> bluetooth_observers_; |
| 172 base::ObserverList<EnterpriseDomainObserver> enterprise_domain_observers_; | 172 base::ObserverList<EnterpriseDomainObserver> enterprise_domain_observers_; |
| 173 base::ObserverList<LastWindowClosedObserver> last_window_closed_observers_; | 173 base::ObserverList<LastWindowClosedObserver> last_window_closed_observers_; |
| 174 base::ObserverList<LogoutButtonObserver> logout_button_observers_; | 174 base::ObserverList<LogoutButtonObserver> logout_button_observers_; |
| 175 base::ObserverList<MediaCaptureObserver> media_capture_observers_; | 175 base::ObserverList<MediaCaptureObserver> media_capture_observers_; |
| 176 base::ObserverList<NetworkObserver> network_observers_; | 176 base::ObserverList<NetworkObserver> network_observers_; |
| 177 base::ObserverList<NetworkPortalDetectorObserver> | 177 base::ObserverList<NetworkPortalDetectorObserver> |
| 178 network_portal_detector_observers_; | 178 network_portal_detector_observers_; |
| 179 base::ObserverList<ScreenCaptureObserver> screen_capture_observers_; | 179 base::ObserverList<ScreenCaptureObserver> screen_capture_observers_; |
| 180 base::ObserverList<ScreenShareObserver> screen_share_observers_; | 180 base::ObserverList<ScreenShareObserver> screen_share_observers_; |
| 181 base::ObserverList<SessionLengthLimitObserver> | 181 base::ObserverList<SessionLengthLimitObserver> |
| 182 session_length_limit_observers_; | 182 session_length_limit_observers_; |
| 183 base::ObserverList<TracingObserver> tracing_observers_; | 183 base::ObserverList<TracingObserver> tracing_observers_; |
| 184 base::ObserverList<VirtualKeyboardObserver> virtual_keyboard_observers_; | 184 base::ObserverList<VirtualKeyboardObserver> virtual_keyboard_observers_; |
| 185 #endif | 185 #endif |
| 186 | 186 |
| 187 DISALLOW_COPY_AND_ASSIGN(SystemTrayNotifier); | 187 DISALLOW_COPY_AND_ASSIGN(SystemTrayNotifier); |
| 188 }; | 188 }; |
| 189 | 189 |
| 190 } // namespace ash | 190 } // namespace ash |
| 191 | 191 |
| 192 #endif // ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_NOTIFIER_H_ | 192 #endif // ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_NOTIFIER_H_ |
| OLD | NEW |