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

Side by Side Diff: chrome/browser/ui/views/ime_driver/input_method_bridge_chromeos.cc

Issue 2629523009: IME for Mus: Remove OnTextInputModeChanged() from IME's mojo API. (Closed)
Patch Set: Created 3 years, 11 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
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(ui::mojom::TextInputClientPtr client) 10 InputMethodBridge::InputMethodBridge(ui::mojom::TextInputClientPtr client)
11 : client_(base::MakeUnique<RemoteTextInputClient>(std::move(client))), 11 : client_(base::MakeUnique<RemoteTextInputClient>(std::move(client))),
12 input_method_chromeos_( 12 input_method_chromeos_(
13 base::MakeUnique<ui::InputMethodChromeOS>(nullptr)) { 13 base::MakeUnique<ui::InputMethodChromeOS>(nullptr)) {
14 input_method_chromeos_->SetFocusedTextInputClient(client_.get()); 14 input_method_chromeos_->SetFocusedTextInputClient(client_.get());
15 } 15 }
16 16
17 InputMethodBridge::~InputMethodBridge() {} 17 InputMethodBridge::~InputMethodBridge() {}
18 18
19 void InputMethodBridge::OnTextInputModeChanged(
20 ui::TextInputMode text_input_mode) {
21 // TODO(moshayedi): crbug.com/631527. Consider removing this, as
22 // ui::InputMethodChromeOS doesn't have this.
23 }
24
25 void InputMethodBridge::OnTextInputTypeChanged( 19 void InputMethodBridge::OnTextInputTypeChanged(
26 ui::TextInputType text_input_type) { 20 ui::TextInputType text_input_type) {
27 input_method_chromeos_->OnTextInputTypeChanged(client_.get()); 21 input_method_chromeos_->OnTextInputTypeChanged(client_.get());
28 } 22 }
29 23
30 void InputMethodBridge::OnCaretBoundsChanged(const gfx::Rect& caret_bounds) { 24 void InputMethodBridge::OnCaretBoundsChanged(const gfx::Rect& caret_bounds) {
31 input_method_chromeos_->OnCaretBoundsChanged(client_.get()); 25 input_method_chromeos_->OnCaretBoundsChanged(client_.get());
32 } 26 }
33 27
34 void InputMethodBridge::ProcessKeyEvent( 28 void InputMethodBridge::ProcessKeyEvent(
35 std::unique_ptr<ui::Event> event, 29 std::unique_ptr<ui::Event> event,
36 const ProcessKeyEventCallback& callback) { 30 const ProcessKeyEventCallback& callback) {
37 DCHECK(event->IsKeyEvent()); 31 DCHECK(event->IsKeyEvent());
38 ui::KeyEvent* key_event = event->AsKeyEvent(); 32 ui::KeyEvent* key_event = event->AsKeyEvent();
39 if (!key_event->is_char()) { 33 if (!key_event->is_char()) {
40 input_method_chromeos_->DispatchKeyEvent( 34 input_method_chromeos_->DispatchKeyEvent(
41 key_event, base::MakeUnique<base::Callback<void(bool)>>(callback)); 35 key_event, base::MakeUnique<base::Callback<void(bool)>>(callback));
42 } else { 36 } else {
43 // On Linux (include ChromeOS), the mus emulates the WM_CHAR generation 37 // On Linux (include ChromeOS), the mus emulates the WM_CHAR generation
44 // behaviour of Windows. But for ChromeOS, we don't expect those char 38 // behaviour of Windows. But for ChromeOS, we don't expect those char
45 // events, so we filter them out. 39 // events, so we filter them out.
46 const bool handled = true; 40 const bool handled = true;
47 callback.Run(handled); 41 callback.Run(handled);
48 } 42 }
49 } 43 }
50 44
51 void InputMethodBridge::CancelComposition() { 45 void InputMethodBridge::CancelComposition() {
52 input_method_chromeos_->CancelComposition(client_.get()); 46 input_method_chromeos_->CancelComposition(client_.get());
53 } 47 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698