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

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

Issue 568883003: Second attempt to land change to remove NativeViewportService and (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 3 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.cc ('k') | mojo/shell/in_process_dynamic_service_runner.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 7d57e89d98b1ec0207119863d94824a7fa0f352d..3dac7c78abce1c662de280e647278b700347101c 100644
--- a/mojo/shell/desktop/mojo_main.cc
+++ b/mojo/shell/desktop/mojo_main.cc
@@ -12,14 +12,21 @@
#include "mojo/shell/init.h"
#include "mojo/shell/switches.h"
#include "ui/gfx/switches.h"
+
+#if defined(COMPONENT_BUILD)
#include "ui/gl/gl_surface.h"
+#endif
namespace {
-void RunApps(mojo::shell::Context* context, std::vector<GURL> app_urls) {
- for (std::vector<GURL>::const_iterator it = app_urls.begin();
- it != app_urls.end(); ++it) {
- context->Run(*it);
+void RunApps(mojo::shell::Context* context) {
+ const base::CommandLine& command_line =
+ *base::CommandLine::ForCurrentProcess();
+ base::CommandLine::StringVector args = command_line.GetArgs();
+ for (base::CommandLine::StringVector::const_iterator it = args.begin();
+ it != args.end();
+ ++it) {
+ context->Run(GURL(*it));
}
}
@@ -43,8 +50,9 @@ int main(int argc, char** argv) {
*base::CommandLine::ForCurrentProcess())) {
child_process->Main();
} else {
+#if defined(COMPONENT_BUILD)
gfx::GLSurface::InitializeOneOff();
-
+#endif
// We want the shell::Context to outlive the MessageLoop so that pipes are
// all gracefully closed / error-out before we try to shut the Context down.
mojo::shell::Context shell_context;
@@ -59,17 +67,7 @@ int main(int argc, char** argv) {
GURL(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(RunApps,
- &shell_context,
- app_urls));
+ message_loop.PostTask(FROM_HERE, base::Bind(RunApps, &shell_context));
message_loop.Run();
}
}
« no previous file with comments | « mojo/shell/context.cc ('k') | mojo/shell/in_process_dynamic_service_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698