| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/chromeos/status/clock_updater.h" | 5 #include "chrome/browser/chromeos/status/clock_updater.h" |
| 6 | 6 |
| 7 #include "chrome/browser/chromeos/dbus/dbus_thread_manager.h" | |
| 8 #include "chrome/browser/chromeos/status/clock_menu_button.h" | 7 #include "chrome/browser/chromeos/status/clock_menu_button.h" |
| 9 #include "chrome/browser/chromeos/system/timezone_settings.h" | 8 #include "chrome/browser/chromeos/system/timezone_settings.h" |
| 9 #include "chromeos/dbus/dbus_thread_manager.h" |
| 10 | 10 |
| 11 ClockUpdater::ClockUpdater(ClockMenuButton* button) | 11 ClockUpdater::ClockUpdater(ClockMenuButton* button) |
| 12 : button_(button) { | 12 : button_(button) { |
| 13 chromeos::system::TimezoneSettings::GetInstance()->AddObserver(this); | 13 chromeos::system::TimezoneSettings::GetInstance()->AddObserver(this); |
| 14 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> | 14 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> |
| 15 AddObserver(this); | 15 AddObserver(this); |
| 16 } | 16 } |
| 17 | 17 |
| 18 ClockUpdater::~ClockUpdater() { | 18 ClockUpdater::~ClockUpdater() { |
| 19 chromeos::system::TimezoneSettings::GetInstance()->RemoveObserver(this); | 19 chromeos::system::TimezoneSettings::GetInstance()->RemoveObserver(this); |
| 20 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> | 20 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> |
| 21 RemoveObserver(this); | 21 RemoveObserver(this); |
| 22 } | 22 } |
| 23 | 23 |
| 24 void ClockUpdater::TimezoneChanged(const icu::TimeZone& timezone) { | 24 void ClockUpdater::TimezoneChanged(const icu::TimeZone& timezone) { |
| 25 button_->UpdateText(); | 25 button_->UpdateText(); |
| 26 } | 26 } |
| 27 | 27 |
| 28 void ClockUpdater::SystemResumed() { | 28 void ClockUpdater::SystemResumed() { |
| 29 button_->UpdateText(); | 29 button_->UpdateText(); |
| 30 } | 30 } |
| OLD | NEW |