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

Unified Diff: content/browser/accessibility/browser_accessibility.cc

Issue 8746022: Split accessible bounds calculation into two methods for Mac & Win (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/accessibility/browser_accessibility.cc
===================================================================
--- content/browser/accessibility/browser_accessibility.cc (revision 111700)
+++ content/browser/accessibility/browser_accessibility.cc (working copy)
@@ -126,14 +126,9 @@
return NULL;
}
-gfx::Rect BrowserAccessibility::GetBoundsRect() {
+gfx::Rect BrowserAccessibility::GetLocalBoundsRect() {
gfx::Rect bounds = location_;
- // Adjust the bounds by the top left corner of the containing view's bounds
- // in screen coordinates.
- gfx::Point top_left = manager_->GetViewBounds().origin();
- bounds.Offset(top_left);
-
// Adjust top left position by the root document's scroll offset.
BrowserAccessibility* root = manager_->GetRoot();
int scroll_x = 0;
@@ -145,13 +140,24 @@
return bounds;
}
+gfx::Rect BrowserAccessibility::GetGlobalBoundsRect() {
+ gfx::Rect bounds = GetLocalBoundsRect();
+
+ // Adjust the bounds by the top left corner of the containing view's bounds
+ // in screen coordinates.
+ gfx::Point top_left = manager_->GetViewBounds().origin();
+ bounds.Offset(top_left);
+
+ return bounds;
+}
+
BrowserAccessibility* BrowserAccessibility::BrowserAccessibilityForPoint(
const gfx::Point& point) {
// Walk the children recursively looking for the BrowserAccessibility that
// most tightly encloses the specified point.
for (int i = children_.size() - 1; i >= 0; --i) {
BrowserAccessibility* child = children_[i];
- if (child->GetBoundsRect().Contains(point))
+ if (child->GetGlobalBoundsRect().Contains(point))
return child->BrowserAccessibilityForPoint(point);
}
return this;
« no previous file with comments | « content/browser/accessibility/browser_accessibility.h ('k') | content/browser/accessibility/browser_accessibility_cocoa.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698