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

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: EventHandler 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 1327 matching lines...) Expand 10 before | Expand all | Expand 10 after
1769 CreateOverscrollControllerIfPossible(); 1770 CreateOverscrollControllerIfPossible();
1770 } 1771 }
1771 1772
1772 void RenderWidgetHostViewAndroid::RunAckCallbacks() { 1773 void RenderWidgetHostViewAndroid::RunAckCallbacks() {
1773 while (!ack_callbacks_.empty()) { 1774 while (!ack_callbacks_.empty()) {
1774 ack_callbacks_.front().Run(); 1775 ack_callbacks_.front().Run();
1775 ack_callbacks_.pop(); 1776 ack_callbacks_.pop();
1776 } 1777 }
1777 } 1778 }
1778 1779
1780 bool RenderWidgetHostViewAndroid::OnTouchEvent(
1781 const ui::MotionEventAndroid& event,
1782 bool is_touch_handle_event) {
1783 return is_touch_handle_event ? OnTouchHandleEvent(event)
1784 : OnTouchEvent(event);
1785 }
1786
1787 bool RenderWidgetHostViewAndroid::OnMouseEvent(
1788 const ui::MotionEventAndroid& event,
1789 int action_button) {
1790 SendMouseEvent(event, action_button);
1791 return true;
1792 }
1793
1779 void RenderWidgetHostViewAndroid::OnGestureEvent( 1794 void RenderWidgetHostViewAndroid::OnGestureEvent(
1780 const ui::GestureEventData& gesture) { 1795 const ui::GestureEventData& gesture) {
1781 blink::WebGestureEvent web_gesture = 1796 blink::WebGestureEvent web_gesture =
1782 ui::CreateWebGestureEventFromGestureEventData(gesture); 1797 ui::CreateWebGestureEventFromGestureEventData(gesture);
1783 // TODO(jdduke): Remove this workaround after Android fixes UiAutomator to 1798 // TODO(jdduke): Remove this workaround after Android fixes UiAutomator to
1784 // stop providing shift meta values to synthetic MotionEvents. This prevents 1799 // stop providing shift meta values to synthetic MotionEvents. This prevents
1785 // unintended shift+click interpretation of all accessibility clicks. 1800 // unintended shift+click interpretation of all accessibility clicks.
1786 // See crbug.com/443247. 1801 // See crbug.com/443247.
1787 if (web_gesture.type() == blink::WebInputEvent::GestureTap && 1802 if (web_gesture.type() == blink::WebInputEvent::GestureTap &&
1788 web_gesture.modifiers() == blink::WebInputEvent::ShiftKey) { 1803 web_gesture.modifiers() == blink::WebInputEvent::ShiftKey) {
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
1992 ui::WindowAndroidCompositor* compositor = window_android->GetCompositor(); 2007 ui::WindowAndroidCompositor* compositor = window_android->GetCompositor();
1993 if (!compositor) 2008 if (!compositor)
1994 return; 2009 return;
1995 2010
1996 overscroll_controller_ = base::MakeUnique<OverscrollControllerAndroid>( 2011 overscroll_controller_ = base::MakeUnique<OverscrollControllerAndroid>(
1997 overscroll_refresh_handler, compositor, 2012 overscroll_refresh_handler, compositor,
1998 ui::GetScaleFactorForNativeView(GetNativeView())); 2013 ui::GetScaleFactorForNativeView(GetNativeView()));
1999 } 2014 }
2000 2015
2001 } // namespace content 2016 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698