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 599 matching lines...) Loading... |
610 if (event->GetType() == blink::WebInputEvent::kMouseWheel) { | 610 if (event->GetType() == blink::WebInputEvent::kMouseWheel) { |
611 ui::LatencyInfo latency_info(ui::SourceEventType::WHEEL); | 611 ui::LatencyInfo latency_info(ui::SourceEventType::WHEEL); |
612 host_->ForwardWheelEventWithLatencyInfo( | 612 host_->ForwardWheelEventWithLatencyInfo( |
613 *static_cast<const blink::WebMouseWheelEvent*>(event), latency_info); | 613 *static_cast<const blink::WebMouseWheelEvent*>(event), latency_info); |
614 return; | 614 return; |
615 } | 615 } |
616 | 616 |
617 if (blink::WebInputEvent::IsKeyboardEventType(event->GetType())) { | 617 if (blink::WebInputEvent::IsKeyboardEventType(event->GetType())) { |
618 if (!embedder->GetLastKeyboardEvent()) | 618 if (!embedder->GetLastKeyboardEvent()) |
619 return; | 619 return; |
| 620 ui::LatencyInfo latency_info(ui::SourceEventType::KEY); |
620 NativeWebKeyboardEvent keyboard_event(*embedder->GetLastKeyboardEvent()); | 621 NativeWebKeyboardEvent keyboard_event(*embedder->GetLastKeyboardEvent()); |
621 host_->ForwardKeyboardEvent(keyboard_event); | 622 host_->ForwardKeyboardEventWithLatencyInfo(keyboard_event, latency_info); |
622 return; | 623 return; |
623 } | 624 } |
624 | 625 |
625 if (blink::WebInputEvent::IsTouchEventType(event->GetType())) { | 626 if (blink::WebInputEvent::IsTouchEventType(event->GetType())) { |
626 if (event->GetType() == blink::WebInputEvent::kTouchStart && | 627 if (event->GetType() == blink::WebInputEvent::kTouchStart && |
627 !embedder->GetView()->HasFocus()) { | 628 !embedder->GetView()->HasFocus()) { |
628 embedder->GetView()->Focus(); | 629 embedder->GetView()->Focus(); |
629 } | 630 } |
630 ui::LatencyInfo latency_info(ui::SourceEventType::TOUCH); | 631 ui::LatencyInfo latency_info(ui::SourceEventType::TOUCH); |
631 host_->ForwardTouchEventWithLatencyInfo( | 632 host_->ForwardTouchEventWithLatencyInfo( |
(...skipping 21 matching lines...) Loading... |
653 host_->ForwardGestureEvent(gesture_event); | 654 host_->ForwardGestureEvent(gesture_event); |
654 return; | 655 return; |
655 } | 656 } |
656 } | 657 } |
657 | 658 |
658 bool RenderWidgetHostViewGuest::HasEmbedderChanged() { | 659 bool RenderWidgetHostViewGuest::HasEmbedderChanged() { |
659 return guest_ && guest_->has_attached_since_surface_set(); | 660 return guest_ && guest_->has_attached_since_surface_set(); |
660 } | 661 } |
661 | 662 |
662 } // namespace content | 663 } // namespace content |
OLD | NEW |