diff options
author | jennyz@chromium.org <jennyz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-14 14:54:19 +0000 |
---|---|---|
committer | jennyz@chromium.org <jennyz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-14 14:54:19 +0000 |
commit | ce3b13abc2404989ad6f31959a60881f700dd26d (patch) | |
tree | ef7730fcd6cbae8f0577826b532bd66101f8868e /ash/system | |
parent | d35992788a69b2ec9ae2ac8f00ca95285a2612d4 (diff) | |
download | chromium_src-ce3b13abc2404989ad6f31959a60881f700dd26d.zip chromium_src-ce3b13abc2404989ad6f31959a60881f700dd26d.tar.gz chromium_src-ce3b13abc2404989ad6f31959a60881f700dd26d.tar.bz2 |
Hook up system clock update dbus signal to chrome and ash tray ui. cros will send tlsdate.TimeUpdated dbus signal when system clock is updated from server, chrome will listen to the signal and update ash tray ui for time.
BUG=177970
Review URL: https://chromiumcodereview.appspot.com/12564007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@188070 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/system')
-rw-r--r-- | ash/system/date/clock_observer.h | 1 | ||||
-rw-r--r-- | ash/system/date/tray_date.cc | 5 | ||||
-rw-r--r-- | ash/system/date/tray_date.h | 1 | ||||
-rw-r--r-- | ash/system/tray/system_tray_notifier.cc | 6 | ||||
-rw-r--r-- | ash/system/tray/system_tray_notifier.h | 1 |
5 files changed, 14 insertions, 0 deletions
diff --git a/ash/system/date/clock_observer.h b/ash/system/date/clock_observer.h index b82df02..3046528 100644 --- a/ash/system/date/clock_observer.h +++ b/ash/system/date/clock_observer.h @@ -12,6 +12,7 @@ class ClockObserver { virtual ~ClockObserver() {} virtual void OnDateFormatChanged() = 0; + virtual void OnSystemClockTimeUpdated() = 0; // Force a refresh (e.g. after the system is resumed). virtual void Refresh() = 0; diff --git a/ash/system/date/tray_date.cc b/ash/system/date/tray_date.cc index c603b26..4b25bbc 100644 --- a/ash/system/date/tray_date.cc +++ b/ash/system/date/tray_date.cc @@ -188,6 +188,11 @@ void TrayDate::OnDateFormatChanged() { time_tray_->UpdateTimeFormat(); } +void TrayDate::OnSystemClockTimeUpdated() { + if (time_tray_) + time_tray_->UpdateTimeFormat(); +} + void TrayDate::Refresh() { if (time_tray_) time_tray_->UpdateText(); diff --git a/ash/system/date/tray_date.h b/ash/system/date/tray_date.h index 6e11642..dc8988c 100644 --- a/ash/system/date/tray_date.h +++ b/ash/system/date/tray_date.h @@ -43,6 +43,7 @@ class TrayDate : public SystemTrayItem, // Overridden from ClockObserver. virtual void OnDateFormatChanged() OVERRIDE; + virtual void OnSystemClockTimeUpdated() OVERRIDE; virtual void Refresh() OVERRIDE; void SetupLabelForTimeTray(views::Label* label); diff --git a/ash/system/tray/system_tray_notifier.cc b/ash/system/tray/system_tray_notifier.cc index 8897917..e174e0d 100644 --- a/ash/system/tray/system_tray_notifier.cc +++ b/ash/system/tray/system_tray_notifier.cc @@ -228,6 +228,12 @@ void SystemTrayNotifier::NotifyDateFormatChanged() { OnDateFormatChanged()); } +void SystemTrayNotifier::NotifySystemClockTimeUpdated() { + FOR_EACH_OBSERVER(ClockObserver, + clock_observers_, + OnSystemClockTimeUpdated()); +} + void SystemTrayNotifier::NotifyRefreshDrive(DriveOperationStatusList& list) { FOR_EACH_OBSERVER(DriveObserver, drive_observers_, diff --git a/ash/system/tray/system_tray_notifier.h b/ash/system/tray/system_tray_notifier.h index 7437efc..8933687 100644 --- a/ash/system/tray/system_tray_notifier.h +++ b/ash/system/tray/system_tray_notifier.h @@ -107,6 +107,7 @@ public: void NotifyCapsLockChanged(bool enabled, bool search_mapped_to_caps_lock); void NotifyRefreshClock(); void NotifyDateFormatChanged(); + void NotifySystemClockTimeUpdated(); void NotifyRefreshDrive(DriveOperationStatusList& list); void NotifyRefreshIME(bool show_message); void NotifyShowLoginButtonChanged(bool show_login_button); |