| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/accessibility/native_view_accessibility.h" | 5 #include "ui/views/accessibility/native_view_accessibility.h" |
| 6 | 6 |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 #include "ui/accessibility/ax_view_state.h" | 9 #include "ui/accessibility/ax_view_state.h" |
| 10 #include "ui/events/event_utils.h" | 10 #include "ui/events/event_utils.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 data_ = ui::AXNodeData(); | 56 data_ = ui::AXNodeData(); |
| 57 data_.role = state.role; | 57 data_.role = state.role; |
| 58 data_.state = state.state(); | 58 data_.state = state.state(); |
| 59 data_.location = view_->GetBoundsInScreen(); | 59 data_.location = view_->GetBoundsInScreen(); |
| 60 data_.AddStringAttribute(ui::AX_ATTR_NAME, base::UTF16ToUTF8(state.name)); | 60 data_.AddStringAttribute(ui::AX_ATTR_NAME, base::UTF16ToUTF8(state.name)); |
| 61 data_.AddStringAttribute(ui::AX_ATTR_VALUE, base::UTF16ToUTF8(state.value)); | 61 data_.AddStringAttribute(ui::AX_ATTR_VALUE, base::UTF16ToUTF8(state.value)); |
| 62 data_.AddStringAttribute(ui::AX_ATTR_ACTION, | 62 data_.AddStringAttribute(ui::AX_ATTR_ACTION, |
| 63 base::UTF16ToUTF8(state.default_action)); | 63 base::UTF16ToUTF8(state.default_action)); |
| 64 data_.AddStringAttribute(ui::AX_ATTR_SHORTCUT, | 64 data_.AddStringAttribute(ui::AX_ATTR_SHORTCUT, |
| 65 base::UTF16ToUTF8(state.keyboard_shortcut)); | 65 base::UTF16ToUTF8(state.keyboard_shortcut)); |
| 66 data_.AddStringAttribute(ui::AX_ATTR_PLACEHOLDER, |
| 67 base::UTF16ToUTF8(state.placeholder)); |
| 66 data_.AddIntAttribute(ui::AX_ATTR_TEXT_SEL_START, state.selection_start); | 68 data_.AddIntAttribute(ui::AX_ATTR_TEXT_SEL_START, state.selection_start); |
| 67 data_.AddIntAttribute(ui::AX_ATTR_TEXT_SEL_END, state.selection_end); | 69 data_.AddIntAttribute(ui::AX_ATTR_TEXT_SEL_END, state.selection_end); |
| 68 | 70 |
| 69 data_.state |= (1 << ui::AX_STATE_FOCUSABLE); | 71 data_.state |= (1 << ui::AX_STATE_FOCUSABLE); |
| 70 | 72 |
| 71 if (!view_->enabled()) | 73 if (!view_->enabled()) |
| 72 data_.state |= (1 << ui::AX_STATE_DISABLED); | 74 data_.state |= (1 << ui::AX_STATE_DISABLED); |
| 73 | 75 |
| 74 if (!view_->visible()) | 76 if (!view_->visible()) |
| 75 data_.state |= (1 << ui::AX_STATE_INVISIBLE); | 77 data_.state |= (1 << ui::AX_STATE_INVISIBLE); |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 child_widget_platform_node->GetDelegate()); | 245 child_widget_platform_node->GetDelegate()); |
| 244 if (child_widget_view_accessibility->parent_widget() != widget) | 246 if (child_widget_view_accessibility->parent_widget() != widget) |
| 245 child_widget_view_accessibility->SetParentWidget(widget); | 247 child_widget_view_accessibility->SetParentWidget(widget); |
| 246 } | 248 } |
| 247 | 249 |
| 248 result_child_widgets->push_back(child_widget); | 250 result_child_widgets->push_back(child_widget); |
| 249 } | 251 } |
| 250 } | 252 } |
| 251 | 253 |
| 252 } // namespace views | 254 } // namespace views |
| OLD | NEW |