Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(938)

Side by Side Diff: content/browser/frame_host/render_widget_host_view_guest.cc

Issue 1180503002: Force a GuestView's embedder to be focused on TouchStart. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add test. Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698