| 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 <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "android_webview/browser/aw_browser_context.h" | 9 #include "android_webview/browser/aw_browser_context.h" |
| 10 #include "android_webview/browser/aw_browser_main_parts.h" | 10 #include "android_webview/browser/aw_browser_main_parts.h" |
| (...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 836 | 836 |
| 837 void AwContents::OnWebLayoutPageScaleFactorChanged(float page_scale_factor) { | 837 void AwContents::OnWebLayoutPageScaleFactorChanged(float page_scale_factor) { |
| 838 JNIEnv* env = AttachCurrentThread(); | 838 JNIEnv* env = AttachCurrentThread(); |
| 839 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 839 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
| 840 if (obj.is_null()) | 840 if (obj.is_null()) |
| 841 return; | 841 return; |
| 842 Java_AwContents_onWebLayoutPageScaleFactorChanged(env, obj.obj(), | 842 Java_AwContents_onWebLayoutPageScaleFactorChanged(env, obj.obj(), |
| 843 page_scale_factor); | 843 page_scale_factor); |
| 844 } | 844 } |
| 845 | 845 |
| 846 void AwContents::OnWebLayoutContentsSizeChanged( |
| 847 const gfx::Size& contents_size) { |
| 848 JNIEnv* env = AttachCurrentThread(); |
| 849 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
| 850 if (obj.is_null()) |
| 851 return; |
| 852 Java_AwContents_onWebLayoutContentsSizeChanged( |
| 853 env, obj.obj(), contents_size.width(), contents_size.height()); |
| 854 } |
| 855 |
| 846 jint AwContents::CapturePicture(JNIEnv* env, | 856 jint AwContents::CapturePicture(JNIEnv* env, |
| 847 jobject obj, | 857 jobject obj, |
| 848 int width, | 858 int width, |
| 849 int height) { | 859 int height) { |
| 850 return reinterpret_cast<jint>(new AwPicture( | 860 return reinterpret_cast<jint>(new AwPicture( |
| 851 browser_view_renderer_->CapturePicture(width, height))); | 861 browser_view_renderer_->CapturePicture(width, height))); |
| 852 } | 862 } |
| 853 | 863 |
| 854 void AwContents::EnableOnNewPicture(JNIEnv* env, | 864 void AwContents::EnableOnNewPicture(JNIEnv* env, |
| 855 jobject obj, | 865 jobject obj, |
| 856 jboolean enabled) { | 866 jboolean enabled) { |
| 857 browser_view_renderer_->EnableOnNewPicture(enabled); | 867 browser_view_renderer_->EnableOnNewPicture(enabled); |
| 858 } | 868 } |
| 859 | 869 |
| 860 void AwContents::SetJsOnlineProperty(JNIEnv* env, | 870 void AwContents::SetJsOnlineProperty(JNIEnv* env, |
| 861 jobject obj, | 871 jobject obj, |
| 862 jboolean network_up) { | 872 jboolean network_up) { |
| 863 render_view_host_ext_->SetJsOnlineProperty(network_up); | 873 render_view_host_ext_->SetJsOnlineProperty(network_up); |
| 864 } | 874 } |
| 865 | 875 |
| 866 } // namespace android_webview | 876 } // namespace android_webview |
| OLD | NEW |