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 "base/bind_helpers.h" | 5 #include "base/bind_helpers.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "cc/surfaces/surface.h" | 9 #include "cc/surfaces/surface.h" |
10 #include "cc/surfaces/surface_factory.h" | 10 #include "cc/surfaces/surface_factory.h" |
(...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
640 | 640 |
641 if (blink::WebInputEvent::isKeyboardEventType(event->type)) { | 641 if (blink::WebInputEvent::isKeyboardEventType(event->type)) { |
642 if (!embedder->GetLastKeyboardEvent()) | 642 if (!embedder->GetLastKeyboardEvent()) |
643 return; | 643 return; |
644 NativeWebKeyboardEvent keyboard_event(*embedder->GetLastKeyboardEvent()); | 644 NativeWebKeyboardEvent keyboard_event(*embedder->GetLastKeyboardEvent()); |
645 host_->ForwardKeyboardEvent(keyboard_event); | 645 host_->ForwardKeyboardEvent(keyboard_event); |
646 return; | 646 return; |
647 } | 647 } |
648 | 648 |
649 if (blink::WebInputEvent::isTouchEventType(event->type)) { | 649 if (blink::WebInputEvent::isTouchEventType(event->type)) { |
| 650 if (event->type == blink::WebInputEvent::TouchStart && |
| 651 !embedder->GetView()->HasFocus()) { |
| 652 embedder->GetView()->Focus(); |
| 653 } |
| 654 |
650 host_->ForwardTouchEventWithLatencyInfo( | 655 host_->ForwardTouchEventWithLatencyInfo( |
651 *static_cast<const blink::WebTouchEvent*>(event), | 656 *static_cast<const blink::WebTouchEvent*>(event), |
652 ui::LatencyInfo()); | 657 ui::LatencyInfo()); |
653 return; | 658 return; |
654 } | 659 } |
655 | 660 |
656 if (blink::WebInputEvent::isGestureEventType(event->type)) { | 661 if (blink::WebInputEvent::isGestureEventType(event->type)) { |
657 host_->ForwardGestureEvent( | 662 host_->ForwardGestureEvent( |
658 *static_cast<const blink::WebGestureEvent*>(event)); | 663 *static_cast<const blink::WebGestureEvent*>(event)); |
659 return; | 664 return; |
660 } | 665 } |
661 } | 666 } |
662 | 667 |
663 } // namespace content | 668 } // namespace content |
OLD | NEW |