| 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 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 ScopedJavaLocalRef<jobject> delegate(GetViewAndroidDelegate()); | 276 ScopedJavaLocalRef<jobject> delegate(GetViewAndroidDelegate()); |
| 277 if (delegate.is_null()) | 277 if (delegate.is_null()) |
| 278 return; | 278 return; |
| 279 JNIEnv* env = base::android::AttachCurrentThread(); | 279 JNIEnv* env = base::android::AttachCurrentThread(); |
| 280 ScopedJavaLocalRef<jstring> jcontent_url = | 280 ScopedJavaLocalRef<jstring> jcontent_url = |
| 281 ConvertUTF8ToJavaString(env, content_url.spec()); | 281 ConvertUTF8ToJavaString(env, content_url.spec()); |
| 282 Java_ViewAndroidDelegate_onStartContentIntent(env, delegate, jcontent_url, | 282 Java_ViewAndroidDelegate_onStartContentIntent(env, delegate, jcontent_url, |
| 283 is_main_frame); | 283 is_main_frame); |
| 284 } | 284 } |
| 285 | 285 |
| 286 int ViewAndroid::GetSystemWindowInsetBottom() { |
| 287 ScopedJavaLocalRef<jobject> delegate(GetViewAndroidDelegate()); |
| 288 if (delegate.is_null()) |
| 289 return 0; |
| 290 JNIEnv* env = base::android::AttachCurrentThread(); |
| 291 return Java_ViewAndroidDelegate_getSystemWindowInsetBottom(env, delegate); |
| 292 } |
| 293 |
| 286 bool ViewAndroid::OnTouchEvent(const MotionEventAndroid& event, | 294 bool ViewAndroid::OnTouchEvent(const MotionEventAndroid& event, |
| 287 bool for_touch_handle) { | 295 bool for_touch_handle) { |
| 288 return HitTest( | 296 return HitTest( |
| 289 base::Bind(&ViewAndroid::SendTouchEventToClient, for_touch_handle), | 297 base::Bind(&ViewAndroid::SendTouchEventToClient, for_touch_handle), |
| 290 event); | 298 event); |
| 291 } | 299 } |
| 292 | 300 |
| 293 bool ViewAndroid::SendTouchEventToClient(bool for_touch_handle, | 301 bool ViewAndroid::SendTouchEventToClient(bool for_touch_handle, |
| 294 ViewClient* client, | 302 ViewClient* client, |
| 295 const MotionEventAndroid& event) { | 303 const MotionEventAndroid& event) { |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 matched = bound.Contains(e->GetX(0), e->GetY(0)); | 344 matched = bound.Contains(e->GetX(0), e->GetY(0)); |
| 337 } | 345 } |
| 338 if (matched && child->HitTest(send_to_client, *e)) | 346 if (matched && child->HitTest(send_to_client, *e)) |
| 339 return true; | 347 return true; |
| 340 } | 348 } |
| 341 } | 349 } |
| 342 return false; | 350 return false; |
| 343 } | 351 } |
| 344 | 352 |
| 345 } // namespace ui | 353 } // namespace ui |
| OLD | NEW |