| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/accessibility/browser_accessibility_win.h" | 5 #include "content/browser/accessibility/browser_accessibility_win.h" |
| 6 | 6 |
| 7 #include <UIAutomationClient.h> | 7 #include <UIAutomationClient.h> |
| 8 #include <UIAutomationCoreApi.h> | 8 #include <UIAutomationCoreApi.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 4057 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4068 return -1; | 4068 return -1; |
| 4069 | 4069 |
| 4070 int focus_offset = manager()->GetTreeData().sel_focus_offset; | 4070 int focus_offset = manager()->GetTreeData().sel_focus_offset; |
| 4071 return GetHypertextOffsetFromEndpoint(*focus_object, focus_offset); | 4071 return GetHypertextOffsetFromEndpoint(*focus_object, focus_offset); |
| 4072 } | 4072 } |
| 4073 | 4073 |
| 4074 void BrowserAccessibilityWin::GetSelectionOffsets( | 4074 void BrowserAccessibilityWin::GetSelectionOffsets( |
| 4075 int* selection_start, int* selection_end) const { | 4075 int* selection_start, int* selection_end) const { |
| 4076 DCHECK(selection_start && selection_end); | 4076 DCHECK(selection_start && selection_end); |
| 4077 | 4077 |
| 4078 if (IsSimpleTextControl() && | 4078 if (HasState(ui::AX_STATE_EDITABLE) && |
| 4079 !HasState(ui::AX_STATE_RICHLY_EDITABLE) && |
| 4079 GetIntAttribute(ui::AX_ATTR_TEXT_SEL_START, selection_start) && | 4080 GetIntAttribute(ui::AX_ATTR_TEXT_SEL_START, selection_start) && |
| 4080 GetIntAttribute(ui::AX_ATTR_TEXT_SEL_END, selection_end)) { | 4081 GetIntAttribute(ui::AX_ATTR_TEXT_SEL_END, selection_end)) { |
| 4081 return; | 4082 return; |
| 4082 } | 4083 } |
| 4083 | 4084 |
| 4084 *selection_start = GetSelectionAnchor(); | 4085 *selection_start = GetSelectionAnchor(); |
| 4085 *selection_end = GetSelectionFocus(); | 4086 *selection_end = GetSelectionFocus(); |
| 4086 if (*selection_start < 0 || *selection_end < 0) | 4087 if (*selection_start < 0 || *selection_end < 0) |
| 4087 return; | 4088 return; |
| 4088 | 4089 |
| (...skipping 854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4943 return static_cast<BrowserAccessibilityWin*>(obj); | 4944 return static_cast<BrowserAccessibilityWin*>(obj); |
| 4944 } | 4945 } |
| 4945 | 4946 |
| 4946 const BrowserAccessibilityWin* | 4947 const BrowserAccessibilityWin* |
| 4947 ToBrowserAccessibilityWin(const BrowserAccessibility* obj) { | 4948 ToBrowserAccessibilityWin(const BrowserAccessibility* obj) { |
| 4948 DCHECK(!obj || obj->IsNative()); | 4949 DCHECK(!obj || obj->IsNative()); |
| 4949 return static_cast<const BrowserAccessibilityWin*>(obj); | 4950 return static_cast<const BrowserAccessibilityWin*>(obj); |
| 4950 } | 4951 } |
| 4951 | 4952 |
| 4952 } // namespace content | 4953 } // namespace content |
| OLD | NEW |