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

Unified Diff: content/browser/renderer_host/render_widget_host_view_event_handler.cc

Issue 2775553002: Adds the ability for WebContentsDelegate to decide if event should be updated (Closed)
Patch Set: Fix compile Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/render_widget_host_view_event_handler.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_event_handler.cc b/content/browser/renderer_host/render_widget_host_view_event_handler.cc
index bdfc55a994f929f6793cff68b647edbe62d3a102..f00420c1ee93afcd5c87c995fc61dc5a48e405c8 100644
--- a/content/browser/renderer_host/render_widget_host_view_event_handler.cc
+++ b/content/browser/renderer_host/render_widget_host_view_event_handler.cc
@@ -248,6 +248,7 @@ void RenderWidgetHostViewEventHandler::OnKeyEvent(ui::KeyEvent* event) {
return;
}
+ bool mark_event_as_handled = true;
// We need to handle the Escape key for Pepper Flash.
if (host_view_->is_fullscreen() && event->key_code() == ui::VKEY_ESCAPE) {
// Focus the window we were created from.
@@ -283,9 +284,10 @@ void RenderWidgetHostViewEventHandler::OnKeyEvent(ui::KeyEvent* event) {
SetKeyboardFocus();
// We don't have to communicate with an input method here.
NativeWebKeyboardEvent webkit_event(*event);
- delegate_->ForwardKeyboardEvent(webkit_event);
+ delegate_->ForwardKeyboardEvent(webkit_event, &mark_event_as_handled);
}
- event->SetHandled();
+ if (mark_event_as_handled)
+ event->SetHandled();
}
void RenderWidgetHostViewEventHandler::OnMouseEvent(ui::MouseEvent* event) {

Powered by Google App Engine
This is Rietveld 408576698