[content shell] don't require a user action for focus/blur events during layout tests
Many layout tests assume that e.g. window.focus() will change the focus instantly. This
is not the case, and those tests will need to be updated.
BUG=111316
TEST=layout tests that change the focus and listen to focus events work.
[email protected]
Review URL: https://chromiumcodereview.appspot.com/12317133
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@185017 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/content/renderer/render_thread_impl.h b/content/renderer/render_thread_impl.h
index 6d8ac9f8..9813cfb 100644
--- a/content/renderer/render_thread_impl.h
+++ b/content/renderer/render_thread_impl.h
@@ -173,6 +173,14 @@
void DoNotSuspendWebKitSharedTimer();
void DoNotNotifyWebKitOfModalLoop();
+ // True if changing the focus of a RenderView requires a active user gesture.
+ bool require_user_gesture_for_focus() const {
+ return require_user_gesture_for_focus_;
+ }
+ void set_require_user_gesture_for_focus(bool require_gesture) {
+ require_user_gesture_for_focus_ = require_gesture;
+ }
+
IPC::ForwardingMessageFilter* compositor_output_surface_filter() const {
return compositor_output_surface_filter_.get();
}
@@ -373,6 +381,8 @@
bool suspend_webkit_shared_timer_;
bool notify_webkit_of_modal_loop_;
+ bool require_user_gesture_for_focus_;
+
// Timer that periodically calls IdleHandler.
base::RepeatingTimer<RenderThreadImpl> idle_timer_;