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

Side by Side Diff: ash/system/chromeos/power/power_status_view.cc

Issue 273223002: views: Make view::Views::GetPreferredSize() const. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More compile fix for ToT Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
OLDNEW
« no previous file with comments | « ash/system/chromeos/power/power_status_view.h ('k') | ash/system/chromeos/virtual_keyboard/virtual_keyboard_tray.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698