| 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 #ifndef SERVICES_UI_IME_IME_SERVER_IMPL_H_ | 5 #ifndef SERVICES_UI_IME_IME_SERVER_IMPL_H_ |
| 6 #define SERVICES_UI_IME_IME_SERVER_IMPL_H_ | 6 #define SERVICES_UI_IME_IME_SERVER_IMPL_H_ |
| 7 | 7 |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "mojo/public/cpp/bindings/binding_set.h" | 10 #include "mojo/public/cpp/bindings/binding_set.h" |
| 11 #include "services/ui/public/interfaces/ime.mojom.h" | 11 #include "services/ui/public/interfaces/ime.mojom.h" |
| 12 | 12 |
| 13 namespace shell { | |
| 14 class Connector; | |
| 15 } | |
| 16 | |
| 17 namespace ui { | 13 namespace ui { |
| 18 | 14 |
| 19 class IMEServerImpl : public mojom::IMEServer { | 15 class IMEServerImpl : public mojom::IMEServer { |
| 20 public: | 16 public: |
| 21 IMEServerImpl(); | 17 IMEServerImpl(); |
| 22 ~IMEServerImpl() override; | 18 ~IMEServerImpl() override; |
| 23 | 19 |
| 24 void Init(shell::Connector* connector); | |
| 25 void AddBinding(mojom::IMEServerRequest request); | 20 void AddBinding(mojom::IMEServerRequest request); |
| 26 void OnDriverChanged(mojom::IMEDriverPtr driver); | 21 void OnDriverChanged(mojom::IMEDriverPtr driver); |
| 27 | 22 |
| 28 private: | 23 private: |
| 29 // mojom::IMEServer: | 24 // mojom::IMEServer: |
| 30 void StartSession(mojom::TextInputClientPtr client, | 25 void StartSession(mojom::TextInputClientPtr client, |
| 31 mojom::InputMethodRequest input_method) override; | 26 mojom::InputMethodRequest input_method) override; |
| 32 | 27 |
| 33 mojo::BindingSet<mojom::IMEServer> bindings_; | 28 mojo::BindingSet<mojom::IMEServer> bindings_; |
| 34 mojom::IMEDriverPtr driver_; | 29 mojom::IMEDriverPtr driver_; |
| 35 int current_id_; | 30 int current_id_; |
| 36 | 31 |
| 37 using PendingRequest = | 32 using PendingRequest = |
| 38 std::pair<mojom::TextInputClientPtr, mojom::InputMethodRequest>; | 33 std::pair<mojom::TextInputClientPtr, mojom::InputMethodRequest>; |
| 39 std::queue<PendingRequest> pending_requests_; | 34 std::queue<PendingRequest> pending_requests_; |
| 40 | 35 |
| 41 DISALLOW_COPY_AND_ASSIGN(IMEServerImpl); | 36 DISALLOW_COPY_AND_ASSIGN(IMEServerImpl); |
| 42 }; | 37 }; |
| 43 | 38 |
| 44 } // namespace ui | 39 } // namespace ui |
| 45 | 40 |
| 46 #endif // SERVICES_UI_IME_IME_SERVER_IMPL_H_ | 41 #endif // SERVICES_UI_IME_IME_SERVER_IMPL_H_ |
| OLD | NEW |