| 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 815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 826 | 826 |
| 827 void AwContents::OnWebLayoutPageScaleFactorChanged(float page_scale_factor) { | 827 void AwContents::OnWebLayoutPageScaleFactorChanged(float page_scale_factor) { |
| 828 JNIEnv* env = AttachCurrentThread(); | 828 JNIEnv* env = AttachCurrentThread(); |
| 829 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 829 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
| 830 if (obj.is_null()) | 830 if (obj.is_null()) |
| 831 return; | 831 return; |
| 832 Java_AwContents_onWebLayoutPageScaleFactorChanged(env, obj.obj(), | 832 Java_AwContents_onWebLayoutPageScaleFactorChanged(env, obj.obj(), |
| 833 page_scale_factor); | 833 page_scale_factor); |
| 834 } | 834 } |
| 835 | 835 |
| 836 void AwContents::OnWebLayoutContentsSizeChanged( |
| 837 const gfx::Size& contents_size) { |
| 838 JNIEnv* env = AttachCurrentThread(); |
| 839 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
| 840 if (obj.is_null()) |
| 841 return; |
| 842 Java_AwContents_onWebLayoutContentsSizeChanged( |
| 843 env, obj.obj(), contents_size.width(), contents_size.height()); |
| 844 } |
| 845 |
| 836 jint AwContents::CapturePicture(JNIEnv* env, | 846 jint AwContents::CapturePicture(JNIEnv* env, |
| 837 jobject obj, | 847 jobject obj, |
| 838 int width, | 848 int width, |
| 839 int height) { | 849 int height) { |
| 840 return reinterpret_cast<jint>(new AwPicture( | 850 return reinterpret_cast<jint>(new AwPicture( |
| 841 browser_view_renderer_->CapturePicture(width, height))); | 851 browser_view_renderer_->CapturePicture(width, height))); |
| 842 } | 852 } |
| 843 | 853 |
| 844 void AwContents::EnableOnNewPicture(JNIEnv* env, | 854 void AwContents::EnableOnNewPicture(JNIEnv* env, |
| 845 jobject obj, | 855 jobject obj, |
| 846 jboolean enabled) { | 856 jboolean enabled) { |
| 847 browser_view_renderer_->EnableOnNewPicture(enabled); | 857 browser_view_renderer_->EnableOnNewPicture(enabled); |
| 848 } | 858 } |
| 849 | 859 |
| 850 void AwContents::SetJsOnlineProperty(JNIEnv* env, | 860 void AwContents::SetJsOnlineProperty(JNIEnv* env, |
| 851 jobject obj, | 861 jobject obj, |
| 852 jboolean network_up) { | 862 jboolean network_up) { |
| 853 render_view_host_ext_->SetJsOnlineProperty(network_up); | 863 render_view_host_ext_->SetJsOnlineProperty(network_up); |
| 854 } | 864 } |
| 855 | 865 |
| 856 } // namespace android_webview | 866 } // namespace android_webview |
| OLD | NEW |