Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Side by Side Diff: services/ui/ime/test_ime_driver/test_ime_driver.cc

Issue 2945283002: Unify IMEDriver and IMEServer. (Closed)
Patch Set: Addressed feedback. Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « services/ui/ime/test_ime_driver/test_ime_driver.h ('k') | services/ui/manifest.json » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/test_ime_driver/test_ime_driver.h" 5 #include "services/ui/ime/test_ime_driver/test_ime_driver.h"
6 6
7 #include "mojo/public/cpp/bindings/strong_binding.h"
7 #include "services/ui/public/interfaces/ime/ime.mojom.h" 8 #include "services/ui/public/interfaces/ime/ime.mojom.h"
8 9
9 namespace ui { 10 namespace ui {
10 namespace test { 11 namespace test {
11 12
12 class TestInputMethod : public mojom::InputMethod { 13 class TestInputMethod : public mojom::InputMethod {
13 public: 14 public:
14 explicit TestInputMethod(mojom::TextInputClientPtr client) 15 explicit TestInputMethod(mojom::TextInputClientPtr client)
15 : client_(std::move(client)) {} 16 : client_(std::move(client)) {}
16 ~TestInputMethod() override {} 17 ~TestInputMethod() override {}
(...skipping 17 matching lines...) Expand all
34 35
35 mojom::TextInputClientPtr client_; 36 mojom::TextInputClientPtr client_;
36 37
37 DISALLOW_COPY_AND_ASSIGN(TestInputMethod); 38 DISALLOW_COPY_AND_ASSIGN(TestInputMethod);
38 }; 39 };
39 40
40 TestIMEDriver::TestIMEDriver() {} 41 TestIMEDriver::TestIMEDriver() {}
41 42
42 TestIMEDriver::~TestIMEDriver() {} 43 TestIMEDriver::~TestIMEDriver() {}
43 44
44 void TestIMEDriver::StartSession(int32_t session_id, 45 void TestIMEDriver::StartSession(mojom::StartSessionDetailsPtr details) {
45 mojom::StartSessionDetailsPtr details) { 46 mojo::MakeStrongBinding(
46 input_method_bindings_[session_id].reset( 47 base::MakeUnique<TestInputMethod>(std::move(details->client)),
47 new mojo::Binding<mojom::InputMethod>( 48 std::move(details->input_method_request));
48 new TestInputMethod(std::move(details->client)),
49 std::move(details->input_method_request)));
50 }
51
52 void TestIMEDriver::CancelSession(int32_t session_id) {
53 input_method_bindings_.erase(session_id);
54 } 49 }
55 50
56 } // namespace test 51 } // namespace test
57 } // namespace ui 52 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/ime/test_ime_driver/test_ime_driver.h ('k') | services/ui/manifest.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698