Permalink
Browse files

WindowDelegate onResizeRequested(win, x, y, w, h) support

  • Loading branch information...
1 parent 196ff0a commit eb686ec74de44b23ae49ec271786c5533b4f29c9 @drieks drieks committed Feb 20, 2012
Showing with 28 additions and 0 deletions.
  1. +20 −0 include/berkelium/WindowDelegate.hpp
  2. +7 −0 src/WindowImpl.cpp
  3. +1 −0 src/WindowImpl.hpp
View
20 include/berkelium/WindowDelegate.hpp
@@ -428,6 +428,26 @@ class BERKELIUM_EXPORT WindowDelegate {
win->filesSelected(NULL);
}
+ /**
+ * Resize of this Window was requested.
+ *
+ * This corresponds to the window.resizeTo() and window.moveTo() APIs, and
+ * the browser may ignore this message.
+ *
+ * \param win Window which should be resized.
+ * \param x Requested x position
+ * \param y Requested y position
+ * \param newWidth Requested width
+ * \param newHeight Requested height
+ */
+ virtual void onResizeRequested(
+ Window *win,
+ int x,
+ int y,
+ int newWidth,
+ int newHeight) {
+ }
+
/**************************
Might want messages for:
- StartDragging(const WebDropData& drop_data,
View
7 src/WindowImpl.cpp
@@ -594,6 +594,7 @@ bool WindowImpl::OnMessageReceived(const IPC::Message& message) {
// OnBlockedOutdatedPlugin)
IPC_MESSAGE_HANDLER(ViewHostMsg_PageContents, OnPageContents)
IPC_MESSAGE_HANDLER(ViewHostMsg_PageTranslated, OnPageTranslated)
+ IPC_MESSAGE_HANDLER(ViewHostMsg_RequestMove, onResizeRequested)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP_EX()
@@ -926,6 +927,12 @@ void WindowImpl::WorkerCrashed(){
}
}
+void WindowImpl::onResizeRequested(gfx::Rect rect) {
+ if (mDelegate) {
+ mDelegate->onResizeRequested(this, rect.x(), rect.y(), rect.width(), rect.height());
+ }
+}
+
void WindowImpl::OnPageContents(
const GURL& url,
int32 page_id,
View
1 src/WindowImpl.hpp
@@ -246,6 +246,7 @@ class WindowImpl :
virtual void ClearInspectorSettings();
virtual void OnUserGesture();
virtual void WorkerCrashed();
+ virtual void onResizeRequested(gfx::Rect rect);
private: /******* Formerly RenderViewHostDelegate::Resource *******/
void OnDidStartProvisionalLoadForFrame(

0 comments on commit eb686ec

Please sign in to comment.