OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "webkit/compositor_bindings/web_to_ccinput_handler_adapter.h" | 5 #include "webkit/compositor_bindings/web_to_ccinput_handler_adapter.h" |
6 | 6 |
7 #include "third_party/WebKit/Source/Platform/chromium/public/WebInputHandlerClie
nt.h" | 7 #include "third_party/WebKit/Source/Platform/chromium/public/WebInputHandlerClie
nt.h" |
8 | 8 |
9 #define COMPILE_ASSERT_MATCHING_ENUM(webkit_name, cc_name) \ | 9 #define COMPILE_ASSERT_MATCHING_ENUM(webkit_name, cc_name) \ |
10 COMPILE_ASSERT(static_cast<int>(WebKit::webkit_name) == \ | 10 COMPILE_ASSERT(static_cast<int>(WebKit::webkit_name) == \ |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 virtual ScrollStatus scrollBegin(WebPoint point, ScrollInputType type) { | 45 virtual ScrollStatus scrollBegin(WebPoint point, ScrollInputType type) { |
46 return static_cast<WebInputHandlerClient::ScrollStatus>( | 46 return static_cast<WebInputHandlerClient::ScrollStatus>( |
47 client_->ScrollBegin( | 47 client_->ScrollBegin( |
48 point, static_cast<cc::InputHandlerClient::ScrollInputType>(type))); | 48 point, static_cast<cc::InputHandlerClient::ScrollInputType>(type))); |
49 } | 49 } |
50 | 50 |
51 virtual bool scrollByIfPossible(WebPoint point, WebFloatSize delta) { | 51 virtual bool scrollByIfPossible(WebPoint point, WebFloatSize delta) { |
52 return client_->ScrollBy(point, delta); | 52 return client_->ScrollBy(point, delta); |
53 } | 53 } |
54 | 54 |
| 55 virtual bool scrollVerticallyByPageIfPossible( |
| 56 WebPoint point, WebScrollbar::ScrollDirection direction) { |
| 57 return client_->ScrollVerticallyByPage(point, direction); |
| 58 } |
| 59 |
55 virtual void scrollEnd() { client_->ScrollEnd(); } | 60 virtual void scrollEnd() { client_->ScrollEnd(); } |
56 | 61 |
57 virtual void pinchGestureBegin() { client_->PinchGestureBegin(); } | 62 virtual void pinchGestureBegin() { client_->PinchGestureBegin(); } |
58 | 63 |
59 virtual void pinchGestureUpdate(float magnify_delta, WebPoint anchor) { | 64 virtual void pinchGestureUpdate(float magnify_delta, WebPoint anchor) { |
60 client_->PinchGestureUpdate(magnify_delta, anchor); | 65 client_->PinchGestureUpdate(magnify_delta, anchor); |
61 } | 66 } |
62 | 67 |
63 virtual void pinchGestureEnd() { client_->PinchGestureEnd(); } | 68 virtual void pinchGestureEnd() { client_->PinchGestureEnd(); } |
64 | 69 |
(...skipping 28 matching lines...) Expand all Loading... |
93 void WebToCCInputHandlerAdapter::Animate(base::TimeTicks time) { | 98 void WebToCCInputHandlerAdapter::Animate(base::TimeTicks time) { |
94 double monotonic_time_seconds = (time - base::TimeTicks()).InSecondsF(); | 99 double monotonic_time_seconds = (time - base::TimeTicks()).InSecondsF(); |
95 handler_->animate(monotonic_time_seconds); | 100 handler_->animate(monotonic_time_seconds); |
96 } | 101 } |
97 | 102 |
98 void WebToCCInputHandlerAdapter::MainThreadHasStoppedFlinging() { | 103 void WebToCCInputHandlerAdapter::MainThreadHasStoppedFlinging() { |
99 handler_->mainThreadHasStoppedFlinging(); | 104 handler_->mainThreadHasStoppedFlinging(); |
100 } | 105 } |
101 | 106 |
102 } // namespace WebKit | 107 } // namespace WebKit |
OLD | NEW |