| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 <memory> | 5 #include <memory> |
| 6 #include <utility> | 6 #include <utility> |
| 7 | 7 |
| 8 #include "mojo/public/cpp/bindings/binding.h" | 8 #include "mojo/public/cpp/bindings/binding.h" |
| 9 #include "services/service_manager/public/c/main.h" | 9 #include "services/service_manager/public/c/main.h" |
| 10 #include "services/service_manager/public/cpp/connector.h" | 10 #include "services/service_manager/public/cpp/connector.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 class TestWM : public service_manager::Service, | 22 class TestWM : public service_manager::Service, |
| 23 public ui::WindowTreeClientDelegate, | 23 public ui::WindowTreeClientDelegate, |
| 24 public ui::WindowManagerDelegate { | 24 public ui::WindowManagerDelegate { |
| 25 public: | 25 public: |
| 26 TestWM() {} | 26 TestWM() {} |
| 27 ~TestWM() override {} | 27 ~TestWM() override {} |
| 28 | 28 |
| 29 private: | 29 private: |
| 30 // service_manager::Service: | 30 // service_manager::Service: |
| 31 void OnStart(const service_manager::Identity& identity) override { | 31 void OnStart(const service_manager::ServiceInfo& info) override { |
| 32 window_tree_client_.reset(new ui::WindowTreeClient(this, this)); | 32 window_tree_client_.reset(new ui::WindowTreeClient(this, this)); |
| 33 window_tree_client_->ConnectAsWindowManager(connector()); | 33 window_tree_client_->ConnectAsWindowManager(connector()); |
| 34 } | 34 } |
| 35 | 35 |
| 36 // ui::WindowTreeClientDelegate: | 36 // ui::WindowTreeClientDelegate: |
| 37 void OnEmbed(ui::Window* root) override { | 37 void OnEmbed(ui::Window* root) override { |
| 38 // WindowTreeClients configured as the window manager should never get | 38 // WindowTreeClients configured as the window manager should never get |
| 39 // OnEmbed(). | 39 // OnEmbed(). |
| 40 NOTREACHED(); | 40 NOTREACHED(); |
| 41 } | 41 } |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 DISALLOW_COPY_AND_ASSIGN(TestWM); | 106 DISALLOW_COPY_AND_ASSIGN(TestWM); |
| 107 }; | 107 }; |
| 108 | 108 |
| 109 } // namespace test | 109 } // namespace test |
| 110 } // namespace ui | 110 } // namespace ui |
| 111 | 111 |
| 112 MojoResult ServiceMain(MojoHandle service_request_handle) { | 112 MojoResult ServiceMain(MojoHandle service_request_handle) { |
| 113 service_manager::ServiceRunner runner(new ui::test::TestWM); | 113 service_manager::ServiceRunner runner(new ui::test::TestWM); |
| 114 return runner.Run(service_request_handle); | 114 return runner.Run(service_request_handle); |
| 115 } | 115 } |
| OLD | NEW |