Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | |
|
sadrul
2016/08/16 20:01:51
no (c)
Hadi
2016/08/16 20:18:25
Done.
| |
| 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( | |
| 12 ui::mojom::TextInputClientRequest request, | |
| 13 ui::TextInputClient* text_input_client) | |
| 14 : text_input_client_(text_input_client), | |
| 15 binding_(this, std::move(request)) {} | |
| 16 | |
| 17 TextInputClientImpl::~TextInputClientImpl() {} | |
| 18 | |
| 19 void TextInputClientImpl::OnCompositionEvent( | |
| 20 ui::mojom::CompositionEventPtr event) { | |
| 21 switch (event->type) { | |
| 22 case ui::mojom::CompositionEventType::INSERT_CHAR: | |
| 23 text_input_client_->InsertChar(*(*event->key_event)->AsKeyEvent()); | |
| 24 break; | |
| 25 case ui::mojom::CompositionEventType::CONFIRM: | |
| 26 text_input_client_->ConfirmCompositionText(); | |
| 27 break; | |
| 28 case ui::mojom::CompositionEventType::CLEAR: | |
| 29 text_input_client_->ClearCompositionText(); | |
| 30 break; | |
| 31 case ui::mojom::CompositionEventType::UPDATE: | |
| 32 case ui::mojom::CompositionEventType::INSERT_TEXT: | |
| 33 // TODO(moshayedi): crbug.com/631524. Implement these types of composition | |
| 34 // events once we have the necessary fields in ui.mojom.CompositionEvent. | |
| 35 NOTIMPLEMENTED(); | |
| 36 break; | |
| 37 } | |
| 38 } | |
| 39 | |
| 40 } // namespace views | |
| OLD | NEW |