summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chromeos/status/power_menu_button.h
diff options
context:
space:
mode:
authorstevenjb@chromium.org <stevenjb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-03 23:27:28 +0000
committerstevenjb@chromium.org <stevenjb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-03 23:27:28 +0000
commit18d0ee3958b93177db2a9683e454407cf61a7026 (patch)
tree92940191b7bcb3983dafe5118c40a58b4f1b12e4 /chrome/browser/chromeos/status/power_menu_button.h
parentd815a1b2b93788ccd245136ce788eb4a9010c6bb (diff)
downloadchromium_src-18d0ee3958b93177db2a9683e454407cf61a7026.zip
chromium_src-18d0ee3958b93177db2a9683e454407cf61a7026.tar.gz
chromium_src-18d0ee3958b93177db2a9683e454407cf61a7026.tar.bz2
Valgrind fix for chromium-os:5601
BUG=chromium-os:6441 (valgrind error) TEST=Run Valgrind, verify it doesn't fail in PowerMenuButton. Original CL: http://codereview.chromium.org/3158014/show Two changes: 1. Re-ordered the member variables so that members used by GetLabelAt() are initialized before power_menu_ which calls into GetLabelAt(). 2. Modified GetLabelAt() to explicitly check for index == 1 for the second line, just for clarity. Review URL: http://codereview.chromium.org/3291010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58559 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos/status/power_menu_button.h')
-rw-r--r--chrome/browser/chromeos/status/power_menu_button.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/chrome/browser/chromeos/status/power_menu_button.h b/chrome/browser/chromeos/status/power_menu_button.h
index abf758a..7f27333 100644
--- a/chrome/browser/chromeos/status/power_menu_button.h
+++ b/chrome/browser/chromeos/status/power_menu_button.h
@@ -74,10 +74,7 @@ class PowerMenuButton : public StatusAreaButton,
// The number of power images.
static const int kNumPowerImages;
- // The power menu.
- views::Menu2 power_menu_;
-
- // Stored data gathered CrosLibrary::PowerLibrary.
+ // Stored data gathered from CrosLibrary::PowerLibrary.
bool battery_is_present_;
bool line_power_on_;
bool battery_fully_charged_;
@@ -88,6 +85,10 @@ class PowerMenuButton : public StatusAreaButton,
// The currently showing icon bitmap id.
int icon_id_;
+ // The power menu. This needs to be initialized last since it calls into
+ // GetLabelAt() during construction.
+ views::Menu2 power_menu_;
+
DISALLOW_COPY_AND_ASSIGN(PowerMenuButton);
};