summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chromeos/status
diff options
context:
space:
mode:
authorthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-15 22:35:23 +0000
committerthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-15 22:35:23 +0000
commit6faf1083ba454f1a0e4d2fb563a7e4f5c30e453f (patch)
treed270282a97740a2d475bdd2599bcb00cb053f05a /chrome/browser/chromeos/status
parent5db8cd6e1c2048f80931581157adac7cceb691d8 (diff)
downloadchromium_src-6faf1083ba454f1a0e4d2fb563a7e4f5c30e453f.zip
chromium_src-6faf1083ba454f1a0e4d2fb563a7e4f5c30e453f.tar.gz
chromium_src-6faf1083ba454f1a0e4d2fb563a7e4f5c30e453f.tar.bz2
cros: Out-of-line some virtual methods of PowerMenuButton, make constructor explicit
BUG=none TEST=none TBR=dpolukhin Review URL: http://codereview.chromium.org/7033001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85436 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos/status')
-rw-r--r--chrome/browser/chromeos/status/power_menu_button.cc45
-rw-r--r--chrome/browser/chromeos/status/power_menu_button.h26
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