| 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/wm_system_tray_notifier.h" | 5 #include "ash/common/system/tray/wm_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" |
| 8 #include "ash/common/system/date/clock_observer.h" | 9 #include "ash/common/system/date/clock_observer.h" |
| 9 #include "ash/common/system/ime/ime_observer.h" | 10 #include "ash/common/system/ime/ime_observer.h" |
| 10 #include "ash/common/system/update/update_observer.h" | 11 #include "ash/common/system/update/update_observer.h" |
| 11 | 12 |
| 12 #if defined(OS_CHROMEOS) | 13 #if defined(OS_CHROMEOS) |
| 13 #include "ash/common/system/chromeos/virtual_keyboard/virtual_keyboard_observer.
h" | 14 #include "ash/common/system/chromeos/virtual_keyboard/virtual_keyboard_observer.
h" |
| 14 #endif | 15 #endif |
| 15 | 16 |
| 16 namespace ash { | 17 namespace ash { |
| 17 | 18 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 28 AccessibilityObserver* observer) { | 29 AccessibilityObserver* observer) { |
| 29 accessibility_observers_.RemoveObserver(observer); | 30 accessibility_observers_.RemoveObserver(observer); |
| 30 } | 31 } |
| 31 | 32 |
| 32 void WmSystemTrayNotifier::NotifyAccessibilityModeChanged( | 33 void WmSystemTrayNotifier::NotifyAccessibilityModeChanged( |
| 33 AccessibilityNotificationVisibility notify) { | 34 AccessibilityNotificationVisibility notify) { |
| 34 FOR_EACH_OBSERVER(AccessibilityObserver, accessibility_observers_, | 35 FOR_EACH_OBSERVER(AccessibilityObserver, accessibility_observers_, |
| 35 OnAccessibilityModeChanged(notify)); | 36 OnAccessibilityModeChanged(notify)); |
| 36 } | 37 } |
| 37 | 38 |
| 39 void WmSystemTrayNotifier::AddAudioObserver(AudioObserver* observer) { |
| 40 audio_observers_.AddObserver(observer); |
| 41 } |
| 42 |
| 43 void WmSystemTrayNotifier::RemoveAudioObserver(AudioObserver* observer) { |
| 44 audio_observers_.RemoveObserver(observer); |
| 45 } |
| 46 |
| 47 void WmSystemTrayNotifier::NotifyAudioOutputVolumeChanged(uint64_t node_id, |
| 48 double volume) { |
| 49 FOR_EACH_OBSERVER(AudioObserver, audio_observers_, |
| 50 OnOutputNodeVolumeChanged(node_id, volume)); |
| 51 } |
| 52 |
| 53 void WmSystemTrayNotifier::NotifyAudioOutputMuteChanged(bool mute_on, |
| 54 bool system_adjust) { |
| 55 FOR_EACH_OBSERVER(AudioObserver, audio_observers_, |
| 56 OnOutputMuteChanged(mute_on, system_adjust)); |
| 57 } |
| 58 |
| 59 void WmSystemTrayNotifier::NotifyAudioNodesChanged() { |
| 60 FOR_EACH_OBSERVER(AudioObserver, audio_observers_, OnAudioNodesChanged()); |
| 61 } |
| 62 |
| 63 void WmSystemTrayNotifier::NotifyAudioActiveOutputNodeChanged() { |
| 64 FOR_EACH_OBSERVER(AudioObserver, audio_observers_, |
| 65 OnActiveOutputNodeChanged()); |
| 66 } |
| 67 |
| 68 void WmSystemTrayNotifier::NotifyAudioActiveInputNodeChanged() { |
| 69 FOR_EACH_OBSERVER(AudioObserver, audio_observers_, |
| 70 OnActiveInputNodeChanged()); |
| 71 } |
| 72 |
| 38 void WmSystemTrayNotifier::AddClockObserver(ClockObserver* observer) { | 73 void WmSystemTrayNotifier::AddClockObserver(ClockObserver* observer) { |
| 39 clock_observers_.AddObserver(observer); | 74 clock_observers_.AddObserver(observer); |
| 40 } | 75 } |
| 41 | 76 |
| 42 void WmSystemTrayNotifier::RemoveClockObserver(ClockObserver* observer) { | 77 void WmSystemTrayNotifier::RemoveClockObserver(ClockObserver* observer) { |
| 43 clock_observers_.RemoveObserver(observer); | 78 clock_observers_.RemoveObserver(observer); |
| 44 } | 79 } |
| 45 | 80 |
| 46 void WmSystemTrayNotifier::NotifyRefreshClock() { | 81 void WmSystemTrayNotifier::NotifyRefreshClock() { |
| 47 FOR_EACH_OBSERVER(ClockObserver, clock_observers_, Refresh()); | 82 FOR_EACH_OBSERVER(ClockObserver, clock_observers_, Refresh()); |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 | 159 |
| 125 void WmSystemTrayNotifier::NotifyVirtualKeyboardSuppressionChanged( | 160 void WmSystemTrayNotifier::NotifyVirtualKeyboardSuppressionChanged( |
| 126 bool suppressed) { | 161 bool suppressed) { |
| 127 FOR_EACH_OBSERVER(VirtualKeyboardObserver, virtual_keyboard_observers_, | 162 FOR_EACH_OBSERVER(VirtualKeyboardObserver, virtual_keyboard_observers_, |
| 128 OnKeyboardSuppressionChanged(suppressed)); | 163 OnKeyboardSuppressionChanged(suppressed)); |
| 129 } | 164 } |
| 130 | 165 |
| 131 #endif // defined(OS_CHROMEOS) | 166 #endif // defined(OS_CHROMEOS) |
| 132 | 167 |
| 133 } // namespace ash | 168 } // namespace ash |
| OLD | NEW |