summaryrefslogtreecommitdiffstats
path: root/ash/system/settings
diff options
context:
space:
mode:
authorthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-24 03:42:45 +0000
committerthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-24 03:42:45 +0000
commit9d58a450c4447ce363c9272a04454776590f9814 (patch)
tree76f99ad8cceb3ec8049f94493b64c5f1c7fc8491 /ash/system/settings
parent8a360a4ca8a2afe8ec6eb47df414667f6d7661c0 (diff)
downloadchromium_src-9d58a450c4447ce363c9272a04454776590f9814.zip
chromium_src-9d58a450c4447ce363c9272a04454776590f9814.tar.gz
chromium_src-9d58a450c4447ce363c9272a04454776590f9814.tar.bz2
Revert 153141 - Adjust the power status UI to left aligned UI if the Settings is not displayed on the uber tray bubble.
BUG=138186 Review URL: https://chromiumcodereview.appspot.com/10877029 TBR=jennyz@chromium.org Review URL: https://chromiumcodereview.appspot.com/10870059 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@153149 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/system/settings')
-rw-r--r--ash/system/settings/tray_settings.cc12
1 files changed, 4 insertions, 8 deletions
diff --git a/ash/system/settings/tray_settings.cc b/ash/system/settings/tray_settings.cc
index 47939da..c28a3ea 100644
--- a/ash/system/settings/tray_settings.cc
+++ b/ash/system/settings/tray_settings.cc
@@ -32,13 +32,11 @@ class SettingsDefaultView : public ash::internal::ActionableView {
public:
explicit SettingsDefaultView(user::LoginStatus status)
: login_status_(status),
- label_(NULL),
power_status_view_(NULL) {
SetLayoutManager(new views::BoxLayout(views::BoxLayout::kHorizontal,
ash::kTrayPopupPaddingHorizontal, 0,
ash::kTrayPopupPaddingBetweenItems));
- bool power_view_right_align = false;
if (login_status_ != user::LOGGED_IN_NONE &&
login_status_ != user::LOGGED_IN_LOCKED) {
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
@@ -52,15 +50,13 @@ class SettingsDefaultView : public ash::internal::ActionableView {
label_ = new views::Label(text);
AddChildView(label_);
SetAccessibleName(text);
-
- power_view_right_align = true;
}
PowerSupplyStatus power_status =
ash::Shell::GetInstance()->tray_delegate()->GetPowerSupplyStatus();
if (power_status.battery_is_present) {
power_status_view_ = new ash::internal::PowerStatusView(
- ash::internal::PowerStatusView::VIEW_DEFAULT, power_view_right_align);
+ ash::internal::PowerStatusView::VIEW_DEFAULT);
AddChildView(power_status_view_);
UpdatePowerStatus(power_status);
}
@@ -85,11 +81,11 @@ class SettingsDefaultView : public ash::internal::ActionableView {
// Overridden from views::View.
virtual void Layout() OVERRIDE {
+ // Let the box-layout do the layout first. Then move power_status_view_
+ // to right align if it is created.
views::View::Layout();
- if (label_) {
- // Let the box-layout do the layout first. Then move power_status_view_
- // to right align if it is created.
+ if (power_status_view_) {
gfx::Size size = power_status_view_->GetPreferredSize();
gfx::Rect bounds(size);
bounds.set_x(width() - size.width() - ash::kTrayPopupPaddingBetweenItems);