| 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 OVERRIDE { | 100 OVERRIDE { |
| 101 base::TimeTicks frame_time = base::TimeTicks::FromInternalValue( | 101 base::TimeTicks frame_time = base::TimeTicks::FromInternalValue( |
| 102 frame_time_sec * base::Time::kMicrosecondsPerSecond); | 102 frame_time_sec * base::Time::kMicrosecondsPerSecond); |
| 103 handler_->DidReceiveLastInputEventForVSync(frame_time); | 103 handler_->DidReceiveLastInputEventForVSync(frame_time); |
| 104 } | 104 } |
| 105 | 105 |
| 106 private: | 106 private: |
| 107 cc::InputHandler* handler_; | 107 cc::InputHandler* handler_; |
| 108 }; | 108 }; |
| 109 | 109 |
| 110 void WebToCCInputHandlerAdapter::BindToHandler(cc::InputHandler* handler) { | |
| 111 handler_adapter_.reset(new HandlerAdapter(handler)); | |
| 112 handler_->bindToClient(handler_adapter_.get()); | |
| 113 } | |
| 114 | |
| 115 void WebToCCInputHandlerAdapter::Animate(base::TimeTicks time) { | 110 void WebToCCInputHandlerAdapter::Animate(base::TimeTicks time) { |
| 116 double monotonic_time_seconds = (time - base::TimeTicks()).InSecondsF(); | 111 double monotonic_time_seconds = (time - base::TimeTicks()).InSecondsF(); |
| 117 handler_->animate(monotonic_time_seconds); | 112 handler_->animate(monotonic_time_seconds); |
| 118 } | 113 } |
| 119 | 114 |
| 120 void WebToCCInputHandlerAdapter::MainThreadHasStoppedFlinging() { | 115 void WebToCCInputHandlerAdapter::MainThreadHasStoppedFlinging() { |
| 121 handler_->mainThreadHasStoppedFlinging(); | 116 handler_->mainThreadHasStoppedFlinging(); |
| 122 } | 117 } |
| 123 | 118 |
| 124 } // namespace WebKit | 119 } // namespace WebKit |
| OLD | NEW |