Commit 91e368b5 authored by jochen@chromium.org's avatar jochen@chromium.org

Expose whether a UserGestureToken still has gestures via WebKit API

https://bugs.webkit.org/show_bug.cgi?id=112342

Reviewed by Adam Barth.

Source/WebCore:

* dom/UserGestureIndicator.cpp:
* dom/UserGestureIndicator.h:
(UserGestureToken):

Source/WebKit/chromium:

* public/WebUserGestureToken.h:
(WebUserGestureToken):
* src/WebUserGestureToken.cpp:
(WebKit::WebUserGestureToken::hasGestures):
(WebKit):
* tests/WebUserGestureTokenTest.cpp:
(WebCore::TEST):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145944 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 2005e105
2013-03-15 Jochen Eisinger <jochen@chromium.org>
Expose whether a UserGestureToken still has gestures via WebKit API
https://bugs.webkit.org/show_bug.cgi?id=112342
Reviewed by Adam Barth.
* dom/UserGestureIndicator.cpp:
* dom/UserGestureIndicator.h:
(UserGestureToken):
2013-03-15 Christian Biesinger <cbiesinger@chromium.org>
Convert inspector to new-flexbox
......@@ -35,6 +35,7 @@ public:
static PassRefPtr<UserGestureToken> create() { return adoptRef(new GestureToken); }
virtual ~GestureToken() { }
virtual bool hasGestures() const OVERRIDE { return m_consumableGestures > 0; }
void addGesture() { m_consumableGestures++; }
bool consumeGesture()
......@@ -44,7 +45,6 @@ public:
m_consumableGestures--;
return true;
}
bool hasGestures() const { return m_consumableGestures > 0; }
private:
GestureToken()
......
......@@ -42,6 +42,7 @@ enum ProcessingUserGestureState {
class UserGestureToken : public RefCounted<UserGestureToken> {
public:
virtual ~UserGestureToken() { }
virtual bool hasGestures() const = 0;
};
......
2013-03-15 Jochen Eisinger <jochen@chromium.org>
Expose whether a UserGestureToken still has gestures via WebKit API
https://bugs.webkit.org/show_bug.cgi?id=112342
Reviewed by Adam Barth.
* public/WebUserGestureToken.h:
(WebUserGestureToken):
* src/WebUserGestureToken.cpp:
(WebKit::WebUserGestureToken::hasGestures):
(WebKit):
* tests/WebUserGestureTokenTest.cpp:
(WebCore::TEST):
2013-03-15 Sheriff Bot <webkit.review.bot@gmail.com>
Unreviewed. Rolled Chromium DEPS to r188418. Requested by
......
......@@ -53,6 +53,7 @@ public:
}
~WebUserGestureToken() { reset(); }
WEBKIT_EXPORT bool hasGestures() const;
bool isNull() const { return m_token.isNull(); }
#if WEBKIT_IMPLEMENTATION
......
......@@ -35,6 +35,11 @@
namespace WebKit {
bool WebUserGestureToken::hasGestures() const
{
return !m_token.isNull() && m_token->hasGestures();
}
WebUserGestureToken::WebUserGestureToken(PassRefPtr<WebCore::UserGestureToken> token)
{
m_token = token;
......
......@@ -45,6 +45,7 @@ namespace {
TEST(WebUserGestureTokenTest, Basic)
{
WebUserGestureToken token;
EXPECT_FALSE(token.hasGestures());
{
WebScopedUserGesture indicator(token);
......@@ -57,6 +58,7 @@ TEST(WebUserGestureTokenTest, Basic)
token = WebUserGestureIndicator::currentUserGestureToken();
}
EXPECT_TRUE(token.hasGestures());
EXPECT_FALSE(WebUserGestureIndicator::isProcessingUserGesture());
{
......@@ -66,6 +68,8 @@ TEST(WebUserGestureTokenTest, Basic)
EXPECT_FALSE(WebUserGestureIndicator::isProcessingUserGesture());
}
EXPECT_FALSE(token.hasGestures());
{
WebScopedUserGesture indicator(token);
EXPECT_FALSE(WebUserGestureIndicator::isProcessingUserGesture());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment