Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(198)

Side by Side Diff: ui/android/view_android.cc

Issue 2804953003: Refactor ContentViewClient (6/6) (Closed)
Patch Set: rebase Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/android/view_android.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ui/android/view_android.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698