Index: mojo/examples/sample_view_manager_app/sample_view_manager_app.cc |
diff --git a/mojo/examples/sample_view_manager_app/sample_view_manager_app.cc b/mojo/examples/sample_view_manager_app/sample_view_manager_app.cc |
index 43ee7f2a8b9c10819dcfa4a492e54eca28a6ee1c..69d6a4491449aab4d179e8a85902e60d96726edb 100644 |
--- a/mojo/examples/sample_view_manager_app/sample_view_manager_app.cc |
+++ b/mojo/examples/sample_view_manager_app/sample_view_manager_app.cc |
@@ -32,11 +32,12 @@ class SampleApp : public Application { |
explicit SampleApp(MojoHandle shell_handle) |
: Application(shell_handle) { |
view_manager_.reset(new services::view_manager::ViewManager(shell())); |
- node_1_.reset( |
- new services::view_manager::ViewTreeNode(view_manager_.get())); |
- node_11_.reset( |
- new services::view_manager::ViewTreeNode(view_manager_.get())); |
- node_1_->AddChild(node_11_.get()); |
+ view_manager_->Init(); |
+ services::view_manager::ViewTreeNode* node1 = |
+ services::view_manager::ViewTreeNode::Create(view_manager_.get()); |
+ services::view_manager::ViewTreeNode* node11 = |
+ services::view_manager::ViewTreeNode::Create(view_manager_.get()); |
+ node1->AddChild(node11); |
} |
virtual ~SampleApp() { |
@@ -45,8 +46,6 @@ class SampleApp : public Application { |
private: |
// SampleApp creates a ViewManager and a trivial node hierarchy. |
scoped_ptr<services::view_manager::ViewManager> view_manager_; |
- scoped_ptr<services::view_manager::ViewTreeNode> node_1_; |
- scoped_ptr<services::view_manager::ViewTreeNode> node_11_; |
DISALLOW_COPY_AND_ASSIGN(SampleApp); |
}; |