OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 "content/browser/android/content_view_core_impl.h" | 5 #include "content/browser/android/content_view_core_impl.h" |
6 | 6 |
7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
8 #include "base/android/jni_array.h" | 8 #include "base/android/jni_array.h" |
9 #include "base/android/jni_string.h" | 9 #include "base/android/jni_string.h" |
10 #include "base/android/scoped_java_ref.h" | 10 #include "base/android/scoped_java_ref.h" |
(...skipping 1506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1517 return entry && entry->GetIsOverridingUserAgent(); | 1517 return entry && entry->GetIsOverridingUserAgent(); |
1518 } | 1518 } |
1519 | 1519 |
1520 void ContentViewCoreImpl::UpdateImeAdapter(int native_ime_adapter, | 1520 void ContentViewCoreImpl::UpdateImeAdapter(int native_ime_adapter, |
1521 int text_input_type, | 1521 int text_input_type, |
1522 const std::string& text, | 1522 const std::string& text, |
1523 int selection_start, | 1523 int selection_start, |
1524 int selection_end, | 1524 int selection_end, |
1525 int composition_start, | 1525 int composition_start, |
1526 int composition_end, | 1526 int composition_end, |
1527 bool show_ime_if_needed) { | 1527 bool show_ime_if_needed, |
| 1528 bool require_ack) { |
1528 JNIEnv* env = AttachCurrentThread(); | 1529 JNIEnv* env = AttachCurrentThread(); |
1529 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 1530 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
1530 if (obj.is_null()) | 1531 if (obj.is_null()) |
1531 return; | 1532 return; |
1532 | 1533 |
1533 ScopedJavaLocalRef<jstring> jstring_text = ConvertUTF8ToJavaString(env, text); | 1534 ScopedJavaLocalRef<jstring> jstring_text = ConvertUTF8ToJavaString(env, text); |
1534 Java_ContentViewCore_updateImeAdapter(env, obj.obj(), | 1535 Java_ContentViewCore_updateImeAdapter(env, obj.obj(), |
1535 native_ime_adapter, text_input_type, | 1536 native_ime_adapter, text_input_type, |
1536 jstring_text.obj(), | 1537 jstring_text.obj(), |
1537 selection_start, selection_end, | 1538 selection_start, selection_end, |
1538 composition_start, composition_end, | 1539 composition_start, composition_end, |
1539 show_ime_if_needed); | 1540 show_ime_if_needed, require_ack); |
1540 } | |
1541 | |
1542 void ContentViewCoreImpl::ProcessImeBatchStateAck(bool is_begin) { | |
1543 JNIEnv* env = AttachCurrentThread(); | |
1544 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | |
1545 if (obj.is_null()) | |
1546 return; | |
1547 Java_ContentViewCore_processImeBatchStateAck(env, obj.obj(), is_begin); | |
1548 } | 1541 } |
1549 | 1542 |
1550 void ContentViewCoreImpl::ClearSslPreferences(JNIEnv* env, jobject obj) { | 1543 void ContentViewCoreImpl::ClearSslPreferences(JNIEnv* env, jobject obj) { |
1551 SSLHostState* state = SSLHostState::GetFor( | 1544 SSLHostState* state = SSLHostState::GetFor( |
1552 web_contents_->GetController().GetBrowserContext()); | 1545 web_contents_->GetController().GetBrowserContext()); |
1553 state->Clear(); | 1546 state->Clear(); |
1554 } | 1547 } |
1555 | 1548 |
1556 void ContentViewCoreImpl::SetUseDesktopUserAgent( | 1549 void ContentViewCoreImpl::SetUseDesktopUserAgent( |
1557 JNIEnv* env, | 1550 JNIEnv* env, |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1609 reinterpret_cast<ui::ViewAndroid*>(view_android), | 1602 reinterpret_cast<ui::ViewAndroid*>(view_android), |
1610 reinterpret_cast<ui::WindowAndroid*>(window_android)); | 1603 reinterpret_cast<ui::WindowAndroid*>(window_android)); |
1611 return reinterpret_cast<jint>(view); | 1604 return reinterpret_cast<jint>(view); |
1612 } | 1605 } |
1613 | 1606 |
1614 bool RegisterContentViewCore(JNIEnv* env) { | 1607 bool RegisterContentViewCore(JNIEnv* env) { |
1615 return RegisterNativesImpl(env); | 1608 return RegisterNativesImpl(env); |
1616 } | 1609 } |
1617 | 1610 |
1618 } // namespace content | 1611 } // namespace content |
OLD | NEW |