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

Unified Diff: chrome/browser/extensions/extension_service.h

Issue 22944002: Implementation of the "Redirect URLs to Packaged Apps" feature. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 1) Fixed broken redirection for in-page WebKit-initiated navigations. All redirections work now. 2)… Created 7 years, 4 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/extensions/extension_service.h
diff --git a/chrome/browser/extensions/extension_service.h b/chrome/browser/extensions/extension_service.h
index 4fe80206c850947ed8327d380bb1a74a07c80743..09b632cebfc3f3362b4e97d15d153abdddedf971 100644
--- a/chrome/browser/extensions/extension_service.h
+++ b/chrome/browser/extensions/extension_service.h
@@ -38,6 +38,7 @@
#include "chrome/common/extensions/manifest.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
+#include "ipc/ipc_listener.h"
#include "sync/api/string_ordinal.h"
#include "sync/api/sync_change.h"
#include "sync/api/syncable_service.h"
@@ -408,6 +409,25 @@ class ExtensionService
// tab. In this case, |url| is also rewritten to an error URL.
bool ShouldBlockUrlInBrowserTab(GURL* url);
+ // Looks if there is a platform app that's registered itself for handling
+ // a URL pattern(s) that matches |url|. If there is, launches the app, using
+ // the onLaunched event with |url|, |referrerUrl| and the just found
+ // handler ID as launch parameters, and returns true.
+ // Otherwise, returns false.
+ // This way of redirecting URLs is for use in browser-initiated that happen
+ // in the browser process.
+ bool MaybeRedirectUrlToApp(const GURL& url, const GURL& referrer_url);
+
+ // Launches an app with |app_id|, via an onLaunched event with |handler_id|,
+ // |url| and |referrerUrl| as launch parameters. This is registered to listen
+ // to the respective IPC control message from a renderer process to provide
+ // a way of redirecting URLs for navigations initiated within a
+ // renderer (e.g. WebKit-initiated).
+ bool RedirectUrlToApp(const std::string& app_id,
+ const std::string& handler_id,
+ const GURL& url,
+ const GURL& referrer_url);
+
// Called when the initial extensions load has completed.
virtual void OnLoadedInstalledExtensions();

Powered by Google App Engine
This is Rietveld 408576698