| 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( |
| 11 std::unique_ptr<RemoteTextInputClient> client) | 11 std::unique_ptr<RemoteTextInputClient> client) |
| 12 : client_(std::move(client)), | 12 : client_(std::move(client)), |
| 13 input_method_chromeos_( | 13 input_method_chromeos_( |
| 14 base::MakeUnique<ui::InputMethodChromeOS>(nullptr)) { | 14 base::MakeUnique<ui::InputMethodChromeOS>(client_.get())) { |
| 15 input_method_chromeos_->SetFocusedTextInputClient(client_.get()); | 15 input_method_chromeos_->SetFocusedTextInputClient(client_.get()); |
| 16 } | 16 } |
| 17 | 17 |
| 18 InputMethodBridge::~InputMethodBridge() {} | 18 InputMethodBridge::~InputMethodBridge() {} |
| 19 | 19 |
| 20 void InputMethodBridge::OnTextInputTypeChanged( | 20 void InputMethodBridge::OnTextInputTypeChanged( |
| 21 ui::TextInputType text_input_type) { | 21 ui::TextInputType text_input_type) { |
| 22 client_->SetTextInputType(text_input_type); | 22 client_->SetTextInputType(text_input_type); |
| 23 input_method_chromeos_->OnTextInputTypeChanged(client_.get()); | 23 input_method_chromeos_->OnTextInputTypeChanged(client_.get()); |
| 24 } | 24 } |
| (...skipping 13 matching lines...) Expand all Loading... |
| 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 const bool handled = false; | 40 const bool handled = false; |
| 41 callback.Run(handled); | 41 callback.Run(handled); |
| 42 } | 42 } |
| 43 } | 43 } |
| 44 | 44 |
| 45 void InputMethodBridge::CancelComposition() { | 45 void InputMethodBridge::CancelComposition() { |
| 46 input_method_chromeos_->CancelComposition(client_.get()); | 46 input_method_chromeos_->CancelComposition(client_.get()); |
| 47 } | 47 } |
| OLD | NEW |