| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 } | 49 } |
| 50 | 50 |
| 51 // ui::AXPlatformNodeDelegate | 51 // ui::AXPlatformNodeDelegate |
| 52 | 52 |
| 53 const ui::AXNodeData& NativeViewAccessibility::GetData() { | 53 const ui::AXNodeData& NativeViewAccessibility::GetData() { |
| 54 ui::AXViewState state; | 54 ui::AXViewState state; |
| 55 view_->GetAccessibleState(&state); | 55 view_->GetAccessibleState(&state); |
| 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 = gfx::RectF(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, | 66 data_.AddStringAttribute(ui::AX_ATTR_PLACEHOLDER, |
| 67 base::UTF16ToUTF8(state.placeholder)); | 67 base::UTF16ToUTF8(state.placeholder)); |
| 68 data_.AddIntAttribute(ui::AX_ATTR_TEXT_SEL_START, state.selection_start); | 68 data_.AddIntAttribute(ui::AX_ATTR_TEXT_SEL_START, state.selection_start); |
| 69 data_.AddIntAttribute(ui::AX_ATTR_TEXT_SEL_END, state.selection_end); | 69 data_.AddIntAttribute(ui::AX_ATTR_TEXT_SEL_END, state.selection_end); |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 child_widget_platform_node->GetDelegate()); | 245 child_widget_platform_node->GetDelegate()); |
| 246 if (child_widget_view_accessibility->parent_widget() != widget) | 246 if (child_widget_view_accessibility->parent_widget() != widget) |
| 247 child_widget_view_accessibility->SetParentWidget(widget); | 247 child_widget_view_accessibility->SetParentWidget(widget); |
| 248 } | 248 } |
| 249 | 249 |
| 250 result_child_widgets->push_back(child_widget); | 250 result_child_widgets->push_back(child_widget); |
| 251 } | 251 } |
| 252 } | 252 } |
| 253 | 253 |
| 254 } // namespace views | 254 } // namespace views |
| OLD | NEW |