| 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 "chrome/app/mash/mash_runner.h" | 5 #include "chrome/app/mash/mash_runner.h" |
| 6 | 6 |
| 7 #include "ash/mus/window_manager_application.h" | 7 #include "ash/mus/window_manager_application.h" |
| 8 #include "ash/sysui/sysui_application.h" | 8 #include "ash/sysui/sysui_application.h" |
| 9 #include "ash/touch_hud/mus/touch_hud_application.h" | 9 #include "ash/touch_hud/mus/touch_hud_application.h" |
| 10 #include "base/at_exit.h" | 10 #include "base/at_exit.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 | 46 |
| 47 // Service responsible for starting the appropriate app. | 47 // Service responsible for starting the appropriate app. |
| 48 class DefaultService : public shell::Service, | 48 class DefaultService : public shell::Service, |
| 49 public ServiceFactory, | 49 public ServiceFactory, |
| 50 public shell::InterfaceFactory<ServiceFactory> { | 50 public shell::InterfaceFactory<ServiceFactory> { |
| 51 public: | 51 public: |
| 52 DefaultService() {} | 52 DefaultService() {} |
| 53 ~DefaultService() override {} | 53 ~DefaultService() override {} |
| 54 | 54 |
| 55 // shell::Service: | 55 // shell::Service: |
| 56 bool OnConnect(shell::Connection* connection) override { | 56 bool OnConnect(const shell::Identity& remote_identity, |
| 57 connection->AddInterface<ServiceFactory>(this); | 57 shell::InterfaceRegistry* registry) override { |
| 58 registry->AddInterface<ServiceFactory>(this); |
| 58 return true; | 59 return true; |
| 59 } | 60 } |
| 60 | 61 |
| 61 // shell::InterfaceFactory<ServiceFactory> | 62 // shell::InterfaceFactory<ServiceFactory> |
| 62 void Create(const shell::Identity& remote_identity, | 63 void Create(const shell::Identity& remote_identity, |
| 63 mojo::InterfaceRequest<ServiceFactory> request) override { | 64 mojo::InterfaceRequest<ServiceFactory> request) override { |
| 64 service_factory_bindings_.AddBinding(this, std::move(request)); | 65 service_factory_bindings_.AddBinding(this, std::move(request)); |
| 65 } | 66 } |
| 66 | 67 |
| 67 // ServiceFactory: | 68 // ServiceFactory: |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 std::unique_ptr<base::MessageLoop> message_loop; | 231 std::unique_ptr<base::MessageLoop> message_loop; |
| 231 #if defined(OS_LINUX) | 232 #if defined(OS_LINUX) |
| 232 base::AtExitManager exit_manager; | 233 base::AtExitManager exit_manager; |
| 233 #endif | 234 #endif |
| 234 if (!IsChild()) | 235 if (!IsChild()) |
| 235 message_loop.reset(new base::MessageLoop(base::MessageLoop::TYPE_UI)); | 236 message_loop.reset(new base::MessageLoop(base::MessageLoop::TYPE_UI)); |
| 236 MashRunner mash_runner; | 237 MashRunner mash_runner; |
| 237 mash_runner.Run(); | 238 mash_runner.Run(); |
| 238 return 0; | 239 return 0; |
| 239 } | 240 } |
| OLD | NEW |