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" | 8 #include "ash/common/system/audio/audio_observer.h" |
9 #include "ash/common/system/date/clock_observer.h" | 9 #include "ash/common/system/date/clock_observer.h" |
10 #include "ash/common/system/ime/ime_observer.h" | 10 #include "ash/common/system/ime/ime_observer.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 void SystemTrayNotifier::NotifyAudioActiveOutputNodeChanged() { | 75 void SystemTrayNotifier::NotifyAudioActiveOutputNodeChanged() { |
76 FOR_EACH_OBSERVER(AudioObserver, audio_observers_, | 76 FOR_EACH_OBSERVER(AudioObserver, audio_observers_, |
77 OnActiveOutputNodeChanged()); | 77 OnActiveOutputNodeChanged()); |
78 } | 78 } |
79 | 79 |
80 void SystemTrayNotifier::NotifyAudioActiveInputNodeChanged() { | 80 void SystemTrayNotifier::NotifyAudioActiveInputNodeChanged() { |
81 FOR_EACH_OBSERVER(AudioObserver, audio_observers_, | 81 FOR_EACH_OBSERVER(AudioObserver, audio_observers_, |
82 OnActiveInputNodeChanged()); | 82 OnActiveInputNodeChanged()); |
83 } | 83 } |
84 | 84 |
85 void SystemTrayNotifier::AddClockObserver(ClockObserver* observer) { | |
86 clock_observers_.AddObserver(observer); | |
87 } | |
88 | |
89 void SystemTrayNotifier::RemoveClockObserver(ClockObserver* observer) { | |
90 clock_observers_.RemoveObserver(observer); | |
91 } | |
92 | |
93 void SystemTrayNotifier::NotifyRefreshClock() { | 85 void SystemTrayNotifier::NotifyRefreshClock() { |
94 FOR_EACH_OBSERVER(ClockObserver, clock_observers_, Refresh()); | 86 FOR_EACH_OBSERVER(ClockObserver, clock_observers_, Refresh()); |
95 } | 87 } |
96 | 88 |
97 void SystemTrayNotifier::NotifyDateFormatChanged() { | |
98 FOR_EACH_OBSERVER(ClockObserver, clock_observers_, OnDateFormatChanged()); | |
99 } | |
100 | |
101 void SystemTrayNotifier::NotifySystemClockTimeUpdated() { | 89 void SystemTrayNotifier::NotifySystemClockTimeUpdated() { |
102 FOR_EACH_OBSERVER(ClockObserver, clock_observers_, | 90 FOR_EACH_OBSERVER(ClockObserver, clock_observers_, |
103 OnSystemClockTimeUpdated()); | 91 OnSystemClockTimeUpdated()); |
104 } | 92 } |
105 | 93 |
106 void SystemTrayNotifier::NotifySystemClockCanSetTimeChanged(bool can_set_time) { | 94 void SystemTrayNotifier::NotifySystemClockCanSetTimeChanged(bool can_set_time) { |
107 FOR_EACH_OBSERVER(ClockObserver, clock_observers_, | 95 FOR_EACH_OBSERVER(ClockObserver, clock_observers_, |
108 OnSystemClockCanSetTimeChanged(can_set_time)); | 96 OnSystemClockCanSetTimeChanged(can_set_time)); |
109 } | 97 } |
110 | 98 |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 | 362 |
375 void SystemTrayNotifier::NotifyVirtualKeyboardSuppressionChanged( | 363 void SystemTrayNotifier::NotifyVirtualKeyboardSuppressionChanged( |
376 bool suppressed) { | 364 bool suppressed) { |
377 FOR_EACH_OBSERVER(VirtualKeyboardObserver, virtual_keyboard_observers_, | 365 FOR_EACH_OBSERVER(VirtualKeyboardObserver, virtual_keyboard_observers_, |
378 OnKeyboardSuppressionChanged(suppressed)); | 366 OnKeyboardSuppressionChanged(suppressed)); |
379 } | 367 } |
380 | 368 |
381 #endif // defined(OS_CHROMEOS) | 369 #endif // defined(OS_CHROMEOS) |
382 | 370 |
383 } // namespace ash | 371 } // namespace ash |
OLD | NEW |