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