| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef BLIMP_CLIENT_CORE_CONTENTS_ANDROID_IME_HELPER_DIALOG_H_ |
| 6 #define BLIMP_CLIENT_CORE_CONTENTS_ANDROID_IME_HELPER_DIALOG_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "base/android/jni_android.h" |
| 11 #include "base/macros.h" |
| 12 #include "blimp/client/core/contents/ime_feature.h" |
| 13 #include "ui/base/ime/text_input_type.h" |
| 14 |
| 15 namespace ui { |
| 16 class WindowAndroid; |
| 17 } // namespace ui |
| 18 |
| 19 namespace blimp { |
| 20 namespace client { |
| 21 |
| 22 // The native component of |
| 23 // org.chromium.blimp.core.contents.input.ImeHelperDialog |
| 24 class ImeHelperDialog : public ImeFeature::Delegate { |
| 25 public: |
| 26 static bool RegisterJni(JNIEnv* env); |
| 27 |
| 28 explicit ImeHelperDialog(ui::WindowAndroid* window); |
| 29 ~ImeHelperDialog() override; |
| 30 |
| 31 // ImeFeature::Delegate implementation. |
| 32 void OnShowImeRequested(ui::TextInputType input_type, |
| 33 const std::string& text, |
| 34 const ImeFeature::ShowImeCallback& callback) override; |
| 35 void OnHideImeRequested() override; |
| 36 |
| 37 // Sends the text entered from IME to the blimp engine. |
| 38 void OnImeTextEntered(JNIEnv* env, |
| 39 const base::android::JavaParamRef<jobject>& jobj, |
| 40 const base::android::JavaParamRef<jstring>& text); |
| 41 |
| 42 private: |
| 43 base::android::ScopedJavaLocalRef<jobject> java_obj_; |
| 44 |
| 45 // A callback for the current request to be executed on text submission from |
| 46 // the user. |
| 47 ImeFeature::ShowImeCallback text_submit_callback_; |
| 48 |
| 49 DISALLOW_COPY_AND_ASSIGN(ImeHelperDialog); |
| 50 }; |
| 51 |
| 52 } // namespace client |
| 53 } // namespace blimp |
| 54 #endif // BLIMP_CLIENT_CORE_CONTENTS_ANDROID_IME_HELPER_DIALOG_H_ |
| OLD | NEW |