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

Side by Side Diff: Source/WebKit/chromium/src/PinchViewports.h

Issue 16799005: Insert pinch zoom virtual viewport layers to graphics layer tree. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Skip creating WebScrollbarLayers, defer to creation in CC. Created 7 years, 6 months 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 | Annotate | Revision Log
OLDNEW
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
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;
jamesr 2013/06/14 20:55:46 specific using statements are strongly preferred i
wjmaclean 2013/06/17 17:45:27 Done.
50
51 class PinchViewports {
46 public: 52 public:
47 WebUserGestureToken() { } 53 static WTF::PassOwnPtr<PinchViewports> create(WebViewImpl* owner);
jamesr 2013/06/14 20:55:46 no WTF:: needed - wtf/OwnPtr.h has a using stateme
wjmaclean 2013/06/17 17:45:27 Done.
48 WebUserGestureToken(const WebUserGestureToken& other) { assign(other); } 54 ~PinchViewports();
49 WebUserGestureToken& operator=(const WebUserGestureToken& other) 55
56 void setOverflowControlsHostLayer(GraphicsLayer*);
57 GraphicsLayer* rootGraphicsLayer()
50 { 58 {
51 assign(other); 59 return m_innerViewportClipLayer.get();
52 return *this;
53 } 60 }
54 ~WebUserGestureToken() { reset(); } 61 void setViewportSize(const FloatSize&);
62 void showGraphicsLayers();
55 63
56 WEBKIT_EXPORT bool hasGestures() const; 64 protected:
57 bool isNull() const { return m_token.isNull(); } 65 PinchViewports(WebViewImpl* owner);
jamesr 2013/06/14 20:55:46 explicit. why are all these protected and not priv
wjmaclean 2013/06/17 17:45:27 D'oh! I have no clue what I was thinking there! D
58 66
59 #if WEBKIT_IMPLEMENTATION 67 void setupScrollbar(WebKit::WebScrollbar::Orientation);
60 explicit WebUserGestureToken(PassRefPtr<WebCore::UserGestureToken>);
61 operator PassRefPtr<WebCore::UserGestureToken>() const;
62 #endif
63 68
64 private: 69 WebViewImpl* m_owner;
65 WEBKIT_EXPORT void assign(const WebUserGestureToken&); 70 WTF::OwnPtr<GraphicsLayer> m_innerViewportClipLayer;
jamesr 2013/06/14 20:55:46 no WTF::
wjmaclean 2013/06/17 17:45:27 Done.
66 WEBKIT_EXPORT void reset(); 71 WTF::OwnPtr<GraphicsLayer> m_pageScaleLayer;
67 72 WTF::OwnPtr<GraphicsLayer> m_innerViewportScrollLayer;
68 WebPrivatePtr<WebCore::UserGestureToken> m_token; 73 WTF::OwnPtr<GraphicsLayer> m_overlayScrollbarHorizontal;
74 WTF::OwnPtr<GraphicsLayer> m_overlayScrollbarVertical;
69 }; 75 };
70 76
71 } // namespace WebKit 77 } // namespace WebKit
72 78
73 #endif // WebUserGestureToken_h 79 #endif // PinchViewports_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698