Skip to content

Commit

Permalink
Merge pull request #14 from drieks/chromium11
Browse files Browse the repository at this point in the history
WindowDelegate onResizeRequested(win, x, y, w, h) support
  • Loading branch information
ewencp committed Feb 20, 2012
2 parents 196ff0a + eb686ec commit 9f3b3dc
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
20 changes: 20 additions & 0 deletions include/berkelium/WindowDelegate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
7 changes: 7 additions & 0 deletions src/WindowImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions src/WindowImpl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 9f3b3dc

Please sign in to comment.