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

Side by Side Diff: third_party/WebKit/Source/platform/UserGestureIndicator.h

Issue 2467993002: Document user gesture state should be able to propagate over postMessage (Closed)
Patch Set: Created 4 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2010 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 // for later (see, e.g., DOMTimer, which propagates user gestures to the timer 53 // for later (see, e.g., DOMTimer, which propagates user gestures to the timer
54 // fire in certain situations). Passing it to a UserGestureIndicator will cause 54 // fire in certain situations). Passing it to a UserGestureIndicator will cause
55 // it to be considered as currently being processed. 55 // it to be considered as currently being processed.
56 class PLATFORM_EXPORT UserGestureToken : public RefCounted<UserGestureToken> { 56 class PLATFORM_EXPORT UserGestureToken : public RefCounted<UserGestureToken> {
57 WTF_MAKE_NONCOPYABLE(UserGestureToken); 57 WTF_MAKE_NONCOPYABLE(UserGestureToken);
58 58
59 public: 59 public:
60 enum Status { NewGesture, PossiblyExistingGesture }; 60 enum Status { NewGesture, PossiblyExistingGesture };
61 enum TimeoutPolicy { Default, OutOfProcess, HasPaused }; 61 enum TimeoutPolicy { Default, OutOfProcess, HasPaused };
62 62
63 virtual ~UserGestureToken() {} 63 ~UserGestureToken() {}
64 bool hasGestures() const; 64 bool hasGestures() const;
65 void transferGestureTo(UserGestureToken*); 65 void transferGestureTo(UserGestureToken*);
66 bool consumeGesture(); 66 bool consumeGesture();
67 void setTimeoutPolicy(TimeoutPolicy); 67 void setTimeoutPolicy(TimeoutPolicy);
68 68
69 // If this UserGestureToken is wrapped in a UserGestureIndicator, and the 69 // If this UserGestureToken is wrapped in a UserGestureIndicator, and the
70 // UserGestureIndicator is the lowest on the callstack (and therefore this 70 // UserGestureIndicator is the lowest on the callstack (and therefore this
71 // UserGestureToken is UserGestureIndicator::s_rootToken), then the callback 71 // UserGestureToken is UserGestureIndicator::s_rootToken), then the callback
72 // provided here will be called when this UserGestureToken is utilized. 72 // provided here will be called when this UserGestureToken is utilized.
73 // Calling setUserGestureUtilizedCallback() on a UserGestureToken that is not 73 // Calling setUserGestureUtilizedCallback() on a UserGestureToken that is not
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 118
119 private: 119 private:
120 static UserGestureToken* s_rootToken; 120 static UserGestureToken* s_rootToken;
121 121
122 RefPtr<UserGestureToken> m_token; 122 RefPtr<UserGestureToken> m_token;
123 }; 123 };
124 124
125 } // namespace blink 125 } // namespace blink
126 126
127 #endif 127 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698