summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/external_tab_container.cc7
-rw-r--r--chrome/browser/external_tab_container.h2
-rw-r--r--chrome/browser/native_ui_contents.cc6
-rw-r--r--chrome/browser/native_ui_contents.h2
-rw-r--r--chrome/browser/views/hung_renderer_view.cc8
-rw-r--r--chrome/browser/views/status_bubble.cc4
-rw-r--r--chrome/browser/web_contents_view_win.cc6
-rw-r--r--chrome/views/bitmap_scroll_bar.cc8
-rw-r--r--chrome/views/bitmap_scroll_bar.h4
-rw-r--r--chrome/views/tooltip_manager.cc6
-rw-r--r--chrome/views/view.cc8
-rw-r--r--chrome/views/widget.h8
-rw-r--r--chrome/views/widget_win.cc23
-rw-r--r--chrome/views/widget_win.h2
14 files changed, 45 insertions, 49 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) {
diff --git a/chrome/views/bitmap_scroll_bar.cc b/chrome/views/bitmap_scroll_bar.cc
index 283f987..54b4f28 100644
--- a/chrome/views/bitmap_scroll_bar.cc
+++ b/chrome/views/bitmap_scroll_bar.cc
@@ -527,12 +527,14 @@ enum ScrollBarContextMenuCommands {
ScrollBarContextMenuCommand_ScrollNext
};
-void BitmapScrollBar::ShowContextMenu(View* source, int x, int y,
+void BitmapScrollBar::ShowContextMenu(View* source,
+ int x,
+ int y,
bool is_mouse_gesture) {
Widget* widget = GetWidget();
- CRect widget_bounds;
+ gfx::Rect widget_bounds;
widget->GetBounds(&widget_bounds, true);
- gfx::Point temp_pt(x - widget_bounds.left, y - widget_bounds.top);
+ gfx::Point temp_pt(x - widget_bounds.x(), y - widget_bounds.y());
View::ConvertPointFromWidget(this, &temp_pt);
context_menu_mouse_position_ = IsHorizontal() ? temp_pt.x() : temp_pt.y();
diff --git a/chrome/views/bitmap_scroll_bar.h b/chrome/views/bitmap_scroll_bar.h
index 1c3f46f..499286c 100644
--- a/chrome/views/bitmap_scroll_bar.h
+++ b/chrome/views/bitmap_scroll_bar.h
@@ -106,7 +106,9 @@ class BitmapScrollBar : public ScrollBar,
virtual int GetPosition() const;
// ContextMenuController overrides.
- virtual void ShowContextMenu(View* source, int x, int y,
+ virtual void ShowContextMenu(View* source,
+ int x,
+ int y,
bool is_mouse_gesture);
// Menu::Delegate overrides:
diff --git a/chrome/views/tooltip_manager.cc b/chrome/views/tooltip_manager.cc
index 2e5c00b..095fe32 100644
--- a/chrome/views/tooltip_manager.cc
+++ b/chrome/views/tooltip_manager.cc
@@ -351,10 +351,10 @@ void TooltipManager::OnMouse(UINT u_msg, WPARAM w_param, LPARAM l_param) {
if (u_msg >= WM_NCMOUSEMOVE && u_msg <= WM_NCXBUTTONDBLCLK) {
// NC message coordinates are in screen coordinates.
- CRect frame_bounds;
+ gfx::Rect frame_bounds;
widget_->GetBounds(&frame_bounds, true);
- x -= frame_bounds.left;
- y -= frame_bounds.top;
+ x -= frame_bounds.x();
+ y -= frame_bounds.y();
}
if (u_msg != WM_MOUSEMOVE || last_mouse_x_ != x || last_mouse_y_ != y) {
diff --git a/chrome/views/view.cc b/chrome/views/view.cc
index 823cb3e..07061b3 100644
--- a/chrome/views/view.cc
+++ b/chrome/views/view.cc
@@ -1289,9 +1289,9 @@ void View::ConvertPointToView(View* src, View* dst, gfx::Point* point,
if (src == NULL) {
Widget* widget = dst->GetWidget();
if (widget) {
- CRect b;
+ gfx::Rect b;
widget->GetBounds(&b, false);
- point->SetPoint(point->x() - b.left, point->y() - b.top);
+ point->SetPoint(point->x() - b.x(), point->y() - b.y());
}
}
}
@@ -1327,9 +1327,9 @@ void View::ConvertPointToScreen(View* src, gfx::Point* p) {
Widget* widget = src->GetWidget();
if (widget) {
ConvertPointToWidget(src, p);
- CRect r;
+ gfx::Rect r;
widget->GetBounds(&r, false);
- p->SetPoint(p->x() + r.left, p->y() + r.top);
+ p->SetPoint(p->x() + r.x(), p->y() + r.y());
}
}
diff --git a/chrome/views/widget.h b/chrome/views/widget.h
index 221919d..4192912 100644
--- a/chrome/views/widget.h
+++ b/chrome/views/widget.h
@@ -12,12 +12,6 @@ namespace gfx {
class Rect;
}
-// TODO(maruel): Remove once gfx::Rect is used instead.
-namespace WTL {
-class CRect;
-}
-using WTL::CRect;
-
namespace views {
class RootView;
@@ -48,7 +42,7 @@ class Widget {
// this method returns the client area if including_frame is false and the
// frame bounds otherwise. If the receiving Widget is not a frame,
// including_frame is ignored.
- virtual void GetBounds(CRect *out, bool including_frame) const = 0;
+ virtual void GetBounds(gfx::Rect* out, bool including_frame) const = 0;
// Moves this Widget to the front of the Z-Order If should_activate is TRUE,
// the window should also become the active window.
diff --git a/chrome/views/widget_win.cc b/chrome/views/widget_win.cc
index 31f7a47..0cfc8e5 100644
--- a/chrome/views/widget_win.cc
+++ b/chrome/views/widget_win.cc
@@ -218,20 +218,19 @@ void WidgetWin::SetContentsView(View* view) {
///////////////////////////////////////////////////////////////////////////////
// Widget implementation:
-void WidgetWin::GetBounds(CRect *out, bool including_frame) const {
+void WidgetWin::GetBounds(gfx::Rect* out, bool including_frame) const {
+ CRect crect;
if (including_frame) {
- GetWindowRect(out);
- } else {
- GetClientRect(out);
-
- POINT p = {0, 0};
- ::ClientToScreen(hwnd_, &p);
-
- out->left += p.x;
- out->top += p.y;
- out->right += p.x;
- out->bottom += p.y;
+ GetWindowRect(&crect);
+ *out = gfx::Rect(crect);
+ return;
}
+
+ GetClientRect(&crect);
+ POINT p = {0, 0};
+ ::ClientToScreen(hwnd_, &p);
+ out->SetRect(crect.left + p.x, crect.top + p.y,
+ crect.Width(), crect.Height());
}
void WidgetWin::MoveToFront(bool should_activate) {
diff --git a/chrome/views/widget_win.h b/chrome/views/widget_win.h
index 40c1f65..e16c3f6 100644
--- a/chrome/views/widget_win.h
+++ b/chrome/views/widget_win.h
@@ -240,7 +240,7 @@ class WidgetWin : public Widget,
END_MSG_MAP()
// Overridden from 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);