| 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 #include "ash/common/system/tray/system_tray_notifier.h" | 5 #include "ash/common/system/tray/system_tray_notifier.h" |
| 6 | 6 |
| 7 #include "ash/common/system/accessibility_observer.h" | 7 #include "ash/common/system/accessibility_observer.h" |
| 8 #include "ash/common/system/date/clock_observer.h" | 8 #include "ash/common/system/date/clock_observer.h" |
| 9 #include "ash/common/system/ime/ime_observer.h" | 9 #include "ash/common/system/ime/ime_observer.h" |
| 10 #include "ash/common/system/update/update_observer.h" | 10 #include "ash/common/system/update/update_observer.h" |
| 11 #include "ash/common/system/user/user_observer.h" | 11 #include "ash/common/system/user/user_observer.h" |
| 12 | 12 |
| 13 #if defined(OS_CHROMEOS) | 13 #if defined(OS_CHROMEOS) |
| 14 #include "ash/common/system/chromeos/audio/audio_observer.h" | |
| 15 #include "ash/common/system/chromeos/bluetooth/bluetooth_observer.h" | 14 #include "ash/common/system/chromeos/bluetooth/bluetooth_observer.h" |
| 16 #include "ash/common/system/chromeos/enterprise/enterprise_domain_observer.h" | 15 #include "ash/common/system/chromeos/enterprise/enterprise_domain_observer.h" |
| 17 #include "ash/common/system/chromeos/media_security/media_capture_observer.h" | 16 #include "ash/common/system/chromeos/media_security/media_capture_observer.h" |
| 18 #include "ash/common/system/chromeos/network/network_observer.h" | 17 #include "ash/common/system/chromeos/network/network_observer.h" |
| 19 #include "ash/common/system/chromeos/network/network_portal_detector_observer.h" | 18 #include "ash/common/system/chromeos/network/network_portal_detector_observer.h" |
| 20 #include "ash/common/system/chromeos/screen_security/screen_capture_observer.h" | 19 #include "ash/common/system/chromeos/screen_security/screen_capture_observer.h" |
| 21 #include "ash/common/system/chromeos/screen_security/screen_share_observer.h" | 20 #include "ash/common/system/chromeos/screen_security/screen_share_observer.h" |
| 22 #include "ash/common/system/chromeos/session/last_window_closed_observer.h" | 21 #include "ash/common/system/chromeos/session/last_window_closed_observer.h" |
| 23 #include "ash/common/system/chromeos/session/logout_button_observer.h" | 22 #include "ash/common/system/chromeos/session/logout_button_observer.h" |
| 24 #include "ash/common/system/chromeos/session/session_length_limit_observer.h" | 23 #include "ash/common/system/chromeos/session/session_length_limit_observer.h" |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 | 121 |
| 123 void SystemTrayNotifier::NotifyUserAddedToSession() { | 122 void SystemTrayNotifier::NotifyUserAddedToSession() { |
| 124 for (auto& observer : user_observers_) | 123 for (auto& observer : user_observers_) |
| 125 observer.OnUserAddedToSession(); | 124 observer.OnUserAddedToSession(); |
| 126 } | 125 } |
| 127 | 126 |
| 128 //////////////////////////////////////////////////////////////////////////////// | 127 //////////////////////////////////////////////////////////////////////////////// |
| 129 | 128 |
| 130 #if defined(OS_CHROMEOS) | 129 #if defined(OS_CHROMEOS) |
| 131 | 130 |
| 132 void SystemTrayNotifier::AddAudioObserver(AudioObserver* observer) { | |
| 133 audio_observers_.AddObserver(observer); | |
| 134 } | |
| 135 | |
| 136 void SystemTrayNotifier::RemoveAudioObserver(AudioObserver* observer) { | |
| 137 audio_observers_.RemoveObserver(observer); | |
| 138 } | |
| 139 | |
| 140 void SystemTrayNotifier::NotifyAudioOutputVolumeChanged(uint64_t node_id, | |
| 141 double volume) { | |
| 142 for (auto& observer : audio_observers_) | |
| 143 observer.OnOutputNodeVolumeChanged(node_id, volume); | |
| 144 } | |
| 145 | |
| 146 void SystemTrayNotifier::NotifyAudioOutputMuteChanged(bool mute_on, | |
| 147 bool system_adjust) { | |
| 148 for (auto& observer : audio_observers_) | |
| 149 observer.OnOutputMuteChanged(mute_on, system_adjust); | |
| 150 } | |
| 151 | |
| 152 void SystemTrayNotifier::NotifyAudioNodesChanged() { | |
| 153 for (auto& observer : audio_observers_) | |
| 154 observer.OnAudioNodesChanged(); | |
| 155 } | |
| 156 | |
| 157 void SystemTrayNotifier::NotifyAudioActiveOutputNodeChanged() { | |
| 158 for (auto& observer : audio_observers_) | |
| 159 observer.OnActiveOutputNodeChanged(); | |
| 160 } | |
| 161 | |
| 162 void SystemTrayNotifier::NotifyAudioActiveInputNodeChanged() { | |
| 163 for (auto& observer : audio_observers_) | |
| 164 observer.OnActiveInputNodeChanged(); | |
| 165 } | |
| 166 | |
| 167 void SystemTrayNotifier::AddBluetoothObserver(BluetoothObserver* observer) { | 131 void SystemTrayNotifier::AddBluetoothObserver(BluetoothObserver* observer) { |
| 168 bluetooth_observers_.AddObserver(observer); | 132 bluetooth_observers_.AddObserver(observer); |
| 169 } | 133 } |
| 170 | 134 |
| 171 void SystemTrayNotifier::RemoveBluetoothObserver(BluetoothObserver* observer) { | 135 void SystemTrayNotifier::RemoveBluetoothObserver(BluetoothObserver* observer) { |
| 172 bluetooth_observers_.RemoveObserver(observer); | 136 bluetooth_observers_.RemoveObserver(observer); |
| 173 } | 137 } |
| 174 | 138 |
| 175 void SystemTrayNotifier::NotifyRefreshBluetooth() { | 139 void SystemTrayNotifier::NotifyRefreshBluetooth() { |
| 176 for (auto& observer : bluetooth_observers_) | 140 for (auto& observer : bluetooth_observers_) |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 | 329 |
| 366 void SystemTrayNotifier::NotifyVirtualKeyboardSuppressionChanged( | 330 void SystemTrayNotifier::NotifyVirtualKeyboardSuppressionChanged( |
| 367 bool suppressed) { | 331 bool suppressed) { |
| 368 for (auto& observer : virtual_keyboard_observers_) | 332 for (auto& observer : virtual_keyboard_observers_) |
| 369 observer.OnKeyboardSuppressionChanged(suppressed); | 333 observer.OnKeyboardSuppressionChanged(suppressed); |
| 370 } | 334 } |
| 371 | 335 |
| 372 #endif // defined(OS_CHROMEOS) | 336 #endif // defined(OS_CHROMEOS) |
| 373 | 337 |
| 374 } // namespace ash | 338 } // namespace ash |
| OLD | NEW |