OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/frame_host/render_widget_host_view_guest.h" | 5 #include "content/browser/frame_host/render_widget_host_view_guest.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
601 if (event->type() == blink::WebInputEvent::MouseWheel) { | 601 if (event->type() == blink::WebInputEvent::MouseWheel) { |
602 ui::LatencyInfo latency_info(ui::SourceEventType::WHEEL); | 602 ui::LatencyInfo latency_info(ui::SourceEventType::WHEEL); |
603 host_->ForwardWheelEventWithLatencyInfo( | 603 host_->ForwardWheelEventWithLatencyInfo( |
604 *static_cast<const blink::WebMouseWheelEvent*>(event), latency_info); | 604 *static_cast<const blink::WebMouseWheelEvent*>(event), latency_info); |
605 return; | 605 return; |
606 } | 606 } |
607 | 607 |
608 if (blink::WebInputEvent::isKeyboardEventType(event->type())) { | 608 if (blink::WebInputEvent::isKeyboardEventType(event->type())) { |
609 if (!embedder->GetLastKeyboardEvent()) | 609 if (!embedder->GetLastKeyboardEvent()) |
610 return; | 610 return; |
| 611 ui::LatencyInfo latency_info(ui::SourceEventType::KEY); |
611 NativeWebKeyboardEvent keyboard_event(*embedder->GetLastKeyboardEvent()); | 612 NativeWebKeyboardEvent keyboard_event(*embedder->GetLastKeyboardEvent()); |
612 host_->ForwardKeyboardEvent(keyboard_event); | 613 host_->ForwardKeyboardEventWithLatencyInfo(keyboard_event, latency_info); |
613 return; | 614 return; |
614 } | 615 } |
615 | 616 |
616 if (blink::WebInputEvent::isTouchEventType(event->type())) { | 617 if (blink::WebInputEvent::isTouchEventType(event->type())) { |
617 if (event->type() == blink::WebInputEvent::TouchStart && | 618 if (event->type() == blink::WebInputEvent::TouchStart && |
618 !embedder->GetView()->HasFocus()) { | 619 !embedder->GetView()->HasFocus()) { |
619 embedder->GetView()->Focus(); | 620 embedder->GetView()->Focus(); |
620 } | 621 } |
621 ui::LatencyInfo latency_info(ui::SourceEventType::TOUCH); | 622 ui::LatencyInfo latency_info(ui::SourceEventType::TOUCH); |
622 host_->ForwardTouchEventWithLatencyInfo( | 623 host_->ForwardTouchEventWithLatencyInfo( |
(...skipping 21 matching lines...) Expand all Loading... |
644 host_->ForwardGestureEvent(gesture_event); | 645 host_->ForwardGestureEvent(gesture_event); |
645 return; | 646 return; |
646 } | 647 } |
647 } | 648 } |
648 | 649 |
649 bool RenderWidgetHostViewGuest::HasEmbedderChanged() { | 650 bool RenderWidgetHostViewGuest::HasEmbedderChanged() { |
650 return guest_ && guest_->has_attached_since_surface_set(); | 651 return guest_ && guest_->has_attached_since_surface_set(); |
651 } | 652 } |
652 | 653 |
653 } // namespace content | 654 } // namespace content |
OLD | NEW |