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" |
11 #include "base/android/jni_string.h" | 11 #include "base/android/jni_string.h" |
12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
13 #include "base/containers/hash_tables.h" | 13 #include "base/containers/hash_tables.h" |
14 #include "base/json/json_writer.h" | 14 #include "base/json/json_writer.h" |
15 #include "base/lazy_instance.h" | 15 #include "base/lazy_instance.h" |
16 #include "base/logging.h" | 16 #include "base/logging.h" |
17 #include "content/browser/accessibility/browser_accessibility_android.h" | 17 #include "content/browser/accessibility/browser_accessibility_android.h" |
18 #include "content/browser/accessibility/browser_accessibility_manager_android.h" | 18 #include "content/browser/accessibility/browser_accessibility_manager_android.h" |
19 #include "content/browser/android/content_view_core_impl.h" | 19 #include "content/browser/android/content_view_core_impl.h" |
20 #include "content/browser/android/interstitial_page_delegate_android.h" | 20 #include "content/browser/android/interstitial_page_delegate_android.h" |
21 #include "content/browser/frame_host/interstitial_page_impl.h" | 21 #include "content/browser/frame_host/interstitial_page_impl.h" |
22 #include "content/browser/media/android/browser_media_player_manager.h" | 22 #include "content/browser/media/android/browser_media_player_manager.h" |
23 #include "content/browser/media/android/media_web_contents_observer_android.h" | 23 #include "content/browser/media/android/media_web_contents_observer_android.h" |
| 24 #include "content/browser/media/session/media_session.h" |
24 #include "content/browser/renderer_host/render_view_host_impl.h" | 25 #include "content/browser/renderer_host/render_view_host_impl.h" |
25 #include "content/browser/web_contents/web_contents_impl.h" | 26 #include "content/browser/web_contents/web_contents_impl.h" |
26 #include "content/common/devtools_messages.h" | 27 #include "content/common/devtools_messages.h" |
27 #include "content/common/frame_messages.h" | 28 #include "content/common/frame_messages.h" |
28 #include "content/common/input_messages.h" | 29 #include "content/common/input_messages.h" |
29 #include "content/common/view_messages.h" | 30 #include "content/common/view_messages.h" |
30 #include "content/public/browser/android/app_web_message_port_service.h" | 31 #include "content/public/browser/android/app_web_message_port_service.h" |
31 #include "content/public/browser/browser_context.h" | 32 #include "content/public/browser/browser_context.h" |
32 #include "content/public/browser/browser_thread.h" | 33 #include "content/public/browser/browser_thread.h" |
33 #include "content/public/browser/message_port_provider.h" | 34 #include "content/public/browser/message_port_provider.h" |
(...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
606 // base::Callback. | 607 // base::Callback. |
607 ScopedJavaGlobalRef<jobject> j_callback; | 608 ScopedJavaGlobalRef<jobject> j_callback; |
608 j_callback.Reset(env, callback); | 609 j_callback.Reset(env, callback); |
609 | 610 |
610 WebContentsImpl::AXTreeSnapshotCallback snapshot_callback = | 611 WebContentsImpl::AXTreeSnapshotCallback snapshot_callback = |
611 base::Bind(&AXTreeSnapshotCallback, j_callback); | 612 base::Bind(&AXTreeSnapshotCallback, j_callback); |
612 static_cast<WebContentsImpl*>(web_contents_)->RequestAXTreeSnapshot( | 613 static_cast<WebContentsImpl*>(web_contents_)->RequestAXTreeSnapshot( |
613 snapshot_callback); | 614 snapshot_callback); |
614 } | 615 } |
615 | 616 |
616 void WebContentsAndroid::ResumeMediaSession(JNIEnv* env, | |
617 const JavaParamRef<jobject>& obj) { | |
618 web_contents_->ResumeMediaSession(); | |
619 } | |
620 | |
621 void WebContentsAndroid::SuspendMediaSession(JNIEnv* env, | |
622 const JavaParamRef<jobject>& obj) { | |
623 web_contents_->SuspendMediaSession(); | |
624 } | |
625 | |
626 void WebContentsAndroid::StopMediaSession(JNIEnv* env, | |
627 const JavaParamRef<jobject>& obj) { | |
628 web_contents_->StopMediaSession(); | |
629 } | |
630 | |
631 ScopedJavaLocalRef<jstring> WebContentsAndroid::GetEncoding( | 617 ScopedJavaLocalRef<jstring> WebContentsAndroid::GetEncoding( |
632 JNIEnv* env, | 618 JNIEnv* env, |
633 const JavaParamRef<jobject>& obj) const { | 619 const JavaParamRef<jobject>& obj) const { |
634 return base::android::ConvertUTF8ToJavaString(env, | 620 return base::android::ConvertUTF8ToJavaString(env, |
635 web_contents_->GetEncoding()); | 621 web_contents_->GetEncoding()); |
636 } | 622 } |
637 | 623 |
638 void WebContentsAndroid::GetContentBitmap( | 624 void WebContentsAndroid::GetContentBitmap( |
639 JNIEnv* env, | 625 JNIEnv* env, |
640 const JavaParamRef<jobject>& obj, | 626 const JavaParamRef<jobject>& obj, |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
727 Java_WebContentsImpl_addToBitmapList(env, jbitmaps, jbitmap); | 713 Java_WebContentsImpl_addToBitmapList(env, jbitmaps, jbitmap); |
728 } | 714 } |
729 for (const gfx::Size& size : sizes) { | 715 for (const gfx::Size& size : sizes) { |
730 Java_WebContentsImpl_createSizeAndAddToList(env, jsizes, size.width(), | 716 Java_WebContentsImpl_createSizeAndAddToList(env, jsizes, size.width(), |
731 size.height()); | 717 size.height()); |
732 } | 718 } |
733 Java_WebContentsImpl_onDownloadImageFinished( | 719 Java_WebContentsImpl_onDownloadImageFinished( |
734 env, *obj, *callback, id, http_status_code, jurl, jbitmaps, jsizes); | 720 env, *obj, *callback, id, http_status_code, jurl, jbitmaps, jsizes); |
735 } | 721 } |
736 } // namespace content | 722 } // namespace content |
OLD | NEW |