2014-09-04 19:53:40 +02:00
|
|
|
diff --git public/renderer/content_renderer_client.cc public/renderer/content_renderer_client.cc
|
2015-08-14 16:41:08 +02:00
|
|
|
index 95af2f7..c7270f1 100644
|
2014-09-04 19:53:40 +02:00
|
|
|
--- public/renderer/content_renderer_client.cc
|
|
|
|
+++ public/renderer/content_renderer_client.cc
|
2015-08-14 16:41:08 +02:00
|
|
|
@@ -101,6 +101,18 @@ bool ContentRendererClient::AllowPopup() {
|
2013-12-17 23:04:35 +01:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2015-08-14 16:41:08 +02:00
|
|
|
+bool ContentRendererClient::HandleNavigation(
|
|
|
|
+ RenderFrame* render_frame,
|
|
|
|
+ DocumentState* document_state,
|
|
|
|
+ int opener_id,
|
|
|
|
+ blink::WebFrame* frame,
|
|
|
|
+ const blink::WebURLRequest& request,
|
|
|
|
+ blink::WebNavigationType type,
|
|
|
|
+ blink::WebNavigationPolicy default_policy,
|
|
|
|
+ bool is_redirect) {
|
|
|
|
+ return false;
|
|
|
|
+}
|
|
|
|
+
|
2015-07-24 02:06:56 +02:00
|
|
|
bool ContentRendererClient::ShouldFork(blink::WebLocalFrame* frame,
|
2013-12-17 23:04:35 +01:00
|
|
|
const GURL& url,
|
2015-08-14 16:41:08 +02:00
|
|
|
const std::string& http_method,
|
2014-09-04 19:53:40 +02:00
|
|
|
diff --git public/renderer/content_renderer_client.h public/renderer/content_renderer_client.h
|
2015-08-14 16:41:08 +02:00
|
|
|
index ebb7f44..3f77142 100644
|
2014-09-04 19:53:40 +02:00
|
|
|
--- public/renderer/content_renderer_client.h
|
|
|
|
+++ public/renderer/content_renderer_client.h
|
2015-08-14 16:41:08 +02:00
|
|
|
@@ -16,6 +16,8 @@
|
|
|
|
#include "base/strings/string16.h"
|
|
|
|
#include "content/public/common/content_client.h"
|
|
|
|
#include "third_party/WebKit/public/platform/WebPageVisibilityState.h"
|
|
|
|
+#include "third_party/WebKit/public/web/WebNavigationPolicy.h"
|
|
|
|
+#include "third_party/WebKit/public/web/WebNavigationType.h"
|
|
|
|
#include "ui/base/page_transition_types.h"
|
|
|
|
#include "v8/include/v8.h"
|
|
|
|
|
|
|
|
@@ -196,6 +198,17 @@ class CONTENT_EXPORT ContentRendererClient {
|
2013-12-17 23:04:35 +01:00
|
|
|
// Returns true if a popup window should be allowed.
|
|
|
|
virtual bool AllowPopup();
|
|
|
|
|
2015-08-14 16:41:08 +02:00
|
|
|
+ // Returns true if the navigation was handled by the embedder and should be
|
|
|
|
+ // ignored by WebKit. This method is used by CEF and android_webview.
|
|
|
|
+ virtual bool HandleNavigation(RenderFrame* render_frame,
|
|
|
|
+ DocumentState* document_state,
|
|
|
|
+ int opener_id,
|
|
|
|
+ blink::WebFrame* frame,
|
|
|
|
+ const blink::WebURLRequest& request,
|
|
|
|
+ blink::WebNavigationType type,
|
|
|
|
+ blink::WebNavigationPolicy default_policy,
|
|
|
|
+ bool is_redirect);
|
|
|
|
+
|
2013-12-17 23:04:35 +01:00
|
|
|
// Returns true if we should fork a new process for the given navigation.
|
|
|
|
// If |send_referrer| is set to false (which is the default), no referrer
|
2015-08-14 16:41:08 +02:00
|
|
|
// header will be send for the navigation. Otherwise, the referrer header is
|
2014-09-04 19:53:40 +02:00
|
|
|
diff --git renderer/render_frame_impl.cc renderer/render_frame_impl.cc
|
2015-08-14 16:41:08 +02:00
|
|
|
index 05e6ad6..4c02fc8 100644
|
2014-09-04 19:53:40 +02:00
|
|
|
--- renderer/render_frame_impl.cc
|
|
|
|
+++ renderer/render_frame_impl.cc
|
2015-08-14 16:41:08 +02:00
|
|
|
@@ -4195,6 +4195,19 @@ void RenderFrameImpl::OnFailedNavigation(
|
2014-09-04 19:53:40 +02:00
|
|
|
WebNavigationPolicy RenderFrameImpl::DecidePolicyForNavigation(
|
|
|
|
RenderFrame* render_frame,
|
|
|
|
const NavigationPolicyInfo& info) {
|
2015-08-14 16:41:08 +02:00
|
|
|
+ if (info.urlRequest.url() != GURL(kSwappedOutURL) &&
|
|
|
|
+ GetContentClient()->renderer()->HandleNavigation(
|
|
|
|
+ render_frame,
|
|
|
|
+ static_cast<DocumentState*>(info.extraData),
|
|
|
|
+ render_view_->opener_id_,
|
|
|
|
+ info.frame,
|
|
|
|
+ info.urlRequest,
|
|
|
|
+ info.navigationType,
|
|
|
|
+ info.defaultPolicy,
|
|
|
|
+ info.isRedirect)) {
|
|
|
|
+ return blink::WebNavigationPolicyIgnore;
|
|
|
|
+ }
|
|
|
|
+
|
2014-09-04 19:53:40 +02:00
|
|
|
Referrer referrer(RenderViewImpl::GetReferrerFromRequest(info.frame,
|
|
|
|
info.urlRequest));
|
2015-08-14 16:41:08 +02:00
|
|
|
|