| 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/audio/audio_observer.h" | |
| 9 #include "ash/common/system/date/clock_observer.h" | 8 #include "ash/common/system/date/clock_observer.h" |
| 10 #include "ash/common/system/ime/ime_observer.h" | 9 #include "ash/common/system/ime/ime_observer.h" |
| 11 #include "ash/common/system/update/update_observer.h" | 10 #include "ash/common/system/update/update_observer.h" |
| 12 #include "ash/common/system/user/user_observer.h" | 11 #include "ash/common/system/user/user_observer.h" |
| 13 | 12 |
| 14 #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" | 15 #include "ash/common/system/chromeos/bluetooth/bluetooth_observer.h" |
| 16 #include "ash/common/system/chromeos/enterprise/enterprise_domain_observer.h" | 16 #include "ash/common/system/chromeos/enterprise/enterprise_domain_observer.h" |
| 17 #include "ash/common/system/chromeos/media_security/media_capture_observer.h" | 17 #include "ash/common/system/chromeos/media_security/media_capture_observer.h" |
| 18 #include "ash/common/system/chromeos/network/network_observer.h" | 18 #include "ash/common/system/chromeos/network/network_observer.h" |
| 19 #include "ash/common/system/chromeos/network/network_portal_detector_observer.h" | 19 #include "ash/common/system/chromeos/network/network_portal_detector_observer.h" |
| 20 #include "ash/common/system/chromeos/screen_security/screen_capture_observer.h" | 20 #include "ash/common/system/chromeos/screen_security/screen_capture_observer.h" |
| 21 #include "ash/common/system/chromeos/screen_security/screen_share_observer.h" | 21 #include "ash/common/system/chromeos/screen_security/screen_share_observer.h" |
| 22 #include "ash/common/system/chromeos/session/last_window_closed_observer.h" | 22 #include "ash/common/system/chromeos/session/last_window_closed_observer.h" |
| 23 #include "ash/common/system/chromeos/session/logout_button_observer.h" | 23 #include "ash/common/system/chromeos/session/logout_button_observer.h" |
| 24 #include "ash/common/system/chromeos/session/session_length_limit_observer.h" | 24 #include "ash/common/system/chromeos/session/session_length_limit_observer.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 41 AccessibilityObserver* observer) { | 41 AccessibilityObserver* observer) { |
| 42 accessibility_observers_.RemoveObserver(observer); | 42 accessibility_observers_.RemoveObserver(observer); |
| 43 } | 43 } |
| 44 | 44 |
| 45 void SystemTrayNotifier::NotifyAccessibilityModeChanged( | 45 void SystemTrayNotifier::NotifyAccessibilityModeChanged( |
| 46 AccessibilityNotificationVisibility notify) { | 46 AccessibilityNotificationVisibility notify) { |
| 47 for (auto& observer : accessibility_observers_) | 47 for (auto& observer : accessibility_observers_) |
| 48 observer.OnAccessibilityModeChanged(notify); | 48 observer.OnAccessibilityModeChanged(notify); |
| 49 } | 49 } |
| 50 | 50 |
| 51 void SystemTrayNotifier::AddAudioObserver(AudioObserver* observer) { | |
| 52 audio_observers_.AddObserver(observer); | |
| 53 } | |
| 54 | |
| 55 void SystemTrayNotifier::RemoveAudioObserver(AudioObserver* observer) { | |
| 56 audio_observers_.RemoveObserver(observer); | |
| 57 } | |
| 58 | |
| 59 void SystemTrayNotifier::NotifyAudioOutputVolumeChanged(uint64_t node_id, | |
| 60 double volume) { | |
| 61 for (auto& observer : audio_observers_) | |
| 62 observer.OnOutputNodeVolumeChanged(node_id, volume); | |
| 63 } | |
| 64 | |
| 65 void SystemTrayNotifier::NotifyAudioOutputMuteChanged(bool mute_on, | |
| 66 bool system_adjust) { | |
| 67 for (auto& observer : audio_observers_) | |
| 68 observer.OnOutputMuteChanged(mute_on, system_adjust); | |
| 69 } | |
| 70 | |
| 71 void SystemTrayNotifier::NotifyAudioNodesChanged() { | |
| 72 for (auto& observer : audio_observers_) | |
| 73 observer.OnAudioNodesChanged(); | |
| 74 } | |
| 75 | |
| 76 void SystemTrayNotifier::NotifyAudioActiveOutputNodeChanged() { | |
| 77 for (auto& observer : audio_observers_) | |
| 78 observer.OnActiveOutputNodeChanged(); | |
| 79 } | |
| 80 | |
| 81 void SystemTrayNotifier::NotifyAudioActiveInputNodeChanged() { | |
| 82 for (auto& observer : audio_observers_) | |
| 83 observer.OnActiveInputNodeChanged(); | |
| 84 } | |
| 85 | |
| 86 void SystemTrayNotifier::AddClockObserver(ClockObserver* observer) { | 51 void SystemTrayNotifier::AddClockObserver(ClockObserver* observer) { |
| 87 clock_observers_.AddObserver(observer); | 52 clock_observers_.AddObserver(observer); |
| 88 } | 53 } |
| 89 | 54 |
| 90 void SystemTrayNotifier::RemoveClockObserver(ClockObserver* observer) { | 55 void SystemTrayNotifier::RemoveClockObserver(ClockObserver* observer) { |
| 91 clock_observers_.RemoveObserver(observer); | 56 clock_observers_.RemoveObserver(observer); |
| 92 } | 57 } |
| 93 | 58 |
| 94 void SystemTrayNotifier::NotifyRefreshClock() { | 59 void SystemTrayNotifier::NotifyRefreshClock() { |
| 95 for (auto& observer : clock_observers_) | 60 for (auto& observer : clock_observers_) |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 void SystemTrayNotifier::NotifyUserUpdate() { | 118 void SystemTrayNotifier::NotifyUserUpdate() { |
| 154 for (auto& observer : user_observers_) | 119 for (auto& observer : user_observers_) |
| 155 observer.OnUserUpdate(); | 120 observer.OnUserUpdate(); |
| 156 } | 121 } |
| 157 | 122 |
| 158 void SystemTrayNotifier::NotifyUserAddedToSession() { | 123 void SystemTrayNotifier::NotifyUserAddedToSession() { |
| 159 for (auto& observer : user_observers_) | 124 for (auto& observer : user_observers_) |
| 160 observer.OnUserAddedToSession(); | 125 observer.OnUserAddedToSession(); |
| 161 } | 126 } |
| 162 | 127 |
| 128 //////////////////////////////////////////////////////////////////////////////// |
| 129 |
| 163 #if defined(OS_CHROMEOS) | 130 #if defined(OS_CHROMEOS) |
| 164 | 131 |
| 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 |
| 165 void SystemTrayNotifier::AddBluetoothObserver(BluetoothObserver* observer) { | 167 void SystemTrayNotifier::AddBluetoothObserver(BluetoothObserver* observer) { |
| 166 bluetooth_observers_.AddObserver(observer); | 168 bluetooth_observers_.AddObserver(observer); |
| 167 } | 169 } |
| 168 | 170 |
| 169 void SystemTrayNotifier::RemoveBluetoothObserver(BluetoothObserver* observer) { | 171 void SystemTrayNotifier::RemoveBluetoothObserver(BluetoothObserver* observer) { |
| 170 bluetooth_observers_.RemoveObserver(observer); | 172 bluetooth_observers_.RemoveObserver(observer); |
| 171 } | 173 } |
| 172 | 174 |
| 173 void SystemTrayNotifier::NotifyRefreshBluetooth() { | 175 void SystemTrayNotifier::NotifyRefreshBluetooth() { |
| 174 for (auto& observer : bluetooth_observers_) | 176 for (auto& observer : bluetooth_observers_) |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 | 365 |
| 364 void SystemTrayNotifier::NotifyVirtualKeyboardSuppressionChanged( | 366 void SystemTrayNotifier::NotifyVirtualKeyboardSuppressionChanged( |
| 365 bool suppressed) { | 367 bool suppressed) { |
| 366 for (auto& observer : virtual_keyboard_observers_) | 368 for (auto& observer : virtual_keyboard_observers_) |
| 367 observer.OnKeyboardSuppressionChanged(suppressed); | 369 observer.OnKeyboardSuppressionChanged(suppressed); |
| 368 } | 370 } |
| 369 | 371 |
| 370 #endif // defined(OS_CHROMEOS) | 372 #endif // defined(OS_CHROMEOS) |
| 371 | 373 |
| 372 } // namespace ash | 374 } // namespace ash |
| OLD | NEW |