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

Unified Diff: mojo/shell/application_manager.h

Issue 1115363002: mojo: Use ContentHandlers to bundle multiple Applications into a module. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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: mojo/shell/application_manager.h
diff --git a/mojo/shell/application_manager.h b/mojo/shell/application_manager.h
index ba1454c7b78a7df90314b748da1c18bd4f7bae02..76a2fcdb1d704bdca9e9b5b15f3486aaf372643a 100644
--- a/mojo/shell/application_manager.h
+++ b/mojo/shell/application_manager.h
@@ -89,6 +89,12 @@ class ApplicationManager {
void RegisterContentHandler(const std::string& mime_type,
const GURL& content_handler_url);
+ // Registers a package redirect. When attempting to load |alias|, it will
+ // instead redirect to |content_handler_package|, which is a content handler
+ // which will be passed the |alias| as the URLResponse::url.
+ void RegisterApplicationPackageRedirect(const GURL& alias,
+ const GURL& content_handler_package);
+
// Sets the default Loader to be used if not overridden by SetLoaderForURL()
// or SetLoaderForScheme().
void set_default_loader(scoped_ptr<ApplicationLoader> loader) {
@@ -128,12 +134,13 @@ class ApplicationManager {
private:
class ContentHandlerConnection;
- typedef std::map<std::string, ApplicationLoader*> SchemeToLoaderMap;
- typedef std::map<GURL, ApplicationLoader*> URLToLoaderMap;
- typedef std::map<Identity, ShellImpl*> IdentityToShellImplMap;
- typedef std::map<GURL, ContentHandlerConnection*> URLToContentHandlerMap;
- typedef std::map<std::string, GURL> MimeTypeToURLMap;
- typedef std::map<GURL, NativeRunnerFactory::Options> URLToNativeOptionsMap;
+ using ApplicationPackagedRedirect = std::map<GURL, GURL>;
+ using IdentityToShellImplMap = std::map<Identity, ShellImpl*>;
+ using MimeTypeToURLMap = std::map<std::string, GURL>;
+ using SchemeToLoaderMap = std::map<std::string, ApplicationLoader*>;
+ using URLToContentHandlerMap = std::map<GURL, ContentHandlerConnection*>;
+ using URLToLoaderMap = std::map<GURL, ApplicationLoader*>;
+ using URLToNativeOptionsMap = std::map<GURL, NativeRunnerFactory::Options>;
void ConnectToApplicationWithParameters(
const GURL& application_url,
@@ -213,6 +220,7 @@ class ApplicationManager {
scoped_ptr<ApplicationLoader> default_loader_;
scoped_ptr<NativeRunnerFactory> native_runner_factory_;
+ ApplicationPackagedRedirect application_package_redirect_;
IdentityToShellImplMap identity_to_shell_impl_;
URLToContentHandlerMap url_to_content_handler_;
// Note: The keys are URLs after mapping and resolving.

Powered by Google App Engine
This is Rietveld 408576698