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

Side by Side Diff: ui/accessibility/ax_view_state.h

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: Add dependency Created 6 years, 9 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 | « chrome/browser/ui/views/toolbar/toolbar_button.cc ('k') | ui/accessibility/ax_view_state.cc » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #ifndef UI_ACCESSIBILITY_AX_VIEW_STATE_H_ 5 #ifndef UI_ACCESSIBILITY_AX_VIEW_STATE_H_
6 #define UI_ACCESSIBILITY_AX_VIEW_STATE_H_ 6 #define UI_ACCESSIBILITY_AX_VIEW_STATE_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/strings/string16.h" 10 #include "base/strings/string16.h"
11 #include "ui/accessibility/ax_enums.h" 11 #include "ui/accessibility/ax_enums.h"
12 #include "ui/accessibility/ax_export.h" 12 #include "ui/accessibility/ax_export.h"
13 13
14 namespace ui { 14 namespace ui {
15 15
16 //////////////////////////////////////////////////////////////////////////////// 16 ////////////////////////////////////////////////////////////////////////////////
17 // 17 //
18 // AXViewState 18 // AXViewState
19 // 19 //
20 // A cross-platform struct for storing the core accessibility information 20 // A cross-platform struct for storing the core accessibility information
21 // that should be provided about any UI view to assistive technology (AT). 21 // that should be provided about any UI view to assistive technology (AT).
22 // 22 //
23 //////////////////////////////////////////////////////////////////////////////// 23 ////////////////////////////////////////////////////////////////////////////////
24 struct AX_EXPORT AXViewState { 24 struct AX_EXPORT AXViewState {
25 public: 25 public:
26 AXViewState(); 26 AXViewState();
27 ~AXViewState(); 27 ~AXViewState();
28 28
29 // Convenience functions to set or check bits in |state|.
30 void SetStateFlag(ui::AXState state);
mpichlinski 2014/03/18 08:32:34 This only adds flags, its for previous usage of |=
dmazzoni 2014/03/22 14:28:01 In typical programming and computer science jargon
mpichlinski 2014/03/24 08:43:41 Done.
31 bool HasStateFlag(ui::AXState state) const;
32
29 // The view's role, like button or list box. 33 // The view's role, like button or list box.
30 AXRole role; 34 AXRole role;
31 35
32 // The view's state, a bitmask containing fields such as checked 36 // The view's state, a bitmask containing fields such as checked
33 // (for a checkbox) and protected (for a password text box). 37 // (for a checkbox) and protected (for a password text box).
34 uint32 state; 38 uint32 state;
mpichlinski 2014/03/18 08:32:34 Hide it in private section, to prevent incorrect a
dmazzoni 2014/03/22 14:28:01 I don't think this complexity is needed. We don't
mpichlinski 2014/03/24 08:43:41 Still hiding it in private section will prevent in
dmazzoni 2014/03/24 23:08:01 Fair enough, done. Now it should probably be a cl
35 39
36 // The view's name / label. 40 // The view's name / label.
37 base::string16 name; 41 base::string16 name;
38 42
39 // The view's value, for example the text content. 43 // The view's value, for example the text content.
40 base::string16 value; 44 base::string16 value;
41 45
42 // The name of the default action if the user clicks on this view. 46 // The name of the default action if the user clicks on this view.
43 base::string16 default_action; 47 base::string16 default_action;
44 48
(...skipping 19 matching lines...) Expand all
64 // 68 //
65 // This callback is only valid for the lifetime of the view, and should 69 // This callback is only valid for the lifetime of the view, and should
66 // be a safe no-op if the view is deleted. Typically, accessible views 70 // be a safe no-op if the view is deleted. Typically, accessible views
67 // should use a WeakPtr when binding the callback. 71 // should use a WeakPtr when binding the callback.
68 base::Callback<void(const base::string16&)> set_value_callback; 72 base::Callback<void(const base::string16&)> set_value_callback;
69 }; 73 };
70 74
71 } // namespace ui 75 } // namespace ui
72 76
73 #endif // UI_ACCESSIBILITY_AX_VIEW_STATE_H_ 77 #endif // UI_ACCESSIBILITY_AX_VIEW_STATE_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/toolbar/toolbar_button.cc ('k') | ui/accessibility/ax_view_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698