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

Unified Diff: third_party/WebKit/Source/platform/UserGestureIndicator.h

Issue 2408333004: Move persistent gesture state to Document, add DocumentUserGestureToken (Closed)
Patch Set: Re-add dropped null check Created 4 years, 2 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
Index: third_party/WebKit/Source/platform/UserGestureIndicator.h
diff --git a/third_party/WebKit/Source/platform/UserGestureIndicator.h b/third_party/WebKit/Source/platform/UserGestureIndicator.h
index 41565a540003551d840db26701c03ade7872f343..54602b80668b3b54837a7c34ec17bfe50c747c3c 100644
--- a/third_party/WebKit/Source/platform/UserGestureIndicator.h
+++ b/third_party/WebKit/Source/platform/UserGestureIndicator.h
@@ -60,12 +60,7 @@ class PLATFORM_EXPORT UserGestureToken : public RefCounted<UserGestureToken> {
enum Status { NewGesture, PossiblyExistingGesture };
enum TimeoutPolicy { Default, OutOfProcess, HasPaused };
- static PassRefPtr<UserGestureToken> create(
- Status status = PossiblyExistingGesture) {
- return adoptRef(new UserGestureToken(status));
- }
-
- ~UserGestureToken() {}
+ virtual ~UserGestureToken() {}
bool hasGestures() const;
void transferGestureTo(UserGestureToken*);
bool consumeGesture();
@@ -81,9 +76,10 @@ class PLATFORM_EXPORT UserGestureToken : public RefCounted<UserGestureToken> {
void setUserGestureUtilizedCallback(UserGestureUtilizedCallback*);
void userGestureUtilized();
- private:
+ protected:
UserGestureToken(Status);
+ private:
bool hasTimedOut() const;
size_t m_consumableGestures;
@@ -117,17 +113,10 @@ class PLATFORM_EXPORT UserGestureIndicator final {
static UserGestureToken* currentToken();
- // Reset the notion of "since load".
- static void clearProcessedUserGestureSinceLoad();
-
- // Returns whether a user gesture has occurred since page load.
- static bool processedUserGestureSinceLoad();
-
explicit UserGestureIndicator(PassRefPtr<UserGestureToken>);
~UserGestureIndicator();
private:
- static bool s_processedUserGestureSinceLoad;
static UserGestureToken* s_rootToken;
RefPtr<UserGestureToken> m_token;

Powered by Google App Engine
This is Rietveld 408576698