Index: mojo/application_manager/application_manager.cc |
diff --git a/mojo/application_manager/application_manager.cc b/mojo/application_manager/application_manager.cc |
index b0a300eb4b6c1b17e237dfc5f77a4129242e4b30..382cb035bcd005c4d7655479785ef39fa1c4f0f9 100644 |
--- a/mojo/application_manager/application_manager.cc |
+++ b/mojo/application_manager/application_manager.cc |
@@ -220,9 +220,14 @@ void ApplicationManager::RegisterLoadedApplication( |
shell_impl = iter->second; |
} else { |
MessagePipe pipe; |
+ URLToArgsMap::const_iterator args_it = url_to_args_.find(url); |
+ Array<String> args; |
+ if (args_it != url_to_args_.end()) |
+ args = Array<String>::From(args_it->second); |
shell_impl = WeakBindToPipe(new ShellImpl(this, url), pipe.handle1.Pass()); |
url_to_shell_impl_[url] = shell_impl; |
*shell_handle = pipe.handle0.Pass(); |
+ shell_impl->client()->Initialize(args.Pass()); |
} |
ConnectToClient(shell_impl, url, requestor_url, service_provider.Pass()); |
@@ -267,6 +272,11 @@ void ApplicationManager::SetLoaderForScheme( |
scheme_to_loader_[scheme] = loader.release(); |
} |
+void ApplicationManager::SetArgsForURL(const std::vector<std::string>& args, |
+ const GURL& url) { |
+ url_to_args_[url] = args; |
+} |
+ |
void ApplicationManager::SetInterceptor(Interceptor* interceptor) { |
interceptor_ = interceptor; |
} |