| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 "android_webview/native/aw_contents.h" | 5 #include "android_webview/native/aw_contents.h" |
| 6 | 6 |
| 7 #include "android_webview/browser/aw_browser_context.h" | 7 #include "android_webview/browser/aw_browser_context.h" |
| 8 #include "android_webview/browser/aw_browser_main_parts.h" | 8 #include "android_webview/browser/aw_browser_main_parts.h" |
| 9 #include "android_webview/browser/gpu_memory_buffer_factory_impl.h" | 9 #include "android_webview/browser/gpu_memory_buffer_factory_impl.h" |
| 10 #include "android_webview/browser/in_process_view_renderer.h" | 10 #include "android_webview/browser/in_process_view_renderer.h" |
| (...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 775 | 775 |
| 776 void AwContents::OnWebLayoutPageScaleFactorChanged(float page_scale_factor) { | 776 void AwContents::OnWebLayoutPageScaleFactorChanged(float page_scale_factor) { |
| 777 JNIEnv* env = AttachCurrentThread(); | 777 JNIEnv* env = AttachCurrentThread(); |
| 778 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 778 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
| 779 if (obj.is_null()) | 779 if (obj.is_null()) |
| 780 return; | 780 return; |
| 781 Java_AwContents_onWebLayoutPageScaleFactorChanged(env, obj.obj(), | 781 Java_AwContents_onWebLayoutPageScaleFactorChanged(env, obj.obj(), |
| 782 page_scale_factor); | 782 page_scale_factor); |
| 783 } | 783 } |
| 784 | 784 |
| 785 void AwContents::OnWebLayoutContentsSizeChanged( |
| 786 const gfx::Size& contents_size) { |
| 787 JNIEnv* env = AttachCurrentThread(); |
| 788 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
| 789 if (obj.is_null()) |
| 790 return; |
| 791 Java_AwContents_onWebLayoutContentsSizeChanged( |
| 792 env, obj.obj(), contents_size.width(), contents_size.height()); |
| 793 } |
| 794 |
| 785 jint AwContents::CapturePicture(JNIEnv* env, | 795 jint AwContents::CapturePicture(JNIEnv* env, |
| 786 jobject obj, | 796 jobject obj, |
| 787 int width, | 797 int width, |
| 788 int height) { | 798 int height) { |
| 789 return reinterpret_cast<jint>(new AwPicture( | 799 return reinterpret_cast<jint>(new AwPicture( |
| 790 browser_view_renderer_->CapturePicture(width, height))); | 800 browser_view_renderer_->CapturePicture(width, height))); |
| 791 } | 801 } |
| 792 | 802 |
| 793 void AwContents::EnableOnNewPicture(JNIEnv* env, | 803 void AwContents::EnableOnNewPicture(JNIEnv* env, |
| 794 jobject obj, | 804 jobject obj, |
| 795 jboolean enabled) { | 805 jboolean enabled) { |
| 796 browser_view_renderer_->EnableOnNewPicture(enabled); | 806 browser_view_renderer_->EnableOnNewPicture(enabled); |
| 797 } | 807 } |
| 798 | 808 |
| 799 void AwContents::SetJsOnlineProperty(JNIEnv* env, | 809 void AwContents::SetJsOnlineProperty(JNIEnv* env, |
| 800 jobject obj, | 810 jobject obj, |
| 801 jboolean network_up) { | 811 jboolean network_up) { |
| 802 render_view_host_ext_->SetJsOnlineProperty(network_up); | 812 render_view_host_ext_->SetJsOnlineProperty(network_up); |
| 803 } | 813 } |
| 804 | 814 |
| 805 } // namespace android_webview | 815 } // namespace android_webview |
| OLD | NEW |