| 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 "services/shell/public/c/main.h" | 5 #include "services/shell/public/c/main.h" |
| 6 #include "services/shell/public/cpp/connector.h" | |
| 7 #include "services/shell/public/cpp/service.h" | |
| 8 #include "services/shell/public/cpp/service_runner.h" | 6 #include "services/shell/public/cpp/service_runner.h" |
| 9 #include "services/ui/ime/test_ime_driver/test_ime_driver.h" | 7 #include "services/ui/ime/test_ime_driver/test_ime_application.h" |
| 10 | |
| 11 namespace ui { | |
| 12 namespace test { | |
| 13 | |
| 14 class TestIME : public shell::Service { | |
| 15 public: | |
| 16 TestIME() {} | |
| 17 ~TestIME() override {} | |
| 18 | |
| 19 private: | |
| 20 // shell::Service: | |
| 21 void OnStart(const shell::Identity& identity) override { | |
| 22 mojom::IMEDriverPtr ime_driver_ptr; | |
| 23 new TestIMEDriver(GetProxy(&ime_driver_ptr)); | |
| 24 | |
| 25 ui::mojom::IMERegistrarPtr ime_registrar; | |
| 26 connector()->ConnectToInterface("mojo:ui", &ime_registrar); | |
| 27 ime_registrar->RegisterDriver(std::move(ime_driver_ptr)); | |
| 28 } | |
| 29 | |
| 30 DISALLOW_COPY_AND_ASSIGN(TestIME); | |
| 31 }; | |
| 32 | |
| 33 } // namespace test | |
| 34 } // namespace ui | |
| 35 | 8 |
| 36 MojoResult ServiceMain(MojoHandle service_request_handle) { | 9 MojoResult ServiceMain(MojoHandle service_request_handle) { |
| 37 shell::ServiceRunner runner(new ui::test::TestIME); | 10 shell::ServiceRunner runner(new ui::test::TestIMEApplication); |
| 38 return runner.Run(service_request_handle); | 11 return runner.Run(service_request_handle); |
| 39 } | 12 } |
| OLD | NEW |