OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/at_exit.h" | 5 #include "base/at_exit.h" |
6 #include "base/bind.h" | 6 #include "base/bind.h" |
7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
8 #include "mojo/public/cpp/application/application.h" | 8 #include "mojo/public/cpp/application/application.h" |
9 #include "mojo/public/cpp/environment/environment.h" | 9 #include "mojo/public/cpp/environment/environment.h" |
10 #include "mojo/public/cpp/system/core.h" | 10 #include "mojo/public/cpp/system/core.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 view_manager::ViewTreeNode* node1 = | 58 view_manager::ViewTreeNode* node1 = |
59 view_manager::ViewTreeNode::Create(view_manager_.get()); | 59 view_manager::ViewTreeNode::Create(view_manager_.get()); |
60 node1->SetBounds(gfx::Rect(800, 600)); | 60 node1->SetBounds(gfx::Rect(800, 600)); |
61 view_manager::ViewTreeNode* node11 = | 61 view_manager::ViewTreeNode* node11 = |
62 view_manager::ViewTreeNode::Create(view_manager_.get()); | 62 view_manager::ViewTreeNode::Create(view_manager_.get()); |
63 node11->SetBounds(gfx::Rect(800, 600)); | 63 node11->SetBounds(gfx::Rect(800, 600)); |
64 | 64 |
65 view_manager::View* view11 = | 65 view_manager::View* view11 = |
66 view_manager::View::Create(view_manager_.get()); | 66 view_manager::View::Create(view_manager_.get()); |
67 node11->SetActiveView(view11); | 67 node11->SetActiveView(view11); |
68 view_manager_->tree()->AddChild(node1); | 68 view_manager_->roots().front()->AddChild(node1); |
69 node1->AddChild(node11); | 69 node1->AddChild(node11); |
70 | 70 |
71 view11->SetColor(SK_ColorRED); | 71 view11->SetColor(SK_ColorRED); |
72 | 72 |
73 view11->AddObserver(this); | 73 view11->AddObserver(this); |
74 } | 74 } |
75 | 75 |
76 private: | 76 private: |
77 virtual void OnViewInputEvent(mojo::view_manager::View* view, | 77 virtual void OnViewInputEvent(mojo::view_manager::View* view, |
78 EventPtr event) OVERRIDE { | 78 EventPtr event) OVERRIDE { |
(...skipping 15 matching lines...) Expand all Loading... |
94 }; | 94 }; |
95 | 95 |
96 } // namespace examples | 96 } // namespace examples |
97 | 97 |
98 // static | 98 // static |
99 Application* Application::Create() { | 99 Application* Application::Create() { |
100 return new examples::SampleApp(); | 100 return new examples::SampleApp(); |
101 } | 101 } |
102 | 102 |
103 } // namespace mojo | 103 } // namespace mojo |
OLD | NEW |