OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "ui/base/ime/input_method_android.h" |
| 6 |
| 7 #include "ui/base/ime/text_input_client.h" |
| 8 #include "ui/events/event.h" |
| 9 |
| 10 // TODO(bshe): This is currently very similar to InputMethodMUS. Consider unify |
| 11 // them in the furture if the two have reasonable similarity. |
| 12 |
| 13 namespace ui { |
| 14 |
| 15 //////////////////////////////////////////////////////////////////////////////// |
| 16 // InputMethodAndroid, public: |
| 17 |
| 18 InputMethodAndroid::InputMethodAndroid( |
| 19 internal::InputMethodDelegate* delegate) { |
| 20 SetDelegate(delegate); |
| 21 } |
| 22 |
| 23 InputMethodAndroid::~InputMethodAndroid() {} |
| 24 |
| 25 bool InputMethodAndroid::OnUntranslatedIMEMessage( |
| 26 const base::NativeEvent& event, |
| 27 NativeEventResult* result) { |
| 28 return false; |
| 29 } |
| 30 |
| 31 void InputMethodAndroid::DispatchKeyEvent(ui::KeyEvent* event) { |
| 32 DCHECK(event->type() == ui::ET_KEY_PRESSED || |
| 33 event->type() == ui::ET_KEY_RELEASED); |
| 34 |
| 35 // If no text input client, do nothing. |
| 36 if (!GetTextInputClient()) { |
| 37 ignore_result(DispatchKeyEventPostIME(event)); |
| 38 return; |
| 39 } |
| 40 |
| 41 ignore_result(DispatchKeyEventPostIME(event)); |
| 42 } |
| 43 |
| 44 void InputMethodAndroid::OnCaretBoundsChanged( |
| 45 const ui::TextInputClient* client) { |
| 46 } |
| 47 |
| 48 void InputMethodAndroid::CancelComposition( |
| 49 const ui::TextInputClient* client) { |
| 50 } |
| 51 |
| 52 void InputMethodAndroid::OnInputLocaleChanged() {} |
| 53 |
| 54 std::string InputMethodAndroid::GetInputLocale() { |
| 55 return ""; |
| 56 } |
| 57 |
| 58 bool InputMethodAndroid::IsCandidatePopupOpen() const { |
| 59 return false; |
| 60 } |
| 61 |
| 62 } // namespace ui |
OLD | NEW |