| 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 "web_to_ccinput_handler_adapter.h" | 5 #include "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(int(WebKit::webkit_name) == int(cc::cc_name), mismatching_enu
ms) | 10 COMPILE_ASSERT(int(WebKit::webkit_name) == int(cc::cc_name), mismatching_enu
ms) |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 base::TimeTicks startTime = base::TimeTicks::FromInternalValue(startTime
Sec * base::Time::kMicrosecondsPerSecond); | 81 base::TimeTicks startTime = base::TimeTicks::FromInternalValue(startTime
Sec * base::Time::kMicrosecondsPerSecond); |
| 82 base::TimeDelta duration = base::TimeDelta::FromMicroseconds(durationSec
* base::Time::kMicrosecondsPerSecond); | 82 base::TimeDelta duration = base::TimeDelta::FromMicroseconds(durationSec
* base::Time::kMicrosecondsPerSecond); |
| 83 m_client->startPageScaleAnimation(targetPosition, anchorPoint, pageScale
, startTime, duration); | 83 m_client->startPageScaleAnimation(targetPosition, anchorPoint, pageScale
, startTime, duration); |
| 84 } | 84 } |
| 85 | 85 |
| 86 virtual void scheduleAnimation() OVERRIDE | 86 virtual void scheduleAnimation() OVERRIDE |
| 87 { | 87 { |
| 88 m_client->scheduleAnimation(); | 88 m_client->scheduleAnimation(); |
| 89 } | 89 } |
| 90 | 90 |
| 91 virtual bool haveTouchEventHandlersAt(WebPoint point) |
| 92 { |
| 93 return m_client->haveTouchEventHandlersAt(point); |
| 94 } |
| 95 |
| 91 private: | 96 private: |
| 92 cc::InputHandlerClient* m_client; | 97 cc::InputHandlerClient* m_client; |
| 93 }; | 98 }; |
| 94 | 99 |
| 95 | 100 |
| 96 void WebToCCInputHandlerAdapter::bindToClient(cc::InputHandlerClient* client) | 101 void WebToCCInputHandlerAdapter::bindToClient(cc::InputHandlerClient* client) |
| 97 { | 102 { |
| 98 m_clientAdapter.reset(new ClientAdapter(client)); | 103 m_clientAdapter.reset(new ClientAdapter(client)); |
| 99 m_handler->bindToClient(m_clientAdapter.get()); | 104 m_handler->bindToClient(m_clientAdapter.get()); |
| 100 } | 105 } |
| 101 | 106 |
| 102 void WebToCCInputHandlerAdapter::animate(base::TimeTicks time) | 107 void WebToCCInputHandlerAdapter::animate(base::TimeTicks time) |
| 103 { | 108 { |
| 104 double monotonicTimeSeconds = (time - base::TimeTicks()).InSecondsF(); | 109 double monotonicTimeSeconds = (time - base::TimeTicks()).InSecondsF(); |
| 105 m_handler->animate(monotonicTimeSeconds); | 110 m_handler->animate(monotonicTimeSeconds); |
| 106 } | 111 } |
| 107 | 112 |
| 108 } // namespace WebKit | 113 } // namespace WebKit |
| OLD | NEW |