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

Side by Side Diff: sky/tools/tester/tester.cc

Issue 818583002: Moves Create() off of View and onto ViewManager (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: merge 2 trunk Created 6 years 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
« no previous file with comments | « sky/tools/debugger/debugger.cc ('k') | sky/viewer/document_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <iostream> 5 #include <iostream>
6 #include "base/bind.h" 6 #include "base/bind.h"
7 #include "base/memory/weak_ptr.h" 7 #include "base/memory/weak_ptr.h"
8 #include "mojo/application/application_runner_chromium.h" 8 #include "mojo/application/application_runner_chromium.h"
9 #include "mojo/public/c/system/main.h" 9 #include "mojo/public/c/system/main.h"
10 #include "mojo/public/cpp/application/application_delegate.h" 10 #include "mojo/public/cpp/application/application_delegate.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 } 83 }
84 84
85 // Overridden from mojo::ViewManagerDelegate: 85 // Overridden from mojo::ViewManagerDelegate:
86 virtual void OnEmbed( 86 virtual void OnEmbed(
87 mojo::View* root, 87 mojo::View* root,
88 mojo::ServiceProviderImpl* exported_services, 88 mojo::ServiceProviderImpl* exported_services,
89 scoped_ptr<mojo::ServiceProvider> remote_service_provider) override { 89 scoped_ptr<mojo::ServiceProvider> remote_service_provider) override {
90 root_ = root; 90 root_ = root;
91 root_->AddObserver(this); 91 root_->AddObserver(this);
92 92
93 content_ = mojo::View::Create(root->view_manager()); 93 content_ = root->view_manager()->CreateView();
94 content_->SetBounds(root_->bounds()); 94 content_->SetBounds(root_->bounds());
95 root_->AddChild(content_); 95 root_->AddChild(content_);
96 content_->SetVisible(true); 96 content_->SetVisible(true);
97 97
98 std::cout << "#READY\n"; 98 std::cout << "#READY\n";
99 std::cout.flush(); 99 std::cout.flush();
100 ScheduleRun(); 100 ScheduleRun();
101 } 101 }
102 102
103 // Overridden from window_manager::WindowManagerDelegate: 103 // Overridden from window_manager::WindowManagerDelegate:
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 DISALLOW_COPY_AND_ASSIGN(SkyTester); 165 DISALLOW_COPY_AND_ASSIGN(SkyTester);
166 }; 166 };
167 167
168 } // namespace tester 168 } // namespace tester
169 } // namespace examples 169 } // namespace examples
170 170
171 MojoResult MojoMain(MojoHandle shell_handle) { 171 MojoResult MojoMain(MojoHandle shell_handle) {
172 mojo::ApplicationRunnerChromium runner(new sky::tester::SkyTester); 172 mojo::ApplicationRunnerChromium runner(new sky::tester::SkyTester);
173 return runner.Run(shell_handle); 173 return runner.Run(shell_handle);
174 } 174 }
OLDNEW
« no previous file with comments | « sky/tools/debugger/debugger.cc ('k') | sky/viewer/document_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698