mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-01-16 20:02:24 +01:00
8aac23386e
- Implement CefRequestHandler::OnBeforeBrowse using NavigationThrottle instead of ResourceThrottle (see http://crbug.com/537634). The CefRequest object passed to OnBeforeBrowse will no longer have an associated request identifier. - Mac: Remove additional helper apps which are no longer required (see http://crbug.com/520680) - Remove the UR_FLAG_REPORT_RAW_HEADERS flag which is no longer supported (see http://crbug.com/517114) - Remove the CefBrowserSettings.java parameter. Java is an NPAPI plugin and NPAPI plugins are no longer supported (see http://crbug.com/470301#c11) - Add CefFormatUrlForSecurityDisplay function in cef_parser.h - Fix crash when passing `--disable-extensions` command-line flag (issue #1721) - Linux: Fix NSS handler loading (issue #1727)
79 lines
3.3 KiB
Diff
79 lines
3.3 KiB
Diff
diff --git public/renderer/content_renderer_client.cc public/renderer/content_renderer_client.cc
|
|
index e09e803..ff26996 100644
|
|
--- public/renderer/content_renderer_client.cc
|
|
+++ public/renderer/content_renderer_client.cc
|
|
@@ -98,6 +98,18 @@ bool ContentRendererClient::AllowPopup() {
|
|
return false;
|
|
}
|
|
|
|
+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;
|
|
+}
|
|
+
|
|
bool ContentRendererClient::ShouldFork(blink::WebLocalFrame* frame,
|
|
const GURL& url,
|
|
const std::string& http_method,
|
|
diff --git public/renderer/content_renderer_client.h public/renderer/content_renderer_client.h
|
|
index df8d501..f3a2068 100644
|
|
--- public/renderer/content_renderer_client.h
|
|
+++ public/renderer/content_renderer_client.h
|
|
@@ -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"
|
|
|
|
@@ -191,6 +193,17 @@ class CONTENT_EXPORT ContentRendererClient {
|
|
// Returns true if a popup window should be allowed.
|
|
virtual bool AllowPopup();
|
|
|
|
+ // 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);
|
|
+
|
|
// 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
|
|
// header will be send for the navigation. Otherwise, the referrer header is
|
|
diff --git renderer/render_frame_impl.cc renderer/render_frame_impl.cc
|
|
index ff5d269..6ca4948 100644
|
|
--- renderer/render_frame_impl.cc
|
|
+++ renderer/render_frame_impl.cc
|
|
@@ -4274,6 +4274,19 @@ void RenderFrameImpl::OnFailedNavigation(
|
|
WebNavigationPolicy RenderFrameImpl::DecidePolicyForNavigation(
|
|
RenderFrame* render_frame,
|
|
const NavigationPolicyInfo& info) {
|
|
+ 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;
|
|
+ }
|
|
+
|
|
Referrer referrer(RenderViewImpl::GetReferrerFromRequest(info.frame,
|
|
info.urlRequest));
|
|
|