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 1565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1576 1 : (int)(height / dpi_scale()))); | 1576 1 : (int)(height / dpi_scale()))); |
1577 GetWebContents()->Send(new ViewMsg_ExtractSmartClipData( | 1577 GetWebContents()->Send(new ViewMsg_ExtractSmartClipData( |
1578 GetWebContents()->GetRoutingID(), rect)); | 1578 GetWebContents()->GetRoutingID(), rect)); |
1579 } | 1579 } |
1580 | 1580 |
1581 jint ContentViewCoreImpl::GetCurrentRenderProcessId(JNIEnv* env, jobject obj) { | 1581 jint ContentViewCoreImpl::GetCurrentRenderProcessId(JNIEnv* env, jobject obj) { |
1582 return GetRenderProcessIdFromRenderViewHost( | 1582 return GetRenderProcessIdFromRenderViewHost( |
1583 web_contents_->GetRenderViewHost()); | 1583 web_contents_->GetRenderViewHost()); |
1584 } | 1584 } |
1585 | 1585 |
| 1586 void ContentViewCoreImpl::SetBackgroundOpaque(JNIEnv* env, jobject jobj, |
| 1587 jboolean opaque) { |
| 1588 if (GetRenderWidgetHostViewAndroid()) |
| 1589 GetRenderWidgetHostViewAndroid()->SetBackgroundOpaque(opaque); |
| 1590 } |
| 1591 |
1586 void ContentViewCoreImpl::OnSmartClipDataExtracted( | 1592 void ContentViewCoreImpl::OnSmartClipDataExtracted( |
1587 const base::string16& result) { | 1593 const base::string16& result) { |
1588 JNIEnv* env = AttachCurrentThread(); | 1594 JNIEnv* env = AttachCurrentThread(); |
1589 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 1595 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
1590 if (obj.is_null()) | 1596 if (obj.is_null()) |
1591 return; | 1597 return; |
1592 ScopedJavaLocalRef<jstring> jresult = ConvertUTF16ToJavaString(env, result); | 1598 ScopedJavaLocalRef<jstring> jresult = ConvertUTF16ToJavaString(env, result); |
1593 Java_ContentViewCore_onSmartClipDataExtracted( | 1599 Java_ContentViewCore_onSmartClipDataExtracted( |
1594 env, obj.obj(), jresult.obj()); | 1600 env, obj.obj(), jresult.obj()); |
1595 } | 1601 } |
(...skipping 19 matching lines...) Expand all Loading... |
1615 reinterpret_cast<ui::WindowAndroid*>(window_android), | 1621 reinterpret_cast<ui::WindowAndroid*>(window_android), |
1616 retained_objects_set); | 1622 retained_objects_set); |
1617 return reinterpret_cast<intptr_t>(view); | 1623 return reinterpret_cast<intptr_t>(view); |
1618 } | 1624 } |
1619 | 1625 |
1620 bool RegisterContentViewCore(JNIEnv* env) { | 1626 bool RegisterContentViewCore(JNIEnv* env) { |
1621 return RegisterNativesImpl(env); | 1627 return RegisterNativesImpl(env); |
1622 } | 1628 } |
1623 | 1629 |
1624 } // namespace content | 1630 } // namespace content |
OLD | NEW |