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

Unified Diff: mojo/examples/wm_flow/wm/wm.cc

Issue 658753004: Make wm_flow_init work with gn (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: done 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 | « mojo/examples/wm_flow/init/init.cc ('k') | mojo/mojo.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/examples/wm_flow/wm/wm.cc
diff --git a/mojo/examples/wm_flow/wm/wm.cc b/mojo/examples/wm_flow/wm/wm.cc
index b781f60d17a32a46a1b9916343765c8f3260c3ae..228f04fab37a796992877e2e6f09ecb7e4ee80ee 100644
--- a/mojo/examples/wm_flow/wm/wm.cc
+++ b/mojo/examples/wm_flow/wm/wm.cc
@@ -102,6 +102,10 @@ class SimpleWM : public mojo::ApplicationDelegate,
private:
// Overridden from mojo::ApplicationDelegate:
virtual void Initialize(mojo::ApplicationImpl* impl) override {
+ // Create views_init here as we need ApplicationRunnerChromium to install
+ // an AtExitManager and CommandLine.
+ if (!views_init_.get())
+ views_init_.reset(new mojo::ViewsInit);
shell_ = impl->shell();
window_manager_app_->Initialize(impl);
}
@@ -183,6 +187,8 @@ class SimpleWM : public mojo::ApplicationDelegate,
mojo::Shell* shell_;
+ scoped_ptr<mojo::ViewsInit> views_init_;
+
scoped_ptr<mojo::WindowManagerApp> window_manager_app_;
mojo::ViewManager* view_manager_;
@@ -197,7 +203,6 @@ class SimpleWM : public mojo::ApplicationDelegate,
} // namespace examples
MojoResult MojoMain(MojoHandle shell_handle) {
- mojo::ViewsInit views_init;
mojo::ApplicationRunnerChromium runner(new examples::SimpleWM);
return runner.Run(shell_handle);
}
« no previous file with comments | « mojo/examples/wm_flow/init/init.cc ('k') | mojo/mojo.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698