diff options
author | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-17 02:03:23 +0000 |
---|---|---|
committer | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-17 02:03:23 +0000 |
commit | 3b680a8b28f63a13f82fbb5e7324fba69c28d75d (patch) | |
tree | 5fdcb6ef14cdf63449e95a50c3e18db90d60923a /chrome/browser | |
parent | 4ec0cd19d253161aa42d0f9583da8f0886dff7c9 (diff) | |
download | chromium_src-3b680a8b28f63a13f82fbb5e7324fba69c28d75d.zip chromium_src-3b680a8b28f63a13f82fbb5e7324fba69c28d75d.tar.gz chromium_src-3b680a8b28f63a13f82fbb5e7324fba69c28d75d.tar.bz2 |
Replace some CRects with gfx::Rect
Review URL: http://codereview.chromium.org/14173
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7126 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/external_tab_container.cc | 7 | ||||
-rw-r--r-- | chrome/browser/external_tab_container.h | 2 | ||||
-rw-r--r-- | chrome/browser/native_ui_contents.cc | 6 | ||||
-rw-r--r-- | chrome/browser/native_ui_contents.h | 2 | ||||
-rw-r--r-- | chrome/browser/views/hung_renderer_view.cc | 8 | ||||
-rw-r--r-- | chrome/browser/views/status_bubble.cc | 4 | ||||
-rw-r--r-- | chrome/browser/web_contents_view_win.cc | 6 |
7 files changed, 17 insertions, 18 deletions
diff --git a/chrome/browser/external_tab_container.cc b/chrome/browser/external_tab_container.cc index b52da83..b074746 100644 --- a/chrome/browser/external_tab_container.cc +++ b/chrome/browser/external_tab_container.cc @@ -235,8 +235,11 @@ void ExternalTabContainer::Observe(NotificationType type, } } -void ExternalTabContainer::GetBounds(CRect *out, bool including_frame) const { - GetWindowRect(out); +void ExternalTabContainer::GetBounds(gfx::Rect* out, + bool including_frame) const { + CRect crect; + GetWindowRect(&crect); + *out = gfx::Rect(crect); } void ExternalTabContainer::MoveToFront(bool should_activate) { diff --git a/chrome/browser/external_tab_container.h b/chrome/browser/external_tab_container.h index 2ae64fbd..17be9b2 100644 --- a/chrome/browser/external_tab_container.h +++ b/chrome/browser/external_tab_container.h @@ -87,7 +87,7 @@ class ExternalTabContainer : public TabContentsDelegate, //////////////////////////////////////////////////////////////////////////////// // views::Widget //////////////////////////////////////////////////////////////////////////////// - virtual void GetBounds(CRect *out, bool including_frame) const; + virtual void GetBounds(gfx::Rect* out, bool including_frame) const; virtual void MoveToFront(bool should_activate); virtual HWND GetHWND() const; virtual void PaintNow(const gfx::Rect& update_rect); diff --git a/chrome/browser/native_ui_contents.cc b/chrome/browser/native_ui_contents.cc index 52e09076..d8098bb 100644 --- a/chrome/browser/native_ui_contents.cc +++ b/chrome/browser/native_ui_contents.cc @@ -197,10 +197,8 @@ void NativeUIContents::OnWindowPosChanged(WINDOWPOS* position) { SetMsgHandled(FALSE); } -void NativeUIContents::GetContainerBounds(gfx::Rect *out) const { - CRect r; - GetBounds(&r, false); - *out = r; +void NativeUIContents::GetContainerBounds(gfx::Rect* out) const { + GetBounds(out, false); } void NativeUIContents::SetPageState(PageState* page_state) { diff --git a/chrome/browser/native_ui_contents.h b/chrome/browser/native_ui_contents.h index 6f194f7..09c9750 100644 --- a/chrome/browser/native_ui_contents.h +++ b/chrome/browser/native_ui_contents.h @@ -40,7 +40,7 @@ class NativeUIContents : public TabContents, virtual void CreateView(); virtual HWND GetContainerHWND() const { return GetHWND(); } - virtual void GetContainerBounds(gfx::Rect *out) const; + virtual void GetContainerBounds(gfx::Rect* out) const; // Sets the page state. NativeUIContents takes ownership of the supplied // PageState. Use a value of NULL to set the state to empty. diff --git a/chrome/browser/views/hung_renderer_view.cc b/chrome/browser/views/hung_renderer_view.cc index 5e5a411..132f7a8 100644 --- a/chrome/browser/views/hung_renderer_view.cc +++ b/chrome/browser/views/hung_renderer_view.cc @@ -398,14 +398,14 @@ gfx::Rect HungRendererWarningView::GetDisplayBounds( CRect contents_bounds; GetWindowRect(contents_hwnd, &contents_bounds); - CRect window_bounds; + gfx::Rect window_bounds; window()->GetBounds(&window_bounds, true); int window_x = contents_bounds.left + - (contents_bounds.Width() - window_bounds.Width()) / 2; + (contents_bounds.Width() - window_bounds.width()) / 2; int window_y = contents_bounds.top + kOverlayContentsOffsetY; - return gfx::Rect(window_x, window_y, window_bounds.Width(), - window_bounds.Height()); + return gfx::Rect(window_x, window_y, window_bounds.width(), + window_bounds.height()); } // static diff --git a/chrome/browser/views/status_bubble.cc b/chrome/browser/views/status_bubble.cc index 680d94a..6f0a375 100644 --- a/chrome/browser/views/status_bubble.cc +++ b/chrome/browser/views/status_bubble.cc @@ -629,9 +629,9 @@ void StatusBubble::SetBounds(int x, int y, int w, int h) { // If the UI layout is RTL, we need to mirror the position of the bubble // relative to the parent. if (l10n_util::GetTextDirection() == l10n_util::RIGHT_TO_LEFT) { - CRect frame_bounds; + gfx::Rect frame_bounds; frame_->GetBounds(&frame_bounds, false); - int mirrored_x = frame_bounds.Width() - x - w; + int mirrored_x = frame_bounds.width() - x - w; position_.SetPoint(mirrored_x, y); } else { position_.SetPoint(x, y); diff --git a/chrome/browser/web_contents_view_win.cc b/chrome/browser/web_contents_view_win.cc index f4e63b9..e97f6ac 100644 --- a/chrome/browser/web_contents_view_win.cc +++ b/chrome/browser/web_contents_view_win.cc @@ -81,10 +81,8 @@ HWND WebContentsViewWin::GetContentHWND() const { return web_contents_->render_widget_host_view()->GetPluginHWND(); } -void WebContentsViewWin::GetContainerBounds(gfx::Rect *out) const { - CRect r; - GetBounds(&r, false); - *out = r; +void WebContentsViewWin::GetContainerBounds(gfx::Rect* out) const { + GetBounds(out, false); } void WebContentsViewWin::StartDragging(const WebDropData& drop_data) { |