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 884 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
895 if (message_id < 0) | 895 if (message_id < 0) |
896 return WebString(); | 896 return WebString(); |
897 std::vector<base::string16> values; | 897 std::vector<base::string16> values; |
898 values.reserve(2); | 898 values.reserve(2); |
899 values.push_back(value1); | 899 values.push_back(value1); |
900 values.push_back(value2); | 900 values.push_back(value2); |
901 return base::ReplaceStringPlaceholders( | 901 return base::ReplaceStringPlaceholders( |
902 GetContentClient()->GetLocalizedString(message_id), values, NULL); | 902 GetContentClient()->GetLocalizedString(message_id), values, NULL); |
903 } | 903 } |
904 | 904 |
905 double BlinkPlatformImpl::currentTimeSeconds() { | |
906 return base::Time::Now().ToDoubleT(); | |
907 } | |
908 | |
909 double BlinkPlatformImpl::monotonicallyIncreasingTimeSeconds() { | |
910 return base::TimeTicks::Now().ToInternalValue() / | |
911 static_cast<double>(base::Time::kMicrosecondsPerSecond); | |
912 } | |
913 | |
914 blink::WebThread* BlinkPlatformImpl::compositorThread() const { | 905 blink::WebThread* BlinkPlatformImpl::compositorThread() const { |
915 return compositor_thread_; | 906 return compositor_thread_; |
916 } | 907 } |
917 | 908 |
918 blink::WebGestureCurve* BlinkPlatformImpl::createFlingAnimationCurve( | 909 blink::WebGestureCurve* BlinkPlatformImpl::createFlingAnimationCurve( |
919 blink::WebGestureDevice device_source, | 910 blink::WebGestureDevice device_source, |
920 const blink::WebFloatPoint& velocity, | 911 const blink::WebFloatPoint& velocity, |
921 const blink::WebSize& cumulative_scroll) { | 912 const blink::WebSize& cumulative_scroll) { |
922 return ui::WebGestureCurveImpl::CreateFromDefaultPlatformCurve( | 913 return ui::WebGestureCurveImpl::CreateFromDefaultPlatformCurve( |
923 gfx::Vector2dF(velocity.x, velocity.y), | 914 gfx::Vector2dF(velocity.x, velocity.y), |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1096 return WebString::fromUTF8(ui::KeycodeConverter::DomKeyToKeyString( | 1087 return WebString::fromUTF8(ui::KeycodeConverter::DomKeyToKeyString( |
1097 static_cast<ui::DomKey>(dom_key))); | 1088 static_cast<ui::DomKey>(dom_key))); |
1098 } | 1089 } |
1099 | 1090 |
1100 int BlinkPlatformImpl::domKeyEnumFromString(const WebString& key_string) { | 1091 int BlinkPlatformImpl::domKeyEnumFromString(const WebString& key_string) { |
1101 return static_cast<int>( | 1092 return static_cast<int>( |
1102 ui::KeycodeConverter::KeyStringToDomKey(key_string.utf8())); | 1093 ui::KeycodeConverter::KeyStringToDomKey(key_string.utf8())); |
1103 } | 1094 } |
1104 | 1095 |
1105 } // namespace content | 1096 } // namespace content |
OLD | NEW |