Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(398)

Unified Diff: chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc

Issue 23847004: "Redirecting URLs to Packaged Apps" implementation: revised (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Prevent interception for POSTs sooner; prevent when prerendering. Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc
diff --git a/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc b/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc
index 266d8e1b9ed2def0d49ea851cea7b0bc2193f9df..ca87d1cc3fe4421e7ca9f698e54eff62d3af5072 100644
--- a/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc
+++ b/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc
@@ -72,6 +72,10 @@
#include "chrome/browser/renderer_host/offline_resource_throttle.h"
#endif
+#if !defined(OS_ANDROID) && !defined(OS_IOS)
+#include "chrome/browser/apps/app_url_redirector.h"
+#endif
+
using content::BrowserThread;
using content::RenderViewHost;
using content::ResourceDispatcherHostLoginDelegate;
@@ -262,12 +266,22 @@ void ChromeResourceDispatcherHostDelegate::RequestBeginning(
request->SetPriority(net::IDLE);
}
+#if !defined(OS_ANDROID) && !defined(OS_IOS)
+ // Redirect some navigations to apps that have registered matching URL
+ // handlers ('url_handlers' in the manifest).
+ if (!is_prerendering && resource_type == ResourceType::MAIN_FRAME &&
darin (slow to review) 2013/09/05 23:54:25 I don't think this file should be built in the OS_
sergeygs 2013/09/06 02:51:14 Done. I guess you're right about this file not bui
+ request->method() != "POST") {
+ throttles->push_back(AppUrlRedirector::CreateThrottleFor(request));
not at google - send to devlin 2013/09/06 00:51:30 come to think of it, you should only need to regis
sergeygs 2013/09/06 02:51:14 Sure, I'll test that case. This is registered for
not at google - send to devlin 2013/09/06 03:02:11 As more recently discussed in person, the Extensio
+ }
+#endif
+
#if defined(OS_ANDROID)
if (!is_prerendering && resource_type == ResourceType::MAIN_FRAME) {
throttles->push_back(
InterceptNavigationDelegate::CreateThrottleFor(request));
}
#endif
+
#if defined(OS_CHROMEOS)
if (resource_type == ResourceType::MAIN_FRAME) {
// We check offline first, then check safe browsing so that we still can

Powered by Google App Engine
This is Rietveld 408576698