| 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/date/clock_observer.h" | 8 #include "ash/common/system/date/clock_observer.h" |
| 8 #include "ash/common/system/update/update_observer.h" | 9 #include "ash/common/system/update/update_observer.h" |
| 9 | 10 |
| 10 namespace ash { | 11 namespace ash { |
| 11 | 12 |
| 12 WmSystemTrayNotifier::WmSystemTrayNotifier() {} | 13 WmSystemTrayNotifier::WmSystemTrayNotifier() {} |
| 13 | 14 |
| 14 WmSystemTrayNotifier::~WmSystemTrayNotifier() {} | 15 WmSystemTrayNotifier::~WmSystemTrayNotifier() {} |
| 15 | 16 |
| 17 void WmSystemTrayNotifier::AddAccessibilityObserver( |
| 18 AccessibilityObserver* observer) { |
| 19 accessibility_observers_.AddObserver(observer); |
| 20 } |
| 21 |
| 22 void WmSystemTrayNotifier::RemoveAccessibilityObserver( |
| 23 AccessibilityObserver* observer) { |
| 24 accessibility_observers_.RemoveObserver(observer); |
| 25 } |
| 26 |
| 16 void WmSystemTrayNotifier::AddClockObserver(ClockObserver* observer) { | 27 void WmSystemTrayNotifier::AddClockObserver(ClockObserver* observer) { |
| 17 clock_observers_.AddObserver(observer); | 28 clock_observers_.AddObserver(observer); |
| 18 } | 29 } |
| 19 | 30 |
| 20 void WmSystemTrayNotifier::RemoveClockObserver(ClockObserver* observer) { | 31 void WmSystemTrayNotifier::RemoveClockObserver(ClockObserver* observer) { |
| 21 clock_observers_.RemoveObserver(observer); | 32 clock_observers_.RemoveObserver(observer); |
| 22 } | 33 } |
| 23 | 34 |
| 24 void WmSystemTrayNotifier::AddUpdateObserver(UpdateObserver* observer) { | 35 void WmSystemTrayNotifier::AddUpdateObserver(UpdateObserver* observer) { |
| 25 update_observers_.AddObserver(observer); | 36 update_observers_.AddObserver(observer); |
| 26 } | 37 } |
| 27 | 38 |
| 28 void WmSystemTrayNotifier::RemoveUpdateObserver(UpdateObserver* observer) { | 39 void WmSystemTrayNotifier::RemoveUpdateObserver(UpdateObserver* observer) { |
| 29 update_observers_.RemoveObserver(observer); | 40 update_observers_.RemoveObserver(observer); |
| 30 } | 41 } |
| 31 | 42 |
| 43 void WmSystemTrayNotifier::NotifyAccessibilityModeChanged( |
| 44 ui::AccessibilityNotificationVisibility notify) { |
| 45 FOR_EACH_OBSERVER(AccessibilityObserver, accessibility_observers_, |
| 46 OnAccessibilityModeChanged(notify)); |
| 47 } |
| 48 |
| 32 void WmSystemTrayNotifier::NotifyRefreshClock() { | 49 void WmSystemTrayNotifier::NotifyRefreshClock() { |
| 33 FOR_EACH_OBSERVER(ClockObserver, clock_observers_, Refresh()); | 50 FOR_EACH_OBSERVER(ClockObserver, clock_observers_, Refresh()); |
| 34 } | 51 } |
| 35 | 52 |
| 36 void WmSystemTrayNotifier::NotifyDateFormatChanged() { | 53 void WmSystemTrayNotifier::NotifyDateFormatChanged() { |
| 37 FOR_EACH_OBSERVER(ClockObserver, clock_observers_, OnDateFormatChanged()); | 54 FOR_EACH_OBSERVER(ClockObserver, clock_observers_, OnDateFormatChanged()); |
| 38 } | 55 } |
| 39 | 56 |
| 40 void WmSystemTrayNotifier::NotifySystemClockTimeUpdated() { | 57 void WmSystemTrayNotifier::NotifySystemClockTimeUpdated() { |
| 41 FOR_EACH_OBSERVER(ClockObserver, clock_observers_, | 58 FOR_EACH_OBSERVER(ClockObserver, clock_observers_, |
| 42 OnSystemClockTimeUpdated()); | 59 OnSystemClockTimeUpdated()); |
| 43 } | 60 } |
| 44 | 61 |
| 45 void WmSystemTrayNotifier::NotifySystemClockCanSetTimeChanged( | 62 void WmSystemTrayNotifier::NotifySystemClockCanSetTimeChanged( |
| 46 bool can_set_time) { | 63 bool can_set_time) { |
| 47 FOR_EACH_OBSERVER(ClockObserver, clock_observers_, | 64 FOR_EACH_OBSERVER(ClockObserver, clock_observers_, |
| 48 OnSystemClockCanSetTimeChanged(can_set_time)); | 65 OnSystemClockCanSetTimeChanged(can_set_time)); |
| 49 } | 66 } |
| 50 | 67 |
| 51 void WmSystemTrayNotifier::NotifyUpdateRecommended(const UpdateInfo& info) { | 68 void WmSystemTrayNotifier::NotifyUpdateRecommended(const UpdateInfo& info) { |
| 52 FOR_EACH_OBSERVER(UpdateObserver, update_observers_, | 69 FOR_EACH_OBSERVER(UpdateObserver, update_observers_, |
| 53 OnUpdateRecommended(info)); | 70 OnUpdateRecommended(info)); |
| 54 } | 71 } |
| 55 | 72 |
| 56 } // namespace ash | 73 } // namespace ash |
| OLD | NEW |