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/power/power_status_view.h" | 5 #include "ash/system/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/power/tray_power.h" | 9 #include "ash/system/power/tray_power.h" |
10 #include "ash/system/tray/fixed_sized_image_view.h" | 10 #include "ash/system/tray/fixed_sized_image_view.h" |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 | 283 |
284 void PowerStatusView::ChildPreferredSizeChanged(views::View* child) { | 284 void PowerStatusView::ChildPreferredSizeChanged(views::View* child) { |
285 PreferredSizeChanged(); | 285 PreferredSizeChanged(); |
286 } | 286 } |
287 | 287 |
288 gfx::Size PowerStatusView::GetPreferredSize() { | 288 gfx::Size PowerStatusView::GetPreferredSize() { |
289 gfx::Size size = views::View::GetPreferredSize(); | 289 gfx::Size size = views::View::GetPreferredSize(); |
290 return gfx::Size(size.width(), kTrayPopupItemHeight); | 290 return gfx::Size(size.width(), kTrayPopupItemHeight); |
291 } | 291 } |
292 | 292 |
| 293 int PowerStatusView::GetHeightForWidth(int width) { |
| 294 return kTrayPopupItemHeight; |
| 295 } |
| 296 |
293 void PowerStatusView::Layout() { | 297 void PowerStatusView::Layout() { |
294 views::View::Layout(); | 298 views::View::Layout(); |
295 | 299 |
296 // Move the time_status_label_ closer to percentage_label_. | 300 // Move the time_status_label_ closer to percentage_label_. |
297 if (percentage_label_ && time_status_label_ && | 301 if (percentage_label_ && time_status_label_ && |
298 percentage_label_->visible() && time_status_label_->visible()) { | 302 percentage_label_->visible() && time_status_label_->visible()) { |
299 time_status_label_->SetX(percentage_label_->bounds().right() + 1); | 303 time_status_label_->SetX(percentage_label_->bounds().right() + 1); |
300 } | 304 } |
301 } | 305 } |
302 | 306 |
303 } // namespace internal | 307 } // namespace internal |
304 } // namespace ash | 308 } // namespace ash |
OLD | NEW |