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

Side by Side Diff: webkit/compositor_bindings/WebToCCInputHandlerAdapter.cpp

Issue 10917153: Update cc snapshot to r127918 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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
(Empty)
1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "config.h"
6
7 #include "WebToCCInputHandlerAdapter.h"
8
9 #include <public/WebInputHandlerClient.h>
10
11 #define COMPILE_ASSERT_MATCHING_ENUM(webkit_name, webcore_name) \
12 COMPILE_ASSERT(int(WebKit::webkit_name) == int(WebCore::webcore_name), misma tching_enums)
13
14 COMPILE_ASSERT_MATCHING_ENUM(WebInputHandlerClient::ScrollStatusOnMainThread, CC InputHandlerClient::ScrollOnMainThread);
15 COMPILE_ASSERT_MATCHING_ENUM(WebInputHandlerClient::ScrollStatusStarted, CCInput HandlerClient::ScrollStarted);
16 COMPILE_ASSERT_MATCHING_ENUM(WebInputHandlerClient::ScrollStatusIgnored, CCInput HandlerClient::ScrollIgnored);
17 COMPILE_ASSERT_MATCHING_ENUM(WebInputHandlerClient::ScrollInputTypeGesture, CCIn putHandlerClient::Gesture);
18 COMPILE_ASSERT_MATCHING_ENUM(WebInputHandlerClient::ScrollInputTypeWheel, CCInpu tHandlerClient::Wheel);
19
20 namespace WebKit {
21
22 PassOwnPtr<WebToCCInputHandlerAdapter> WebToCCInputHandlerAdapter::create(PassOw nPtr<WebInputHandler> handler)
23 {
24 return adoptPtr(new WebToCCInputHandlerAdapter(handler));
25 }
26
27 WebToCCInputHandlerAdapter::WebToCCInputHandlerAdapter(PassOwnPtr<WebInputHandle r> handler)
28 : m_handler(handler)
29 {
30 }
31
32 WebToCCInputHandlerAdapter::~WebToCCInputHandlerAdapter()
33 {
34 }
35
36 class WebToCCInputHandlerAdapter::ClientAdapter : public WebInputHandlerClient {
37 public:
38 ClientAdapter(WebCore::CCInputHandlerClient* client)
39 : m_client(client)
40 {
41 }
42
43 virtual ~ClientAdapter()
44 {
45 }
46
47 virtual ScrollStatus scrollBegin(WebPoint point, ScrollInputType type) OVERR IDE
48 {
49 return static_cast<WebInputHandlerClient::ScrollStatus>(m_client->scroll Begin(point, static_cast<WebCore::CCInputHandlerClient::ScrollInputType>(type))) ;
50 }
51
52 virtual void scrollBy(WebPoint point, WebSize offset) OVERRIDE
53 {
54 m_client->scrollBy(point, offset);
55 }
56
57 virtual void scrollEnd() OVERRIDE
58 {
59 m_client->scrollEnd();
60 }
61
62 virtual void pinchGestureBegin() OVERRIDE
63 {
64 m_client->pinchGestureBegin();
65 }
66
67 virtual void pinchGestureUpdate(float magnifyDelta, WebPoint anchor) OVERRID E
68 {
69 m_client->pinchGestureUpdate(magnifyDelta, anchor);
70 }
71
72 virtual void pinchGestureEnd() OVERRIDE
73 {
74 m_client->pinchGestureEnd();
75 }
76
77 virtual void startPageScaleAnimation(WebSize targetPosition,
78 bool anchorPoint,
79 float pageScale,
80 double startTime,
81 double duration) OVERRIDE
82 {
83 m_client->startPageScaleAnimation(targetPosition, anchorPoint, pageScale , startTime, duration);
84 }
85
86 virtual void scheduleAnimation() OVERRIDE
87 {
88 m_client->scheduleAnimation();
89 }
90
91 private:
92 WebCore::CCInputHandlerClient* m_client;
93 };
94
95
96 void WebToCCInputHandlerAdapter::bindToClient(WebCore::CCInputHandlerClient* cli ent)
97 {
98 m_clientAdapter = adoptPtr(new ClientAdapter(client));
99 m_handler->bindToClient(m_clientAdapter.get());
100 }
101
102 void WebToCCInputHandlerAdapter::animate(double monotonicTime)
103 {
104 m_handler->animate(monotonicTime);
105 }
106
107 }
108
OLDNEW
« no previous file with comments | « webkit/compositor_bindings/WebToCCInputHandlerAdapter.h ('k') | webkit/compositor_bindings/WheelFlingPlatformGestureCurve.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698