| 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 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 613 // base::Callback. | 613 // base::Callback. |
| 614 ScopedJavaGlobalRef<jobject> j_callback; | 614 ScopedJavaGlobalRef<jobject> j_callback; |
| 615 j_callback.Reset(env, callback); | 615 j_callback.Reset(env, callback); |
| 616 | 616 |
| 617 WebContentsImpl::AXTreeSnapshotCallback snapshot_callback = | 617 WebContentsImpl::AXTreeSnapshotCallback snapshot_callback = |
| 618 base::Bind(&AXTreeSnapshotCallback, j_callback); | 618 base::Bind(&AXTreeSnapshotCallback, j_callback); |
| 619 static_cast<WebContentsImpl*>(web_contents_)->RequestAXTreeSnapshot( | 619 static_cast<WebContentsImpl*>(web_contents_)->RequestAXTreeSnapshot( |
| 620 snapshot_callback); | 620 snapshot_callback); |
| 621 } | 621 } |
| 622 | 622 |
| 623 void WebContentsAndroid::ResumeMediaSession(JNIEnv* env, | |
| 624 const JavaParamRef<jobject>& obj) { | |
| 625 web_contents_->ResumeMediaSession(); | |
| 626 } | |
| 627 | |
| 628 void WebContentsAndroid::SuspendMediaSession(JNIEnv* env, | |
| 629 const JavaParamRef<jobject>& obj) { | |
| 630 web_contents_->SuspendMediaSession(); | |
| 631 } | |
| 632 | |
| 633 void WebContentsAndroid::StopMediaSession(JNIEnv* env, | |
| 634 const JavaParamRef<jobject>& obj) { | |
| 635 web_contents_->StopMediaSession(); | |
| 636 } | |
| 637 | |
| 638 ScopedJavaLocalRef<jstring> WebContentsAndroid::GetEncoding( | 623 ScopedJavaLocalRef<jstring> WebContentsAndroid::GetEncoding( |
| 639 JNIEnv* env, | 624 JNIEnv* env, |
| 640 const JavaParamRef<jobject>& obj) const { | 625 const JavaParamRef<jobject>& obj) const { |
| 641 return base::android::ConvertUTF8ToJavaString(env, | 626 return base::android::ConvertUTF8ToJavaString(env, |
| 642 web_contents_->GetEncoding()); | 627 web_contents_->GetEncoding()); |
| 643 } | 628 } |
| 644 | 629 |
| 645 void WebContentsAndroid::GetContentBitmap( | 630 void WebContentsAndroid::GetContentBitmap( |
| 646 JNIEnv* env, | 631 JNIEnv* env, |
| 647 const JavaParamRef<jobject>& obj, | 632 const JavaParamRef<jobject>& obj, |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 734 Java_WebContentsImpl_addToBitmapList(env, jbitmaps, jbitmap); | 719 Java_WebContentsImpl_addToBitmapList(env, jbitmaps, jbitmap); |
| 735 } | 720 } |
| 736 for (const gfx::Size& size : sizes) { | 721 for (const gfx::Size& size : sizes) { |
| 737 Java_WebContentsImpl_createSizeAndAddToList(env, jsizes, size.width(), | 722 Java_WebContentsImpl_createSizeAndAddToList(env, jsizes, size.width(), |
| 738 size.height()); | 723 size.height()); |
| 739 } | 724 } |
| 740 Java_WebContentsImpl_onDownloadImageFinished( | 725 Java_WebContentsImpl_onDownloadImageFinished( |
| 741 env, *obj, *callback, id, http_status_code, jurl, jbitmaps, jsizes); | 726 env, *obj, *callback, id, http_status_code, jurl, jbitmaps, jsizes); |
| 742 } | 727 } |
| 743 } // namespace content | 728 } // namespace content |
| OLD | NEW |