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

Unified Diff: mojo/shell/application_manager.cc

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: Rename redirect -> alias 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
« no previous file with comments | « mojo/shell/application_manager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/shell/application_manager.cc
diff --git a/mojo/shell/application_manager.cc b/mojo/shell/application_manager.cc
index 3f51008dbddf2018edbd4b7147cd33f1c42d07fe..44a0c0d410501711eeab625b5a592601ac0fb1f9 100644
--- a/mojo/shell/application_manager.cc
+++ b/mojo/shell/application_manager.cc
@@ -313,6 +313,16 @@ void ApplicationManager::HandleFetchCallback(
return;
}
+ auto alias_iter = application_package_alias_.find(app_url);
+ if (alias_iter != application_package_alias_.end()) {
+ URLResponsePtr response(URLResponse::New());
+ response->url = String::From(app_url.spec());
+ LoadWithContentHandler(alias_iter->second,
+ request.Pass(),
+ response.Pass());
+ return;
+ }
+
// TODO(aa): Sanity check that the thing we got looks vaguely like a mojo
// application. That could either mean looking for the platform-specific dll
// header, or looking for some specific mojo signature prepended to the
@@ -370,6 +380,13 @@ void ApplicationManager::RegisterContentHandler(
mime_type_to_url_[mime_type] = content_handler_url;
}
+
+void ApplicationManager::RegisterApplicationPackageAlias(
+ const GURL& alias,
+ const GURL& content_handler_package) {
+ application_package_alias_[alias] = content_handler_package;
+}
+
void ApplicationManager::LoadWithContentHandler(
const GURL& content_handler_url,
InterfaceRequest<Application> application_request,
« no previous file with comments | « mojo/shell/application_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698