OLD | NEW |
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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 WTF_MAKE_NONCOPYABLE(UserGestureIndicator); | 73 WTF_MAKE_NONCOPYABLE(UserGestureIndicator); |
74 | 74 |
75 public: | 75 public: |
76 // Returns whether a user gesture is currently in progress. | 76 // Returns whether a user gesture is currently in progress. |
77 // Does not invoke the UserGestureUtilizedCallback. Consider calling | 77 // Does not invoke the UserGestureUtilizedCallback. Consider calling |
78 // utilizeUserGesture instead if you know for sure that the return value | 78 // utilizeUserGesture instead if you know for sure that the return value |
79 // will have an effect. | 79 // will have an effect. |
80 static bool processingUserGesture(); | 80 static bool processingUserGesture(); |
81 | 81 |
82 // Indicates that a user gesture (if any) is being used, without preventing it | 82 // Indicates that a user gesture (if any) is being used, without preventing it |
83 // from being used again. Returns whether a user gesture is currently in prog
ress. | 83 // from being used again. Returns whether a user gesture is currently in |
84 // If true, invokes (and then clears) any UserGestureUtilizedCallback. | 84 // progress. If true, invokes (and then clears) any |
| 85 // UserGestureUtilizedCallback. |
85 static bool utilizeUserGesture(); | 86 static bool utilizeUserGesture(); |
86 | 87 |
87 // Mark the current user gesture (if any) as having been used, such that | 88 // Mark the current user gesture (if any) as having been used, such that |
88 // it cannot be used again. This is done only for very security-sensitive | 89 // it cannot be used again. This is done only for very security-sensitive |
89 // operations like creating a new process. | 90 // operations like creating a new process. |
90 // Like utilizeUserGesture, may invoke/clear any UserGestureUtilizedCallback. | 91 // Like utilizeUserGesture, may invoke/clear any UserGestureUtilizedCallback. |
91 static bool consumeUserGesture(); | 92 static bool consumeUserGesture(); |
92 | 93 |
93 static UserGestureToken* currentToken(); | 94 static UserGestureToken* currentToken(); |
94 | 95 |
(...skipping 14 matching lines...) Expand all Loading... |
109 static UserGestureIndicator* s_topmostIndicator; | 110 static UserGestureIndicator* s_topmostIndicator; |
110 static bool s_processedUserGestureSinceLoad; | 111 static bool s_processedUserGestureSinceLoad; |
111 ProcessingUserGestureState m_previousState; | 112 ProcessingUserGestureState m_previousState; |
112 RefPtr<UserGestureToken> m_token; | 113 RefPtr<UserGestureToken> m_token; |
113 UserGestureUtilizedCallback* m_usageCallback; | 114 UserGestureUtilizedCallback* m_usageCallback; |
114 }; | 115 }; |
115 | 116 |
116 } // namespace blink | 117 } // namespace blink |
117 | 118 |
118 #endif | 119 #endif |
OLD | NEW |