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

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

Issue 2016243002: Mac a11y: Add RoleDescription and Value attributes to accessibility information. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase again. Created 4 years, 6 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) 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 <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
11 #include "base/strings/string16.h" 11 #include "base/strings/string16.h"
12 #include "ui/accessibility/ax_enums.h" 12 #include "ui/accessibility/ax_enums.h"
13 #include "ui/accessibility/ax_export.h" 13 #include "ui/accessibility/ax_export.h"
14 14
15 namespace ui { 15 namespace ui {
16 16
17 //////////////////////////////////////////////////////////////////////////////// 17 ////////////////////////////////////////////////////////////////////////////////
18 // 18 //
19 // AXViewState 19 // AXViewState
20 // 20 //
21 // A cross-platform struct for storing the core accessibility information 21 // A cross-platform struct for storing the core accessibility information
22 // that should be provided about any UI view to assistive technology (AT). 22 // that should be provided about any UI view to assistive technology (AT).
23 // 23 //
24 //////////////////////////////////////////////////////////////////////////////// 24 ////////////////////////////////////////////////////////////////////////////////
25 struct AX_EXPORT AXViewState { 25 struct AX_EXPORT AXViewState {
26 public: 26 public:
27 AXViewState(); 27 AXViewState();
28 ~AXViewState(); 28 ~AXViewState();
29 29
30 // Like HasStateFlag(), but static.
tapted 2016/06/17 03:32:49 HasStateFlag's is a bit "light" so it doesn't make
Patti Lor 2016/06/17 05:57:35 Done.
31 static bool IsFlagSet(uint32_t state, ui::AXState state_flag);
32
30 // Set or check bits in |state_|. 33 // Set or check bits in |state_|.
31 void AddStateFlag(ui::AXState state); 34 void AddStateFlag(ui::AXState state_flag);
32 bool HasStateFlag(ui::AXState state) const; 35 bool HasStateFlag(ui::AXState state_flag) const;
33 36
34 // The view's state, a bitmask containing fields such as checked 37 // The view's state, a bitmask containing fields such as checked
35 // (for a checkbox) and protected (for a password text box). This "state" 38 // (for a checkbox) and protected (for a password text box). This "state"
36 // should not be confused with the class's name. 39 // should not be confused with the class's name.
37 uint32_t state() { return state_; } 40 uint32_t state() { return state_; }
38 41
39 // The view's role, like button or list box. 42 // The view's role, like button or list box.
40 AXRole role; 43 AXRole role;
41 44
42 // The view's name / label. 45 // The view's name / label.
(...skipping 30 matching lines...) Expand all
73 // should use a WeakPtr when binding the callback. 76 // should use a WeakPtr when binding the callback.
74 base::Callback<void(const base::string16&)> set_value_callback; 77 base::Callback<void(const base::string16&)> set_value_callback;
75 78
76 private: 79 private:
77 uint32_t state_; 80 uint32_t state_;
78 }; 81 };
79 82
80 } // namespace ui 83 } // namespace ui
81 84
82 #endif // UI_ACCESSIBILITY_AX_VIEW_STATE_H_ 85 #endif // UI_ACCESSIBILITY_AX_VIEW_STATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698