Index: mojo/shell/application_manager.cc |
diff --git a/mojo/shell/application_manager.cc b/mojo/shell/application_manager.cc |
index 3f51008dbddf2018edbd4b7147cd33f1c42d07fe..86d1ba6e300d7606ffca7c934d9704fb454d33e7 100644 |
--- a/mojo/shell/application_manager.cc |
+++ b/mojo/shell/application_manager.cc |
@@ -313,6 +313,16 @@ void ApplicationManager::HandleFetchCallback( |
return; |
} |
+ auto redirect_iter = application_package_redirect_.find(app_url); |
+ if (redirect_iter != application_package_redirect_.end()) { |
+ URLResponsePtr response(URLResponse::New()); |
+ response->url = String::From(app_url.spec()); |
+ LoadWithContentHandler(redirect_iter->second, |
sky
2015/04/30 21:59:08
Doing it like you have here means multiple calls t
Elliot Glaysher
2015/05/01 17:00:04
I don't believe this is the case. Above, RegisterS
|
+ 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::RegisterApplicationPackageRedirect( |
+ const GURL& alias, |
+ const GURL& content_handler_package) { |
+ application_package_redirect_[alias] = content_handler_package; |
+} |
+ |
void ApplicationManager::LoadWithContentHandler( |
const GURL& content_handler_url, |
InterfaceRequest<Application> application_request, |