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 10 matching lines...) Expand all Loading... | |
| 21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | 21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 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 #ifndef WebUserGestureToken_h | 31 #ifndef PinchViewports_h |
| 32 #define WebUserGestureToken_h | 32 #define PinchViewports_h |
| 33 | 33 |
| 34 #include "../platform/WebPrivatePtr.h" | 34 #include "core/platform/graphics/FloatSize.h" |
| 35 #include "public/platform/WebScrollbar.h" | |
| 36 #include "public/platform/WebSize.h" | |
| 37 #include "wtf/OwnPtr.h" | |
| 38 #include "wtf/PassOwnPtr.h" | |
| 35 | 39 |
| 36 namespace WebCore { | 40 namespace WebCore { |
| 37 class UserGestureToken; | 41 class GraphicsLayer; |
| 38 } | 42 } |
| 39 | 43 |
| 40 namespace WebKit { | 44 namespace WebKit { |
| 41 | 45 |
| 42 // A WebUserGestureToken allows for storing the user gesture state of the | 46 class WebScrollbarLayer; |
| 43 // currently active context and reinstantiating it later on to continue | 47 class WebViewImpl; |
| 44 // processing the user gesture in case it was not consumed meanwhile. | 48 |
| 45 class WebUserGestureToken { | 49 using namespace WebCore; |
| 50 | |
| 51 class PinchViewports { | |
| 46 public: | 52 public: |
| 47 WebUserGestureToken() { } | 53 static WTF::PassOwnPtr<PinchViewports> create(WebViewImpl* owner); |
| 48 WebUserGestureToken(const WebUserGestureToken& other) { assign(other); } | 54 ~PinchViewports(); |
| 49 WebUserGestureToken& operator=(const WebUserGestureToken& other) | |
| 50 { | |
| 51 assign(other); | |
| 52 return *this; | |
| 53 } | |
| 54 ~WebUserGestureToken() { reset(); } | |
| 55 | 55 |
| 56 WEBKIT_EXPORT bool hasGestures() const; | 56 void setOverflowControlsHostLayer(GraphicsLayer*); |
| 57 bool isNull() const { return m_token.isNull(); } | 57 GraphicsLayer* rootGraphicsLayer() { return m_innerViewportClipLayer.get(); } |
|
trchen
2013/06/13 21:11:54
nits: 80 chars
wjmaclean
2013/06/14 15:54:16
Done.
| |
| 58 void setViewportSize(const FloatSize&); | |
| 59 void showGraphicsLayers(); | |
| 58 | 60 |
| 59 #if WEBKIT_IMPLEMENTATION | 61 protected: |
| 60 explicit WebUserGestureToken(PassRefPtr<WebCore::UserGestureToken>); | 62 const static size_t kOverlayScrollbarThickness; |
|
trchen
2013/06/13 21:11:54
Should we make it a WebSettings?
wjmaclean
2013/06/14 15:54:16
Sure, seems reasonable.
| |
| 61 operator PassRefPtr<WebCore::UserGestureToken>() const; | |
| 62 #endif | |
| 63 | 63 |
| 64 private: | 64 PinchViewports(WebViewImpl* owner); |
| 65 WEBKIT_EXPORT void assign(const WebUserGestureToken&); | |
| 66 WEBKIT_EXPORT void reset(); | |
| 67 | 65 |
| 68 WebPrivatePtr<WebCore::UserGestureToken> m_token; | 66 void setupScrollbar(WebKit::WebScrollbar::Orientation); |
| 67 | |
| 68 WebViewImpl* m_owner; | |
| 69 WTF::OwnPtr<GraphicsLayer> m_innerViewportClipLayer; | |
| 70 WTF::OwnPtr<GraphicsLayer> m_pageScaleLayer; | |
| 71 WTF::OwnPtr<GraphicsLayer> m_innerViewportScrollLayer; | |
| 72 WTF::OwnPtr<GraphicsLayer> m_overlayScrollbarHorizontal; | |
| 73 WTF::OwnPtr<GraphicsLayer> m_overlayScrollbarVertical; | |
| 74 WTF::OwnPtr<WebScrollbarLayer> m_webScrollbarLayerHorizontal; | |
| 75 WTF::OwnPtr<WebScrollbarLayer> m_webScrollbarLayerVertical; | |
| 69 }; | 76 }; |
| 70 | 77 |
| 71 } // namespace WebKit | 78 } // namespace WebKit |
| 72 | 79 |
| 73 #endif // WebUserGestureToken_h | 80 #endif // PinchViewports_h |
| OLD | NEW |