OLD | NEW |
---|---|
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_aura.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
(...skipping 1986 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1997 TRACE_EVENT0("input", "RenderWidgetHostViewAura::OnTouchEvent"); | 1997 TRACE_EVENT0("input", "RenderWidgetHostViewAura::OnTouchEvent"); |
1998 if (touch_editing_client_ && touch_editing_client_->HandleInputEvent(event)) | 1998 if (touch_editing_client_ && touch_editing_client_->HandleInputEvent(event)) |
1999 return; | 1999 return; |
2000 | 2000 |
2001 // Update the touch event first. | 2001 // Update the touch event first. |
2002 blink::WebTouchPoint* point = UpdateWebTouchEventFromUIEvent(*event, | 2002 blink::WebTouchPoint* point = UpdateWebTouchEventFromUIEvent(*event, |
2003 &touch_event_); | 2003 &touch_event_); |
2004 | 2004 |
2005 // Forward the touch event only if a touch point was updated, and there's a | 2005 // Forward the touch event only if a touch point was updated, and there's a |
2006 // touch-event handler in the page, and no other touch-event is in the queue. | 2006 // touch-event handler in the page, and no other touch-event is in the queue. |
2007 // It is important to always consume the event if there is a touch-event | 2007 // It is important to always mark events as being handled asynchronously if |
2008 // handler in the page, or some touch-event is already in the queue, even if | 2008 // there is a touch-event handler in the page, or some touch-event is already |
2009 // no point has been updated, to make sure that this event does not get | 2009 // in the queue, even if no point has been updated, to make sure that this |
2010 // processed by the gesture recognizer before the events in the queue. | 2010 // event does not get processed by the gesture recognizer before the events in |
jdduke (slow)
2014/11/12 00:04:52
Could you split this sentence apart and perhaps ti
tdresser
2014/11/12 14:51:25
Done.
| |
2011 if (host_->ShouldForwardTouchEvent()) | 2011 // the queue. |
2012 event->StopPropagation(); | 2012 if (host_->ShouldForwardTouchEvent()) { |
2013 event->DisableSynchronousHandling(); | |
2014 if (point) { | |
2015 host_->ForwardTouchEventWithLatencyInfo(touch_event_, *event->latency()); | |
2016 } else { | |
2017 // Fake an ack for the invalid touch event. | |
2018 DCHECK(window_->GetHost()); | |
2019 window_->GetHost()->dispatcher()->ProcessedTouchEvent(event, window_, | |
jdduke (slow)
2014/11/12 00:04:52
I've been getting this arg packing style recently
tdresser
2014/11/12 14:51:24
It doesn't appear to be against the style guide.
h
| |
2020 ui::ER_HANDLED); | |
2021 } | |
2022 } | |
2013 | 2023 |
2014 if (point) { | 2024 if (point) |
2015 if (host_->ShouldForwardTouchEvent()) | |
2016 host_->ForwardTouchEventWithLatencyInfo(touch_event_, *event->latency()); | |
2017 UpdateWebTouchEventAfterDispatch(&touch_event_, point); | 2025 UpdateWebTouchEventAfterDispatch(&touch_event_, point); |
2018 } | |
2019 } | 2026 } |
2020 | 2027 |
2021 void RenderWidgetHostViewAura::OnGestureEvent(ui::GestureEvent* event) { | 2028 void RenderWidgetHostViewAura::OnGestureEvent(ui::GestureEvent* event) { |
2022 TRACE_EVENT0("input", "RenderWidgetHostViewAura::OnGestureEvent"); | 2029 TRACE_EVENT0("input", "RenderWidgetHostViewAura::OnGestureEvent"); |
2023 if ((event->type() == ui::ET_GESTURE_PINCH_BEGIN || | 2030 if ((event->type() == ui::ET_GESTURE_PINCH_BEGIN || |
2024 event->type() == ui::ET_GESTURE_PINCH_UPDATE || | 2031 event->type() == ui::ET_GESTURE_PINCH_UPDATE || |
2025 event->type() == ui::ET_GESTURE_PINCH_END) && !pinch_zoom_enabled_) { | 2032 event->type() == ui::ET_GESTURE_PINCH_END) && !pinch_zoom_enabled_) { |
2026 event->SetHandled(); | 2033 event->SetHandled(); |
2027 return; | 2034 return; |
2028 } | 2035 } |
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2540 | 2547 |
2541 //////////////////////////////////////////////////////////////////////////////// | 2548 //////////////////////////////////////////////////////////////////////////////// |
2542 // RenderWidgetHostViewBase, public: | 2549 // RenderWidgetHostViewBase, public: |
2543 | 2550 |
2544 // static | 2551 // static |
2545 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) { | 2552 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) { |
2546 GetScreenInfoForWindow(results, NULL); | 2553 GetScreenInfoForWindow(results, NULL); |
2547 } | 2554 } |
2548 | 2555 |
2549 } // namespace content | 2556 } // namespace content |
OLD | NEW |