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

Unified Diff: chrome/browser/chromeos/status/clock_menu_button.cc

Issue 6486007: Introducing ResumeLibrary to track system resume signal (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ResumeLibrary removed, its functions moved to PowerLibrary Created 9 years, 10 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/status/clock_menu_button.cc
diff --git a/chrome/browser/chromeos/status/clock_menu_button.cc b/chrome/browser/chromeos/status/clock_menu_button.cc
index f285d281d77abef49990a35e5eca4761088d1942..12eb535b86a1fa6368c85a5b87cea947d0dd21d0 100644
--- a/chrome/browser/chromeos/status/clock_menu_button.cc
+++ b/chrome/browser/chromeos/status/clock_menu_button.cc
@@ -33,6 +33,7 @@ ClockMenuButton::ClockMenuButton(StatusAreaHost* host)
host_(host) {
// Add as SystemLibrary observer. We update the clock if timezone changes.
CrosLibrary::Get()->GetSystemLibrary()->AddObserver(this);
+ CrosLibrary::Get()->GetPowerLibrary()->AddObserver(this);
set_border(NULL);
set_use_menu_button_paint(true);
@@ -45,6 +46,7 @@ ClockMenuButton::ClockMenuButton(StatusAreaHost* host)
}
ClockMenuButton::~ClockMenuButton() {
+ CrosLibrary::Get()->GetPowerLibrary()->RemoveObserver(this);
CrosLibrary::Get()->GetSystemLibrary()->RemoveObserver(this);
}
@@ -111,6 +113,13 @@ void ClockMenuButton::ActivatedAt(int index) {
}
///////////////////////////////////////////////////////////////////////////////
+// ClockMenuButton, PowerLibrary::Observer implementation:
+
+void ClockMenuButton::SystemResumed() {
+ UpdateText();
+}
+
+///////////////////////////////////////////////////////////////////////////////
// ClockMenuButton, SystemLibrary::Observer implementation:
void ClockMenuButton::TimezoneChanged(const icu::TimeZone& timezone) {

Powered by Google App Engine
This is Rietveld 408576698