From 0d8ea70525f3c0805b0a474838917d0d1b5cd6a9 Mon Sep 17 00:00:00 2001 From: "ben@chromium.org" Date: Tue, 14 Oct 2008 17:03:07 +0000 Subject: Replace View::GetBounds(CRect* bounds) const; with gfx::Rect bounds() const. http://crbug.com/2186 Review URL: http://codereview.chromium.org/7136 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3348 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/views/accessibility/view_accessibility.cc | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'chrome/views/accessibility') diff --git a/chrome/views/accessibility/view_accessibility.cc b/chrome/views/accessibility/view_accessibility.cc index 2790bb1..259eb5c 100644 --- a/chrome/views/accessibility/view_accessibility.cc +++ b/chrome/views/accessibility/view_accessibility.cc @@ -446,7 +446,7 @@ STDMETHODIMP ViewAccessibility::accLocation(LONG* x_left, LONG* y_top, return E_INVALIDARG; } - CRect view_bounds(0, 0, 0, 0); + gfx::Rect view_bounds; // Retrieving the parent View to be used for converting from view-to-screen // coordinates. ChromeViews::View* parent = view_->GetParent(); @@ -458,25 +458,26 @@ STDMETHODIMP ViewAccessibility::accLocation(LONG* x_left, LONG* y_top, if (var_id.lVal == CHILDID_SELF) { // Retrieve active View's bounds. - view_->GetBounds(&view_bounds); + view_bounds = view_->bounds(); } else { // Check to see if child is out-of-bounds. if (!IsValidChild((var_id.lVal - 1), view_)) { return E_INVALIDARG; } // Retrieve child bounds. - view_->GetChildViewAt(var_id.lVal - 1)->GetBounds(&view_bounds); + view_bounds = view_->GetChildViewAt(var_id.lVal - 1)->bounds(); // Parent View is current View. parent = view_; } - if (!view_bounds.IsRectNull()) { - *width = view_bounds.Width(); - *height = view_bounds.Height(); + if (!view_bounds.IsEmpty()) { + *width = view_bounds.width(); + *height = view_bounds.height(); - ChromeViews::View::ConvertPointToScreen(parent, &view_bounds.TopLeft()); - *x_left = view_bounds.left; - *y_top = view_bounds.top; + CPoint topleft = view_bounds.origin().ToPOINT(); + ChromeViews::View::ConvertPointToScreen(parent, &topleft); + *x_left = topleft.x; + *y_top = topleft.y; } else { return E_FAIL; } -- cgit v1.1