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 "base/android/jni_string.h" | 5 #include "base/android/jni_string.h" |
6 #include "blimp/client/app/android/blimp_client_session_android.h" | 6 #include "blimp/client/app/android/blimp_client_session_android.h" |
7 #include "blimp/client/app/android/web_input_box.h" | 7 #include "blimp/client/app/android/web_input_box.h" |
8 #include "blimp/client/feature/ime_feature.h" | 8 #include "blimp/client/feature/ime_feature.h" |
9 #include "jni/WebInputBox_jni.h" | 9 #include "jni/WebInputBox_jni.h" |
10 #include "ui/base/ime/text_input_type.h" | 10 #include "ui/base/ime/text_input_type.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 | 43 |
44 void WebInputBox::Destroy(JNIEnv* env, const JavaParamRef<jobject>& jobj) { | 44 void WebInputBox::Destroy(JNIEnv* env, const JavaParamRef<jobject>& jobj) { |
45 delete this; | 45 delete this; |
46 } | 46 } |
47 | 47 |
48 void WebInputBox::OnShowImeRequested(ui::TextInputType input_type, | 48 void WebInputBox::OnShowImeRequested(ui::TextInputType input_type, |
49 const std::string& text) { | 49 const std::string& text) { |
50 JNIEnv* env = base::android::AttachCurrentThread(); | 50 JNIEnv* env = base::android::AttachCurrentThread(); |
51 DCHECK_NE(ui::TEXT_INPUT_TYPE_NONE, input_type); | 51 DCHECK_NE(ui::TEXT_INPUT_TYPE_NONE, input_type); |
52 Java_WebInputBox_onShowImeRequested( | 52 Java_WebInputBox_onShowImeRequested( |
53 env, java_obj_.obj(), input_type, | 53 env, java_obj_, input_type, |
54 base::android::ConvertUTF8ToJavaString(env, text).obj()); | 54 base::android::ConvertUTF8ToJavaString(env, text)); |
55 } | 55 } |
56 | 56 |
57 void WebInputBox::OnHideImeRequested() { | 57 void WebInputBox::OnHideImeRequested() { |
58 JNIEnv* env = base::android::AttachCurrentThread(); | 58 JNIEnv* env = base::android::AttachCurrentThread(); |
59 Java_WebInputBox_onHideImeRequested(env, java_obj_.obj()); | 59 Java_WebInputBox_onHideImeRequested(env, java_obj_); |
60 } | 60 } |
61 | 61 |
62 void WebInputBox::OnImeTextEntered(JNIEnv* env, | 62 void WebInputBox::OnImeTextEntered(JNIEnv* env, |
63 const JavaParamRef<jobject>& jobj, | 63 const JavaParamRef<jobject>& jobj, |
64 const JavaParamRef<jstring>& text) { | 64 const JavaParamRef<jstring>& text) { |
65 std::string textInput = base::android::ConvertJavaStringToUTF8(env, text); | 65 std::string textInput = base::android::ConvertJavaStringToUTF8(env, text); |
66 ime_feature_->OnImeTextEntered(textInput); | 66 ime_feature_->OnImeTextEntered(textInput); |
67 } | 67 } |
68 | 68 |
69 } // namespace client | 69 } // namespace client |
70 } // namespace blimp | 70 } // namespace blimp |
OLD | NEW |