| 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 "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "chrome/browser/ui/views/ime_driver/remote_text_input_client.h" | 8 #include "chrome/browser/ui/views/ime_driver/remote_text_input_client.h" |
| 9 | 9 |
| 10 InputMethodBridge::InputMethodBridge( | 10 InputMethodBridge::InputMethodBridge( |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 | 30 |
| 31 void InputMethodBridge::ProcessKeyEvent( | 31 void InputMethodBridge::ProcessKeyEvent( |
| 32 std::unique_ptr<ui::Event> event, | 32 std::unique_ptr<ui::Event> event, |
| 33 const ProcessKeyEventCallback& callback) { | 33 const ProcessKeyEventCallback& callback) { |
| 34 DCHECK(event->IsKeyEvent()); | 34 DCHECK(event->IsKeyEvent()); |
| 35 ui::KeyEvent* key_event = event->AsKeyEvent(); | 35 ui::KeyEvent* key_event = event->AsKeyEvent(); |
| 36 if (!key_event->is_char()) { | 36 if (!key_event->is_char()) { |
| 37 input_method_chromeos_->DispatchKeyEvent( | 37 input_method_chromeos_->DispatchKeyEvent( |
| 38 key_event, base::MakeUnique<base::Callback<void(bool)>>(callback)); | 38 key_event, base::MakeUnique<base::Callback<void(bool)>>(callback)); |
| 39 } else { | 39 } else { |
| 40 // On Linux (include ChromeOS), the mus emulates the WM_CHAR generation | 40 const bool handled = false; |
| 41 // behaviour of Windows. But for ChromeOS, we don't expect those char | |
| 42 // events, so we filter them out. | |
| 43 const bool handled = true; | |
| 44 callback.Run(handled); | 41 callback.Run(handled); |
| 45 } | 42 } |
| 46 } | 43 } |
| 47 | 44 |
| 48 void InputMethodBridge::CancelComposition() { | 45 void InputMethodBridge::CancelComposition() { |
| 49 input_method_chromeos_->CancelComposition(client_.get()); | 46 input_method_chromeos_->CancelComposition(client_.get()); |
| 50 } | 47 } |
| OLD | NEW |