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