| 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 22 matching lines...) Expand all Loading... |
| 33 #include "content/public/browser/browser_thread.h" | 33 #include "content/public/browser/browser_thread.h" |
| 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/gfx/android/java_bitmap.h" | 42 #include "ui/gfx/android/java_bitmap.h" |
| 43 #include "ui/gfx/geometry/point.h" | |
| 44 #include "ui/gfx/geometry/rect.h" | 43 #include "ui/gfx/geometry/rect.h" |
| 45 | 44 |
| 46 using base::android::AttachCurrentThread; | 45 using base::android::AttachCurrentThread; |
| 47 using base::android::ConvertJavaStringToUTF8; | 46 using base::android::ConvertJavaStringToUTF8; |
| 48 using base::android::ConvertJavaStringToUTF16; | 47 using base::android::ConvertJavaStringToUTF16; |
| 49 using base::android::ConvertUTF8ToJavaString; | 48 using base::android::ConvertUTF8ToJavaString; |
| 50 using base::android::ConvertUTF16ToJavaString; | 49 using base::android::ConvertUTF16ToJavaString; |
| 51 using base::android::JavaParamRef; | 50 using base::android::JavaParamRef; |
| 52 using base::android::JavaRef; | 51 using base::android::JavaRef; |
| 53 using base::android::ScopedJavaGlobalRef; | 52 using base::android::ScopedJavaGlobalRef; |
| (...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 697 } | 696 } |
| 698 | 697 |
| 699 void WebContentsAndroid::DismissTextHandles( | 698 void WebContentsAndroid::DismissTextHandles( |
| 700 JNIEnv* env, | 699 JNIEnv* env, |
| 701 const base::android::JavaParamRef<jobject>& obj) { | 700 const base::android::JavaParamRef<jobject>& obj) { |
| 702 RenderWidgetHostViewAndroid* view = GetRenderWidgetHostViewAndroid(); | 701 RenderWidgetHostViewAndroid* view = GetRenderWidgetHostViewAndroid(); |
| 703 if (view) | 702 if (view) |
| 704 view->DismissTextHandles(); | 703 view->DismissTextHandles(); |
| 705 } | 704 } |
| 706 | 705 |
| 707 void WebContentsAndroid::ShowContextMenuAtPoint( | |
| 708 JNIEnv* env, | |
| 709 const base::android::JavaParamRef<jobject>& obj, | |
| 710 int x, | |
| 711 int y) { | |
| 712 RenderWidgetHostViewAndroid* view = GetRenderWidgetHostViewAndroid(); | |
| 713 if (view) | |
| 714 view->ShowContextMenuAtPoint(gfx::Point(x, y)); | |
| 715 } | |
| 716 | |
| 717 void WebContentsAndroid::SetHasPersistentVideo( | 706 void WebContentsAndroid::SetHasPersistentVideo( |
| 718 JNIEnv* env, | 707 JNIEnv* env, |
| 719 const base::android::JavaParamRef<jobject>& obj, | 708 const base::android::JavaParamRef<jobject>& obj, |
| 720 jboolean value) { | 709 jboolean value) { |
| 721 web_contents_->SetHasPersistentVideo(value); | 710 web_contents_->SetHasPersistentVideo(value); |
| 722 } | 711 } |
| 723 | 712 |
| 724 bool WebContentsAndroid::HasActiveEffectivelyFullscreenVideo( | 713 bool WebContentsAndroid::HasActiveEffectivelyFullscreenVideo( |
| 725 JNIEnv* env, | 714 JNIEnv* env, |
| 726 const base::android::JavaParamRef<jobject>& obj) { | 715 const base::android::JavaParamRef<jobject>& obj) { |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 771 env, obj, callback, id, http_status_code, jurl, jbitmaps, jsizes); | 760 env, obj, callback, id, http_status_code, jurl, jbitmaps, jsizes); |
| 772 } | 761 } |
| 773 | 762 |
| 774 void WebContentsAndroid::SetMediaSession( | 763 void WebContentsAndroid::SetMediaSession( |
| 775 const ScopedJavaLocalRef<jobject>& j_media_session) { | 764 const ScopedJavaLocalRef<jobject>& j_media_session) { |
| 776 JNIEnv* env = base::android::AttachCurrentThread(); | 765 JNIEnv* env = base::android::AttachCurrentThread(); |
| 777 Java_WebContentsImpl_setMediaSession(env, obj_, j_media_session); | 766 Java_WebContentsImpl_setMediaSession(env, obj_, j_media_session); |
| 778 } | 767 } |
| 779 | 768 |
| 780 } // namespace content | 769 } // namespace content |
| OLD | NEW |