| 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/chromeos/bluetooth/bluetooth_observer.h" | 8 #include "ash/common/system/chromeos/bluetooth/bluetooth_observer.h" |
| 9 #include "ash/common/system/chromeos/enterprise/enterprise_domain_observer.h" | 9 #include "ash/common/system/chromeos/enterprise/enterprise_domain_observer.h" |
| 10 #include "ash/common/system/chromeos/network/network_observer.h" | 10 #include "ash/common/system/chromeos/network/network_observer.h" |
| 11 #include "ash/common/system/chromeos/network/network_portal_detector_observer.h" | 11 #include "ash/common/system/chromeos/network/network_portal_detector_observer.h" |
| 12 #include "ash/common/system/chromeos/screen_security/screen_capture_observer.h" | 12 #include "ash/common/system/chromeos/screen_security/screen_capture_observer.h" |
| 13 #include "ash/common/system/chromeos/screen_security/screen_share_observer.h" | 13 #include "ash/common/system/chromeos/screen_security/screen_share_observer.h" |
| 14 #include "ash/common/system/chromeos/session/last_window_closed_observer.h" | 14 #include "ash/common/system/chromeos/session/last_window_closed_observer.h" |
| 15 #include "ash/common/system/chromeos/session/logout_button_observer.h" | 15 #include "ash/common/system/chromeos/session/logout_button_observer.h" |
| 16 #include "ash/common/system/chromeos/session/session_length_limit_observer.h" | 16 #include "ash/common/system/chromeos/session/session_length_limit_observer.h" |
| 17 #include "ash/common/system/chromeos/tray_tracing.h" | 17 #include "ash/common/system/chromeos/tray_tracing.h" |
| 18 #include "ash/common/system/chromeos/virtual_keyboard/virtual_keyboard_observer.
h" | 18 #include "ash/common/system/chromeos/virtual_keyboard/virtual_keyboard_observer.
h" |
| 19 #include "ash/common/system/date/clock_observer.h" | 19 #include "ash/common/system/date/clock_observer.h" |
| 20 #include "ash/common/system/ime/ime_observer.h" | 20 #include "ash/common/system/ime/ime_observer.h" |
| 21 #include "ash/common/system/user/user_observer.h" | |
| 22 | 21 |
| 23 namespace ash { | 22 namespace ash { |
| 24 | 23 |
| 25 SystemTrayNotifier::SystemTrayNotifier() {} | 24 SystemTrayNotifier::SystemTrayNotifier() {} |
| 26 | 25 |
| 27 SystemTrayNotifier::~SystemTrayNotifier() {} | 26 SystemTrayNotifier::~SystemTrayNotifier() {} |
| 28 | 27 |
| 29 void SystemTrayNotifier::AddAccessibilityObserver( | 28 void SystemTrayNotifier::AddAccessibilityObserver( |
| 30 AccessibilityObserver* observer) { | 29 AccessibilityObserver* observer) { |
| 31 accessibility_observers_.AddObserver(observer); | 30 accessibility_observers_.AddObserver(observer); |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 | 254 |
| 256 void SystemTrayNotifier::RemoveTracingObserver(TracingObserver* observer) { | 255 void SystemTrayNotifier::RemoveTracingObserver(TracingObserver* observer) { |
| 257 tracing_observers_.RemoveObserver(observer); | 256 tracing_observers_.RemoveObserver(observer); |
| 258 } | 257 } |
| 259 | 258 |
| 260 void SystemTrayNotifier::NotifyTracingModeChanged(bool value) { | 259 void SystemTrayNotifier::NotifyTracingModeChanged(bool value) { |
| 261 for (auto& observer : tracing_observers_) | 260 for (auto& observer : tracing_observers_) |
| 262 observer.OnTracingModeChanged(value); | 261 observer.OnTracingModeChanged(value); |
| 263 } | 262 } |
| 264 | 263 |
| 265 void SystemTrayNotifier::AddUserObserver(UserObserver* observer) { | |
| 266 user_observers_.AddObserver(observer); | |
| 267 } | |
| 268 | |
| 269 void SystemTrayNotifier::RemoveUserObserver(UserObserver* observer) { | |
| 270 user_observers_.RemoveObserver(observer); | |
| 271 } | |
| 272 | |
| 273 void SystemTrayNotifier::NotifyUserUpdate() { | |
| 274 for (auto& observer : user_observers_) | |
| 275 observer.OnUserUpdate(); | |
| 276 } | |
| 277 | |
| 278 void SystemTrayNotifier::NotifyUserAddedToSession() { | |
| 279 for (auto& observer : user_observers_) | |
| 280 observer.OnUserAddedToSession(); | |
| 281 } | |
| 282 | |
| 283 void SystemTrayNotifier::AddVirtualKeyboardObserver( | 264 void SystemTrayNotifier::AddVirtualKeyboardObserver( |
| 284 VirtualKeyboardObserver* observer) { | 265 VirtualKeyboardObserver* observer) { |
| 285 virtual_keyboard_observers_.AddObserver(observer); | 266 virtual_keyboard_observers_.AddObserver(observer); |
| 286 } | 267 } |
| 287 | 268 |
| 288 void SystemTrayNotifier::RemoveVirtualKeyboardObserver( | 269 void SystemTrayNotifier::RemoveVirtualKeyboardObserver( |
| 289 VirtualKeyboardObserver* observer) { | 270 VirtualKeyboardObserver* observer) { |
| 290 virtual_keyboard_observers_.RemoveObserver(observer); | 271 virtual_keyboard_observers_.RemoveObserver(observer); |
| 291 } | 272 } |
| 292 | 273 |
| 293 void SystemTrayNotifier::NotifyVirtualKeyboardSuppressionChanged( | 274 void SystemTrayNotifier::NotifyVirtualKeyboardSuppressionChanged( |
| 294 bool suppressed) { | 275 bool suppressed) { |
| 295 for (auto& observer : virtual_keyboard_observers_) | 276 for (auto& observer : virtual_keyboard_observers_) |
| 296 observer.OnKeyboardSuppressionChanged(suppressed); | 277 observer.OnKeyboardSuppressionChanged(suppressed); |
| 297 } | 278 } |
| 298 | 279 |
| 299 } // namespace ash | 280 } // namespace ash |
| OLD | NEW |