Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(946)

Side by Side Diff: content/browser/accessibility/browser_accessibility_win.cc

Issue 2393123002: Implement caching asynchronous accessibility hit testing. (Closed)
Patch Set: Made test more robust Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698