Index: chrome/renderer/chrome_content_renderer_client.cc |
diff --git a/chrome/renderer/chrome_content_renderer_client.cc b/chrome/renderer/chrome_content_renderer_client.cc |
index ef9c3fc04d9a306ee5b4af59a4784042814afd79..df31926a55e81079732c13c041440eb6256a0025 100644 |
--- a/chrome/renderer/chrome_content_renderer_client.cc |
+++ b/chrome/renderer/chrome_content_renderer_client.cc |
@@ -80,6 +80,9 @@ |
#include "ppapi/c/private/ppb_nacl_private.h" |
#include "ppapi/c/private/ppb_pdf.h" |
#include "ppapi/shared_impl/ppapi_switches.h" |
+#include "third_party/WebKit/public/platform/WebURL.h" |
+#include "third_party/WebKit/public/platform/WebURLError.h" |
+#include "third_party/WebKit/public/platform/WebURLRequest.h" |
#include "third_party/WebKit/public/web/WebCache.h" |
#include "third_party/WebKit/public/web/WebDataSource.h" |
#include "third_party/WebKit/public/web/WebDocument.h" |
@@ -89,9 +92,7 @@ |
#include "third_party/WebKit/public/web/WebPluginParams.h" |
#include "third_party/WebKit/public/web/WebSecurityOrigin.h" |
#include "third_party/WebKit/public/web/WebSecurityPolicy.h" |
-#include "third_party/WebKit/public/platform/WebURL.h" |
-#include "third_party/WebKit/public/platform/WebURLError.h" |
-#include "third_party/WebKit/public/platform/WebURLRequest.h" |
+#include "third_party/WebKit/public/web/WebUserGestureIndicator.h" |
#include "ui/base/l10n/l10n_util.h" |
#include "ui/base/layout.h" |
#include "ui/base/resource/resource_bundle.h" |
@@ -924,6 +925,22 @@ bool ChromeContentRendererClient::AllowPopup() { |
extensions::Feature::CONTENT_SCRIPT_CONTEXT); |
} |
+// For top-level navigations, tries to find a platform app that has registered |
+// a URL handler matching the URL. If found, delegates further URL processing |
+// to the browser (the browser is supposed to launch the app), and returns true |
+// to cancel navigation on the renderer side. Otherwise, returns false. |
+bool ChromeContentRendererClient::HandleNavigation( |
+ WebKit::WebFrame* frame, |
+ const WebKit::WebURLRequest& request, |
+ WebKit::WebNavigationType type, |
+ WebKit::WebNavigationPolicy default_policy, |
+ bool is_redirect) { |
+ return extension_dispatcher_->MaybeRedirectUrlToApp(frame, |
+ request, |
+ type, |
+ default_policy); |
+} |
+ |
bool ChromeContentRendererClient::ShouldFork(WebFrame* frame, |
const GURL& url, |
const std::string& http_method, |