| 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" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 public: | 21 public: |
| 22 IMEServerImpl(); | 22 IMEServerImpl(); |
| 23 ~IMEServerImpl() override; | 23 ~IMEServerImpl() override; |
| 24 | 24 |
| 25 void Init(service_manager::Connector* connector, bool is_test_config); | 25 void Init(service_manager::Connector* connector, bool is_test_config); |
| 26 void AddBinding(mojom::IMEServerRequest request); | 26 void AddBinding(mojom::IMEServerRequest request); |
| 27 void OnDriverChanged(mojom::IMEDriverPtr driver); | 27 void OnDriverChanged(mojom::IMEDriverPtr driver); |
| 28 | 28 |
| 29 private: | 29 private: |
| 30 // mojom::IMEServer: | 30 // mojom::IMEServer: |
| 31 void StartSession(mojom::TextInputClientPtr client, | 31 void StartSession(mojom::TextInputClientInformationPtr client_info, |
| 32 mojom::TextInputClientPtr client, |
| 32 mojom::InputMethodRequest input_method) override; | 33 mojom::InputMethodRequest input_method) override; |
| 33 | 34 |
| 34 void OnGotCatalogEntries(std::vector<catalog::mojom::EntryPtr> entries); | 35 void OnGotCatalogEntries(std::vector<catalog::mojom::EntryPtr> entries); |
| 35 | 36 |
| 36 service_manager::Connector* connector_; | 37 service_manager::Connector* connector_; |
| 37 catalog::mojom::CatalogPtr catalog_; | 38 catalog::mojom::CatalogPtr catalog_; |
| 38 mojo::BindingSet<mojom::IMEServer> bindings_; | 39 mojo::BindingSet<mojom::IMEServer> bindings_; |
| 39 mojom::IMEDriverPtr driver_; | 40 mojom::IMEDriverPtr driver_; |
| 40 int current_id_; | 41 int current_id_; |
| 41 | 42 |
| 42 using PendingRequest = | 43 struct PendingRequest { |
| 43 std::pair<mojom::TextInputClientPtr, mojom::InputMethodRequest>; | 44 PendingRequest(mojom::TextInputClientInformationPtr client_info, |
| 44 std::queue<PendingRequest> pending_requests_; | 45 mojom::TextInputClientPtr client, |
| 46 mojom::InputMethodRequest input_method_request); |
| 47 ~PendingRequest(); |
| 48 mojom::TextInputClientInformationPtr client_info; |
| 49 mojom::TextInputClientPtr client; |
| 50 mojom::InputMethodRequest input_method_request; |
| 51 }; |
| 52 std::queue<std::unique_ptr<PendingRequest>> pending_requests_; |
| 45 | 53 |
| 46 DISALLOW_COPY_AND_ASSIGN(IMEServerImpl); | 54 DISALLOW_COPY_AND_ASSIGN(IMEServerImpl); |
| 47 }; | 55 }; |
| 48 | 56 |
| 49 } // namespace ui | 57 } // namespace ui |
| 50 | 58 |
| 51 #endif // SERVICES_UI_IME_IME_SERVER_IMPL_H_ | 59 #endif // SERVICES_UI_IME_IME_SERVER_IMPL_H_ |
| OLD | NEW |