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

Unified Diff: mojo/examples/wget/wget.cc

Issue 617943002: Enable setting configuration arguments for Mojo applications with mojo_shell (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use base::string16 instead std::wstring Created 6 years, 2 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 | mojo/shell/desktop/mojo_main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/examples/wget/wget.cc
diff --git a/mojo/examples/wget/wget.cc b/mojo/examples/wget/wget.cc
index 0f7d891f88f284cde36c195fb02bb2869d6f803c..f7c03bb6af17bdd074ffe400c68b5b371c6fced6 100644
--- a/mojo/examples/wget/wget.cc
+++ b/mojo/examples/wget/wget.cc
@@ -72,12 +72,12 @@ class WGetApp : public ApplicationDelegate {
public:
virtual void Initialize(ApplicationImpl* app) override {
app->ConnectToService("mojo:mojo_network_service", &network_service_);
- Start();
+ Start(app->args());
}
private:
- void Start() {
- std::string url = PromptForURL();
+ void Start(const Array<String>& args) {
+ std::string url((args.size() > 1) ? args[1].get() : PromptForURL());
printf("Loading: %s\n", url.c_str());
network_service_->CreateURLLoader(Get(&url_loader_));
« no previous file with comments | « no previous file | mojo/shell/desktop/mojo_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698