| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/renderer/input/render_widget_input_handler.h" | 5 #include "content/renderer/input/render_widget_input_handler.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 if (widget_->compositor()) { | 253 if (widget_->compositor()) { |
| 254 latency_info_swap_promise_monitor = | 254 latency_info_swap_promise_monitor = |
| 255 widget_->compositor()->CreateLatencyInfoSwapPromiseMonitor( | 255 widget_->compositor()->CreateLatencyInfoSwapPromiseMonitor( |
| 256 &swap_latency_info); | 256 &swap_latency_info); |
| 257 } | 257 } |
| 258 | 258 |
| 259 bool prevent_default = false; | 259 bool prevent_default = false; |
| 260 if (WebInputEvent::isMouseEventType(input_event.type())) { | 260 if (WebInputEvent::isMouseEventType(input_event.type())) { |
| 261 const WebMouseEvent& mouse_event = | 261 const WebMouseEvent& mouse_event = |
| 262 static_cast<const WebMouseEvent&>(input_event); | 262 static_cast<const WebMouseEvent&>(input_event); |
| 263 TRACE_EVENT2("renderer", "HandleMouseMove", "x", mouse_event.x, "y", | 263 TRACE_EVENT2("renderer", "HandleMouseMove", "x", |
| 264 mouse_event.y); | 264 mouse_event.positionInWidget().x, "y", |
| 265 mouse_event.positionInWidget().y); |
| 265 context_menu_source_type_ = ui::MENU_SOURCE_MOUSE; | 266 context_menu_source_type_ = ui::MENU_SOURCE_MOUSE; |
| 266 prevent_default = delegate_->WillHandleMouseEvent(mouse_event); | 267 prevent_default = delegate_->WillHandleMouseEvent(mouse_event); |
| 267 } | 268 } |
| 268 | 269 |
| 269 if (WebInputEvent::isKeyboardEventType(input_event.type())) { | 270 if (WebInputEvent::isKeyboardEventType(input_event.type())) { |
| 270 context_menu_source_type_ = ui::MENU_SOURCE_KEYBOARD; | 271 context_menu_source_type_ = ui::MENU_SOURCE_KEYBOARD; |
| 271 #if defined(OS_ANDROID) | 272 #if defined(OS_ANDROID) |
| 272 // The DPAD_CENTER key on Android has a dual semantic: (1) in the general | 273 // The DPAD_CENTER key on Android has a dual semantic: (1) in the general |
| 273 // case it should behave like a select key (i.e. causing a click if a button | 274 // case it should behave like a select key (i.e. causing a click if a button |
| 274 // is focused). However, if a text field is focused (2), its intended | 275 // is focused). However, if a text field is focused (2), its intended |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 465 // it can be bundled in the event ack. | 466 // it can be bundled in the event ack. |
| 466 if (handling_event_overscroll_) { | 467 if (handling_event_overscroll_) { |
| 467 *handling_event_overscroll_ = std::move(params); | 468 *handling_event_overscroll_ = std::move(params); |
| 468 return; | 469 return; |
| 469 } | 470 } |
| 470 | 471 |
| 471 delegate_->OnDidOverscroll(*params); | 472 delegate_->OnDidOverscroll(*params); |
| 472 } | 473 } |
| 473 | 474 |
| 474 } // namespace content | 475 } // namespace content |
| OLD | NEW |