OLD | NEW |
1 // Copyright (c) 2017 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2017 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_com_win.h" | 5 #include "content/browser/accessibility/browser_accessibility_com_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 4085 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4096 | 4096 |
4097 // | 4097 // |
4098 // AXPlatformNode overrides | 4098 // AXPlatformNode overrides |
4099 // | 4099 // |
4100 void BrowserAccessibilityComWin::Destroy() { | 4100 void BrowserAccessibilityComWin::Destroy() { |
4101 // Detach BrowserAccessibilityWin from us. | 4101 // Detach BrowserAccessibilityWin from us. |
4102 owner_ = nullptr; | 4102 owner_ = nullptr; |
4103 AXPlatformNodeWin::Destroy(); | 4103 AXPlatformNodeWin::Destroy(); |
4104 } | 4104 } |
4105 | 4105 |
| 4106 void BrowserAccessibilityComWin::Init(ui::AXPlatformNodeDelegate* delegate) { |
| 4107 owner_ = static_cast<BrowserAccessibilityWin*>(delegate); |
| 4108 AXPlatformNodeBase::Init(delegate); |
| 4109 } |
| 4110 |
4106 std::vector<base::string16> BrowserAccessibilityComWin::ComputeTextAttributes() | 4111 std::vector<base::string16> BrowserAccessibilityComWin::ComputeTextAttributes() |
4107 const { | 4112 const { |
4108 std::vector<base::string16> attributes; | 4113 std::vector<base::string16> attributes; |
4109 | 4114 |
4110 // We include list markers for now, but there might be other objects that are | 4115 // We include list markers for now, but there might be other objects that are |
4111 // auto generated. | 4116 // auto generated. |
4112 // TODO(nektar): Compute what objects are auto-generated in Blink. | 4117 // TODO(nektar): Compute what objects are auto-generated in Blink. |
4113 if (GetOwner()->GetRole() == ui::AX_ROLE_LIST_MARKER) | 4118 if (GetOwner()->GetRole() == ui::AX_ROLE_LIST_MARKER) |
4114 attributes.push_back(L"auto-generated:true"); | 4119 attributes.push_back(L"auto-generated:true"); |
4115 else | 4120 else |
(...skipping 1618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5734 | 5739 |
5735 BrowserAccessibilityComWin* ToBrowserAccessibilityComWin( | 5740 BrowserAccessibilityComWin* ToBrowserAccessibilityComWin( |
5736 BrowserAccessibility* obj) { | 5741 BrowserAccessibility* obj) { |
5737 if (!obj || !obj->IsNative()) | 5742 if (!obj || !obj->IsNative()) |
5738 return nullptr; | 5743 return nullptr; |
5739 auto* result = static_cast<BrowserAccessibilityWin*>(obj)->GetCOM(); | 5744 auto* result = static_cast<BrowserAccessibilityWin*>(obj)->GetCOM(); |
5740 return result; | 5745 return result; |
5741 } | 5746 } |
5742 | 5747 |
5743 } // namespace content | 5748 } // namespace content |
OLD | NEW |