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

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: Release observer on destruction. Make webview focused (for Windows). 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 628 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « chrome/browser/apps/guest_view/web_view_browsertest.cc ('k') | content/public/test/browser_test_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698