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

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: 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..c8f77e75e51c783a3069d6a891d5eb78e09ca7a4 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"
@@ -137,7 +138,8 @@ class ExtensionService
: public ExtensionServiceInterface,
public extensions::ExternalProviderInterface::VisitorInterface,
public content::NotificationObserver,
- public extensions::Blacklist::Observer {
+ public extensions::Blacklist::Observer,
+ public IPC::Listener {
asargent_no_longer_on_chrome 2013/08/14 18:05:12 Since ExtensionService already does a lot of stuff
sergeygs 2013/08/18 11:40:24 It looks to me now that this attempt wasn't viable
public:
// The name of the directory inside the profile where extensions are
// installed to.
@@ -408,6 +410,16 @@ 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 direct way of redirecting URLs to apps is for use in browser-
+ // initiated that happen in the browser process (compare to
+ // OnRedirectUrlToApp).
+ bool MaybeRedirectUrlToApp(const GURL& url, const GURL& referrer_url);
+
// Called when the initial extensions load has completed.
virtual void OnLoadedInstalledExtensions();
@@ -680,6 +692,9 @@ class ExtensionService
void AddUpdateObserver(extensions::UpdateObserver* observer);
void RemoveUpdateObserver(extensions::UpdateObserver* observer);
+ // IPC::Listener implementation.
+ virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
+
private:
// Contains Extension data that can change during the life of the process,
// but does not persist across restarts.
@@ -827,6 +842,16 @@ class ExtensionService
void ManageBlacklist(const std::set<std::string>& old_blacklisted_ids,
const std::set<std::string>& new_blacklisted_ids);
+ // Launches an app that has |app_id|, using the onLaunched event with
+ // |handler_id|, |url| and |referrerUrl| as launch parameters.
+ // This is registered to listen to the respective IPC control message
+ // from renderer processes to provide a way of redirecting URLs to apps
+ // to them (compare to MaybeRedirectUrlToApp).
+ void OnRedirectUrlToApp(const std::string& app_id,
+ const std::string& handler_id,
+ const GURL& url,
+ const GURL& referrer_url);
+
// Controls if installs are delayed. See comment for |installs_delayed_|.
void set_installs_delayed(bool value) { installs_delayed_ = value; }
bool installs_delayed() const { return installs_delayed_; }

Powered by Google App Engine
This is Rietveld 408576698