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 973 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
984 void AwContents::ScrollContainerViewTo(gfx::Vector2d new_value) { | 984 void AwContents::ScrollContainerViewTo(gfx::Vector2d new_value) { |
985 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 985 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
986 JNIEnv* env = AttachCurrentThread(); | 986 JNIEnv* env = AttachCurrentThread(); |
987 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 987 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
988 if (obj.is_null()) | 988 if (obj.is_null()) |
989 return; | 989 return; |
990 Java_AwContents_scrollContainerViewTo( | 990 Java_AwContents_scrollContainerViewTo( |
991 env, obj.obj(), new_value.x(), new_value.y()); | 991 env, obj.obj(), new_value.x(), new_value.y()); |
992 } | 992 } |
993 | 993 |
994 bool AwContents::IsSmoothScrollingActive() const { | |
995 DCHECK_CURRENTLY_ON(BrowserThread::UI); | |
996 JNIEnv* env = AttachCurrentThread(); | |
997 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | |
998 if (obj.is_null()) | |
999 return false; | |
1000 return Java_AwContents_isSmoothScrollingActive(env, obj.obj()); | |
1001 } | |
1002 | |
1003 void AwContents::UpdateScrollState(gfx::Vector2d max_scroll_offset, | 994 void AwContents::UpdateScrollState(gfx::Vector2d max_scroll_offset, |
1004 gfx::SizeF contents_size_dip, | 995 gfx::SizeF contents_size_dip, |
1005 float page_scale_factor, | 996 float page_scale_factor, |
1006 float min_page_scale_factor, | 997 float min_page_scale_factor, |
1007 float max_page_scale_factor) { | 998 float max_page_scale_factor) { |
1008 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 999 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
1009 JNIEnv* env = AttachCurrentThread(); | 1000 JNIEnv* env = AttachCurrentThread(); |
1010 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 1001 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
1011 if (obj.is_null()) | 1002 if (obj.is_null()) |
1012 return; | 1003 return; |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1189 | 1180 |
1190 AwMessagePortServiceImpl::GetInstance()->CreateMessageChannel(env, ports, | 1181 AwMessagePortServiceImpl::GetInstance()->CreateMessageChannel(env, ports, |
1191 GetMessagePortMessageFilter()); | 1182 GetMessagePortMessageFilter()); |
1192 } | 1183 } |
1193 | 1184 |
1194 void SetShouldDownloadFavicons(JNIEnv* env, jclass jclazz) { | 1185 void SetShouldDownloadFavicons(JNIEnv* env, jclass jclazz) { |
1195 g_should_download_favicons = true; | 1186 g_should_download_favicons = true; |
1196 } | 1187 } |
1197 | 1188 |
1198 } // namespace android_webview | 1189 } // namespace android_webview |
OLD | NEW |