Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(180)

Unified Diff: ash/common/system/tray/wm_system_tray_notifier.cc

Issue 2064953002: mash: Migrate tray date view to //ash/common types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@trayviews
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ash/common/system/tray/wm_system_tray_notifier.cc
diff --git a/ash/common/system/tray/wm_system_tray_notifier.cc b/ash/common/system/tray/wm_system_tray_notifier.cc
index 2137e92628f5030d40591ffbac14e1859c91824e..e58aebd90a5599bb613c903e9991581986e6cb6d 100644
--- a/ash/common/system/tray/wm_system_tray_notifier.cc
+++ b/ash/common/system/tray/wm_system_tray_notifier.cc
@@ -4,6 +4,7 @@
#include "ash/common/system/tray/wm_system_tray_notifier.h"
+#include "ash/common/system/date/clock_observer.h"
#include "ash/common/system/update/update_observer.h"
namespace ash {
@@ -12,6 +13,14 @@ WmSystemTrayNotifier::WmSystemTrayNotifier() {}
WmSystemTrayNotifier::~WmSystemTrayNotifier() {}
+void WmSystemTrayNotifier::AddClockObserver(ClockObserver* observer) {
+ clock_observers_.AddObserver(observer);
+}
+
+void WmSystemTrayNotifier::RemoveClockObserver(ClockObserver* observer) {
+ clock_observers_.RemoveObserver(observer);
+}
+
void WmSystemTrayNotifier::AddUpdateObserver(UpdateObserver* observer) {
update_observers_.AddObserver(observer);
}
@@ -25,4 +34,23 @@ void WmSystemTrayNotifier::NotifyUpdateRecommended(const UpdateInfo& info) {
OnUpdateRecommended(info));
}
+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.
+ FOR_EACH_OBSERVER(ClockObserver, clock_observers_, Refresh());
+}
+
+void WmSystemTrayNotifier::NotifyDateFormatChanged() {
+ FOR_EACH_OBSERVER(ClockObserver, clock_observers_, OnDateFormatChanged());
+}
+
+void WmSystemTrayNotifier::NotifySystemClockTimeUpdated() {
+ FOR_EACH_OBSERVER(ClockObserver, clock_observers_,
+ OnSystemClockTimeUpdated());
+}
+
+void WmSystemTrayNotifier::NotifySystemClockCanSetTimeChanged(
+ bool can_set_time) {
+ FOR_EACH_OBSERVER(ClockObserver, clock_observers_,
+ OnSystemClockCanSetTimeChanged(can_set_time));
+}
+
} // namespace ash

Powered by Google App Engine
This is Rietveld 408576698