| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "ui/android/view_android.h" | 5 #include "ui/android/view_android.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
| 10 #include "base/android/jni_string.h" | 10 #include "base/android/jni_string.h" |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 void ViewAndroid::OnBottomControlsChanged(float bottom_controls_offset, | 264 void ViewAndroid::OnBottomControlsChanged(float bottom_controls_offset, |
| 265 float bottom_content_offset) { | 265 float bottom_content_offset) { |
| 266 ScopedJavaLocalRef<jobject> delegate(GetViewAndroidDelegate()); | 266 ScopedJavaLocalRef<jobject> delegate(GetViewAndroidDelegate()); |
| 267 if (delegate.is_null()) | 267 if (delegate.is_null()) |
| 268 return; | 268 return; |
| 269 JNIEnv* env = base::android::AttachCurrentThread(); | 269 JNIEnv* env = base::android::AttachCurrentThread(); |
| 270 Java_ViewAndroidDelegate_onBottomControlsChanged( | 270 Java_ViewAndroidDelegate_onBottomControlsChanged( |
| 271 env, delegate, bottom_controls_offset, bottom_content_offset); | 271 env, delegate, bottom_controls_offset, bottom_content_offset); |
| 272 } | 272 } |
| 273 | 273 |
| 274 int ViewAndroid::GetSystemWindowInsetBottom() { |
| 275 ScopedJavaLocalRef<jobject> delegate(GetViewAndroidDelegate()); |
| 276 if (delegate.is_null()) |
| 277 return 0; |
| 278 JNIEnv* env = base::android::AttachCurrentThread(); |
| 279 return Java_ViewAndroidDelegate_getSystemWindowInsetBottom(env, delegate); |
| 280 } |
| 281 |
| 274 bool ViewAndroid::OnTouchEvent(const MotionEventAndroid& event, | 282 bool ViewAndroid::OnTouchEvent(const MotionEventAndroid& event, |
| 275 bool for_touch_handle) { | 283 bool for_touch_handle) { |
| 276 return HitTest( | 284 return HitTest( |
| 277 base::Bind(&ViewAndroid::SendTouchEventToClient, for_touch_handle), | 285 base::Bind(&ViewAndroid::SendTouchEventToClient, for_touch_handle), |
| 278 event); | 286 event); |
| 279 } | 287 } |
| 280 | 288 |
| 281 bool ViewAndroid::SendTouchEventToClient(bool for_touch_handle, | 289 bool ViewAndroid::SendTouchEventToClient(bool for_touch_handle, |
| 282 ViewClient* client, | 290 ViewClient* client, |
| 283 const MotionEventAndroid& event) { | 291 const MotionEventAndroid& event) { |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 matched = bound.Contains(e->GetX(0), e->GetY(0)); | 332 matched = bound.Contains(e->GetX(0), e->GetY(0)); |
| 325 } | 333 } |
| 326 if (matched && child->HitTest(send_to_client, *e)) | 334 if (matched && child->HitTest(send_to_client, *e)) |
| 327 return true; | 335 return true; |
| 328 } | 336 } |
| 329 } | 337 } |
| 330 return false; | 338 return false; |
| 331 } | 339 } |
| 332 | 340 |
| 333 } // namespace ui | 341 } // namespace ui |
| OLD | NEW |