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 981 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
992 void AwContents::ScrollContainerViewTo(gfx::Vector2d new_value) { | 992 void AwContents::ScrollContainerViewTo(gfx::Vector2d new_value) { |
993 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 993 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
994 JNIEnv* env = AttachCurrentThread(); | 994 JNIEnv* env = AttachCurrentThread(); |
995 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 995 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
996 if (obj.is_null()) | 996 if (obj.is_null()) |
997 return; | 997 return; |
998 Java_AwContents_scrollContainerViewTo( | 998 Java_AwContents_scrollContainerViewTo( |
999 env, obj.obj(), new_value.x(), new_value.y()); | 999 env, obj.obj(), new_value.x(), new_value.y()); |
1000 } | 1000 } |
1001 | 1001 |
1002 bool AwContents::IsSmoothScrollingActive() const { | |
1003 DCHECK_CURRENTLY_ON(BrowserThread::UI); | |
1004 JNIEnv* env = AttachCurrentThread(); | |
1005 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | |
1006 if (obj.is_null()) | |
1007 return false; | |
1008 return Java_AwContents_isSmoothScrollingActive(env, obj.obj()); | |
1009 } | |
1010 | |
1011 void AwContents::UpdateScrollState(gfx::Vector2d max_scroll_offset, | 1002 void AwContents::UpdateScrollState(gfx::Vector2d max_scroll_offset, |
1012 gfx::SizeF contents_size_dip, | 1003 gfx::SizeF contents_size_dip, |
1013 float page_scale_factor, | 1004 float page_scale_factor, |
1014 float min_page_scale_factor, | 1005 float min_page_scale_factor, |
1015 float max_page_scale_factor) { | 1006 float max_page_scale_factor) { |
1016 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 1007 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
1017 JNIEnv* env = AttachCurrentThread(); | 1008 JNIEnv* env = AttachCurrentThread(); |
1018 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 1009 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
1019 if (obj.is_null()) | 1010 if (obj.is_null()) |
1020 return; | 1011 return; |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1197 | 1188 |
1198 AwMessagePortServiceImpl::GetInstance()->CreateMessageChannel(env, ports, | 1189 AwMessagePortServiceImpl::GetInstance()->CreateMessageChannel(env, ports, |
1199 GetMessagePortMessageFilter()); | 1190 GetMessagePortMessageFilter()); |
1200 } | 1191 } |
1201 | 1192 |
1202 void SetShouldDownloadFavicons(JNIEnv* env, jclass jclazz) { | 1193 void SetShouldDownloadFavicons(JNIEnv* env, jclass jclazz) { |
1203 g_should_download_favicons = true; | 1194 g_should_download_favicons = true; |
1204 } | 1195 } |
1205 | 1196 |
1206 } // namespace android_webview | 1197 } // namespace android_webview |
OLD | NEW |