| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "content/child/blink_platform_impl.h" | 5 #include "content/child/blink_platform_impl.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 1075 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1086 shared_timer_.Stop(); | 1086 shared_timer_.Stop(); |
| 1087 shared_timer_.Start(FROM_HERE, base::TimeDelta::FromMicroseconds(interval), | 1087 shared_timer_.Start(FROM_HERE, base::TimeDelta::FromMicroseconds(interval), |
| 1088 this, &BlinkPlatformImpl::DoTimeout); | 1088 this, &BlinkPlatformImpl::DoTimeout); |
| 1089 OnStartSharedTimer(base::TimeDelta::FromMicroseconds(interval)); | 1089 OnStartSharedTimer(base::TimeDelta::FromMicroseconds(interval)); |
| 1090 } | 1090 } |
| 1091 | 1091 |
| 1092 void BlinkPlatformImpl::stopSharedTimer() { | 1092 void BlinkPlatformImpl::stopSharedTimer() { |
| 1093 shared_timer_.Stop(); | 1093 shared_timer_.Stop(); |
| 1094 } | 1094 } |
| 1095 | 1095 |
| 1096 void BlinkPlatformImpl::callOnMainThread( | |
| 1097 void (*func)(void*), void* context) { | |
| 1098 main_thread_task_runner_->PostTask(FROM_HERE, base::Bind(func, context)); | |
| 1099 } | |
| 1100 | |
| 1101 blink::WebGestureCurve* BlinkPlatformImpl::createFlingAnimationCurve( | 1096 blink::WebGestureCurve* BlinkPlatformImpl::createFlingAnimationCurve( |
| 1102 blink::WebGestureDevice device_source, | 1097 blink::WebGestureDevice device_source, |
| 1103 const blink::WebFloatPoint& velocity, | 1098 const blink::WebFloatPoint& velocity, |
| 1104 const blink::WebSize& cumulative_scroll) { | 1099 const blink::WebSize& cumulative_scroll) { |
| 1105 return ui::WebGestureCurveImpl::CreateFromDefaultPlatformCurve( | 1100 return ui::WebGestureCurveImpl::CreateFromDefaultPlatformCurve( |
| 1106 gfx::Vector2dF(velocity.x, velocity.y), | 1101 gfx::Vector2dF(velocity.x, velocity.y), |
| 1107 gfx::Vector2dF(cumulative_scroll.width, cumulative_scroll.height), | 1102 gfx::Vector2dF(cumulative_scroll.width, cumulative_scroll.height), |
| 1108 IsMainThread()).release(); | 1103 IsMainThread()).release(); |
| 1109 } | 1104 } |
| 1110 | 1105 |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1335 return WebString::fromUTF8(ui::KeycodeConverter::DomCodeToCodeString( | 1330 return WebString::fromUTF8(ui::KeycodeConverter::DomCodeToCodeString( |
| 1336 static_cast<ui::DomCode>(dom_code))); | 1331 static_cast<ui::DomCode>(dom_code))); |
| 1337 } | 1332 } |
| 1338 | 1333 |
| 1339 int BlinkPlatformImpl::domEnumFromCodeString(const WebString& code) { | 1334 int BlinkPlatformImpl::domEnumFromCodeString(const WebString& code) { |
| 1340 return static_cast<int>(ui::KeycodeConverter::CodeStringToDomCode( | 1335 return static_cast<int>(ui::KeycodeConverter::CodeStringToDomCode( |
| 1341 code.utf8().data())); | 1336 code.utf8().data())); |
| 1342 } | 1337 } |
| 1343 | 1338 |
| 1344 } // namespace content | 1339 } // namespace content |
| OLD | NEW |