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 "chrome/browser/ui/views/ime_driver/input_method_bridge_chromeos.h" | 5 #include "chrome/browser/ui/views/ime_driver/input_method_bridge_chromeos.h" |
6 | 6 |
7 #include "chrome/browser/ui/views/ime_driver/remote_text_input_client.h" | 7 #include "chrome/browser/ui/views/ime_driver/remote_text_input_client.h" |
8 | 8 |
9 InputMethodBridge::InputMethodBridge(ui::mojom::TextInputClientPtr client) | 9 InputMethodBridge::InputMethodBridge(ui::mojom::TextInputClientPtr client) |
10 : client_(base::MakeUnique<RemoteTextInputClient>(std::move(client))), | 10 : client_(base::MakeUnique<RemoteTextInputClient>(std::move(client))), |
(...skipping 21 matching lines...) Expand all Loading... | |
32 | 32 |
33 void InputMethodBridge::ProcessKeyEvent( | 33 void InputMethodBridge::ProcessKeyEvent( |
34 std::unique_ptr<ui::Event> event, | 34 std::unique_ptr<ui::Event> event, |
35 const ProcessKeyEventCallback& callback) { | 35 const ProcessKeyEventCallback& callback) { |
36 DCHECK(event->IsKeyEvent()); | 36 DCHECK(event->IsKeyEvent()); |
37 ui::KeyEvent* key_event = event->AsKeyEvent(); | 37 ui::KeyEvent* key_event = event->AsKeyEvent(); |
38 if (!key_event->is_char()) { | 38 if (!key_event->is_char()) { |
39 input_method_chromeos_->DispatchKeyEvent( | 39 input_method_chromeos_->DispatchKeyEvent( |
40 key_event, base::MakeUnique<base::Callback<void(bool)>>(callback)); | 40 key_event, base::MakeUnique<base::Callback<void(bool)>>(callback)); |
41 } else { | 41 } else { |
42 callback.Run(false); | 42 callback.Run(true); |
Hadi
2016/12/15 15:28:58
Can you please add some comments for why we are fi
Peng
2016/12/15 15:53:28
Done.
| |
43 } | 43 } |
44 } | 44 } |
45 | 45 |
46 void InputMethodBridge::CancelComposition() { | 46 void InputMethodBridge::CancelComposition() { |
47 input_method_chromeos_->CancelComposition(client_.get()); | 47 input_method_chromeos_->CancelComposition(client_.get()); |
48 } | 48 } |
OLD | NEW |