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

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

Issue 2860883003: A11y: Add/refactor methods for manipulating bitfields on AXNodeData. (Closed)
Patch Set: Delete AXNodeData::Init() and clear bitfields in AXNodeData() instead. Created 3 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
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 <cmath> 8 #include <cmath>
9 #include <string> 9 #include <string>
10 10
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 ProgressBar::ProgressBar(int preferred_height) 45 ProgressBar::ProgressBar(int preferred_height)
46 : preferred_height_(preferred_height) { 46 : preferred_height_(preferred_height) {
47 EnableCanvasFlippingForRTLUI(true); 47 EnableCanvasFlippingForRTLUI(true);
48 } 48 }
49 49
50 ProgressBar::~ProgressBar() { 50 ProgressBar::~ProgressBar() {
51 } 51 }
52 52
53 void ProgressBar::GetAccessibleNodeData(ui::AXNodeData* node_data) { 53 void ProgressBar::GetAccessibleNodeData(ui::AXNodeData* node_data) {
54 node_data->role = ui::AX_ROLE_PROGRESS_INDICATOR; 54 node_data->role = ui::AX_ROLE_PROGRESS_INDICATOR;
55 node_data->AddStateFlag(ui::AX_STATE_READ_ONLY); 55 node_data->AddState(ui::AX_STATE_READ_ONLY);
56 } 56 }
57 57
58 gfx::Size ProgressBar::GetPreferredSize() const { 58 gfx::Size ProgressBar::GetPreferredSize() const {
59 // The width will typically be ignored. 59 // The width will typically be ignored.
60 gfx::Size pref_size(1, preferred_height_); 60 gfx::Size pref_size(1, preferred_height_);
61 gfx::Insets insets = GetInsets(); 61 gfx::Insets insets = GetInsets();
62 pref_size.Enlarge(insets.width(), insets.height()); 62 pref_size.Enlarge(insets.width(), insets.height());
63 return pref_size; 63 return pref_size;
64 } 64 }
65 65
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 AddPossiblyRoundRectToPath(slice_bounds, &slice_path); 200 AddPossiblyRoundRectToPath(slice_bounds, &slice_path);
201 201
202 cc::PaintFlags slice_flags; 202 cc::PaintFlags slice_flags;
203 slice_flags.setStyle(cc::PaintFlags::kFill_Style); 203 slice_flags.setStyle(cc::PaintFlags::kFill_Style);
204 slice_flags.setAntiAlias(true); 204 slice_flags.setAntiAlias(true);
205 slice_flags.setColor(GetForegroundColor()); 205 slice_flags.setColor(GetForegroundColor());
206 canvas->DrawPath(slice_path, slice_flags); 206 canvas->DrawPath(slice_path, slice_flags);
207 } 207 }
208 208
209 } // namespace views 209 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698