Chromium Code Reviews| 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 "ui/views/mus/text_input_client_impl.h" | 5 #include "ui/views/mus/text_input_client_impl.h" |
| 6 | 6 |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "ui/base/ime/text_input_client.h" | 8 #include "ui/base/ime/text_input_client.h" |
| 9 #include "ui/views/mus/input_method_mus.h" | 9 #include "ui/views/mus/input_method_mus.h" |
| 10 | 10 |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 31 void TextInputClientImpl::ClearCompositionText() { | 31 void TextInputClientImpl::ClearCompositionText() { |
| 32 text_input_client_->ClearCompositionText(); | 32 text_input_client_->ClearCompositionText(); |
| 33 } | 33 } |
| 34 | 34 |
| 35 void TextInputClientImpl::InsertText(const std::string& text) { | 35 void TextInputClientImpl::InsertText(const std::string& text) { |
| 36 text_input_client_->InsertText(base::UTF8ToUTF16(text)); | 36 text_input_client_->InsertText(base::UTF8ToUTF16(text)); |
| 37 } | 37 } |
| 38 | 38 |
| 39 void TextInputClientImpl::InsertChar(std::unique_ptr<ui::Event> event) { | 39 void TextInputClientImpl::InsertChar(std::unique_ptr<ui::Event> event) { |
| 40 DCHECK(event->IsKeyEvent()); | 40 DCHECK(event->IsKeyEvent()); |
| 41 ui::KeyEvent* key_event = event->AsKeyEvent(); | 41 text_input_client_->InsertChar(*event->AsKeyEvent()); |
| 42 DCHECK(key_event->is_char()); | |
|
sadrul
2016/12/12 18:50:16
Does this DCHECK() no longer hold?
| |
| 43 text_input_client_->InsertChar(*key_event); | |
| 44 } | 42 } |
| 45 | 43 |
| 46 } // namespace views | 44 } // namespace views |
| OLD | NEW |