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

Unified Diff: Source/platform/UserGestureIndicator.h

Issue 82693006: Adding handlers for user gesture callbacks. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed unit test bug Created 7 years, 1 month 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 | « no previous file | Source/platform/UserGestureIndicator.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/UserGestureIndicator.h
diff --git a/Source/platform/UserGestureIndicator.h b/Source/platform/UserGestureIndicator.h
index 5281bf6909ea33c17e6c33dd5b9a332ef4b471d5..c69d866d89b3083ed9b75b6c22f2dad45d0ba594 100644
--- a/Source/platform/UserGestureIndicator.h
+++ b/Source/platform/UserGestureIndicator.h
@@ -42,6 +42,12 @@ enum ProcessingUserGestureState {
DefinitelyNotProcessingUserGesture
};
+class UserGestureHandler {
+public:
+ virtual ~UserGestureHandler() { }
+ virtual void onGesture() = 0;
+};
+
class PLATFORM_EXPORT UserGestureToken : public RefCounted<UserGestureToken> {
public:
virtual ~UserGestureToken() { }
@@ -68,6 +74,7 @@ public:
static bool processingUserGesture();
static bool consumeUserGesture();
static UserGestureToken* currentToken();
+ static void setHandler(UserGestureHandler*);
explicit UserGestureIndicator(ProcessingUserGestureState);
explicit UserGestureIndicator(PassRefPtr<UserGestureToken>);
@@ -77,6 +84,7 @@ public:
private:
static ProcessingUserGestureState s_state;
static UserGestureIndicator* s_topmostIndicator;
+ static UserGestureHandler* s_handler;
ProcessingUserGestureState m_previousState;
RefPtr<UserGestureToken> m_token;
};
« no previous file with comments | « no previous file | Source/platform/UserGestureIndicator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698