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

Unified Diff: mojo/shell/desktop/mojo_main.cc

Issue 305013015: Mojo: (Mostly) factor out command-line switches from the shell's load code path. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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/context.h ('k') | mojo/shell/dynamic_service_loader.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/shell/desktop/mojo_main.cc
diff --git a/mojo/shell/desktop/mojo_main.cc b/mojo/shell/desktop/mojo_main.cc
index c1e796aeabe0e5c4c370e6af0148d6d92a24b153..f2ef50af27d406b1336b659e04c1a2ee88ac887a 100644
--- a/mojo/shell/desktop/mojo_main.cc
+++ b/mojo/shell/desktop/mojo_main.cc
@@ -14,6 +14,7 @@
#include "mojo/shell/context.h"
#include "mojo/shell/init.h"
#include "mojo/shell/run.h"
+#include "mojo/shell/switches.h"
#include "ui/gl/gl_surface.h"
namespace {
@@ -67,8 +68,26 @@ int main(int argc, char** argv) {
gfx::GLSurface::InitializeOneOff();
base::MessageLoop message_loop;
- mojo::shell::Context context;
- message_loop.PostTask(FROM_HERE, base::Bind(mojo::shell::Run, &context));
+ mojo::shell::Context shell_context;
+
+ const base::CommandLine& command_line =
+ *base::CommandLine::ForCurrentProcess();
+ if (command_line.HasSwitch(switches::kOrigin)) {
+ shell_context.set_mojo_origin(
+ command_line.GetSwitchValueASCII(switches::kOrigin));
+ }
+
+ std::vector<GURL> app_urls;
+ base::CommandLine::StringVector args = command_line.GetArgs();
+ for (base::CommandLine::StringVector::const_iterator it = args.begin();
+ it != args.end();
+ ++it)
+ app_urls.push_back(GURL(*it));
+
+ message_loop.PostTask(FROM_HERE,
+ base::Bind(mojo::shell::Run,
+ &shell_context,
+ app_urls));
message_loop.Run();
}
« no previous file with comments | « mojo/shell/context.h ('k') | mojo/shell/dynamic_service_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698