OLD | NEW |
---|---|
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_BASE_ACCESSIBILITY_ACCESSIBLE_VIEW_STATE_H_ | 5 #ifndef UI_BASE_ACCESSIBILITY_ACCESSIBLE_VIEW_STATE_H_ |
6 #define UI_BASE_ACCESSIBILITY_ACCESSIBLE_VIEW_STATE_H_ | 6 #define UI_BASE_ACCESSIBILITY_ACCESSIBLE_VIEW_STATE_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/callback.h" | |
9 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
10 #include "ui/base/accessibility/accessibility_types.h" | 11 #include "ui/base/accessibility/accessibility_types.h" |
11 #include "ui/base/ui_export.h" | 12 #include "ui/base/ui_export.h" |
12 | 13 |
13 namespace ui { | 14 namespace ui { |
14 | 15 |
15 //////////////////////////////////////////////////////////////////////////////// | 16 //////////////////////////////////////////////////////////////////////////////// |
16 // | 17 // |
17 // AccessibleViewState | 18 // AccessibleViewState |
18 // | 19 // |
(...skipping 28 matching lines...) Expand all Loading... | |
47 // The selection start and end. Only applies to views with text content, | 48 // The selection start and end. Only applies to views with text content, |
48 // such as a text box or combo box; start and end should be -1 otherwise. | 49 // such as a text box or combo box; start and end should be -1 otherwise. |
49 int selection_start; | 50 int selection_start; |
50 int selection_end; | 51 int selection_end; |
51 | 52 |
52 // The selected item's index and the count of the number of items. | 53 // The selected item's index and the count of the number of items. |
53 // Only applies to views with multiple choices like a listbox; both | 54 // Only applies to views with multiple choices like a listbox; both |
54 // index and count should be -1 otherwise. | 55 // index and count should be -1 otherwise. |
55 int index; | 56 int index; |
56 int count; | 57 int count; |
58 | |
59 // An optional callback that can be used by accessibility clients to | |
60 // set the string value of this view. This only applies to roles where | |
61 // setting the value makes sense, like a text box. Not often used by | |
62 // screen readers, but often used by automation software to script | |
63 // things like logging into portals or filling forms. | |
64 // | |
65 // This callback is not expected to persist beyond the scope of the | |
msw
2013/08/31 20:22:36
I think it'd be better to try to use WeakPtr than
dmazzoni
2013/09/03 20:20:11
Done.
| |
66 // function that immediately requested the AccessibleViewState. It should | |
67 // be used immediately or deleted. Accessible views should use | |
68 // base::Unretained when binding the callback. | |
69 base::Callback<void(const base::string16&)> set_value_callback; | |
57 }; | 70 }; |
58 | 71 |
59 } // namespace ui | 72 } // namespace ui |
60 | 73 |
61 #endif // UI_BASE_ACCESSIBILITY_ACCESSIBLE_VIEW_STATE_H_ | 74 #endif // UI_BASE_ACCESSIBILITY_ACCESSIBLE_VIEW_STATE_H_ |
OLD | NEW |