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

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

Issue 11269022: Add Vector2d classes that represent offsets, instead of using Point. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: RenderText fixup Created 8 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/accessibility/browser_accessibility_win.cc
diff --git a/content/browser/accessibility/browser_accessibility_win.cc b/content/browser/accessibility/browser_accessibility_win.cc
index 5696ce2c27717a96ac4910dcdb31e4e3517067bd..71d89082c0e6535110a46f87ec41247db95adde7 100644
--- a/content/browser/accessibility/browser_accessibility_win.cc
+++ b/content/browser/accessibility/browser_accessibility_win.cc
@@ -790,22 +790,18 @@ STDMETHODIMP BrowserAccessibilityWin::scrollToPoint(
if (!instance_active_)
return E_FAIL;
+ gfx::Point scroll_to(x, y);
+
if (coordinate_type == IA2_COORDTYPE_SCREEN_RELATIVE) {
- gfx::Point top_left = manager_->GetViewBounds().origin();
- x -= top_left.x();
- y -= top_left.y();
+ scroll_to -= manager_->GetViewBounds().OffsetFromOrigin();
} else if (coordinate_type == IA2_COORDTYPE_PARENT_RELATIVE) {
- if (parent_) {
- gfx::Rect parent_bounds = parent_->location();
- x += parent_bounds.x();
- y += parent_bounds.y();
- }
+ if (parent_)
+ scroll_to += parent_->location().OffsetFromOrigin();
} else {
return E_INVALIDARG;
}
- gfx::Rect r = location_;
- manager_->ScrollToPoint(*this, gfx::Point(x, y));
+ manager_->ScrollToPoint(*this, scroll_to);
static_cast<BrowserAccessibilityManagerWin*>(manager_)
->TrackScrollingObject(this);

Powered by Google App Engine
This is Rietveld 408576698