| 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 595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 606 // base::Callback. | 606 // base::Callback. |
| 607 ScopedJavaGlobalRef<jobject> j_callback; | 607 ScopedJavaGlobalRef<jobject> j_callback; |
| 608 j_callback.Reset(env, callback); | 608 j_callback.Reset(env, callback); |
| 609 | 609 |
| 610 WebContentsImpl::AXTreeSnapshotCallback snapshot_callback = | 610 WebContentsImpl::AXTreeSnapshotCallback snapshot_callback = |
| 611 base::Bind(&AXTreeSnapshotCallback, j_callback); | 611 base::Bind(&AXTreeSnapshotCallback, j_callback); |
| 612 static_cast<WebContentsImpl*>(web_contents_)->RequestAXTreeSnapshot( | 612 static_cast<WebContentsImpl*>(web_contents_)->RequestAXTreeSnapshot( |
| 613 snapshot_callback); | 613 snapshot_callback); |
| 614 } | 614 } |
| 615 | 615 |
| 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( | 616 ScopedJavaLocalRef<jstring> WebContentsAndroid::GetEncoding( |
| 632 JNIEnv* env, | 617 JNIEnv* env, |
| 633 const JavaParamRef<jobject>& obj) const { | 618 const JavaParamRef<jobject>& obj) const { |
| 634 return base::android::ConvertUTF8ToJavaString(env, | 619 return base::android::ConvertUTF8ToJavaString(env, |
| 635 web_contents_->GetEncoding()); | 620 web_contents_->GetEncoding()); |
| 636 } | 621 } |
| 637 | 622 |
| 638 void WebContentsAndroid::GetContentBitmap( | 623 void WebContentsAndroid::GetContentBitmap( |
| 639 JNIEnv* env, | 624 JNIEnv* env, |
| 640 const JavaParamRef<jobject>& obj, | 625 const JavaParamRef<jobject>& obj, |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 727 Java_WebContentsImpl_addToBitmapList(env, jbitmaps, jbitmap); | 712 Java_WebContentsImpl_addToBitmapList(env, jbitmaps, jbitmap); |
| 728 } | 713 } |
| 729 for (const gfx::Size& size : sizes) { | 714 for (const gfx::Size& size : sizes) { |
| 730 Java_WebContentsImpl_createSizeAndAddToList(env, jsizes, size.width(), | 715 Java_WebContentsImpl_createSizeAndAddToList(env, jsizes, size.width(), |
| 731 size.height()); | 716 size.height()); |
| 732 } | 717 } |
| 733 Java_WebContentsImpl_onDownloadImageFinished( | 718 Java_WebContentsImpl_onDownloadImageFinished( |
| 734 env, *obj, *callback, id, http_status_code, jurl, jbitmaps, jsizes); | 719 env, *obj, *callback, id, http_status_code, jurl, jbitmaps, jsizes); |
| 735 } | 720 } |
| 736 } // namespace content | 721 } // namespace content |
| OLD | NEW |