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

Unified Diff: content/public/test/browser_test_utils.cc

Issue 1463153002: Don't route a non-frame widget's keyboard event to main frame widget. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address Charlie's comments Created 5 years, 1 month 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 | « content/browser/web_contents/web_contents_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/test/browser_test_utils.cc
diff --git a/content/public/test/browser_test_utils.cc b/content/public/test/browser_test_utils.cc
index 27083866f81ff1442bda724f05c1ab1c098b3803..79fd6170245e383d4f99aa70ed7ff58aec365016 100644
--- a/content/public/test/browser_test_utils.cc
+++ b/content/public/test/browser_test_utils.cc
@@ -227,8 +227,11 @@ void InjectRawKeyEvent(WebContents* web_contents,
int modifiers) {
NativeWebKeyboardEvent event;
BuildSimpleWebKeyEvent(type, key_code, native_key_code, modifiers, &event);
- static_cast<WebContentsImpl*>(web_contents)
- ->GetFocusedRenderWidgetHost()
+ WebContentsImpl* web_contents_impl =
+ static_cast<WebContentsImpl*>(web_contents);
+ RenderWidgetHostImpl* main_frame_rwh =
+ web_contents_impl->GetMainFrame()->GetRenderWidgetHost();
+ web_contents_impl->GetFocusedRenderWidgetHost(main_frame_rwh)
->ForwardKeyboardEvent(event);
}
« no previous file with comments | « content/browser/web_contents/web_contents_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698