| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 <atlbase.h> | 5 #include <atlbase.h> |
| 6 #include <atlcom.h> | 6 #include <atlcom.h> |
| 7 #include <limits.h> | 7 #include <limits.h> |
| 8 #include <oleacc.h> | 8 #include <oleacc.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 // Keep track of objects that are a target of an alert event. | 238 // Keep track of objects that are a target of an alert event. |
| 239 if (event_type == ui::AX_EVENT_ALERT) | 239 if (event_type == ui::AX_EVENT_ALERT) |
| 240 AddAlertTarget(); | 240 AddAlertTarget(); |
| 241 } | 241 } |
| 242 | 242 |
| 243 int AXPlatformNodeWin::GetIndexInParent() { | 243 int AXPlatformNodeWin::GetIndexInParent() { |
| 244 base::win::ScopedComPtr<IDispatch> parent_dispatch; | 244 base::win::ScopedComPtr<IDispatch> parent_dispatch; |
| 245 base::win::ScopedComPtr<IAccessible> parent_accessible; | 245 base::win::ScopedComPtr<IAccessible> parent_accessible; |
| 246 if (S_OK != get_accParent(parent_dispatch.Receive())) | 246 if (S_OK != get_accParent(parent_dispatch.Receive())) |
| 247 return -1; | 247 return -1; |
| 248 if (S_OK != parent_dispatch.QueryInterface(parent_accessible.Receive())) | 248 if (S_OK != parent_dispatch.CopyTo(parent_accessible.Receive())) |
| 249 return -1; | 249 return -1; |
| 250 | 250 |
| 251 LONG child_count = 0; | 251 LONG child_count = 0; |
| 252 if (S_OK != parent_accessible->get_accChildCount(&child_count)) | 252 if (S_OK != parent_accessible->get_accChildCount(&child_count)) |
| 253 return -1; | 253 return -1; |
| 254 for (LONG index = 1; index <= child_count; ++index) { | 254 for (LONG index = 1; index <= child_count; ++index) { |
| 255 base::win::ScopedVariant childid_index(index); | 255 base::win::ScopedVariant childid_index(index); |
| 256 base::win::ScopedComPtr<IDispatch> child_dispatch; | 256 base::win::ScopedComPtr<IDispatch> child_dispatch; |
| 257 base::win::ScopedComPtr<IAccessible> child_accessible; | 257 base::win::ScopedComPtr<IAccessible> child_accessible; |
| 258 if (S_OK == parent_accessible->get_accChild(childid_index, | 258 if (S_OK == parent_accessible->get_accChild(childid_index, |
| 259 child_dispatch.Receive()) && | 259 child_dispatch.Receive()) && |
| 260 S_OK == child_dispatch.QueryInterface(child_accessible.Receive())) { | 260 S_OK == child_dispatch.CopyTo(child_accessible.Receive())) { |
| 261 if (child_accessible.Get() == this) | 261 if (child_accessible.Get() == this) |
| 262 return index - 1; | 262 return index - 1; |
| 263 } | 263 } |
| 264 } | 264 } |
| 265 | 265 |
| 266 return -1; | 266 return -1; |
| 267 } | 267 } |
| 268 | 268 |
| 269 // | 269 // |
| 270 // IAccessible implementation. | 270 // IAccessible implementation. |
| (...skipping 1019 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1290 | 1290 |
| 1291 AXPlatformNodeBase* base = | 1291 AXPlatformNodeBase* base = |
| 1292 FromNativeViewAccessible(node->GetNativeViewAccessible()); | 1292 FromNativeViewAccessible(node->GetNativeViewAccessible()); |
| 1293 if (base && !IsDescendant(base)) | 1293 if (base && !IsDescendant(base)) |
| 1294 base = nullptr; | 1294 base = nullptr; |
| 1295 | 1295 |
| 1296 return static_cast<AXPlatformNodeWin*>(base); | 1296 return static_cast<AXPlatformNodeWin*>(base); |
| 1297 } | 1297 } |
| 1298 | 1298 |
| 1299 } // namespace ui | 1299 } // namespace ui |
| OLD | NEW |