| 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 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "android_webview/browser/aw_browser_context.h" | 10 #include "android_webview/browser/aw_browser_context.h" |
| (...skipping 1042 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1053 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 1053 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 1054 JNIEnv* env = AttachCurrentThread(); | 1054 JNIEnv* env = AttachCurrentThread(); |
| 1055 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 1055 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
| 1056 if (obj.is_null()) | 1056 if (obj.is_null()) |
| 1057 return; | 1057 return; |
| 1058 Java_AwContents_didOverscroll(env, obj, overscroll_delta.x(), | 1058 Java_AwContents_didOverscroll(env, obj, overscroll_delta.x(), |
| 1059 overscroll_delta.y(), overscroll_velocity.x(), | 1059 overscroll_delta.y(), overscroll_velocity.x(), |
| 1060 overscroll_velocity.y()); | 1060 overscroll_velocity.y()); |
| 1061 } | 1061 } |
| 1062 | 1062 |
| 1063 ui::TouchHandleDrawable* AwContents::CreateDrawable() { |
| 1064 JNIEnv* env = AttachCurrentThread(); |
| 1065 const ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
| 1066 if (obj.is_null()) |
| 1067 return nullptr; |
| 1068 return reinterpret_cast<ui::TouchHandleDrawable*>( |
| 1069 Java_AwContents_onCreateTouchHandle(env, obj)); |
| 1070 } |
| 1071 |
| 1063 void AwContents::SetDipScale(JNIEnv* env, | 1072 void AwContents::SetDipScale(JNIEnv* env, |
| 1064 const JavaParamRef<jobject>& obj, | 1073 const JavaParamRef<jobject>& obj, |
| 1065 jfloat dip_scale) { | 1074 jfloat dip_scale) { |
| 1066 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 1075 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 1067 SetDipScaleInternal(dip_scale); | 1076 SetDipScaleInternal(dip_scale); |
| 1068 } | 1077 } |
| 1069 | 1078 |
| 1070 void AwContents::SetDipScaleInternal(float dip_scale) { | 1079 void AwContents::SetDipScaleInternal(float dip_scale) { |
| 1071 browser_view_renderer_.SetDipScale(dip_scale); | 1080 browser_view_renderer_.SetDipScale(dip_scale); |
| 1072 } | 1081 } |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1285 int routing_id = new_host->GetRoutingID(); | 1294 int routing_id = new_host->GetRoutingID(); |
| 1286 // At this point, the current RVH may or may not contain a compositor. So | 1295 // At this point, the current RVH may or may not contain a compositor. So |
| 1287 // compositor_ may be nullptr, in which case | 1296 // compositor_ may be nullptr, in which case |
| 1288 // BrowserViewRenderer::DidInitializeCompositor() callback is time when the | 1297 // BrowserViewRenderer::DidInitializeCompositor() callback is time when the |
| 1289 // new compositor is constructed. | 1298 // new compositor is constructed. |
| 1290 browser_view_renderer_.SetActiveCompositorID( | 1299 browser_view_renderer_.SetActiveCompositorID( |
| 1291 CompositorID(process_id, routing_id)); | 1300 CompositorID(process_id, routing_id)); |
| 1292 } | 1301 } |
| 1293 | 1302 |
| 1294 } // namespace android_webview | 1303 } // namespace android_webview |
| OLD | NEW |