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

Side by Side Diff: content/renderer/browser_plugin/browser_plugin.cc

Issue 2101663002: Send synthetic GestureTapDown to focus BrowserPlugin (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/renderer/browser_plugin/browser_plugin.h" 5 #include "content/renderer/browser_plugin/browser_plugin.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 DCHECK(!blink::WebInputEvent::isTouchEventType(event.type)); 422 DCHECK(!blink::WebInputEvent::isTouchEventType(event.type));
423 423
424 if (event.type == blink::WebInputEvent::MouseWheel) { 424 if (event.type == blink::WebInputEvent::MouseWheel) {
425 auto wheel_event = static_cast<const blink::WebMouseWheelEvent&>(event); 425 auto wheel_event = static_cast<const blink::WebMouseWheelEvent&>(event);
426 if (wheel_event.resendingPluginId == browser_plugin_instance_id_) 426 if (wheel_event.resendingPluginId == browser_plugin_instance_id_)
427 return blink::WebInputEventResult::NotHandled; 427 return blink::WebInputEventResult::NotHandled;
428 } 428 }
429 429
430 if (blink::WebInputEvent::isGestureEventType(event.type)) { 430 if (blink::WebInputEvent::isGestureEventType(event.type)) {
431 auto gesture_event = static_cast<const blink::WebGestureEvent&>(event); 431 auto gesture_event = static_cast<const blink::WebGestureEvent&>(event);
432 if (gesture_event.resendingPluginId == browser_plugin_instance_id_) 432 DCHECK(blink::WebInputEvent::GestureTapDown == event.type ||
433 return blink::WebInputEventResult::NotHandled; 433 gesture_event.resendingPluginId == browser_plugin_instance_id_);
434
435 // We shouldn't be forwarding GestureEvents to the Guest anymore. Indicate
436 // we handled this only if it's a non-resent event.
437 return gesture_event.resendingPluginId == browser_plugin_instance_id_
438 ? blink::WebInputEventResult::NotHandled
439 : blink::WebInputEventResult::HandledApplication;
434 } 440 }
435 441
436 if (event.type == blink::WebInputEvent::ContextMenu) 442 if (event.type == blink::WebInputEvent::ContextMenu)
437 return blink::WebInputEventResult::HandledSuppressed; 443 return blink::WebInputEventResult::HandledSuppressed;
438 444
439 if (blink::WebInputEvent::isKeyboardEventType(event.type) && 445 if (blink::WebInputEvent::isKeyboardEventType(event.type) &&
440 !edit_commands_.empty()) { 446 !edit_commands_.empty()) {
441 BrowserPluginManager::Get()->Send( 447 BrowserPluginManager::Get()->Send(
442 new BrowserPluginHostMsg_SetEditCommandsForNextKeyEvent( 448 new BrowserPluginHostMsg_SetEditCommandsForNextKeyEvent(
443 browser_plugin_instance_id_, 449 browser_plugin_instance_id_,
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
569 575
570 bool BrowserPlugin::HandleMouseLockedInputEvent( 576 bool BrowserPlugin::HandleMouseLockedInputEvent(
571 const blink::WebMouseEvent& event) { 577 const blink::WebMouseEvent& event) {
572 BrowserPluginManager::Get()->Send( 578 BrowserPluginManager::Get()->Send(
573 new BrowserPluginHostMsg_HandleInputEvent(browser_plugin_instance_id_, 579 new BrowserPluginHostMsg_HandleInputEvent(browser_plugin_instance_id_,
574 &event)); 580 &event));
575 return true; 581 return true;
576 } 582 }
577 583
578 } // namespace content 584 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698