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/ui/ime/ime_server_impl.h" | 5 #include "services/ui/ime/ime_server_impl.h" |
6 | 6 |
7 #include "services/shell/public/cpp/connector.h" | 7 #include "services/shell/public/cpp/connector.h" |
8 #include "services/ui/ime/ime_registrar_impl.h" | 8 #include "services/ui/ime/ime_registrar_impl.h" |
9 | 9 |
10 namespace ui { | 10 namespace ui { |
11 | 11 |
12 IMEServerImpl::IMEServerImpl() : current_id_(0) {} | 12 IMEServerImpl::IMEServerImpl() : current_id_(0) {} |
13 | 13 |
14 IMEServerImpl::~IMEServerImpl() {} | 14 IMEServerImpl::~IMEServerImpl() {} |
15 | 15 |
16 void IMEServerImpl::Init(shell::Connector* connector) { | 16 void IMEServerImpl::Init(shell::Connector* connector) { |
17 // TODO(moshayedi): crbug.com/641041. Look up the driver from the mojo:catalog | 17 // TODO(moshayedi): crbug.com/641041. Look up the driver from the mojo:catalog |
18 // service. | 18 // service. |
19 connector->Connect("mojo:test_ime_driver"); | 19 connector->Connect("service:test_ime_driver"); |
20 } | 20 } |
21 | 21 |
22 void IMEServerImpl::AddBinding(mojom::IMEServerRequest request) { | 22 void IMEServerImpl::AddBinding(mojom::IMEServerRequest request) { |
23 bindings_.AddBinding(this, std::move(request)); | 23 bindings_.AddBinding(this, std::move(request)); |
24 } | 24 } |
25 | 25 |
26 void IMEServerImpl::OnDriverChanged(mojom::IMEDriverPtr driver) { | 26 void IMEServerImpl::OnDriverChanged(mojom::IMEDriverPtr driver) { |
27 driver_ = std::move(driver); | 27 driver_ = std::move(driver); |
28 | 28 |
29 while (!pending_requests_.empty()) { | 29 while (!pending_requests_.empty()) { |
(...skipping 14 matching lines...) Expand all Loading... |
44 // client's focused window. | 44 // client's focused window. |
45 driver_->StartSession(current_id_++, std::move(client), | 45 driver_->StartSession(current_id_++, std::move(client), |
46 std::move(input_method_request)); | 46 std::move(input_method_request)); |
47 } else { | 47 } else { |
48 pending_requests_.push( | 48 pending_requests_.push( |
49 std::make_pair(std::move(client), std::move(input_method_request))); | 49 std::make_pair(std::move(client), std::move(input_method_request))); |
50 } | 50 } |
51 } | 51 } |
52 | 52 |
53 } // namespace ui | 53 } // namespace ui |
OLD | NEW |