diff options
author | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-23 09:31:48 +0000 |
---|---|---|
committer | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-23 09:31:48 +0000 |
commit | 453c1b2a4f668714b427ebfec8694cde74c318f6 (patch) | |
tree | c72d841e70532cd5effbd7160a56062504d684d3 /content | |
parent | 3eeacfa69d84798cc6ed94123ae0b86664795cfd (diff) | |
download | chromium_src-453c1b2a4f668714b427ebfec8694cde74c318f6.zip chromium_src-453c1b2a4f668714b427ebfec8694cde74c318f6.tar.gz chromium_src-453c1b2a4f668714b427ebfec8694cde74c318f6.tar.bz2 |
Pass WebWindowFeatures to browser when creating a new view
When blocking popups entirely, we'll need to remember the requested
window features so we can restore the popups if the user choses to do
so.
BUG=38458
R=cdn@chromium.org, jam@chromium.org
Review URL: https://codereview.chromium.org/19963002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@213065 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r-- | content/browser/web_contents/web_contents_impl.cc | 12 | ||||
-rw-r--r-- | content/common/DEPS | 1 | ||||
-rw-r--r-- | content/common/view_messages.h | 23 | ||||
-rw-r--r-- | content/public/browser/web_contents_delegate.cc | 1 | ||||
-rw-r--r-- | content/public/browser/web_contents_delegate.h | 2 | ||||
-rw-r--r-- | content/renderer/render_view_impl.cc | 1 |
6 files changed, 37 insertions, 3 deletions
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc index 163a118..941e17f 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc @@ -1437,9 +1437,15 @@ void WebContentsImpl::CreateNewWindow( int main_frame_route_id, const ViewHostMsg_CreateWindow_Params& params, SessionStorageNamespace* session_storage_namespace) { - if (delegate_ && !delegate_->ShouldCreateWebContents( - this, route_id, params.window_container_type, params.frame_name, - params.target_url, params.disposition, params.user_gesture)) { + if (delegate_ && + !delegate_->ShouldCreateWebContents(this, + route_id, + params.window_container_type, + params.frame_name, + params.target_url, + params.disposition, + params.features, + params.user_gesture)) { GetRenderViewHost()->GetProcess()->ResumeRequestsForView(route_id); GetRenderViewHost()->GetProcess()->ResumeRequestsForView( main_frame_route_id); diff --git a/content/common/DEPS b/content/common/DEPS index afff5e3..2e11e26 100644 --- a/content/common/DEPS +++ b/content/common/DEPS @@ -39,6 +39,7 @@ include_rules = [ "+third_party/WebKit/public/web/WebPopupType.h", "+third_party/WebKit/public/web/WebScreenInfo.h", "+third_party/WebKit/public/web/WebTextDirection.h", + "+third_party/WebKit/public/web/WebWindowFeatures.h", # These should be burned down. http://crbug.com/237267 "!third_party/WebKit/public/platform/WebHTTPBody.h", diff --git a/content/common/view_messages.h b/content/common/view_messages.h index bdf9c2f..ecf8c3f 100644 --- a/content/common/view_messages.h +++ b/content/common/view_messages.h @@ -49,6 +49,7 @@ #include "third_party/WebKit/public/web/WebPopupType.h" #include "third_party/WebKit/public/web/WebScreenInfo.h" #include "third_party/WebKit/public/web/WebTextDirection.h" +#include "third_party/WebKit/public/web/WebWindowFeatures.h" #include "third_party/skia/include/core/SkBitmap.h" #include "ui/base/ime/text_input_mode.h" #include "ui/base/ime/text_input_type.h" @@ -313,6 +314,25 @@ IPC_STRUCT_TRAITS_BEGIN(content::BrowserRenderingStats) IPC_STRUCT_TRAITS_MEMBER(total_scroll_update_latency) IPC_STRUCT_TRAITS_END() +IPC_STRUCT_TRAITS_BEGIN(WebKit::WebWindowFeatures) + IPC_STRUCT_TRAITS_MEMBER(x) + IPC_STRUCT_TRAITS_MEMBER(xSet) + IPC_STRUCT_TRAITS_MEMBER(y) + IPC_STRUCT_TRAITS_MEMBER(ySet) + IPC_STRUCT_TRAITS_MEMBER(width) + IPC_STRUCT_TRAITS_MEMBER(widthSet) + IPC_STRUCT_TRAITS_MEMBER(height) + IPC_STRUCT_TRAITS_MEMBER(heightSet) + IPC_STRUCT_TRAITS_MEMBER(menuBarVisible) + IPC_STRUCT_TRAITS_MEMBER(statusBarVisible) + IPC_STRUCT_TRAITS_MEMBER(toolBarVisible) + IPC_STRUCT_TRAITS_MEMBER(locationBarVisible) + IPC_STRUCT_TRAITS_MEMBER(scrollbarsVisible) + IPC_STRUCT_TRAITS_MEMBER(resizable) + IPC_STRUCT_TRAITS_MEMBER(fullscreen) + IPC_STRUCT_TRAITS_MEMBER(dialog) +IPC_STRUCT_TRAITS_END() + IPC_STRUCT_BEGIN(ViewHostMsg_CreateWindow_Params) // Routing ID of the view initiating the open. IPC_STRUCT_MEMBER(int, opener_id) @@ -349,6 +369,9 @@ IPC_STRUCT_BEGIN(ViewHostMsg_CreateWindow_Params) // The URL that will be loaded in the new window (empty if none has been // sepcified). IPC_STRUCT_MEMBER(GURL, target_url) + + // The window features to use for the new view. + IPC_STRUCT_MEMBER(WebKit::WebWindowFeatures, features) IPC_STRUCT_END() IPC_STRUCT_BEGIN(ViewHostMsg_CreateWorker_Params) diff --git a/content/public/browser/web_contents_delegate.cc b/content/public/browser/web_contents_delegate.cc index d490122..6f683ba 100644 --- a/content/public/browser/web_contents_delegate.cc +++ b/content/public/browser/web_contents_delegate.cc @@ -128,6 +128,7 @@ bool WebContentsDelegate::ShouldCreateWebContents( const string16& frame_name, const GURL& target_url, WindowOpenDisposition disposition, + const WebKit::WebWindowFeatures& features, bool user_gesture) { return true; } diff --git a/content/public/browser/web_contents_delegate.h b/content/public/browser/web_contents_delegate.h index ac86a62..7acb1ff 100644 --- a/content/public/browser/web_contents_delegate.h +++ b/content/public/browser/web_contents_delegate.h @@ -54,6 +54,7 @@ class Size; namespace WebKit { class WebLayer; +struct WebWindowFeatures; } namespace content { @@ -295,6 +296,7 @@ class CONTENT_EXPORT WebContentsDelegate { const string16& frame_name, const GURL& target_url, WindowOpenDisposition disposition, + const WebKit::WebWindowFeatures& features, bool user_gesture); // Notifies the delegate about the creation of a new WebContents. This diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc index 57799f2..e2cd9d0 100644 --- a/content/renderer/render_view_impl.cc +++ b/content/renderer/render_view_impl.cc @@ -2139,6 +2139,7 @@ WebView* RenderViewImpl::createView( params.disposition = NavigationPolicyToDisposition(policy); if (!request.isNull()) params.target_url = request.url(); + params.features = features; int32 routing_id = MSG_ROUTING_NONE; int32 main_frame_routing_id = MSG_ROUTING_NONE; |