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

Unified Diff: chrome/browser/chromeos/system/ash_system_tray_delegate.cc

Issue 12564007: Hook up system clock update dbus signal to chrome and ash tray ui. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix MockDBusThreadManagerWithoutGMock compiling issue. Created 7 years, 9 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: chrome/browser/chromeos/system/ash_system_tray_delegate.cc
diff --git a/chrome/browser/chromeos/system/ash_system_tray_delegate.cc b/chrome/browser/chromeos/system/ash_system_tray_delegate.cc
index caba910ee4cc548a5ee8f4f8c5743156c2bb7630..9d6afaa672731132e4d98c1197246f9f8a01217b 100644
--- a/chrome/browser/chromeos/system/ash_system_tray_delegate.cc
+++ b/chrome/browser/chromeos/system/ash_system_tray_delegate.cc
@@ -82,6 +82,7 @@
#include "chromeos/dbus/dbus_thread_manager.h"
#include "chromeos/dbus/power_manager_client.h"
#include "chromeos/dbus/session_manager_client.h"
+#include "chromeos/dbus/system_clock_client.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_service.h"
@@ -197,6 +198,7 @@ class SystemTrayDelegate : public ash::SystemTrayDelegate,
public content::NotificationObserver,
public input_method::InputMethodManager::Observer,
public system::TimezoneSettings::Observer,
+ public chromeos::SystemClockClient::Observer,
public device::BluetoothAdapter::Observer,
public SystemKeyEventListener::CapsLockObserver,
public ash::NetworkTrayDelegate,
@@ -265,6 +267,7 @@ class SystemTrayDelegate : public ash::SystemTrayDelegate,
input_method::GetInputMethodManager()->AddObserver(this);
system::TimezoneSettings::GetInstance()->AddObserver(this);
+ DBusThreadManager::Get()->GetSystemClockClient()->AddObserver(this);
stevenjb 2013/03/13 17:34:31 What do you think of making TrayClock a SystemCloc
jennyz 2013/03/13 19:14:02 I am not sure if TrayDate is chromeos only, or wil
stevenjb 2013/03/13 19:22:39 So, TrayClock is already effectively chromeos spec
jennyz 2013/03/13 20:47:16 I need to jump to audio work for M27. I filed crbu
if (SystemKeyEventListener::GetInstance())
SystemKeyEventListener::GetInstance()->AddCapsLockObserver(this);
@@ -313,6 +316,7 @@ class SystemTrayDelegate : public ash::SystemTrayDelegate,
audiohandler->RemoveVolumeObserver(this);
DBusThreadManager::Get()->GetSessionManagerClient()->RemoveObserver(this);
DBusThreadManager::Get()->GetPowerManagerClient()->RemoveObserver(this);
+ DBusThreadManager::Get()->GetSystemClockClient()->RemoveObserver(this);
NetworkLibrary* crosnet = CrosLibrary::Get()->GetNetworkLibrary();
if (crosnet)
crosnet->RemoveNetworkManagerObserver(this);
@@ -1307,6 +1311,11 @@ class SystemTrayDelegate : public ash::SystemTrayDelegate,
GetSystemTrayNotifier()->NotifyRefreshClock();
}
+ // Overridden from SystemClockClient::Observer.
+ virtual void SystemClockUpdated() OVERRIDE {
+ GetSystemTrayNotifier()->NotifySystemClockTimeUpdated();
+ }
+
// Overridden from BluetoothAdapter::Observer.
virtual void AdapterPresentChanged(device::BluetoothAdapter* adapter,
bool present) OVERRIDE {

Powered by Google App Engine
This is Rietveld 408576698