diff options
author | chocobo@google.com <chocobo@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-15 21:08:29 +0000 |
---|---|---|
committer | chocobo@google.com <chocobo@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-15 21:08:29 +0000 |
commit | fecc1520c83dc037865ba49846f764ce056d4016 (patch) | |
tree | 54be637f39785fda3046ca0a276be1ceba2c9999 /chrome/browser/chromeos/clock_menu_button.h | |
parent | 40c2a7869363f42ab82b48bd5d4cb1a776cd2809 (diff) | |
download | chromium_src-fecc1520c83dc037865ba49846f764ce056d4016.zip chromium_src-fecc1520c83dc037865ba49846f764ce056d4016.tar.gz chromium_src-fecc1520c83dc037865ba49846f764ce056d4016.tar.bz2 |
Add UI for changing timezones.
BUG=24876
TEST=none
Review URL: http://codereview.chromium.org/267113
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29183 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos/clock_menu_button.h')
-rw-r--r-- | chrome/browser/chromeos/clock_menu_button.h | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/chrome/browser/chromeos/clock_menu_button.h b/chrome/browser/chromeos/clock_menu_button.h index 54d0389..e268cd2 100644 --- a/chrome/browser/chromeos/clock_menu_button.h +++ b/chrome/browser/chromeos/clock_menu_button.h @@ -6,17 +6,22 @@ #define CHROME_BROWSER_CHROMEOS_CLOCK_MENU_BUTTON_H_ #include "base/timer.h" +#include "chrome/common/notification_observer.h" +#include "chrome/common/pref_member.h" #include "views/controls/button/menu_button.h" #include "views/controls/menu/menu_2.h" #include "views/controls/menu/view_menu_delegate.h" +class Browser; + // The clock menu button in the status area. // This button shows the current time. class ClockMenuButton : public views::MenuButton, public views::ViewMenuDelegate, - public views::Menu2Model { + public views::Menu2Model, + public NotificationObserver { public: - ClockMenuButton(); + explicit ClockMenuButton(Browser* browser); virtual ~ClockMenuButton() {} // views::Menu2Model implementation. @@ -31,27 +36,37 @@ class ClockMenuButton : public views::MenuButton, virtual bool IsItemCheckedAt(int index) const { return false; } virtual int GetGroupIdAt(int index) const { return 0; } virtual bool GetIconAt(int index, SkBitmap* icon) const { return false; } - virtual bool IsEnabledAt(int index) const { return false; } + virtual bool IsEnabledAt(int index) const; virtual Menu2Model* GetSubmenuModelAt(int index) const { return NULL; } virtual void HighlightChangedTo(int index) {} - virtual void ActivatedAt(int index) {} + virtual void ActivatedAt(int index); virtual void MenuWillShow() {} + // Overridden from NotificationObserver: + virtual void Observe(NotificationType type, + const NotificationSource& source, + const NotificationDetails& details); + private: // views::ViewMenuDelegate implementation. virtual void RunMenu(views::View* source, const gfx::Point& pt); - // Schedules the timer to fire at the next minute interval. - void SetNextTimer(); + // Updates text and schedules the timer to fire at the next minute interval. + void UpdateTextAndSetNextTimer(); - // Updates the time on the menu button and sets the next timer. + // Updates the time on the menu button. void UpdateText(); base::OneShotTimer<ClockMenuButton> timer_; + StringPrefMember timezone_; + // The clock menu. views::Menu2 clock_menu_; + // The browser window that owns us. + Browser* browser_; + DISALLOW_COPY_AND_ASSIGN(ClockMenuButton); }; |