| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ash/system/chromeos/power/power_status_view.h" | 5 #include "ash/system/chromeos/power/power_status_view.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/shell_delegate.h" | 8 #include "ash/shell_delegate.h" |
| 9 #include "ash/system/chromeos/power/power_status.h" | 9 #include "ash/system/chromeos/power/power_status.h" |
| 10 #include "ash/system/chromeos/power/tray_power.h" | 10 #include "ash/system/chromeos/power/tray_power.h" |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 } | 190 } |
| 191 } else { | 191 } else { |
| 192 time_label_->SetText(base::string16()); | 192 time_label_->SetText(base::string16()); |
| 193 } | 193 } |
| 194 } | 194 } |
| 195 | 195 |
| 196 void PowerStatusView::ChildPreferredSizeChanged(views::View* child) { | 196 void PowerStatusView::ChildPreferredSizeChanged(views::View* child) { |
| 197 PreferredSizeChanged(); | 197 PreferredSizeChanged(); |
| 198 } | 198 } |
| 199 | 199 |
| 200 gfx::Size PowerStatusView::GetPreferredSize() { | 200 gfx::Size PowerStatusView::GetPreferredSize() const { |
| 201 gfx::Size size = views::View::GetPreferredSize(); | 201 gfx::Size size = views::View::GetPreferredSize(); |
| 202 return gfx::Size(size.width(), kTrayPopupItemHeight); | 202 return gfx::Size(size.width(), kTrayPopupItemHeight); |
| 203 } | 203 } |
| 204 | 204 |
| 205 int PowerStatusView::GetHeightForWidth(int width) { | 205 int PowerStatusView::GetHeightForWidth(int width) const { |
| 206 return kTrayPopupItemHeight; | 206 return kTrayPopupItemHeight; |
| 207 } | 207 } |
| 208 | 208 |
| 209 void PowerStatusView::Layout() { | 209 void PowerStatusView::Layout() { |
| 210 views::View::Layout(); | 210 views::View::Layout(); |
| 211 | 211 |
| 212 // Move the time_status_label_ closer to percentage_label_. | 212 // Move the time_status_label_ closer to percentage_label_. |
| 213 if (percentage_label_ && time_status_label_ && | 213 if (percentage_label_ && time_status_label_ && |
| 214 percentage_label_->visible() && time_status_label_->visible()) { | 214 percentage_label_->visible() && time_status_label_->visible()) { |
| 215 time_status_label_->SetX(percentage_label_->bounds().right() + 1); | 215 time_status_label_->SetX(percentage_label_->bounds().right() + 1); |
| 216 } | 216 } |
| 217 } | 217 } |
| 218 | 218 |
| 219 } // namespace ash | 219 } // namespace ash |
| OLD | NEW |