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

Side by Side Diff: ui/views/controls/progress_bar.cc

Issue 196133012: Fix incorrect use of AXState caused when refactoring two enums into one. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rename SetStateFlag -> AddStateFlag Created 6 years, 8 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 "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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 173
174 bool ProgressBar::GetTooltipText(const gfx::Point& p, 174 bool ProgressBar::GetTooltipText(const gfx::Point& p,
175 base::string16* tooltip) const { 175 base::string16* tooltip) const {
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->state = 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() {
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 {
(...skipping 120 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/menu/menu_scroll_view_container.cc ('k') | ui/views/controls/progress_bar_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698