Source/WebCore: Add support for consumable user gestures
authorcdn@chromium.org <cdn@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Aug 2012 19:01:18 +0000 (19:01 +0000)
committercdn@chromium.org <cdn@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Aug 2012 19:01:18 +0000 (19:01 +0000)
commitf11cff5e4299a1ec9963e972acb747c9ecb02f1c
tree414cd11bbe2c36bdc4e625998b8280efa0debad8
parent38d07fa4fd5feb70d77d8be6b1396b0fd3f69be8
Source/WebCore: Add support for consumable user gestures
https://bugs.webkit.org/show_bug.cgi?id=94867

Reviewed by Adam Barth.

Adds a static counter of the number of consumable gestures. This is decremented either when
a gestures falls out of scope or is consumed via a call to consumeUserGesture().

Planned usage in Chromium is to prevent the piggybacking of multiple popup windows on a
single user gesture.

No new tests as this should not change behavior. The platform must implement consumable
gestures for this to do anything.

* bindings/v8/ScriptController.cpp:
(WebCore::ScriptController::consumeUserGesture):
(WebCore):
* bindings/v8/ScriptController.h:
(ScriptController):
* dom/UserGestureIndicator.cpp:
(WebCore):
(WebCore::UserGestureIndicator::UserGestureIndicator):
(WebCore::UserGestureIndicator::~UserGestureIndicator):
(WebCore::UserGestureIndicator::consumeUserGesture):
* dom/UserGestureIndicator.h:
(WebCore::UserGestureIndicator::processingUserGesture):
(UserGestureIndicator):

Source/WebKit/chromium: Plumb consumeUserGesture() to the chromium platform layer.
https://bugs.webkit.org/show_bug.cgi?id=9475294867

Reviewed by Adam Barth.

* public/WebFrame.h:
(WebFrame):
* src/WebFrameImpl.cpp:
(WebKit::WebFrameImpl::consumeUserGesture):
(WebKit):
* src/WebFrameImpl.h:
(WebFrameImpl):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@126609 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/dom/UserGestureIndicator.cpp
Source/WebCore/dom/UserGestureIndicator.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/public/WebFrame.h
Source/WebKit/chromium/src/WebFrameImpl.cpp
Source/WebKit/chromium/src/WebFrameImpl.h