Chromium Code Reviews| 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 1524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1535 return ConvertUTF8ToJavaString(env, entry->GetOriginalRequestURL().spec()); | 1535 return ConvertUTF8ToJavaString(env, entry->GetOriginalRequestURL().spec()); |
| 1536 } | 1536 } |
| 1537 | 1537 |
| 1538 int ContentViewCoreImpl::GetNativeImeAdapter(JNIEnv* env, jobject obj) { | 1538 int ContentViewCoreImpl::GetNativeImeAdapter(JNIEnv* env, jobject obj) { |
| 1539 RenderWidgetHostViewAndroid* rwhva = GetRenderWidgetHostViewAndroid(); | 1539 RenderWidgetHostViewAndroid* rwhva = GetRenderWidgetHostViewAndroid(); |
| 1540 if (!rwhva) | 1540 if (!rwhva) |
| 1541 return 0; | 1541 return 0; |
| 1542 return rwhva->GetNativeImeAdapter(); | 1542 return rwhva->GetNativeImeAdapter(); |
| 1543 } | 1543 } |
| 1544 | 1544 |
| 1545 void ContentViewCoreImpl::UndoScrollFocusedEditableNodeIntoView( | |
|
aurimas (slooooooooow)
2014/03/12 18:06:11
Remove this in the header file too.
jdduke (slow)
2014/03/12 18:18:55
Done.
| |
| 1546 JNIEnv* env, | |
| 1547 jobject obj) { | |
| 1548 RenderViewHost* host = web_contents_->GetRenderViewHost(); | |
| 1549 host->Send( | |
| 1550 new ViewMsg_UndoScrollFocusedEditableNodeIntoView(host->GetRoutingID())); | |
| 1551 } | |
| 1552 | |
| 1553 namespace { | 1545 namespace { |
| 1554 void JavaScriptResultCallback(const ScopedJavaGlobalRef<jobject>& callback, | 1546 void JavaScriptResultCallback(const ScopedJavaGlobalRef<jobject>& callback, |
| 1555 const base::Value* result) { | 1547 const base::Value* result) { |
| 1556 JNIEnv* env = base::android::AttachCurrentThread(); | 1548 JNIEnv* env = base::android::AttachCurrentThread(); |
| 1557 std::string json; | 1549 std::string json; |
| 1558 base::JSONWriter::Write(result, &json); | 1550 base::JSONWriter::Write(result, &json); |
| 1559 ScopedJavaLocalRef<jstring> j_json = ConvertUTF8ToJavaString(env, json); | 1551 ScopedJavaLocalRef<jstring> j_json = ConvertUTF8ToJavaString(env, json); |
| 1560 Java_ContentViewCore_onEvaluateJavaScriptResult(env, | 1552 Java_ContentViewCore_onEvaluateJavaScriptResult(env, |
| 1561 j_json.obj(), | 1553 j_json.obj(), |
| 1562 callback.obj()); | 1554 callback.obj()); |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1770 reinterpret_cast<ui::ViewAndroid*>(view_android), | 1762 reinterpret_cast<ui::ViewAndroid*>(view_android), |
| 1771 reinterpret_cast<ui::WindowAndroid*>(window_android)); | 1763 reinterpret_cast<ui::WindowAndroid*>(window_android)); |
| 1772 return reinterpret_cast<intptr_t>(view); | 1764 return reinterpret_cast<intptr_t>(view); |
| 1773 } | 1765 } |
| 1774 | 1766 |
| 1775 bool RegisterContentViewCore(JNIEnv* env) { | 1767 bool RegisterContentViewCore(JNIEnv* env) { |
| 1776 return RegisterNativesImpl(env); | 1768 return RegisterNativesImpl(env); |
| 1777 } | 1769 } |
| 1778 | 1770 |
| 1779 } // namespace content | 1771 } // namespace content |
| OLD | NEW |