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

Side by Side Diff: mojo/examples/sample_view_manager_app/sample_view_manager_app.cc

Issue 316083002: Add support for multiple roots to the client lib. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698