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 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1103 WebString BlinkPlatformImpl::queryLocalizedString( | 1103 WebString BlinkPlatformImpl::queryLocalizedString( |
1104 WebLocalizedString::Name name, int numeric_value) { | 1104 WebLocalizedString::Name name, int numeric_value) { |
1105 return queryLocalizedString(name, base::IntToString16(numeric_value)); | 1105 return queryLocalizedString(name, base::IntToString16(numeric_value)); |
1106 } | 1106 } |
1107 | 1107 |
1108 WebString BlinkPlatformImpl::queryLocalizedString( | 1108 WebString BlinkPlatformImpl::queryLocalizedString( |
1109 WebLocalizedString::Name name, const WebString& value) { | 1109 WebLocalizedString::Name name, const WebString& value) { |
1110 int message_id = ToMessageID(name); | 1110 int message_id = ToMessageID(name); |
1111 if (message_id < 0) | 1111 if (message_id < 0) |
1112 return WebString(); | 1112 return WebString(); |
1113 return ReplaceStringPlaceholders(GetContentClient()->GetLocalizedString( | 1113 return base::ReplaceStringPlaceholders( |
1114 message_id), value, NULL); | 1114 GetContentClient()->GetLocalizedString(message_id), value, NULL); |
1115 } | 1115 } |
1116 | 1116 |
1117 WebString BlinkPlatformImpl::queryLocalizedString( | 1117 WebString BlinkPlatformImpl::queryLocalizedString( |
1118 WebLocalizedString::Name name, | 1118 WebLocalizedString::Name name, |
1119 const WebString& value1, | 1119 const WebString& value1, |
1120 const WebString& value2) { | 1120 const WebString& value2) { |
1121 int message_id = ToMessageID(name); | 1121 int message_id = ToMessageID(name); |
1122 if (message_id < 0) | 1122 if (message_id < 0) |
1123 return WebString(); | 1123 return WebString(); |
1124 std::vector<base::string16> values; | 1124 std::vector<base::string16> values; |
1125 values.reserve(2); | 1125 values.reserve(2); |
1126 values.push_back(value1); | 1126 values.push_back(value1); |
1127 values.push_back(value2); | 1127 values.push_back(value2); |
1128 return ReplaceStringPlaceholders( | 1128 return base::ReplaceStringPlaceholders( |
1129 GetContentClient()->GetLocalizedString(message_id), values, NULL); | 1129 GetContentClient()->GetLocalizedString(message_id), values, NULL); |
1130 } | 1130 } |
1131 | 1131 |
1132 double BlinkPlatformImpl::currentTime() { | 1132 double BlinkPlatformImpl::currentTime() { |
1133 return base::Time::Now().ToDoubleT(); | 1133 return base::Time::Now().ToDoubleT(); |
1134 } | 1134 } |
1135 | 1135 |
1136 double BlinkPlatformImpl::monotonicallyIncreasingTime() { | 1136 double BlinkPlatformImpl::monotonicallyIncreasingTime() { |
1137 return base::TimeTicks::Now().ToInternalValue() / | 1137 return base::TimeTicks::Now().ToInternalValue() / |
1138 static_cast<double>(base::Time::kMicrosecondsPerSecond); | 1138 static_cast<double>(base::Time::kMicrosecondsPerSecond); |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1380 return WebString::fromUTF8(ui::KeycodeConverter::DomCodeToCodeString( | 1380 return WebString::fromUTF8(ui::KeycodeConverter::DomCodeToCodeString( |
1381 static_cast<ui::DomCode>(dom_code))); | 1381 static_cast<ui::DomCode>(dom_code))); |
1382 } | 1382 } |
1383 | 1383 |
1384 int BlinkPlatformImpl::domEnumFromCodeString(const WebString& code) { | 1384 int BlinkPlatformImpl::domEnumFromCodeString(const WebString& code) { |
1385 return static_cast<int>(ui::KeycodeConverter::CodeStringToDomCode( | 1385 return static_cast<int>(ui::KeycodeConverter::CodeStringToDomCode( |
1386 code.utf8().data())); | 1386 code.utf8().data())); |
1387 } | 1387 } |
1388 | 1388 |
1389 } // namespace content | 1389 } // namespace content |
OLD | NEW |