summaryrefslogtreecommitdiffstats
path: root/webkit/glue
diff options
context:
space:
mode:
Diffstat (limited to 'webkit/glue')
-rw-r--r--webkit/glue/glue_util.cc7
-rw-r--r--webkit/glue/glue_util.h1
-rw-r--r--webkit/glue/webframeloaderclient_impl.cc4
-rw-r--r--webkit/glue/webview_delegate.h1
4 files changed, 11 insertions, 2 deletions
diff --git a/webkit/glue/glue_util.cc b/webkit/glue/glue_util.cc
index 6829cd5..7b609e04 100644
--- a/webkit/glue/glue_util.cc
+++ b/webkit/glue/glue_util.cc
@@ -79,8 +79,7 @@ GURL KURLToGURL(const WebCore::KURL& url) {
return GURL();
return GURL(spec.data(), spec.length(), url.parsed(), url.isValid());
#else
- const WebCore::String& spec = url.string();
- return GURL(WideToUTF8(StringToStdWString(spec)));
+ return StringToGURL(url.string());
#endif
}
@@ -95,6 +94,10 @@ WebCore::KURL GURLToKURL(const GURL& url) {
#endif
}
+GURL StringToGURL(const WebCore::String& spec) {
+ return GURL(WideToUTF8(StringToStdWString(spec)));
+}
+
// Rect conversions ------------------------------------------------------------
gfx::Rect FromIntRect(const WebCore::IntRect& r) {
diff --git a/webkit/glue/glue_util.h b/webkit/glue/glue_util.h
index d649ccf..ace448b 100644
--- a/webkit/glue/glue_util.h
+++ b/webkit/glue/glue_util.h
@@ -44,6 +44,7 @@ WebCore::String StdStringToString(const std::string& str);
GURL KURLToGURL(const WebCore::KURL& url);
WebCore::KURL GURLToKURL(const GURL& url);
+GURL StringToGURL(const WebCore::String& spec);
gfx::Rect FromIntRect(const WebCore::IntRect& r);
WebCore::IntRect ToIntRect(const gfx::Rect& r);
diff --git a/webkit/glue/webframeloaderclient_impl.cc b/webkit/glue/webframeloaderclient_impl.cc
index 81a6b06..f178554 100644
--- a/webkit/glue/webframeloaderclient_impl.cc
+++ b/webkit/glue/webframeloaderclient_impl.cc
@@ -917,8 +917,12 @@ void WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction(
} else if (disposition == SAVE_TO_DISK) {
policy_action = PolicyDownload;
} else {
+ GURL referrer = webkit_glue::StringToGURL(
+ request.httpHeaderField("Referer"));
+
d->OpenURL(webframe_->webview_impl(),
webkit_glue::KURLToGURL(request.url()),
+ referrer,
disposition);
policy_action = PolicyIgnore;
}
diff --git a/webkit/glue/webview_delegate.h b/webkit/glue/webview_delegate.h
index 15e93ba..c8aa405 100644
--- a/webkit/glue/webview_delegate.h
+++ b/webkit/glue/webview_delegate.h
@@ -133,6 +133,7 @@ class WebViewDelegate : virtual public WebWidgetDelegate {
// This method is called to open a URL in the specified manner.
virtual void OpenURL(WebView* webview, const GURL& url,
+ const GURL& referrer,
WindowOpenDisposition disposition) {
}