Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 33 | 33 |
| 34 #include "../platform/WebCommon.h" | 34 #include "../platform/WebCommon.h" |
| 35 | 35 |
| 36 namespace blink { | 36 namespace blink { |
| 37 | 37 |
| 38 class WebLocalFrame; | 38 class WebLocalFrame; |
| 39 class WebUserGestureToken; | 39 class WebUserGestureToken; |
| 40 | 40 |
| 41 class WebUserGestureIndicator { | 41 class WebUserGestureIndicator { |
| 42 public: | 42 public: |
| 43 // Returns true if a user gesture is currently being processed. | 43 // Returns true if a user gesture is currently being processed. Must be called |
| 44 // on the main thread. | |
| 44 BLINK_EXPORT static bool isProcessingUserGesture(); | 45 BLINK_EXPORT static bool isProcessingUserGesture(); |
| 46 // Can be called from any thread. | |
|
kinuko
2016/12/09 03:15:51
Also note that it's slow and the other one must be
Charlie Harrison
2016/12/09 15:24:14
Done.
| |
| 47 BLINK_EXPORT static bool isProcessingUserGestureThreadSafe(); | |
| 45 | 48 |
| 46 // Returns true if a consumable gesture exists and has been successfully | 49 // Returns true if a consumable gesture exists and has been successfully |
| 47 // consumed. | 50 // consumed. |
| 48 BLINK_EXPORT static bool consumeUserGesture(); | 51 BLINK_EXPORT static bool consumeUserGesture(); |
| 49 | 52 |
| 50 // Returns true if a user gesture was processed on the provided frame since | 53 // Returns true if a user gesture was processed on the provided frame since |
| 51 // the time the frame was loaded. | 54 // the time the frame was loaded. |
| 52 BLINK_EXPORT static bool processedUserGestureSinceLoad(WebLocalFrame*); | 55 BLINK_EXPORT static bool processedUserGestureSinceLoad(WebLocalFrame*); |
| 53 | 56 |
| 54 // Returns a token for the currently active user gesture. It can be used to | 57 // Returns a token for the currently active user gesture. It can be used to |
| 55 // continue processing the user gesture later on using a | 58 // continue processing the user gesture later on using a |
| 56 // WebScopedUserGesture. | 59 // WebScopedUserGesture. |
| 57 BLINK_EXPORT static WebUserGestureToken currentUserGestureToken(); | 60 BLINK_EXPORT static WebUserGestureToken currentUserGestureToken(); |
| 58 }; | 61 }; |
| 59 } | 62 } |
| 60 | 63 |
| 61 #endif // WebUserGestureIndicator_h | 64 #endif // WebUserGestureIndicator_h |
| OLD | NEW |