| 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 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 if (!child) | 438 if (!child) |
| 439 return E_INVALIDARG; | 439 return E_INVALIDARG; |
| 440 | 440 |
| 441 gfx::Point point(x_left, y_top); | 441 gfx::Point point(x_left, y_top); |
| 442 if (!GetScreenBoundsRect().Contains(point)) { | 442 if (!GetScreenBoundsRect().Contains(point)) { |
| 443 // Return S_FALSE and VT_EMPTY when outside the object's boundaries. | 443 // Return S_FALSE and VT_EMPTY when outside the object's boundaries. |
| 444 child->vt = VT_EMPTY; | 444 child->vt = VT_EMPTY; |
| 445 return S_FALSE; | 445 return S_FALSE; |
| 446 } | 446 } |
| 447 | 447 |
| 448 BrowserAccessibility* result = BrowserAccessibilityForPoint(point); | 448 BrowserAccessibility* result = manager()->CachingAsyncHitTest(point); |
| 449 if (result == this) { | 449 if (result == this) { |
| 450 // Point is within this object. | 450 // Point is within this object. |
| 451 child->vt = VT_I4; | 451 child->vt = VT_I4; |
| 452 child->lVal = CHILDID_SELF; | 452 child->lVal = CHILDID_SELF; |
| 453 } else { | 453 } else { |
| 454 child->vt = VT_DISPATCH; | 454 child->vt = VT_DISPATCH; |
| 455 child->pdispVal = ToBrowserAccessibilityWin(result)->NewReference(); | 455 child->pdispVal = ToBrowserAccessibilityWin(result)->NewReference(); |
| 456 } | 456 } |
| 457 return S_OK; | 457 return S_OK; |
| 458 } | 458 } |
| (...skipping 5069 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5528 return static_cast<BrowserAccessibilityWin*>(obj); | 5528 return static_cast<BrowserAccessibilityWin*>(obj); |
| 5529 } | 5529 } |
| 5530 | 5530 |
| 5531 const BrowserAccessibilityWin* | 5531 const BrowserAccessibilityWin* |
| 5532 ToBrowserAccessibilityWin(const BrowserAccessibility* obj) { | 5532 ToBrowserAccessibilityWin(const BrowserAccessibility* obj) { |
| 5533 DCHECK(!obj || obj->IsNative()); | 5533 DCHECK(!obj || obj->IsNative()); |
| 5534 return static_cast<const BrowserAccessibilityWin*>(obj); | 5534 return static_cast<const BrowserAccessibilityWin*>(obj); |
| 5535 } | 5535 } |
| 5536 | 5536 |
| 5537 } // namespace content | 5537 } // namespace content |
| OLD | NEW |