| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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_SYSTEM_TRAY_SYSTEM_TRAY_NOTIFIER_H_ | 5 #ifndef ASH_SYSTEM_TRAY_SYSTEM_TRAY_NOTIFIER_H_ |
| 6 #define ASH_SYSTEM_TRAY_SYSTEM_TRAY_NOTIFIER_H_ | 6 #define ASH_SYSTEM_TRAY_SYSTEM_TRAY_NOTIFIER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "ash/ash_export.h" | 13 #include "ash/ash_export.h" |
| 14 #include "ash/system/audio/audio_observer.h" | 14 #include "ash/system/audio/audio_observer.h" |
| 15 #include "ash/system/chromeos/tray_tracing.h" | 15 #include "ash/system/chromeos/tray_tracing.h" |
| 16 #include "ash/system/ime/ime_observer.h" | |
| 17 #include "ash/system/locale/locale_observer.h" | 16 #include "ash/system/locale/locale_observer.h" |
| 18 #include "ash/system/user/user_observer.h" | 17 #include "ash/system/user/user_observer.h" |
| 19 #include "base/macros.h" | 18 #include "base/macros.h" |
| 20 #include "base/observer_list.h" | 19 #include "base/observer_list.h" |
| 21 | 20 |
| 22 #if defined(OS_CHROMEOS) | 21 #if defined(OS_CHROMEOS) |
| 23 #include "ash/system/chromeos/bluetooth/bluetooth_observer.h" | 22 #include "ash/system/chromeos/bluetooth/bluetooth_observer.h" |
| 24 #include "ash/system/chromeos/enterprise/enterprise_domain_observer.h" | 23 #include "ash/system/chromeos/enterprise/enterprise_domain_observer.h" |
| 25 #include "ash/system/chromeos/network/network_observer.h" | 24 #include "ash/system/chromeos/network/network_observer.h" |
| 26 #include "ash/system/chromeos/network/network_portal_detector_observer.h" | 25 #include "ash/system/chromeos/network/network_portal_detector_observer.h" |
| 27 #include "ash/system/chromeos/screen_security/screen_capture_observer.h" | 26 #include "ash/system/chromeos/screen_security/screen_capture_observer.h" |
| 28 #include "ash/system/chromeos/screen_security/screen_share_observer.h" | 27 #include "ash/system/chromeos/screen_security/screen_share_observer.h" |
| 29 #include "ash/system/chromeos/session/last_window_closed_observer.h" | 28 #include "ash/system/chromeos/session/last_window_closed_observer.h" |
| 30 #include "ash/system/chromeos/session/logout_button_observer.h" | 29 #include "ash/system/chromeos/session/logout_button_observer.h" |
| 31 #include "ash/system/chromeos/session/session_length_limit_observer.h" | 30 #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" | 31 #include "ash/system/tray/media_security/media_capture_observer.h" |
| 34 #include "base/time/time.h" | 32 #include "base/time/time.h" |
| 35 #endif | 33 #endif |
| 36 | 34 |
| 37 namespace ash { | 35 namespace ash { |
| 38 | 36 |
| 39 #if defined(OS_CHROMEOS) | 37 #if defined(OS_CHROMEOS) |
| 40 class NetworkStateNotifier; | 38 class NetworkStateNotifier; |
| 41 #endif | 39 #endif |
| 42 | 40 |
| 43 class ASH_EXPORT SystemTrayNotifier { | 41 class ASH_EXPORT SystemTrayNotifier { |
| 44 public: | 42 public: |
| 45 SystemTrayNotifier(); | 43 SystemTrayNotifier(); |
| 46 ~SystemTrayNotifier(); | 44 ~SystemTrayNotifier(); |
| 47 | 45 |
| 48 void AddAudioObserver(AudioObserver* observer); | 46 void AddAudioObserver(AudioObserver* observer); |
| 49 void RemoveAudioObserver(AudioObserver* observer); | 47 void RemoveAudioObserver(AudioObserver* observer); |
| 50 | 48 |
| 51 void AddIMEObserver(IMEObserver* observer); | |
| 52 void RemoveIMEObserver(IMEObserver* observer); | |
| 53 | |
| 54 void AddLocaleObserver(LocaleObserver* observer); | 49 void AddLocaleObserver(LocaleObserver* observer); |
| 55 void RemoveLocaleObserver(LocaleObserver* observer); | 50 void RemoveLocaleObserver(LocaleObserver* observer); |
| 56 | 51 |
| 57 void AddTracingObserver(TracingObserver* observer); | 52 void AddTracingObserver(TracingObserver* observer); |
| 58 void RemoveTracingObserver(TracingObserver* observer); | 53 void RemoveTracingObserver(TracingObserver* observer); |
| 59 | 54 |
| 60 void AddUserObserver(UserObserver* observer); | 55 void AddUserObserver(UserObserver* observer); |
| 61 void RemoveUserObserver(UserObserver* observer); | 56 void RemoveUserObserver(UserObserver* observer); |
| 62 | 57 |
| 63 #if defined(OS_CHROMEOS) | 58 #if defined(OS_CHROMEOS) |
| (...skipping 21 matching lines...) Expand all Loading... |
| 85 void RemoveMediaCaptureObserver(MediaCaptureObserver* observer); | 80 void RemoveMediaCaptureObserver(MediaCaptureObserver* observer); |
| 86 | 81 |
| 87 void AddScreenCaptureObserver(ScreenCaptureObserver* observer); | 82 void AddScreenCaptureObserver(ScreenCaptureObserver* observer); |
| 88 void RemoveScreenCaptureObserver(ScreenCaptureObserver* observer); | 83 void RemoveScreenCaptureObserver(ScreenCaptureObserver* observer); |
| 89 | 84 |
| 90 void AddScreenShareObserver(ScreenShareObserver* observer); | 85 void AddScreenShareObserver(ScreenShareObserver* observer); |
| 91 void RemoveScreenShareObserver(ScreenShareObserver* observer); | 86 void RemoveScreenShareObserver(ScreenShareObserver* observer); |
| 92 | 87 |
| 93 void AddLastWindowClosedObserver(LastWindowClosedObserver* observer); | 88 void AddLastWindowClosedObserver(LastWindowClosedObserver* observer); |
| 94 void RemoveLastWindowClosedObserver(LastWindowClosedObserver* observer); | 89 void RemoveLastWindowClosedObserver(LastWindowClosedObserver* observer); |
| 95 | |
| 96 void AddVirtualKeyboardObserver(VirtualKeyboardObserver* observer); | |
| 97 void RemoveVirtualKeyboardObserver(VirtualKeyboardObserver* observer); | |
| 98 #endif | 90 #endif |
| 99 | 91 |
| 100 void NotifyAudioOutputVolumeChanged(uint64_t node_id, double volume); | 92 void NotifyAudioOutputVolumeChanged(uint64_t node_id, double volume); |
| 101 void NotifyAudioOutputMuteChanged(bool mute_on, bool system_adjust); | 93 void NotifyAudioOutputMuteChanged(bool mute_on, bool system_adjust); |
| 102 void NotifyAudioNodesChanged(); | 94 void NotifyAudioNodesChanged(); |
| 103 void NotifyAudioActiveOutputNodeChanged(); | 95 void NotifyAudioActiveOutputNodeChanged(); |
| 104 void NotifyAudioActiveInputNodeChanged(); | 96 void NotifyAudioActiveInputNodeChanged(); |
| 105 void NotifyTracingModeChanged(bool value); | 97 void NotifyTracingModeChanged(bool value); |
| 106 void NotifyRefreshIME(); | |
| 107 void NotifyRefreshIMEMenu(bool is_active); | |
| 108 void NotifyLocaleChanged(LocaleObserver::Delegate* delegate, | 98 void NotifyLocaleChanged(LocaleObserver::Delegate* delegate, |
| 109 const std::string& cur_locale, | 99 const std::string& cur_locale, |
| 110 const std::string& from_locale, | 100 const std::string& from_locale, |
| 111 const std::string& to_locale); | 101 const std::string& to_locale); |
| 112 void NotifyUserUpdate(); | 102 void NotifyUserUpdate(); |
| 113 void NotifyUserAddedToSession(); | 103 void NotifyUserAddedToSession(); |
| 114 #if defined(OS_CHROMEOS) | 104 #if defined(OS_CHROMEOS) |
| 115 void NotifyRefreshBluetooth(); | 105 void NotifyRefreshBluetooth(); |
| 116 void NotifyBluetoothDiscoveringChanged(); | 106 void NotifyBluetoothDiscoveringChanged(); |
| 117 void NotifyShowLoginButtonChanged(bool show_login_button); | 107 void NotifyShowLoginButtonChanged(bool show_login_button); |
| 118 void NotifyLogoutDialogDurationChanged(base::TimeDelta duration); | 108 void NotifyLogoutDialogDurationChanged(base::TimeDelta duration); |
| 119 void NotifySessionStartTimeChanged(); | 109 void NotifySessionStartTimeChanged(); |
| 120 void NotifySessionLengthLimitChanged(); | 110 void NotifySessionLengthLimitChanged(); |
| 121 void NotifyRequestToggleWifi(); | 111 void NotifyRequestToggleWifi(); |
| 122 void NotifyOnCaptivePortalDetected(const std::string& service_path); | 112 void NotifyOnCaptivePortalDetected(const std::string& service_path); |
| 123 void NotifyEnterpriseDomainChanged(); | 113 void NotifyEnterpriseDomainChanged(); |
| 124 void NotifyMediaCaptureChanged(); | 114 void NotifyMediaCaptureChanged(); |
| 125 void NotifyScreenCaptureStart(const base::Closure& stop_callback, | 115 void NotifyScreenCaptureStart(const base::Closure& stop_callback, |
| 126 const base::string16& sharing_app_name); | 116 const base::string16& sharing_app_name); |
| 127 void NotifyScreenCaptureStop(); | 117 void NotifyScreenCaptureStop(); |
| 128 void NotifyScreenShareStart(const base::Closure& stop_callback, | 118 void NotifyScreenShareStart(const base::Closure& stop_callback, |
| 129 const base::string16& helper_name); | 119 const base::string16& helper_name); |
| 130 void NotifyScreenShareStop(); | 120 void NotifyScreenShareStop(); |
| 131 void NotifyLastWindowClosed(); | 121 void NotifyLastWindowClosed(); |
| 132 void NotifyVirtualKeyboardSuppressionChanged(bool suppressed); | |
| 133 #endif | 122 #endif |
| 134 | 123 |
| 135 private: | 124 private: |
| 136 base::ObserverList<AudioObserver> audio_observers_; | 125 base::ObserverList<AudioObserver> audio_observers_; |
| 137 base::ObserverList<IMEObserver> ime_observers_; | |
| 138 base::ObserverList<LocaleObserver> locale_observers_; | 126 base::ObserverList<LocaleObserver> locale_observers_; |
| 139 base::ObserverList<TracingObserver> tracing_observers_; | 127 base::ObserverList<TracingObserver> tracing_observers_; |
| 140 base::ObserverList<UserObserver> user_observers_; | 128 base::ObserverList<UserObserver> user_observers_; |
| 141 #if defined(OS_CHROMEOS) | 129 #if defined(OS_CHROMEOS) |
| 142 base::ObserverList<BluetoothObserver> bluetooth_observers_; | 130 base::ObserverList<BluetoothObserver> bluetooth_observers_; |
| 143 base::ObserverList<LogoutButtonObserver> logout_button_observers_; | 131 base::ObserverList<LogoutButtonObserver> logout_button_observers_; |
| 144 base::ObserverList<SessionLengthLimitObserver> | 132 base::ObserverList<SessionLengthLimitObserver> |
| 145 session_length_limit_observers_; | 133 session_length_limit_observers_; |
| 146 base::ObserverList<NetworkObserver> network_observers_; | 134 base::ObserverList<NetworkObserver> network_observers_; |
| 147 base::ObserverList<NetworkPortalDetectorObserver> | 135 base::ObserverList<NetworkPortalDetectorObserver> |
| 148 network_portal_detector_observers_; | 136 network_portal_detector_observers_; |
| 149 base::ObserverList<EnterpriseDomainObserver> enterprise_domain_observers_; | 137 base::ObserverList<EnterpriseDomainObserver> enterprise_domain_observers_; |
| 150 base::ObserverList<MediaCaptureObserver> media_capture_observers_; | 138 base::ObserverList<MediaCaptureObserver> media_capture_observers_; |
| 151 base::ObserverList<ScreenCaptureObserver> screen_capture_observers_; | 139 base::ObserverList<ScreenCaptureObserver> screen_capture_observers_; |
| 152 base::ObserverList<ScreenShareObserver> screen_share_observers_; | 140 base::ObserverList<ScreenShareObserver> screen_share_observers_; |
| 153 base::ObserverList<LastWindowClosedObserver> last_window_closed_observers_; | 141 base::ObserverList<LastWindowClosedObserver> last_window_closed_observers_; |
| 154 base::ObserverList<VirtualKeyboardObserver> virtual_keyboard_observers_; | |
| 155 #endif | 142 #endif |
| 156 | 143 |
| 157 DISALLOW_COPY_AND_ASSIGN(SystemTrayNotifier); | 144 DISALLOW_COPY_AND_ASSIGN(SystemTrayNotifier); |
| 158 }; | 145 }; |
| 159 | 146 |
| 160 } // namespace ash | 147 } // namespace ash |
| 161 | 148 |
| 162 #endif // ASH_SYSTEM_TRAY_SYSTEM_TRAY_NOTIFIER_H_ | 149 #endif // ASH_SYSTEM_TRAY_SYSTEM_TRAY_NOTIFIER_H_ |
| OLD | NEW |