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

Side by Side Diff: ui/views/controls/progress_bar.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
« no previous file with comments | « ui/views/controls/progress_bar.h ('k') | ui/views/controls/scroll_view.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "ui/views/controls/progress_bar.h" 5 #include "ui/views/controls/progress_bar.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 DCHECK(tooltip); 176 DCHECK(tooltip);
177 *tooltip = tooltip_text_; 177 *tooltip = tooltip_text_;
178 return !tooltip_text_.empty(); 178 return !tooltip_text_.empty();
179 } 179 }
180 180
181 void ProgressBar::GetAccessibleState(ui::AXViewState* state) { 181 void ProgressBar::GetAccessibleState(ui::AXViewState* state) {
182 state->role = ui::AX_ROLE_PROGRESS_INDICATOR; 182 state->role = ui::AX_ROLE_PROGRESS_INDICATOR;
183 state->AddStateFlag(ui::AX_STATE_READ_ONLY); 183 state->AddStateFlag(ui::AX_STATE_READ_ONLY);
184 } 184 }
185 185
186 gfx::Size ProgressBar::GetPreferredSize() { 186 gfx::Size ProgressBar::GetPreferredSize() const {
187 gfx::Size pref_size(100, 11); 187 gfx::Size pref_size(100, 11);
188 gfx::Insets insets = GetInsets(); 188 gfx::Insets insets = GetInsets();
189 pref_size.Enlarge(insets.width(), insets.height()); 189 pref_size.Enlarge(insets.width(), insets.height());
190 return pref_size; 190 return pref_size;
191 } 191 }
192 192
193 const char* ProgressBar::GetClassName() const { 193 const char* ProgressBar::GetClassName() const {
194 return kViewClassName; 194 return kViewClassName;
195 } 195 }
196 196
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 // Draw bar stroke 314 // Draw bar stroke
315 StrokeRoundRect(canvas, 315 StrokeRoundRect(canvas,
316 bar_left, bar_top, progress_width, bar_height, 316 bar_left, bar_top, progress_width, bar_height,
317 kCornerRadius, 317 kCornerRadius,
318 enabled() ? kBarBorderColor : kDisabledBarBorderColor, 318 enabled() ? kBarBorderColor : kDisabledBarBorderColor,
319 kBorderWidth); 319 kBorderWidth);
320 } 320 }
321 } 321 }
322 322
323 } // namespace views 323 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/progress_bar.h ('k') | ui/views/controls/scroll_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698