| 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 <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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |