| 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 12 matching lines...) Expand all Loading... |
| 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "public/web/WebUserGestureIndicator.h" | 31 #include "public/web/WebUserGestureIndicator.h" |
| 32 | 32 |
| 33 #include "core/frame/LocalFrame.h" |
| 34 #include "core/frame/WebLocalFrameBase.h" |
| 33 #include "platform/UserGestureIndicator.h" | 35 #include "platform/UserGestureIndicator.h" |
| 34 #include "public/web/WebUserGestureToken.h" | 36 #include "public/web/WebUserGestureToken.h" |
| 35 #include "web/WebLocalFrameImpl.h" | |
| 36 | 37 |
| 37 namespace blink { | 38 namespace blink { |
| 38 | 39 |
| 39 bool WebUserGestureIndicator::IsProcessingUserGesture() { | 40 bool WebUserGestureIndicator::IsProcessingUserGesture() { |
| 40 return UserGestureIndicator::ProcessingUserGesture(); | 41 return UserGestureIndicator::ProcessingUserGesture(); |
| 41 } | 42 } |
| 42 | 43 |
| 43 bool WebUserGestureIndicator::IsProcessingUserGestureThreadSafe() { | 44 bool WebUserGestureIndicator::IsProcessingUserGestureThreadSafe() { |
| 44 return UserGestureIndicator::ProcessingUserGestureThreadSafe(); | 45 return UserGestureIndicator::ProcessingUserGestureThreadSafe(); |
| 45 } | 46 } |
| 46 | 47 |
| 47 // TODO(csharrison): consumeUserGesture() and currentUserGestureToken() use | 48 // TODO(csharrison): consumeUserGesture() and currentUserGestureToken() use |
| 48 // the thread-safe API, which many callers probably do not need. Consider | 49 // the thread-safe API, which many callers probably do not need. Consider |
| 49 // updating them if they are in any sort of critical path or called often. | 50 // updating them if they are in any sort of critical path or called often. |
| 50 bool WebUserGestureIndicator::ConsumeUserGesture() { | 51 bool WebUserGestureIndicator::ConsumeUserGesture() { |
| 51 return UserGestureIndicator::ConsumeUserGestureThreadSafe(); | 52 return UserGestureIndicator::ConsumeUserGestureThreadSafe(); |
| 52 } | 53 } |
| 53 | 54 |
| 54 bool WebUserGestureIndicator::ProcessedUserGestureSinceLoad( | 55 bool WebUserGestureIndicator::ProcessedUserGestureSinceLoad( |
| 55 WebLocalFrame* frame) { | 56 WebLocalFrame* frame) { |
| 56 return ToWebLocalFrameImpl(frame)->GetFrame()->HasReceivedUserGesture(); | 57 return ToWebLocalFrameBase(frame)->GetFrame()->HasReceivedUserGesture(); |
| 57 } | 58 } |
| 58 | 59 |
| 59 WebUserGestureToken WebUserGestureIndicator::CurrentUserGestureToken() { | 60 WebUserGestureToken WebUserGestureIndicator::CurrentUserGestureToken() { |
| 60 return WebUserGestureToken(UserGestureIndicator::CurrentTokenThreadSafe()); | 61 return WebUserGestureToken(UserGestureIndicator::CurrentTokenThreadSafe()); |
| 61 } | 62 } |
| 62 | 63 |
| 63 } // namespace blink | 64 } // namespace blink |
| OLD | NEW |