OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "content/renderer/renderer_blink_platform_impl.h" | 5 #include "content/renderer/renderer_blink_platform_impl.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 1009 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1020 //------------------------------------------------------------------------------ | 1020 //------------------------------------------------------------------------------ |
1021 | 1021 |
1022 blink::WebString RendererBlinkPlatformImpl::convertIDNToUnicode( | 1022 blink::WebString RendererBlinkPlatformImpl::convertIDNToUnicode( |
1023 const blink::WebString& host, | 1023 const blink::WebString& host, |
1024 const blink::WebString& languages) { | 1024 const blink::WebString& languages) { |
1025 return net::IDNToUnicode(host.utf8(), languages.utf8()); | 1025 return net::IDNToUnicode(host.utf8(), languages.utf8()); |
1026 } | 1026 } |
1027 | 1027 |
1028 //------------------------------------------------------------------------------ | 1028 //------------------------------------------------------------------------------ |
1029 | 1029 |
| 1030 void RendererBlinkPlatformImpl::recordRappor(const char* metric, |
| 1031 const blink::WebString& sample) { |
| 1032 GetContentClient()->renderer()->RecordRappor(metric, sample.utf8()); |
| 1033 } |
| 1034 |
| 1035 void RendererBlinkPlatformImpl::recordRapporURL(const char* metric, |
| 1036 const blink::WebURL& url) { |
| 1037 GetContentClient()->renderer()->RecordRapporURL(metric, url); |
| 1038 } |
| 1039 |
| 1040 //------------------------------------------------------------------------------ |
| 1041 |
1030 // static | 1042 // static |
1031 void RendererBlinkPlatformImpl::SetMockDeviceLightDataForTesting(double data) { | 1043 void RendererBlinkPlatformImpl::SetMockDeviceLightDataForTesting(double data) { |
1032 g_test_device_light_data = data; | 1044 g_test_device_light_data = data; |
1033 } | 1045 } |
1034 | 1046 |
1035 //------------------------------------------------------------------------------ | 1047 //------------------------------------------------------------------------------ |
1036 | 1048 |
1037 // static | 1049 // static |
1038 void RendererBlinkPlatformImpl::SetMockDeviceMotionDataForTesting( | 1050 void RendererBlinkPlatformImpl::SetMockDeviceMotionDataForTesting( |
1039 const blink::WebDeviceMotionData& data) { | 1051 const blink::WebDeviceMotionData& data) { |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1219 //------------------------------------------------------------------------------ | 1231 //------------------------------------------------------------------------------ |
1220 | 1232 |
1221 void RendererBlinkPlatformImpl::MockBatteryStatusChangedForTesting( | 1233 void RendererBlinkPlatformImpl::MockBatteryStatusChangedForTesting( |
1222 const blink::WebBatteryStatus& status) { | 1234 const blink::WebBatteryStatus& status) { |
1223 if (!g_test_battery_status_listener) | 1235 if (!g_test_battery_status_listener) |
1224 return; | 1236 return; |
1225 g_test_battery_status_listener->updateBatteryStatus(status); | 1237 g_test_battery_status_listener->updateBatteryStatus(status); |
1226 } | 1238 } |
1227 | 1239 |
1228 } // namespace content | 1240 } // namespace content |
OLD | NEW |