| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/web_contents/web_contents_android.h" | 5 #include "content/browser/web_contents/web_contents_android.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
| 10 #include "base/android/jni_array.h" | 10 #include "base/android/jni_array.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 #include "content/public/browser/message_port_provider.h" | 34 #include "content/public/browser/message_port_provider.h" |
| 35 #include "content/public/browser/render_widget_host.h" | 35 #include "content/public/browser/render_widget_host.h" |
| 36 #include "content/public/browser/web_contents.h" | 36 #include "content/public/browser/web_contents.h" |
| 37 #include "content/public/common/content_switches.h" | 37 #include "content/public/common/content_switches.h" |
| 38 #include "jni/WebContentsImpl_jni.h" | 38 #include "jni/WebContentsImpl_jni.h" |
| 39 #include "net/android/network_library.h" | 39 #include "net/android/network_library.h" |
| 40 #include "ui/accessibility/ax_node_data.h" | 40 #include "ui/accessibility/ax_node_data.h" |
| 41 #include "ui/android/overscroll_refresh_handler.h" | 41 #include "ui/android/overscroll_refresh_handler.h" |
| 42 #include "ui/android/window_android.h" | 42 #include "ui/android/window_android.h" |
| 43 #include "ui/gfx/android/java_bitmap.h" | 43 #include "ui/gfx/android/java_bitmap.h" |
| 44 #include "ui/gfx/geometry/point.h" |
| 44 #include "ui/gfx/geometry/rect.h" | 45 #include "ui/gfx/geometry/rect.h" |
| 45 | 46 |
| 46 using base::android::AttachCurrentThread; | 47 using base::android::AttachCurrentThread; |
| 47 using base::android::ConvertJavaStringToUTF8; | 48 using base::android::ConvertJavaStringToUTF8; |
| 48 using base::android::ConvertJavaStringToUTF16; | 49 using base::android::ConvertJavaStringToUTF16; |
| 49 using base::android::ConvertUTF8ToJavaString; | 50 using base::android::ConvertUTF8ToJavaString; |
| 50 using base::android::ConvertUTF16ToJavaString; | 51 using base::android::ConvertUTF16ToJavaString; |
| 51 using base::android::JavaParamRef; | 52 using base::android::JavaParamRef; |
| 52 using base::android::JavaRef; | 53 using base::android::JavaRef; |
| 53 using base::android::ScopedJavaGlobalRef; | 54 using base::android::ScopedJavaGlobalRef; |
| (...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 701 } | 702 } |
| 702 | 703 |
| 703 void WebContentsAndroid::DismissTextHandles( | 704 void WebContentsAndroid::DismissTextHandles( |
| 704 JNIEnv* env, | 705 JNIEnv* env, |
| 705 const base::android::JavaParamRef<jobject>& obj) { | 706 const base::android::JavaParamRef<jobject>& obj) { |
| 706 RenderWidgetHostViewAndroid* view = GetRenderWidgetHostViewAndroid(); | 707 RenderWidgetHostViewAndroid* view = GetRenderWidgetHostViewAndroid(); |
| 707 if (view) | 708 if (view) |
| 708 view->DismissTextHandles(); | 709 view->DismissTextHandles(); |
| 709 } | 710 } |
| 710 | 711 |
| 712 void WebContentsAndroid::ShowContextMenuAtPoint( |
| 713 JNIEnv* env, |
| 714 const base::android::JavaParamRef<jobject>& obj, |
| 715 int x, |
| 716 int y) { |
| 717 RenderWidgetHostViewAndroid* view = GetRenderWidgetHostViewAndroid(); |
| 718 if (view) |
| 719 view->ShowContextMenuAtPoint(gfx::Point(x, y)); |
| 720 } |
| 721 |
| 711 void WebContentsAndroid::SetHasPersistentVideo( | 722 void WebContentsAndroid::SetHasPersistentVideo( |
| 712 JNIEnv* env, | 723 JNIEnv* env, |
| 713 const base::android::JavaParamRef<jobject>& obj, | 724 const base::android::JavaParamRef<jobject>& obj, |
| 714 jboolean value) { | 725 jboolean value) { |
| 715 web_contents_->SetHasPersistentVideo(value); | 726 web_contents_->SetHasPersistentVideo(value); |
| 716 } | 727 } |
| 717 | 728 |
| 718 bool WebContentsAndroid::HasActiveEffectivelyFullscreenVideo( | 729 bool WebContentsAndroid::HasActiveEffectivelyFullscreenVideo( |
| 719 JNIEnv* env, | 730 JNIEnv* env, |
| 720 const base::android::JavaParamRef<jobject>& obj) { | 731 const base::android::JavaParamRef<jobject>& obj) { |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 772 env, obj, callback, id, http_status_code, jurl, jbitmaps, jsizes); | 783 env, obj, callback, id, http_status_code, jurl, jbitmaps, jsizes); |
| 773 } | 784 } |
| 774 | 785 |
| 775 void WebContentsAndroid::SetMediaSession( | 786 void WebContentsAndroid::SetMediaSession( |
| 776 const ScopedJavaLocalRef<jobject>& j_media_session) { | 787 const ScopedJavaLocalRef<jobject>& j_media_session) { |
| 777 JNIEnv* env = base::android::AttachCurrentThread(); | 788 JNIEnv* env = base::android::AttachCurrentThread(); |
| 778 Java_WebContentsImpl_setMediaSession(env, obj_, j_media_session); | 789 Java_WebContentsImpl_setMediaSession(env, obj_, j_media_session); |
| 779 } | 790 } |
| 780 | 791 |
| 781 } // namespace content | 792 } // namespace content |
| OLD | NEW |