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

Unified Diff: Source/platform/UserGestureIndicator.cpp

Issue 235983016: Add support for setting password value gated on user's gesture in a page (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: OVERRIDE added Created 6 years, 8 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
« no previous file with comments | « Source/platform/UserGestureIndicator.h ('k') | Source/web/WebViewImpl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « Source/platform/UserGestureIndicator.h ('k') | Source/web/WebViewImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698