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

Unified Diff: content/renderer/render_view_impl.cc

Issue 12317133: [content shell] don't require a user action for focus/blur events during layout tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates Created 7 years, 10 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 | « content/renderer/render_thread_impl.cc ('k') | content/shell/shell.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_view_impl.cc
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index 3a40ebe1e6011855c3a74eae94b41ec501998fff..c1b19daceebcef3f805bdc9e2393242834176c5f 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -2519,17 +2519,21 @@ void RenderViewImpl::didFocus() {
// TODO(jcivelli): when https://bugs.webkit.org/show_bug.cgi?id=33389 is fixed
// we won't have to test for user gesture anymore and we can
// move that code back to render_widget.cc
- if (webview() && webview()->mainFrame() &&
- webview()->mainFrame()->isProcessingUserGesture()) {
- Send(new ViewHostMsg_Focus(routing_id_));
+ if (webview() && webview()->mainFrame()) {
+ if (webview()->mainFrame()->isProcessingUserGesture() ||
+ !RenderThreadImpl::current()->require_user_gesture_for_focus()) {
+ Send(new ViewHostMsg_Focus(routing_id_));
+ }
}
}
void RenderViewImpl::didBlur() {
// TODO(jcivelli): see TODO above in didFocus().
- if (webview() && webview()->mainFrame() &&
- webview()->mainFrame()->isProcessingUserGesture()) {
- Send(new ViewHostMsg_Blur(routing_id_));
+ if (webview() && webview()->mainFrame()) {
+ if (webview()->mainFrame()->isProcessingUserGesture() ||
+ !RenderThreadImpl::current()->require_user_gesture_for_focus()) {
+ Send(new ViewHostMsg_Blur(routing_id_));
+ }
}
}
« no previous file with comments | « content/renderer/render_thread_impl.cc ('k') | content/shell/shell.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698