| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 = 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 LOG(ERROR) << "AXViewObjWrapper: AddStringAttribute: AX_ATTR_NAME = \"" |
| 68 << view_data.name << "\""; |
| 67 | 69 |
| 68 if (view_data.selection_start > -1 && view_data.selection_end > -1) { | 70 if (view_data.selection_start > -1 && view_data.selection_end > -1) { |
| 69 out_node_data->AddIntAttribute(ui::AX_ATTR_TEXT_SEL_START, | 71 out_node_data->AddIntAttribute(ui::AX_ATTR_TEXT_SEL_START, |
| 70 view_data.selection_start); | 72 view_data.selection_start); |
| 71 | 73 |
| 72 out_node_data->AddIntAttribute(ui::AX_ATTR_TEXT_SEL_END, | 74 out_node_data->AddIntAttribute(ui::AX_ATTR_TEXT_SEL_END, |
| 73 view_data.selection_end); | 75 view_data.selection_end); |
| 74 } | 76 } |
| 75 } | 77 } |
| 76 | 78 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 100 void AXViewObjWrapper::SetSelection(int32_t start, int32_t end) { | 102 void AXViewObjWrapper::SetSelection(int32_t start, int32_t end) { |
| 101 // TODO(dtseng): Implement. | 103 // TODO(dtseng): Implement. |
| 102 } | 104 } |
| 103 | 105 |
| 104 void AXViewObjWrapper::ShowContextMenu() { | 106 void AXViewObjWrapper::ShowContextMenu() { |
| 105 view_->ShowContextMenu(view_->bounds().CenterPoint(), | 107 view_->ShowContextMenu(view_->bounds().CenterPoint(), |
| 106 ui::MENU_SOURCE_KEYBOARD); | 108 ui::MENU_SOURCE_KEYBOARD); |
| 107 } | 109 } |
| 108 | 110 |
| 109 } // namespace views | 111 } // namespace views |
| OLD | NEW |