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

Unified Diff: chrome/browser/chromeos/status/power_menu_button.h

Issue 7491083: Implemented nicer battery status (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review fix Created 9 years, 4 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
« no previous file with comments | « chrome/browser/chromeos/cros/power_library.cc ('k') | chrome/browser/chromeos/status/power_menu_button.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/status/power_menu_button.h
diff --git a/chrome/browser/chromeos/status/power_menu_button.h b/chrome/browser/chromeos/status/power_menu_button.h
index fab53600cc9f507723691cc69b10d371c2177bbf..f27f07e953c6cb4bab356736bd0b5844091d138e 100644
--- a/chrome/browser/chromeos/status/power_menu_button.h
+++ b/chrome/browser/chromeos/status/power_menu_button.h
@@ -37,12 +37,14 @@ class PowerMenuButton : public StatusAreaButton,
virtual void PowerChanged(PowerLibrary* obj);
virtual void SystemResumed() {}
- int icon_id() const { return icon_id_; }
+ int battery_index() const { return battery_index_; }
protected:
virtual int icon_width();
private:
+ class StatusView;
+
// views::View
virtual void OnLocaleChanged() OVERRIDE;
@@ -61,26 +63,20 @@ class PowerMenuButton : public StatusAreaButton,
void UpdateBatteryTime(base::TimeDelta* previous,
const base::TimeDelta& current);
- // Update the menu entries.
- void UpdateMenu();
-
- // The number of power images.
- static const int kNumPowerImages;
-
// Stored data gathered from CrosLibrary::PowerLibrary.
bool battery_is_present_;
bool line_power_on_;
- bool battery_fully_charged_;
double battery_percentage_;
+ string16 percentage_text_;
+ int battery_index_;
base::TimeDelta battery_time_to_full_;
base::TimeDelta battery_time_to_empty_;
- // The currently showing icon bitmap id.
- int icon_id_;
+ // The currently showing status view. NULL if menu is not being displayed.
+ StatusView* status_;
- // The power menu. This needs to be initialized last since it calls into
- // GetLabelAt() during construction.
- scoped_ptr<views::MenuItemView> menu_;
+ // The currently showing menu. NULL if menu is not being displayed.
+ views::MenuItemView* menu_;
DISALLOW_COPY_AND_ASSIGN(PowerMenuButton);
};
« no previous file with comments | « chrome/browser/chromeos/cros/power_library.cc ('k') | chrome/browser/chromeos/status/power_menu_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698