Chromium Code Reviews| 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 (HasState(ui::AX_STATE_EDITABLE) && | 4078 if (IsSimpleTextControl() && |
| 4079 !HasState(ui::AX_STATE_RICHLY_EDITABLE) && | |
| 4080 GetIntAttribute(ui::AX_ATTR_TEXT_SEL_START, selection_start) && | 4079 GetIntAttribute(ui::AX_ATTR_TEXT_SEL_START, selection_start) && |
|
dmazzoni
2016/03/21 17:04:02
Will these be set on rich text fields too? Or is i
| |
| 4081 GetIntAttribute(ui::AX_ATTR_TEXT_SEL_END, selection_end)) { | 4080 GetIntAttribute(ui::AX_ATTR_TEXT_SEL_END, selection_end)) { |
| 4082 return; | 4081 return; |
| 4083 } | 4082 } |
| 4084 | 4083 |
| 4085 *selection_start = GetSelectionAnchor(); | 4084 *selection_start = GetSelectionAnchor(); |
| 4086 *selection_end = GetSelectionFocus(); | 4085 *selection_end = GetSelectionFocus(); |
| 4087 if (*selection_start < 0 || *selection_end < 0) | 4086 if (*selection_start < 0 || *selection_end < 0) |
| 4088 return; | 4087 return; |
| 4089 | 4088 |
| 4090 // There are three cases when a selection would start and end on the same | 4089 // There are three cases when a selection would start and end on the same |
| (...skipping 853 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4944 return static_cast<BrowserAccessibilityWin*>(obj); | 4943 return static_cast<BrowserAccessibilityWin*>(obj); |
| 4945 } | 4944 } |
| 4946 | 4945 |
| 4947 const BrowserAccessibilityWin* | 4946 const BrowserAccessibilityWin* |
| 4948 ToBrowserAccessibilityWin(const BrowserAccessibility* obj) { | 4947 ToBrowserAccessibilityWin(const BrowserAccessibility* obj) { |
| 4949 DCHECK(!obj || obj->IsNative()); | 4948 DCHECK(!obj || obj->IsNative()); |
| 4950 return static_cast<const BrowserAccessibilityWin*>(obj); | 4949 return static_cast<const BrowserAccessibilityWin*>(obj); |
| 4951 } | 4950 } |
| 4952 | 4951 |
| 4953 } // namespace content | 4952 } // namespace content |
| OLD | NEW |