| 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(const ImeFeature::WebInputRequest& request) override; | |
| 33 void OnHideImeRequested() override; | |
| 34 | |
| 35 // Sends the text entered from IME to the blimp engine. | |
| 36 void OnImeTextEntered(JNIEnv* env, | |
| 37 const base::android::JavaParamRef<jobject>& jobj, | |
| 38 const base::android::JavaParamRef<jstring>& text, | |
| 39 jboolean submit); | |
| 40 | |
| 41 private: | |
| 42 base::android::ScopedJavaGlobalRef<jobject> java_obj_; | |
| 43 | |
| 44 // The current request is saved in order to populate the fields of the | |
| 45 // subsequent response. | |
| 46 ImeFeature::WebInputRequest current_request_; | |
| 47 | |
| 48 DISALLOW_COPY_AND_ASSIGN(ImeHelperDialog); | |
| 49 }; | |
| 50 | |
| 51 } // namespace client | |
| 52 } // namespace blimp | |
| 53 #endif // BLIMP_CLIENT_CORE_CONTENTS_ANDROID_IME_HELPER_DIALOG_H_ | |
| OLD | NEW |