summaryrefslogtreecommitdiffstats
path: root/chrome/renderer
diff options
context:
space:
mode:
authormad@chromium.org <mad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-09 20:10:17 +0000
committermad@chromium.org <mad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-09 20:10:17 +0000
commitc3826037cbcb22fe784a10589061eaf084818727 (patch)
tree58da3c893c97e0fd5fee5df93f3dc30db7b93a40 /chrome/renderer
parentb595ba77947ee0881ae8ce16ee92b47d1c48f10a (diff)
downloadchromium_src-c3826037cbcb22fe784a10589061eaf084818727.zip
chromium_src-c3826037cbcb22fe784a10589061eaf084818727.tar.gz
chromium_src-c3826037cbcb22fe784a10589061eaf084818727.tar.bz2
Add a new resizer corner.
To display a resize bitmap and handle the mouse interactions as requested in http://code.google.com/p/chromium/issues/detail?id=458. BUG=458 There are unfortunately two cases to handle and they must be handled separately. The first one is when there are no bottom shelf like the download bar, and the case where there is one. For the case without, we must draw on top of what we receive from WebKit, so we intercept the bitmap in RenderWidgetHostViewWin::OnPaint() so that we can draw the resize corner bitmap on top of it (taking into account whether we are in a right to left language or not). For the case where we have a bottom shelf, we use a dedicated view that we properly layout on top of the bottom shelf view (which takes care of handling the RTL language case for us). Same split for the mouse interactions. Without the bottom shelf, we must deal with it in RenderWidgetHostViewWin::OnMouseEvent() by sending the root window a WM_NCLBUTTONDOWN message with either HTBOTTOMRIGHT or HTBOTTOMLEFT (based on the RTL setting) and let the OS take care of the resizing. IF we have a bottom shelf, we must deal with the mouse interaction in BrowserView::NonClientHitTest() to either return HTBOTTOMRIGHT or HTBOTTOMLEFT (again, based on the RTL setting) and, again, let the OS take care of the resizing. More details here: http://code.google.com/p/chromium/wiki/BrowserViewResizer git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9408 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer')
-rw-r--r--chrome/renderer/render_widget.cc9
-rw-r--r--chrome/renderer/render_widget.h7
2 files changed, 11 insertions, 5 deletions
diff --git a/chrome/renderer/render_widget.cc b/chrome/renderer/render_widget.cc
index 82ca86c..ad801b0 100644
--- a/chrome/renderer/render_widget.cc
+++ b/chrome/renderer/render_widget.cc
@@ -229,11 +229,15 @@ void RenderWidget::OnClose() {
}
}
-void RenderWidget::OnResize(const gfx::Size& new_size) {
+void RenderWidget::OnResize(const gfx::Size& new_size,
+ const gfx::Rect& resizer_rect) {
// During shutdown we can just ignore this message.
if (!webwidget_)
return;
+ // Remember the rect where the resize corner will be drawn.
+ resizer_rect_ = resizer_rect;
+
// TODO(darin): We should not need to reset this here.
is_hidden_ = false;
needs_repainting_on_restore_ = false;
@@ -694,8 +698,7 @@ void RenderWidget::GetRootWindowRect(WebWidget* webwidget, gfx::Rect* rect) {
void RenderWidget::GetRootWindowResizerRect(WebWidget* webwidget,
gfx::Rect* rect) {
- Send(new ViewHostMsg_GetRootWindowResizerRect(routing_id_, host_window_,
- rect));
+ *rect = resizer_rect_;
}
void RenderWidget::OnImeSetInputMode(bool is_active) {
diff --git a/chrome/renderer/render_widget.h b/chrome/renderer/render_widget.h
index 8e37b83..9b5f1c4 100644
--- a/chrome/renderer/render_widget.h
+++ b/chrome/renderer/render_widget.h
@@ -120,7 +120,7 @@ class RenderWidget : public IPC::Channel::Listener,
// RenderWidget IPC message handlers
void OnClose();
void OnCreatingNewAck(gfx::NativeViewId parent);
- void OnResize(const gfx::Size& new_size);
+ void OnResize(const gfx::Size& new_size, const gfx::Rect& resizer_rect);
void OnWasHidden();
void OnWasRestored(bool needs_repainting);
void OnPaintRectAck();
@@ -204,6 +204,9 @@ class RenderWidget : public IPC::Channel::Listener,
// scroll event is pending.
gfx::Rect scroll_rect_;
+ // The area that must be reserved for drawing the resize corner.
+ gfx::Rect resizer_rect_;
+
// The scroll delta for a pending scroll event.
gfx::Point scroll_delta_;
@@ -262,4 +265,4 @@ class RenderWidget : public IPC::Channel::Listener,
DISALLOW_EVIL_CONSTRUCTORS(RenderWidget);
};
-#endif // CHROME_RENDERER_RENDER_WIDGET_H__
+#endif // CHROME_RENDERER_RENDER_WIDGET_H__