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

Side by Side Diff: ui/views/mus/text_input_client_impl.cc

Issue 2230393002: IME for Mus: Make InputMethodMus use the IME Mojo API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix dependencies Created 4 years, 4 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "ui/views/mus/text_input_client_impl.h"
6
7 #include "ui/base/ime/text_input_client.h"
8
9 namespace views {
10
11 TextInputClientImpl::TextInputClientImpl(ui::TextInputClient* text_input_client)
12 : text_input_client_(text_input_client), binding_(this) {}
13
14 TextInputClientImpl::~TextInputClientImpl() {}
15
16 ui::mojom::TextInputClientPtr TextInputClientImpl::CreateInterfacePtrAndBind() {
17 return binding_.CreateInterfacePtrAndBind();
18 }
19
20 void TextInputClientImpl::OnCompositionEvent(
21 ui::mojom::CompositionEventPtr event) {
22 switch (event->type) {
23 case ui::mojom::CompositionEventType::INSERT_CHAR:
24 text_input_client_->InsertChar(*(*event->key_event)->AsKeyEvent());
25 break;
26 case ui::mojom::CompositionEventType::CONFIRM:
27 text_input_client_->ConfirmCompositionText();
28 break;
29 case ui::mojom::CompositionEventType::CLEAR:
30 text_input_client_->ClearCompositionText();
31 break;
32 case ui::mojom::CompositionEventType::UPDATE:
33 case ui::mojom::CompositionEventType::INSERT_TEXT:
34 // TODO(moshayedi): crbug.com/631524. Implement these types of composition
35 // events once we have the necessary fields in ui.mojom.CompositionEvent.
36 NOTIMPLEMENTED();
37 break;
38 }
39 }
40
41 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698