summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ash/system/chromeos/system_clock_observer.cc6
-rw-r--r--ash/system/chromeos/system_clock_observer.h8
-rw-r--r--chrome/browser/chromeos/system/ash_system_tray_delegate.cc10
3 files changed, 13 insertions, 11 deletions
diff --git a/ash/system/chromeos/system_clock_observer.cc b/ash/system/chromeos/system_clock_observer.cc
index 5061793..9142dd9 100644
--- a/ash/system/chromeos/system_clock_observer.cc
+++ b/ash/system/chromeos/system_clock_observer.cc
@@ -13,11 +13,13 @@ namespace internal {
SystemClockObserver::SystemClockObserver() {
chromeos::DBusThreadManager::Get()->GetSystemClockClient()
->AddObserver(this);
+ chromeos::system::TimezoneSettings::GetInstance()->AddObserver(this);
}
SystemClockObserver::~SystemClockObserver() {
chromeos::DBusThreadManager::Get()->GetSystemClockClient()
->RemoveObserver(this);
+ chromeos::system::TimezoneSettings::GetInstance()->RemoveObserver(this);
}
void SystemClockObserver::SystemClockUpdated() {
@@ -25,5 +27,9 @@ void SystemClockObserver::SystemClockUpdated() {
->NotifySystemClockTimeUpdated();
}
+void SystemClockObserver::TimezoneChanged(const icu::TimeZone& timezone) {
+ Shell::GetInstance()->system_tray_notifier()->NotifyRefreshClock();
+}
+
} // namespace internal
} // namespace ash
diff --git a/ash/system/chromeos/system_clock_observer.h b/ash/system/chromeos/system_clock_observer.h
index 9dcc854..e2625a8 100644
--- a/ash/system/chromeos/system_clock_observer.h
+++ b/ash/system/chromeos/system_clock_observer.h
@@ -6,11 +6,14 @@
#define ASH_SYSTEM_CHROMEOS_SYSTEM_CLOCK_OBSERVER_H_
#include "chromeos/dbus/system_clock_client.h"
+#include "chromeos/settings/timezone_settings.h"
namespace ash {
namespace internal {
-class SystemClockObserver : public chromeos::SystemClockClient::Observer {
+class SystemClockObserver
+ : public chromeos::SystemClockClient::Observer,
+ public chromeos::system::TimezoneSettings::Observer {
public:
SystemClockObserver();
virtual ~SystemClockObserver();
@@ -18,6 +21,9 @@ class SystemClockObserver : public chromeos::SystemClockClient::Observer {
// chromeos::SystemClockClient::Observer
virtual void SystemClockUpdated() OVERRIDE;
+ // chromeos::system::TimezoneSettings::Observer
+ virtual void TimezoneChanged(const icu::TimeZone& timezone) OVERRIDE;
+
private:
DISALLOW_COPY_AND_ASSIGN(SystemClockObserver);
};
diff --git a/chrome/browser/chromeos/system/ash_system_tray_delegate.cc b/chrome/browser/chromeos/system/ash_system_tray_delegate.cc
index 917d8a3..d2ea4b3 100644
--- a/chrome/browser/chromeos/system/ash_system_tray_delegate.cc
+++ b/chrome/browser/chromeos/system/ash_system_tray_delegate.cc
@@ -89,7 +89,6 @@
#include "chromeos/ime/input_method_manager.h"
#include "chromeos/ime/xkeyboard.h"
#include "chromeos/login/login_state.h"
-#include "chromeos/settings/timezone_settings.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_service.h"
@@ -230,7 +229,6 @@ class SystemTrayDelegate : public ash::SystemTrayDelegate,
public drive::JobListObserver,
public content::NotificationObserver,
public input_method::InputMethodManager::Observer,
- public system::TimezoneSettings::Observer,
public chromeos::LoginState::Observer,
public device::BluetoothAdapter::Observer,
public SystemKeyEventListener::CapsLockObserver,
@@ -287,8 +285,6 @@ class SystemTrayDelegate : public ash::SystemTrayDelegate,
input_method::InputMethodManager::Get()->AddObserver(this);
UpdateClockType();
- system::TimezoneSettings::GetInstance()->AddObserver(this);
-
if (SystemKeyEventListener::GetInstance())
SystemKeyEventListener::GetInstance()->AddCapsLockObserver(this);
@@ -346,7 +342,6 @@ class SystemTrayDelegate : public ash::SystemTrayDelegate,
DBusThreadManager::Get()->GetSessionManagerClient()->RemoveObserver(this);
input_method::InputMethodManager::Get()->RemoveObserver(this);
- system::TimezoneSettings::GetInstance()->RemoveObserver(this);
if (SystemKeyEventListener::GetInstance())
SystemKeyEventListener::GetInstance()->RemoveCapsLockObserver(this);
bluetooth_adapter_->RemoveObserver(this);
@@ -1128,11 +1123,6 @@ class SystemTrayDelegate : public ash::SystemTrayDelegate,
DriveIntegrationServiceFactory::FindForProfile(user_profile_) : NULL;
}
- // Overridden from system::TimezoneSettings::Observer.
- virtual void TimezoneChanged(const icu::TimeZone& timezone) OVERRIDE {
- GetSystemTrayNotifier()->NotifyRefreshClock();
- }
-
// Overridden from BluetoothAdapter::Observer.
virtual void AdapterPresentChanged(device::BluetoothAdapter* adapter,
bool present) OVERRIDE {