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 1513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1524 return entry && entry->GetIsOverridingUserAgent(); | 1524 return entry && entry->GetIsOverridingUserAgent(); |
1525 } | 1525 } |
1526 | 1526 |
1527 void ContentViewCoreImpl::UpdateImeAdapter(int native_ime_adapter, | 1527 void ContentViewCoreImpl::UpdateImeAdapter(int native_ime_adapter, |
1528 int text_input_type, | 1528 int text_input_type, |
1529 const std::string& text, | 1529 const std::string& text, |
1530 int selection_start, | 1530 int selection_start, |
1531 int selection_end, | 1531 int selection_end, |
1532 int composition_start, | 1532 int composition_start, |
1533 int composition_end, | 1533 int composition_end, |
1534 bool show_ime_if_needed) { | 1534 bool show_ime_if_needed, |
| 1535 bool require_ack) { |
1535 JNIEnv* env = AttachCurrentThread(); | 1536 JNIEnv* env = AttachCurrentThread(); |
1536 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 1537 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
1537 if (obj.is_null()) | 1538 if (obj.is_null()) |
1538 return; | 1539 return; |
1539 | 1540 |
1540 ScopedJavaLocalRef<jstring> jstring_text = ConvertUTF8ToJavaString(env, text); | 1541 ScopedJavaLocalRef<jstring> jstring_text = ConvertUTF8ToJavaString(env, text); |
1541 Java_ContentViewCore_updateImeAdapter(env, obj.obj(), | 1542 Java_ContentViewCore_updateImeAdapter(env, obj.obj(), |
1542 native_ime_adapter, text_input_type, | 1543 native_ime_adapter, text_input_type, |
1543 jstring_text.obj(), | 1544 jstring_text.obj(), |
1544 selection_start, selection_end, | 1545 selection_start, selection_end, |
1545 composition_start, composition_end, | 1546 composition_start, composition_end, |
1546 show_ime_if_needed); | 1547 show_ime_if_needed, require_ack); |
1547 } | |
1548 | |
1549 void ContentViewCoreImpl::ProcessImeBatchStateAck(bool is_begin) { | |
1550 JNIEnv* env = AttachCurrentThread(); | |
1551 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | |
1552 if (obj.is_null()) | |
1553 return; | |
1554 Java_ContentViewCore_processImeBatchStateAck(env, obj.obj(), is_begin); | |
1555 } | 1548 } |
1556 | 1549 |
1557 void ContentViewCoreImpl::ClearSslPreferences(JNIEnv* env, jobject obj) { | 1550 void ContentViewCoreImpl::ClearSslPreferences(JNIEnv* env, jobject obj) { |
1558 SSLHostState* state = SSLHostState::GetFor( | 1551 SSLHostState* state = SSLHostState::GetFor( |
1559 web_contents_->GetController().GetBrowserContext()); | 1552 web_contents_->GetController().GetBrowserContext()); |
1560 state->Clear(); | 1553 state->Clear(); |
1561 } | 1554 } |
1562 | 1555 |
1563 void ContentViewCoreImpl::SetUseDesktopUserAgent( | 1556 void ContentViewCoreImpl::SetUseDesktopUserAgent( |
1564 JNIEnv* env, | 1557 JNIEnv* env, |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1621 reinterpret_cast<ui::ViewAndroid*>(view_android), | 1614 reinterpret_cast<ui::ViewAndroid*>(view_android), |
1622 reinterpret_cast<ui::WindowAndroid*>(window_android)); | 1615 reinterpret_cast<ui::WindowAndroid*>(window_android)); |
1623 return reinterpret_cast<jint>(view); | 1616 return reinterpret_cast<jint>(view); |
1624 } | 1617 } |
1625 | 1618 |
1626 bool RegisterContentViewCore(JNIEnv* env) { | 1619 bool RegisterContentViewCore(JNIEnv* env) { |
1627 return RegisterNativesImpl(env); | 1620 return RegisterNativesImpl(env); |
1628 } | 1621 } |
1629 | 1622 |
1630 } // namespace content | 1623 } // namespace content |
OLD | NEW |