| 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/accessibility/platform/ax_platform_node_base.h" | 5 #include "ui/accessibility/platform/ax_platform_node_base.h" |
| 6 | 6 |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "ui/accessibility/ax_action_data.h" |
| 8 #include "ui/accessibility/ax_node_data.h" | 9 #include "ui/accessibility/ax_node_data.h" |
| 9 #include "ui/accessibility/platform/ax_platform_node_delegate.h" | 10 #include "ui/accessibility/platform/ax_platform_node_delegate.h" |
| 10 #include "ui/gfx/geometry/rect_conversions.h" | 11 #include "ui/gfx/geometry/rect_conversions.h" |
| 11 | 12 |
| 12 namespace ui { | 13 namespace ui { |
| 13 | 14 |
| 14 void AXPlatformNodeBase::Init(AXPlatformNodeDelegate* delegate) { | 15 void AXPlatformNodeBase::Init(AXPlatformNodeDelegate* delegate) { |
| 15 delegate_ = delegate; | 16 delegate_ = delegate; |
| 16 } | 17 } |
| 17 | 18 |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 CHECK(!delegate_); | 198 CHECK(!delegate_); |
| 198 } | 199 } |
| 199 | 200 |
| 200 // static | 201 // static |
| 201 AXPlatformNodeBase* AXPlatformNodeBase::FromNativeViewAccessible( | 202 AXPlatformNodeBase* AXPlatformNodeBase::FromNativeViewAccessible( |
| 202 gfx::NativeViewAccessible accessible) { | 203 gfx::NativeViewAccessible accessible) { |
| 203 return static_cast<AXPlatformNodeBase*>( | 204 return static_cast<AXPlatformNodeBase*>( |
| 204 AXPlatformNode::FromNativeViewAccessible(accessible)); | 205 AXPlatformNode::FromNativeViewAccessible(accessible)); |
| 205 } | 206 } |
| 206 | 207 |
| 208 bool AXPlatformNodeBase::SetTextSelection(int start_offset, int end_offset) { |
| 209 ui::AXActionData action_data; |
| 210 action_data.action = ui::AX_ACTION_SET_SELECTION; |
| 211 action_data.anchor_node_id = action_data.focus_node_id = GetData().id; |
| 212 action_data.anchor_offset = start_offset; |
| 213 action_data.focus_offset = end_offset; |
| 214 DCHECK(delegate_); |
| 215 return delegate_->AccessibilityPerformAction(action_data); |
| 216 } |
| 217 |
| 207 } // namespace ui | 218 } // namespace ui |
| OLD | NEW |