| 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 virtual void Initialize(mojo::ApplicationImpl* impl) override { | 71 virtual void Initialize(mojo::ApplicationImpl* impl) override { |
| 72 window_manager_app_->Initialize(impl); | 72 window_manager_app_->Initialize(impl); |
| 73 | 73 |
| 74 if (impl->args().size() >= 2) | 74 if (impl->args().size() >= 2) |
| 75 url_from_args_ = impl->args()[1]; | 75 url_from_args_ = impl->args()[1]; |
| 76 } | 76 } |
| 77 virtual bool ConfigureIncomingConnection( | 77 virtual bool ConfigureIncomingConnection( |
| 78 mojo::ApplicationConnection* connection) override { | 78 mojo::ApplicationConnection* connection) override { |
| 79 window_manager_app_->ConfigureIncomingConnection(connection); | 79 window_manager_app_->ConfigureIncomingConnection(connection); |
| 80 if (test_runner_) | 80 if (test_runner_) |
| 81 connection->AddService(test_runner_->test_harness_factory()); | 81 connection->AddService(test_runner_.get()); |
| 82 return true; | 82 return true; |
| 83 } | 83 } |
| 84 | 84 |
| 85 // Overridden from mojo::ViewManagerDelegate: | 85 // Overridden from mojo::ViewManagerDelegate: |
| 86 virtual void OnEmbed(mojo::View* root, | 86 virtual void OnEmbed(mojo::View* root, |
| 87 mojo::InterfaceRequest<mojo::ServiceProvider> services, | 87 mojo::InterfaceRequest<mojo::ServiceProvider> services, |
| 88 mojo::ServiceProviderPtr exposed_services) override { | 88 mojo::ServiceProviderPtr exposed_services) override { |
| 89 root_ = root; | 89 root_ = root; |
| 90 root_->AddObserver(this); | 90 root_->AddObserver(this); |
| 91 | 91 |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 DISALLOW_COPY_AND_ASSIGN(SkyTester); | 163 DISALLOW_COPY_AND_ASSIGN(SkyTester); |
| 164 }; | 164 }; |
| 165 | 165 |
| 166 } // namespace tester | 166 } // namespace tester |
| 167 } // namespace examples | 167 } // namespace examples |
| 168 | 168 |
| 169 MojoResult MojoMain(MojoHandle shell_handle) { | 169 MojoResult MojoMain(MojoHandle shell_handle) { |
| 170 mojo::ApplicationRunnerChromium runner(new sky::tester::SkyTester); | 170 mojo::ApplicationRunnerChromium runner(new sky::tester::SkyTester); |
| 171 return runner.Run(shell_handle); | 171 return runner.Run(shell_handle); |
| 172 } | 172 } |
| OLD | NEW |