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

Unified Diff: extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc

Issue 557523002: Add keyboard handler for mime-handler-view. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
« no previous file with comments | « extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc
diff --git a/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc b/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc
index 41e076000f5b74660cef82ba4fa8b7c978f51ee4..5e5717c1b571766541789fe7188a70677d773715 100644
--- a/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc
+++ b/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc
@@ -94,4 +94,20 @@ void MimeHandlerViewGuest::DidAttachToEmbedder() {
std::string());
}
+void MimeHandlerViewGuest::HandleKeyboardEvent(
+ WebContents* source,
+ const content::NativeWebKeyboardEvent& event) {
+ if (!attached())
+ return;
+
+ // Send the keyboard events back to the embedder to reprocess them.
+ // TODO(fsamuel): This introduces the possibility of out-of-order keyboard
+ // events because the guest may be arbitrarily delayed when responding to
+ // keyboard events. In that time, the embedder may have received and processed
+ // additional key events. This needs to be fixed as soon as possible.
lazyboy 2014/09/08 21:48:36 I'm not sure if the comment is relevant for mime-h
Fady Samuel 2014/09/08 21:51:38 Yes, it is still relevant unfortunately.
+ // See http://crbug.com/229882.
+ embedder_web_contents()->GetDelegate()->HandleKeyboardEvent(web_contents(),
+ event);
+}
+
} // namespace extensions
« no previous file with comments | « extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698