Commit 012666e4 authored by jochen@chromium.org's avatar jochen@chromium.org

Refactor UserGestureIndicator::Token to be a top-level class

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

Reviewed by Nico Weber.

This will allow for forward declaring the class in a public WebKit
API header. The goal is to enable the embedder to hold on to a
UserGestureToken.

* dom/UserGestureIndicator.cpp:
(WebCore::UserGestureIndicator::UserGestureIndicator):
(WebCore::UserGestureIndicator::currentToken):
* dom/UserGestureIndicator.h:
(UserGestureToken):
(WebCore::UserGestureToken::~UserGestureToken):
(WebCore):
(UserGestureIndicator):
* page/DOMTimer.h:
(DOMTimer):
* page/EventHandler.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@144742 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 699fcf38
2013-03-05 Jochen Eisinger <jochen@chromium.org>
Refactor UserGestureIndicator::Token to be a top-level class
https://bugs.webkit.org/show_bug.cgi?id=111412
Reviewed by Nico Weber.
This will allow for forward declaring the class in a public WebKit
API header. The goal is to enable the embedder to hold on to a
UserGestureToken.
* dom/UserGestureIndicator.cpp:
(WebCore::UserGestureIndicator::UserGestureIndicator):
(WebCore::UserGestureIndicator::currentToken):
* dom/UserGestureIndicator.h:
(UserGestureToken):
(WebCore::UserGestureToken::~UserGestureToken):
(WebCore):
(UserGestureIndicator):
* page/DOMTimer.h:
(DOMTimer):
* page/EventHandler.h:
2013-03-05 Mike West <mkwst@chromium.org>
Remove redundant code in Document::updateHoverActiveState.
......@@ -30,9 +30,9 @@ namespace WebCore {
namespace {
class GestureToken : public UserGestureIndicator::Token {
class GestureToken : public UserGestureToken {
public:
static PassRefPtr<UserGestureIndicator::Token> create() { return adoptRef(new GestureToken); }
static PassRefPtr<UserGestureToken> create() { return adoptRef(new GestureToken); }
virtual ~GestureToken() { }
......@@ -83,7 +83,7 @@ UserGestureIndicator::UserGestureIndicator(ProcessingUserGestureState state)
ASSERT(isDefinite(s_state));
}
UserGestureIndicator::UserGestureIndicator(PassRefPtr<UserGestureIndicator::Token> token)
UserGestureIndicator::UserGestureIndicator(PassRefPtr<UserGestureToken> token)
: m_previousState(s_state)
{
if (token && static_cast<GestureToken*>(token.get())->hasGestures()) {
......@@ -121,7 +121,7 @@ bool UserGestureIndicator::consumeUserGesture()
return static_cast<GestureToken*>(s_topmostIndicator->currentToken())->consumeGesture();
}
UserGestureIndicator::Token* UserGestureIndicator::currentToken()
UserGestureToken* UserGestureIndicator::currentToken()
{
if (!s_topmostIndicator)
return 0;
......
......@@ -38,20 +38,21 @@ enum ProcessingUserGestureState {
DefinitelyNotProcessingUserGesture
};
class UserGestureToken : public RefCounted<UserGestureToken> {
public:
virtual ~UserGestureToken() { }
};
class UserGestureIndicator {
WTF_MAKE_NONCOPYABLE(UserGestureIndicator);
public:
class Token : public RefCounted<Token> {
public:
virtual ~Token() { }
};
static bool processingUserGesture();
static bool consumeUserGesture();
static Token* currentToken();
static UserGestureToken* currentToken();
explicit UserGestureIndicator(ProcessingUserGestureState);
explicit UserGestureIndicator(PassRefPtr<Token>);
explicit UserGestureIndicator(PassRefPtr<UserGestureToken>);
~UserGestureIndicator();
......@@ -59,7 +60,7 @@ private:
static ProcessingUserGestureState s_state;
static UserGestureIndicator* s_topmostIndicator;
ProcessingUserGestureState m_previousState;
RefPtr<Token> m_token;
RefPtr<UserGestureToken> m_token;
};
}
......
......@@ -68,7 +68,7 @@ namespace WebCore {
int m_nestingLevel;
OwnPtr<ScheduledAction> m_action;
int m_originalInterval;
RefPtr<UserGestureIndicator::Token> m_userGestureToken;
RefPtr<UserGestureToken> m_userGestureToken;
};
} // namespace WebCore
......
......@@ -452,7 +452,7 @@ private:
IntPoint m_mouseDownPos; // In our view's coords.
double m_mouseDownTimestamp;
PlatformMouseEvent m_mouseDown;
RefPtr<UserGestureIndicator::Token> m_lastMouseDownUserGestureToken;
RefPtr<UserGestureToken> m_lastMouseDownUserGestureToken;
RefPtr<Node> m_latchedWheelEventNode;
bool m_widgetIsLatched;
......
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