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

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

Issue 1142005: Mocks for all libcros elements (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 9 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/power_menu_button.cc
===================================================================
--- chrome/browser/chromeos/status/power_menu_button.cc (revision 42341)
+++ chrome/browser/chromeos/status/power_menu_button.cc (working copy)
@@ -24,11 +24,11 @@
: StatusAreaButton(this),
ALLOW_THIS_IN_INITIALIZER_LIST(power_menu_(this)) {
UpdateIcon();
- PowerLibrary::Get()->AddObserver(this);
+ CrosLibrary::Get()->GetPowerLibrary()->AddObserver(this);
}
PowerMenuButton::~PowerMenuButton() {
- PowerLibrary::Get()->RemoveObserver(this);
+ CrosLibrary::Get()->GetPowerLibrary()->RemoveObserver(this);
}
////////////////////////////////////////////////////////////////////////////////
@@ -43,7 +43,7 @@
}
string16 PowerMenuButton::GetLabelAt(int index) const {
- PowerLibrary* cros = PowerLibrary::Get();
+ PowerLibrary* cros = CrosLibrary::Get()->GetPowerLibrary();
// The first item shows the percentage of battery left.
if (index == 0) {
// If fully charged, always show 100% even if internal number is a bit less.
@@ -122,9 +122,9 @@
}
void PowerMenuButton::UpdateIcon() {
- PowerLibrary* cros = PowerLibrary::Get();
+ PowerLibrary* cros = CrosLibrary::Get()->GetPowerLibrary();
int id = IDR_STATUSBAR_BATTERY_UNKNOWN;
- if (CrosLibrary::EnsureLoaded()) {
+ if (CrosLibrary::Get()->EnsureLoaded()) {
if (!cros->battery_is_present()) {
id = IDR_STATUSBAR_BATTERY_MISSING;
} else if (cros->line_power_on() && cros->battery_fully_charged()) {
« no previous file with comments | « chrome/browser/chromeos/status/network_menu_button.cc ('k') | chrome/browser/chromeos/text_input/candidate_window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698