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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_android.cc

Issue 2708613002: Add EventForwarder for routing touch events (Closed)
Patch Set: rebased Created 3 years, 9 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "content/browser/renderer_host/render_widget_host_view_android.h" 5 #include "content/browser/renderer_host/render_widget_host_view_android.h"
6 6
7 #include <android/bitmap.h> 7 #include <android/bitmap.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 : host_(widget_host), 422 : host_(widget_host),
423 begin_frame_source_(nullptr), 423 begin_frame_source_(nullptr),
424 outstanding_begin_frame_requests_(0), 424 outstanding_begin_frame_requests_(0),
425 is_showing_(!widget_host->is_hidden()), 425 is_showing_(!widget_host->is_hidden()),
426 is_window_visible_(true), 426 is_window_visible_(true),
427 is_window_activity_started_(true), 427 is_window_activity_started_(true),
428 is_in_vr_(false), 428 is_in_vr_(false),
429 content_view_core_(nullptr), 429 content_view_core_(nullptr),
430 ime_adapter_android_(this), 430 ime_adapter_android_(this),
431 cached_background_color_(SK_ColorWHITE), 431 cached_background_color_(SK_ColorWHITE),
432 view_(this),
432 last_compositor_frame_sink_id_(kUndefinedCompositorFrameSinkId), 433 last_compositor_frame_sink_id_(kUndefinedCompositorFrameSinkId),
433 gesture_provider_(ui::GetGestureProviderConfig( 434 gesture_provider_(ui::GetGestureProviderConfig(
434 ui::GestureProviderConfigType::CURRENT_PLATFORM), 435 ui::GestureProviderConfigType::CURRENT_PLATFORM),
435 this), 436 this),
436 stylus_text_selector_(this), 437 stylus_text_selector_(this),
437 using_browser_compositor_(CompositorImpl::IsInitialized()), 438 using_browser_compositor_(CompositorImpl::IsInitialized()),
438 synchronous_compositor_client_(nullptr), 439 synchronous_compositor_client_(nullptr),
439 frame_evictor_(new DelegatedFrameEvictor(this)), 440 frame_evictor_(new DelegatedFrameEvictor(this)),
440 observing_root_window_(false), 441 observing_root_window_(false),
441 prev_top_shown_pix_(0.f), 442 prev_top_shown_pix_(0.f),
(...skipping 1321 matching lines...) Expand 10 before | Expand all | Expand 10 after
1763 CreateOverscrollControllerIfPossible(); 1764 CreateOverscrollControllerIfPossible();
1764 } 1765 }
1765 1766
1766 void RenderWidgetHostViewAndroid::RunAckCallbacks() { 1767 void RenderWidgetHostViewAndroid::RunAckCallbacks() {
1767 while (!ack_callbacks_.empty()) { 1768 while (!ack_callbacks_.empty()) {
1768 ack_callbacks_.front().Run(); 1769 ack_callbacks_.front().Run();
1769 ack_callbacks_.pop(); 1770 ack_callbacks_.pop();
1770 } 1771 }
1771 } 1772 }
1772 1773
1774 bool RenderWidgetHostViewAndroid::OnTouchEvent(
1775 const ui::MotionEventAndroid& event,
1776 bool is_touch_handle_event) {
David Trainor- moved to gerrit 2017/02/28 01:31:23 We should look at how we could remove this distinc
Jinsuk Kim 2017/02/28 06:56:04 Left a TODO for a reminder for future refactoring.
1777 return is_touch_handle_event ? OnTouchHandleEvent(event)
1778 : OnTouchEvent(event);
1779 }
1780
1781 bool RenderWidgetHostViewAndroid::OnMouseEvent(
1782 const ui::MotionEventAndroid& event,
1783 int action_button) {
1784 SendMouseEvent(event, action_button);
1785 return true;
1786 }
1787
1773 void RenderWidgetHostViewAndroid::OnGestureEvent( 1788 void RenderWidgetHostViewAndroid::OnGestureEvent(
1774 const ui::GestureEventData& gesture) { 1789 const ui::GestureEventData& gesture) {
1775 blink::WebGestureEvent web_gesture = 1790 blink::WebGestureEvent web_gesture =
1776 ui::CreateWebGestureEventFromGestureEventData(gesture); 1791 ui::CreateWebGestureEventFromGestureEventData(gesture);
1777 // TODO(jdduke): Remove this workaround after Android fixes UiAutomator to 1792 // TODO(jdduke): Remove this workaround after Android fixes UiAutomator to
1778 // stop providing shift meta values to synthetic MotionEvents. This prevents 1793 // stop providing shift meta values to synthetic MotionEvents. This prevents
1779 // unintended shift+click interpretation of all accessibility clicks. 1794 // unintended shift+click interpretation of all accessibility clicks.
1780 // See crbug.com/443247. 1795 // See crbug.com/443247.
1781 if (web_gesture.type() == blink::WebInputEvent::GestureTap && 1796 if (web_gesture.type() == blink::WebInputEvent::GestureTap &&
1782 web_gesture.modifiers() == blink::WebInputEvent::ShiftKey) { 1797 web_gesture.modifiers() == blink::WebInputEvent::ShiftKey) {
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
1986 ui::WindowAndroidCompositor* compositor = window_android->GetCompositor(); 2001 ui::WindowAndroidCompositor* compositor = window_android->GetCompositor();
1987 if (!compositor) 2002 if (!compositor)
1988 return; 2003 return;
1989 2004
1990 overscroll_controller_ = base::MakeUnique<OverscrollControllerAndroid>( 2005 overscroll_controller_ = base::MakeUnique<OverscrollControllerAndroid>(
1991 overscroll_refresh_handler, compositor, 2006 overscroll_refresh_handler, compositor,
1992 ui::GetScaleFactorForNativeView(GetNativeView())); 2007 ui::GetScaleFactorForNativeView(GetNativeView()));
1993 } 2008 }
1994 2009
1995 } // namespace content 2010 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698