diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-05 20:00:22 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-05 20:00:22 +0000 |
commit | c88a70fe5a69daf5d3d6e0599ed273d160b55c41 (patch) | |
tree | b0c2303575c6f9d5f6d42e1716fbdc5decdd139e /webkit | |
parent | 0302e4ac5907fcdaafbf2a883b29496032c0db19 (diff) | |
download | chromium_src-c88a70fe5a69daf5d3d6e0599ed273d160b55c41.zip chromium_src-c88a70fe5a69daf5d3d6e0599ed273d160b55c41.tar.gz chromium_src-c88a70fe5a69daf5d3d6e0599ed273d160b55c41.tar.bz2 |
Plumb the creator URL for popups up to the browser. We don't yet use this for anything; it will be used for whitelisting popups by hostname.
BUG=11440
Review URL: http://codereview.chromium.org/105004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15326 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/glue/chrome_client_impl.cc | 9 | ||||
-rw-r--r-- | webkit/glue/inspector_client_impl.cc | 2 | ||||
-rw-r--r-- | webkit/glue/webview_delegate.h | 8 | ||||
-rwxr-xr-x | webkit/tools/test_shell/test_webview_delegate.cc | 3 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_webview_delegate.h | 4 |
5 files changed, 20 insertions, 6 deletions
diff --git a/webkit/glue/chrome_client_impl.cc b/webkit/glue/chrome_client_impl.cc index 9a823a9..e410805 100644 --- a/webkit/glue/chrome_client_impl.cc +++ b/webkit/glue/chrome_client_impl.cc @@ -9,6 +9,7 @@ MSVC_PUSH_WARNING_LEVEL(0); #include "Console.h" #include "Cursor.h" +#include "DocumentLoader.h" #include "FloatRect.h" #include "FileChooser.h" #include "FrameLoadRequest.h" @@ -170,8 +171,14 @@ WebCore::Page* ChromeClientImpl::createWindow( return NULL; bool user_gesture = frame->script()->processingUserGesture(); + + const std::string security_origin(webkit_glue::StringToStdString( + frame->document()->securityOrigin()->toString())); + GURL creator_url(security_origin); WebViewImpl* new_view = static_cast<WebViewImpl*>( - delegate->CreateWebView(webview_, user_gesture)); + delegate->CreateWebView(webview_, user_gesture, + (creator_url.is_valid() && creator_url.IsStandard()) ? + creator_url : GURL())); if (!new_view) return NULL; diff --git a/webkit/glue/inspector_client_impl.cc b/webkit/glue/inspector_client_impl.cc index ae6a57e..1ddae85 100644 --- a/webkit/glue/inspector_client_impl.cc +++ b/webkit/glue/inspector_client_impl.cc @@ -62,7 +62,7 @@ Page* WebInspectorClient::createPage() { if (!delegate) return NULL; inspector_web_view_ = static_cast<WebViewImpl*>( - delegate->CreateWebView(inspected_web_view_, true)); + delegate->CreateWebView(inspected_web_view_, true, GURL())); if (!inspector_web_view_) return NULL; diff --git a/webkit/glue/webview_delegate.h b/webkit/glue/webview_delegate.h index 29c31be..dbaf3b8 100644 --- a/webkit/glue/webview_delegate.h +++ b/webkit/glue/webview_delegate.h @@ -99,8 +99,12 @@ class WebViewDelegate : virtual public WebWidgetDelegate { // made visible until the new WebView's Delegate has its Show method called. // The returned WebView pointer is assumed to be owned by the host window, // and the caller of CreateWebView should not release the given WebView. - // user_gesture is true if a user action initiated this call. - virtual WebView* CreateWebView(WebView* webview, bool user_gesture) { + // |user_gesture| is true if a user action initiated this call. + // |creator_url|, if nonempty, holds the security origin of the page creating + // this WebView. + virtual WebView* CreateWebView(WebView* webview, + bool user_gesture, + const GURL& creator_url) { return NULL; } diff --git a/webkit/tools/test_shell/test_webview_delegate.cc b/webkit/tools/test_shell/test_webview_delegate.cc index 4bf5601..93d498c 100755 --- a/webkit/tools/test_shell/test_webview_delegate.cc +++ b/webkit/tools/test_shell/test_webview_delegate.cc @@ -105,7 +105,8 @@ const char* WebNavigationTypeToString(WebNavigationType type) { // WebViewDelegate ----------------------------------------------------------- WebView* TestWebViewDelegate::CreateWebView(WebView* webview, - bool user_gesture) { + bool user_gesture, + const GURL& creator_url) { return shell_->CreateWebView(webview); } diff --git a/webkit/tools/test_shell/test_webview_delegate.h b/webkit/tools/test_shell/test_webview_delegate.h index 79fd25d..0c5ef3b 100644 --- a/webkit/tools/test_shell/test_webview_delegate.h +++ b/webkit/tools/test_shell/test_webview_delegate.h @@ -77,7 +77,9 @@ class TestWebViewDelegate : public base::RefCounted<TestWebViewDelegate>, virtual ~TestWebViewDelegate(); // WebViewDelegate - virtual WebView* CreateWebView(WebView* webview, bool user_gesture); + virtual WebView* CreateWebView(WebView* webview, + bool user_gesture, + const GURL& creator_url); virtual WebWidget* CreatePopupWidget(WebView* webview, bool activatable); virtual WebPluginDelegate* CreatePluginDelegate( WebView* webview, |