diff options
-rw-r--r-- | chrome/browser/chromeos/status/power_menu_button.cc | 45 | ||||
-rw-r--r-- | chrome/browser/chromeos/status/power_menu_button.h | 26 |
2 files changed, 57 insertions, 14 deletions
diff --git a/chrome/browser/chromeos/status/power_menu_button.cc b/chrome/browser/chromeos/status/power_menu_button.cc index 6886e18..eab61da 100644 --- a/chrome/browser/chromeos/status/power_menu_button.cc +++ b/chrome/browser/chromeos/status/power_menu_button.cc @@ -41,6 +41,10 @@ PowerMenuButton::~PowerMenuButton() { //////////////////////////////////////////////////////////////////////////////// // PowerMenuButton, ui::MenuModel implementation: +bool PowerMenuButton::HasIcons() const { + return false; +} + int PowerMenuButton::GetItemCount() const { // We can't display charging information when no battery is installed. return battery_is_present_ ? 2 : 1; @@ -50,6 +54,10 @@ ui::MenuModel::ItemType PowerMenuButton::GetTypeAt(int index) const { return ui::MenuModel::TYPE_COMMAND; } +int PowerMenuButton::GetCommandIdAt(int index) const { + return index; +} + string16 PowerMenuButton::GetLabelAt(int index) const { if (!battery_is_present_) return l10n_util::GetStringUTF16(IDS_STATUSBAR_NO_BATTERY); @@ -95,6 +103,43 @@ string16 PowerMenuButton::GetLabelAt(int index) const { } } +bool PowerMenuButton::IsItemDynamicAt(int index) const { + return true; +} + +bool PowerMenuButton::GetAcceleratorAt( + int index, ui::Accelerator* accelerator) const { + return false; +} + +bool PowerMenuButton::IsItemCheckedAt(int index) const { + return false; +} + +int PowerMenuButton::GetGroupIdAt(int index) const { + return 0; +} + +bool PowerMenuButton::GetIconAt(int index, SkBitmap* icon) { + return false; +} + +ui::ButtonMenuItemModel* PowerMenuButton::GetButtonMenuItemAt(int index) const { + return NULL; +} + +bool PowerMenuButton::IsEnabledAt(int index) const { + return false; +} + +ui::MenuModel* PowerMenuButton::GetSubmenuModelAt(int index) const { + return NULL; +} + +int PowerMenuButton::icon_width() { + return 26; +} + //////////////////////////////////////////////////////////////////////////////// // PowerMenuButton, views::View implementation: void PowerMenuButton::OnLocaleChanged() { diff --git a/chrome/browser/chromeos/status/power_menu_button.h b/chrome/browser/chromeos/status/power_menu_button.h index fa2d6b1..3876bae 100644 --- a/chrome/browser/chromeos/status/power_menu_button.h +++ b/chrome/browser/chromeos/status/power_menu_button.h @@ -27,26 +27,24 @@ class PowerMenuButton : public StatusAreaButton, public ui::MenuModel, public PowerLibrary::Observer { public: - PowerMenuButton(StatusAreaHost* host); + explicit PowerMenuButton(StatusAreaHost* host); virtual ~PowerMenuButton(); // ui::MenuModel implementation. - virtual bool HasIcons() const { return false; } + virtual bool HasIcons() const; virtual int GetItemCount() const; virtual ui::MenuModel::ItemType GetTypeAt(int index) const; - virtual int GetCommandIdAt(int index) const { return index; } + virtual int GetCommandIdAt(int index) const; virtual string16 GetLabelAt(int index) const; - virtual bool IsItemDynamicAt(int index) const { return true; } + virtual bool IsItemDynamicAt(int index) const; virtual bool GetAcceleratorAt(int index, - ui::Accelerator* accelerator) const { return false; } - virtual bool IsItemCheckedAt(int index) const { return false; } - virtual int GetGroupIdAt(int index) const { return 0; } - virtual bool GetIconAt(int index, SkBitmap* icon) { return false; } - virtual ui::ButtonMenuItemModel* GetButtonMenuItemAt(int index) const { - return NULL; - } - virtual bool IsEnabledAt(int index) const { return false; } - virtual ui::MenuModel* GetSubmenuModelAt(int index) const { return NULL; } + ui::Accelerator* accelerator) const; + virtual bool IsItemCheckedAt(int index) const; + virtual int GetGroupIdAt(int index) const; + virtual bool GetIconAt(int index, SkBitmap* icon); + virtual ui::ButtonMenuItemModel* GetButtonMenuItemAt(int index) const; + virtual bool IsEnabledAt(int index) const; + virtual ui::MenuModel* GetSubmenuModelAt(int index) const; virtual void HighlightChangedTo(int index) {} virtual void ActivatedAt(int index) {} virtual void MenuWillShow() {} @@ -59,7 +57,7 @@ class PowerMenuButton : public StatusAreaButton, int icon_id() const { return icon_id_; } protected: - virtual int icon_width() { return 26; } + virtual int icon_width(); private: // views::View |