| 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 773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 784 | 784 |
| 785 void AwContents::OnWebLayoutPageScaleFactorChanged(float page_scale_factor) { | 785 void AwContents::OnWebLayoutPageScaleFactorChanged(float page_scale_factor) { |
| 786 JNIEnv* env = AttachCurrentThread(); | 786 JNIEnv* env = AttachCurrentThread(); |
| 787 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 787 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
| 788 if (obj.is_null()) | 788 if (obj.is_null()) |
| 789 return; | 789 return; |
| 790 Java_AwContents_onWebLayoutPageScaleFactorChanged(env, obj.obj(), | 790 Java_AwContents_onWebLayoutPageScaleFactorChanged(env, obj.obj(), |
| 791 page_scale_factor); | 791 page_scale_factor); |
| 792 } | 792 } |
| 793 | 793 |
| 794 void AwContents::OnWebLayoutContentsSizeChanged( |
| 795 const gfx::Size& contents_size) { |
| 796 JNIEnv* env = AttachCurrentThread(); |
| 797 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
| 798 if (obj.is_null()) |
| 799 return; |
| 800 Java_AwContents_onWebLayoutContentsSizeChanged( |
| 801 env, obj.obj(), contents_size.width(), contents_size.height()); |
| 802 } |
| 803 |
| 794 jint AwContents::CapturePicture(JNIEnv* env, | 804 jint AwContents::CapturePicture(JNIEnv* env, |
| 795 jobject obj, | 805 jobject obj, |
| 796 int width, | 806 int width, |
| 797 int height) { | 807 int height) { |
| 798 return reinterpret_cast<jint>(new AwPicture( | 808 return reinterpret_cast<jint>(new AwPicture( |
| 799 browser_view_renderer_->CapturePicture(width, height))); | 809 browser_view_renderer_->CapturePicture(width, height))); |
| 800 } | 810 } |
| 801 | 811 |
| 802 void AwContents::EnableOnNewPicture(JNIEnv* env, | 812 void AwContents::EnableOnNewPicture(JNIEnv* env, |
| 803 jobject obj, | 813 jobject obj, |
| 804 jboolean enabled) { | 814 jboolean enabled) { |
| 805 browser_view_renderer_->EnableOnNewPicture(enabled); | 815 browser_view_renderer_->EnableOnNewPicture(enabled); |
| 806 } | 816 } |
| 807 | 817 |
| 808 void AwContents::SetJsOnlineProperty(JNIEnv* env, | 818 void AwContents::SetJsOnlineProperty(JNIEnv* env, |
| 809 jobject obj, | 819 jobject obj, |
| 810 jboolean network_up) { | 820 jboolean network_up) { |
| 811 render_view_host_ext_->SetJsOnlineProperty(network_up); | 821 render_view_host_ext_->SetJsOnlineProperty(network_up); |
| 812 } | 822 } |
| 813 | 823 |
| 814 } // namespace android_webview | 824 } // namespace android_webview |
| OLD | NEW |