| 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 "content/browser/renderer_host/render_widget_host_view_event_handler.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_event_handler.h" |
| 6 | 6 |
| 7 #include "base/metrics/user_metrics.h" | 7 #include "base/metrics/user_metrics.h" |
| 8 #include "base/metrics/user_metrics_action.h" | 8 #include "base/metrics/user_metrics_action.h" |
| 9 #include "content/browser/renderer_host/input/touch_selection_controller_client_
aura.h" | 9 #include "content/browser/renderer_host/input/touch_selection_controller_client_
aura.h" |
| 10 #include "content/browser/renderer_host/overscroll_controller.h" | 10 #include "content/browser/renderer_host/overscroll_controller.h" |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 // Accept return key character events between press and release events. | 277 // Accept return key character events between press and release events. |
| 278 accept_return_character_ = event->type() == ui::ET_KEY_PRESSED; | 278 accept_return_character_ = event->type() == ui::ET_KEY_PRESSED; |
| 279 } | 279 } |
| 280 | 280 |
| 281 // Call SetKeyboardFocus() for not only ET_KEY_PRESSED but also | 281 // Call SetKeyboardFocus() for not only ET_KEY_PRESSED but also |
| 282 // ET_KEY_RELEASED. If a user closed the hotdog menu with ESC key press, | 282 // ET_KEY_RELEASED. If a user closed the hotdog menu with ESC key press, |
| 283 // we need to notify focus to Blink on ET_KEY_RELEASED for ESC key. | 283 // we need to notify focus to Blink on ET_KEY_RELEASED for ESC key. |
| 284 SetKeyboardFocus(); | 284 SetKeyboardFocus(); |
| 285 // We don't have to communicate with an input method here. | 285 // We don't have to communicate with an input method here. |
| 286 NativeWebKeyboardEvent webkit_event(*event); | 286 NativeWebKeyboardEvent webkit_event(*event); |
| 287 delegate_->ForwardKeyboardEvent(webkit_event, &mark_event_as_handled); | 287 delegate_->ForwardKeyboardEventWithLatencyInfo( |
| 288 webkit_event, *event->latency(), &mark_event_as_handled); |
| 288 } | 289 } |
| 289 if (mark_event_as_handled) | 290 if (mark_event_as_handled) |
| 290 event->SetHandled(); | 291 event->SetHandled(); |
| 291 } | 292 } |
| 292 | 293 |
| 293 void RenderWidgetHostViewEventHandler::OnMouseEvent(ui::MouseEvent* event) { | 294 void RenderWidgetHostViewEventHandler::OnMouseEvent(ui::MouseEvent* event) { |
| 294 TRACE_EVENT0("input", "RenderWidgetHostViewBase::OnMouseEvent"); | 295 TRACE_EVENT0("input", "RenderWidgetHostViewBase::OnMouseEvent"); |
| 295 ForwardMouseEventToParent(event); | 296 ForwardMouseEventToParent(event); |
| 296 // TODO(mgiuca): Return if event->handled() returns true. This currently | 297 // TODO(mgiuca): Return if event->handled() returns true. This currently |
| 297 // breaks drop-down lists which means something is incorrectly setting | 298 // breaks drop-down lists which means something is incorrectly setting |
| (...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 881 host_->ForwardWheelEventWithLatencyInfo(event, latency); | 882 host_->ForwardWheelEventWithLatencyInfo(event, latency); |
| 882 } | 883 } |
| 883 | 884 |
| 884 void RenderWidgetHostViewEventHandler::ProcessTouchEvent( | 885 void RenderWidgetHostViewEventHandler::ProcessTouchEvent( |
| 885 const blink::WebTouchEvent& event, | 886 const blink::WebTouchEvent& event, |
| 886 const ui::LatencyInfo& latency) { | 887 const ui::LatencyInfo& latency) { |
| 887 host_->ForwardTouchEventWithLatencyInfo(event, latency); | 888 host_->ForwardTouchEventWithLatencyInfo(event, latency); |
| 888 } | 889 } |
| 889 | 890 |
| 890 } // namespace content | 891 } // namespace content |
| OLD | NEW |