| 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 void SystemTrayNotifier::NotifyRefreshIME() { | 122 void SystemTrayNotifier::NotifyRefreshIME() { |
| 123 for (auto& observer : ime_observers_) | 123 for (auto& observer : ime_observers_) |
| 124 observer.OnIMERefresh(); | 124 observer.OnIMERefresh(); |
| 125 } | 125 } |
| 126 | 126 |
| 127 void SystemTrayNotifier::NotifyRefreshIMEMenu(bool is_active) { | 127 void SystemTrayNotifier::NotifyRefreshIMEMenu(bool is_active) { |
| 128 for (auto& observer : ime_observers_) | 128 for (auto& observer : ime_observers_) |
| 129 observer.OnIMEMenuActivationChanged(is_active); | 129 observer.OnIMEMenuActivationChanged(is_active); |
| 130 } | 130 } |
| 131 | 131 |
| 132 void SystemTrayNotifier::AddLocaleObserver(LocaleObserver* observer) { | |
| 133 locale_observers_.AddObserver(observer); | |
| 134 } | |
| 135 | |
| 136 void SystemTrayNotifier::RemoveLocaleObserver(LocaleObserver* observer) { | |
| 137 locale_observers_.RemoveObserver(observer); | |
| 138 } | |
| 139 | |
| 140 void SystemTrayNotifier::NotifyLocaleChanged(LocaleObserver::Delegate* delegate, | |
| 141 const std::string& cur_locale, | |
| 142 const std::string& from_locale, | |
| 143 const std::string& to_locale) { | |
| 144 for (auto& observer : locale_observers_) | |
| 145 observer.OnLocaleChanged(delegate, cur_locale, from_locale, to_locale); | |
| 146 } | |
| 147 | |
| 148 void SystemTrayNotifier::AddUpdateObserver(UpdateObserver* observer) { | 132 void SystemTrayNotifier::AddUpdateObserver(UpdateObserver* observer) { |
| 149 update_observers_.AddObserver(observer); | 133 update_observers_.AddObserver(observer); |
| 150 } | 134 } |
| 151 | 135 |
| 152 void SystemTrayNotifier::RemoveUpdateObserver(UpdateObserver* observer) { | 136 void SystemTrayNotifier::RemoveUpdateObserver(UpdateObserver* observer) { |
| 153 update_observers_.RemoveObserver(observer); | 137 update_observers_.RemoveObserver(observer); |
| 154 } | 138 } |
| 155 | 139 |
| 156 void SystemTrayNotifier::NotifyUpdateRecommended(const UpdateInfo& info) { | 140 void SystemTrayNotifier::NotifyUpdateRecommended(const UpdateInfo& info) { |
| 157 for (auto& observer : update_observers_) | 141 for (auto& observer : update_observers_) |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 | 363 |
| 380 void SystemTrayNotifier::NotifyVirtualKeyboardSuppressionChanged( | 364 void SystemTrayNotifier::NotifyVirtualKeyboardSuppressionChanged( |
| 381 bool suppressed) { | 365 bool suppressed) { |
| 382 for (auto& observer : virtual_keyboard_observers_) | 366 for (auto& observer : virtual_keyboard_observers_) |
| 383 observer.OnKeyboardSuppressionChanged(suppressed); | 367 observer.OnKeyboardSuppressionChanged(suppressed); |
| 384 } | 368 } |
| 385 | 369 |
| 386 #endif // defined(OS_CHROMEOS) | 370 #endif // defined(OS_CHROMEOS) |
| 387 | 371 |
| 388 } // namespace ash | 372 } // namespace ash |
| OLD | NEW |