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

Unified Diff: shell/application_manager/application_manager.cc

Issue 879053006: Revert "Only use externally provided args for external apps" (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: shell/application_manager/application_manager.cc
diff --git a/shell/application_manager/application_manager.cc b/shell/application_manager/application_manager.cc
index 2cd3c9bf7716eb4686d4a595b880e2996e176775..e46b4e38e5fa1d855e00082391f56aeb6f9fe1c3 100644
--- a/shell/application_manager/application_manager.cc
+++ b/shell/application_manager/application_manager.cc
@@ -186,15 +186,13 @@ void ApplicationManager::RegisterExternalApplication(
const GURL& url,
const std::vector<std::string>& args,
ApplicationPtr application) {
- const auto& args_it = url_to_args_.find(url);
- if (args_it != url_to_args_.end()) {
- LOG(WARNING) << "--args-for provided for external application "
- << url
- << " <ignored>";
- }
ShellImpl* shell_impl = new ShellImpl(application.Pass(), this, url, url);
url_to_shell_impl_[url] = shell_impl;
- shell_impl->InitializeApplication(Array<String>::From(args));
+
+ if (args.empty())
+ shell_impl->InitializeApplication(GetArgsForURL(url));
+ else
+ shell_impl->InitializeApplication(Array<String>::From(args));
}
void ApplicationManager::LoadWithContentHandler(
@@ -287,7 +285,7 @@ ScopedMessagePipeHandle ApplicationManager::ConnectToServiceByName(
}
Array<String> ApplicationManager::GetArgsForURL(const GURL& url) {
- const auto& args_it = url_to_args_.find(url);
+ URLToArgsMap::const_iterator args_it = url_to_args_.find(url);
if (args_it != url_to_args_.end())
return Array<String>::From(args_it->second);
return Array<String>();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698