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

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

Issue 2326913003: Privatize StrongBinding lifetime management (Closed)
Patch Set: rebase Created 4 years, 3 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/service.cc » ('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 "services/ui/public/interfaces/ime.mojom.h" 7 #include "services/ui/public/interfaces/ime.mojom.h"
8 8
9 namespace ui { 9 namespace ui {
10 namespace test { 10 namespace test {
(...skipping 22 matching lines...) Expand all
33 client_->OnUnhandledEvent(std::move(key_event)); 33 client_->OnUnhandledEvent(std::move(key_event));
34 } 34 }
35 }; 35 };
36 void CancelComposition() override {} 36 void CancelComposition() override {}
37 37
38 mojom::TextInputClientPtr client_; 38 mojom::TextInputClientPtr client_;
39 39
40 DISALLOW_COPY_AND_ASSIGN(TestInputMethod); 40 DISALLOW_COPY_AND_ASSIGN(TestInputMethod);
41 }; 41 };
42 42
43 TestIMEDriver::TestIMEDriver(mojom::IMEDriverRequest request) 43 TestIMEDriver::TestIMEDriver() {}
44 : driver_binding_(this, std::move(request)) {}
45 44
46 TestIMEDriver::~TestIMEDriver() {} 45 TestIMEDriver::~TestIMEDriver() {}
47 46
48 void TestIMEDriver::StartSession( 47 void TestIMEDriver::StartSession(
49 int32_t session_id, 48 int32_t session_id,
50 mojom::TextInputClientPtr client, 49 mojom::TextInputClientPtr client,
51 mojom::InputMethodRequest input_method_request) { 50 mojom::InputMethodRequest input_method_request) {
52 input_method_bindings_[session_id].reset( 51 input_method_bindings_[session_id].reset(
53 new mojo::Binding<mojom::InputMethod>( 52 new mojo::Binding<mojom::InputMethod>(
54 new TestInputMethod(std::move(client)), 53 new TestInputMethod(std::move(client)),
55 std::move(input_method_request))); 54 std::move(input_method_request)));
56 } 55 }
57 56
58 void TestIMEDriver::CancelSession(int32_t session_id) { 57 void TestIMEDriver::CancelSession(int32_t session_id) {
59 input_method_bindings_.erase(session_id); 58 input_method_bindings_.erase(session_id);
60 } 59 }
61 60
62 } // namespace test 61 } // namespace test
63 } // namespace ui 62 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/ime/test_ime_driver/test_ime_driver.h ('k') | services/ui/service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698