| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/ax_view_obj_wrapper.h" | 5 #include "ui/views/accessibility/ax_view_obj_wrapper.h" |
| 6 | 6 |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "ui/accessibility/ax_node_data.h" | 8 #include "ui/accessibility/ax_node_data.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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 | 51 |
| 52 out_node_data->id = GetID(); | 52 out_node_data->id = GetID(); |
| 53 out_node_data->role = view_data.role; | 53 out_node_data->role = view_data.role; |
| 54 | 54 |
| 55 out_node_data->state = view_data.state(); | 55 out_node_data->state = view_data.state(); |
| 56 if (view_->IsFocusable()) | 56 if (view_->IsFocusable()) |
| 57 out_node_data->state |= 1 << ui::AX_STATE_FOCUSABLE; | 57 out_node_data->state |= 1 << ui::AX_STATE_FOCUSABLE; |
| 58 if (!view_->visible()) | 58 if (!view_->visible()) |
| 59 out_node_data->state |= 1 << ui::AX_STATE_INVISIBLE; | 59 out_node_data->state |= 1 << ui::AX_STATE_INVISIBLE; |
| 60 | 60 |
| 61 out_node_data->location = view_->GetBoundsInScreen(); | 61 out_node_data->location = gfx::RectF(view_->GetBoundsInScreen()); |
| 62 | 62 |
| 63 out_node_data->AddStringAttribute( | 63 out_node_data->AddStringAttribute( |
| 64 ui::AX_ATTR_NAME, base::UTF16ToUTF8(view_data.name)); | 64 ui::AX_ATTR_NAME, base::UTF16ToUTF8(view_data.name)); |
| 65 out_node_data->AddStringAttribute( | 65 out_node_data->AddStringAttribute( |
| 66 ui::AX_ATTR_VALUE, base::UTF16ToUTF8(view_data.value)); | 66 ui::AX_ATTR_VALUE, base::UTF16ToUTF8(view_data.value)); |
| 67 | 67 |
| 68 if (view_data.selection_start > -1 && view_data.selection_end > -1) { | 68 if (view_data.selection_start > -1 && view_data.selection_end > -1) { |
| 69 out_node_data->AddIntAttribute(ui::AX_ATTR_TEXT_SEL_START, | 69 out_node_data->AddIntAttribute(ui::AX_ATTR_TEXT_SEL_START, |
| 70 view_data.selection_start); | 70 view_data.selection_start); |
| 71 | 71 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 100 void AXViewObjWrapper::SetSelection(int32_t start, int32_t end) { | 100 void AXViewObjWrapper::SetSelection(int32_t start, int32_t end) { |
| 101 // TODO(dtseng): Implement. | 101 // TODO(dtseng): Implement. |
| 102 } | 102 } |
| 103 | 103 |
| 104 void AXViewObjWrapper::ShowContextMenu() { | 104 void AXViewObjWrapper::ShowContextMenu() { |
| 105 view_->ShowContextMenu(view_->bounds().CenterPoint(), | 105 view_->ShowContextMenu(view_->bounds().CenterPoint(), |
| 106 ui::MENU_SOURCE_KEYBOARD); | 106 ui::MENU_SOURCE_KEYBOARD); |
| 107 } | 107 } |
| 108 | 108 |
| 109 } // namespace views | 109 } // namespace views |
| OLD | NEW |