Index: Source/platform/UserGestureIndicator.cpp |
diff --git a/Source/platform/UserGestureIndicator.cpp b/Source/platform/UserGestureIndicator.cpp |
index 03d219537a755790da17f7bf8602c9a560633c6b..dbebd06a9ddc724f81f454e1af6366d3c0ae55fb 100644 |
--- a/Source/platform/UserGestureIndicator.cpp |
+++ b/Source/platform/UserGestureIndicator.cpp |
@@ -112,6 +112,7 @@ static bool isDefinite(ProcessingUserGestureState state) |
ProcessingUserGestureState UserGestureIndicator::s_state = DefinitelyNotProcessingUserGesture; |
UserGestureIndicator* UserGestureIndicator::s_topmostIndicator = 0; |
+bool UserGestureIndicator::s_processedUserGestureInPast = false; |
UserGestureIndicator::UserGestureIndicator(ProcessingUserGestureState state) |
: m_previousState(s_state) |
@@ -129,6 +130,8 @@ UserGestureIndicator::UserGestureIndicator(ProcessingUserGestureState state) |
m_token = s_topmostIndicator->currentToken(); |
} |
s_state = state; |
+ if (state == DefinitelyProcessingNewUserGesture || state == DefinitelyProcessingUserGesture) |
+ s_processedUserGestureInPast = true; |
jochen (gone - plz use gerrit)
2014/04/16 14:05:16
i think you only want to do this when we actually
vabr (Chromium)
2014/04/16 16:24:16
Done.
|
} |
if (state == DefinitelyProcessingNewUserGesture) |
@@ -158,6 +161,7 @@ UserGestureIndicator::UserGestureIndicator(PassRefPtr<UserGestureToken> token) |
} |
} |
s_state = DefinitelyProcessingUserGesture; |
+ s_processedUserGestureInPast = true; |
} |
ASSERT(isDefinite(s_state)); |
@@ -194,6 +198,19 @@ UserGestureToken* UserGestureIndicator::currentToken() |
return s_topmostIndicator->m_token.get(); |
} |
+void UserGestureIndicator::clearProcessedUserGestureInPast() |
+{ |
+ if (isMainThread()) |
+ s_processedUserGestureInPast = true; |
jochen (gone - plz use gerrit)
2014/04/16 14:05:16
false?
vabr (Chromium)
2014/04/16 16:24:16
True! :)
(Thanks for catching this!)
|
+} |
+ |
+bool UserGestureIndicator::processedUserGestureInPast() |
+{ |
+ if (!isMainThread()) |
+ return false; |
+ return s_processedUserGestureInPast; |
+} |
+ |
UserGestureIndicatorDisabler::UserGestureIndicatorDisabler() |
: m_savedState(UserGestureIndicator::s_state) |
, m_savedIndicator(UserGestureIndicator::s_topmostIndicator) |