Chromium Code Reviews| 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 |
| 23 void WmSystemTrayNotifier::NotifyUpdateRecommended(const UpdateInfo& info) { | 32 void WmSystemTrayNotifier::NotifyUpdateRecommended(const UpdateInfo& info) { |
| 24 FOR_EACH_OBSERVER(UpdateObserver, update_observers_, | 33 FOR_EACH_OBSERVER(UpdateObserver, update_observers_, |
| 25 OnUpdateRecommended(info)); | 34 OnUpdateRecommended(info)); |
| 26 } | 35 } |
| 27 | 36 |
| 37 void WmSystemTrayNotifier::NotifyRefreshClock() { | |
|
msw
2016/06/14 00:18:26
nit: order these three functions before NotifyUpda
James Cook
2016/06/14 16:54:07
Done.
| |
| 38 FOR_EACH_OBSERVER(ClockObserver, clock_observers_, Refresh()); | |
| 39 } | |
| 40 | |
| 41 void WmSystemTrayNotifier::NotifyDateFormatChanged() { | |
| 42 FOR_EACH_OBSERVER(ClockObserver, clock_observers_, OnDateFormatChanged()); | |
| 43 } | |
| 44 | |
| 45 void WmSystemTrayNotifier::NotifySystemClockTimeUpdated() { | |
| 46 FOR_EACH_OBSERVER(ClockObserver, clock_observers_, | |
| 47 OnSystemClockTimeUpdated()); | |
| 48 } | |
| 49 | |
| 50 void WmSystemTrayNotifier::NotifySystemClockCanSetTimeChanged( | |
| 51 bool can_set_time) { | |
| 52 FOR_EACH_OBSERVER(ClockObserver, clock_observers_, | |
| 53 OnSystemClockCanSetTimeChanged(can_set_time)); | |
| 54 } | |
| 55 | |
| 28 } // namespace ash | 56 } // namespace ash |
| OLD | NEW |