OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/common/child_process_logging.h" | 5 #include "chrome/common/child_process_logging.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 | 8 |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 if (!exe_module) | 66 if (!exe_module) |
67 return; | 67 return; |
68 set_client_id = reinterpret_cast<MainSetClientId>( | 68 set_client_id = reinterpret_cast<MainSetClientId>( |
69 GetProcAddress(exe_module, "SetClientId")); | 69 GetProcAddress(exe_module, "SetClientId")); |
70 if (!set_client_id) | 70 if (!set_client_id) |
71 return; | 71 return; |
72 } | 72 } |
73 (set_client_id)(wstr.c_str()); | 73 (set_client_id)(wstr.c_str()); |
74 } | 74 } |
75 | 75 |
| 76 std::string GetClientId() { |
| 77 std::wstring wstr_client_id; |
| 78 if (GoogleUpdateSettings::GetMetricsId(&wstr_client_id)) |
| 79 return WideToASCII(wstr_client_id); |
| 80 else |
| 81 return std::string(); |
| 82 } |
| 83 |
76 void SetActiveExtensions(const std::set<std::string>& extension_ids) { | 84 void SetActiveExtensions(const std::set<std::string>& extension_ids) { |
77 static MainSetExtensionID set_extension_id = NULL; | 85 static MainSetExtensionID set_extension_id = NULL; |
78 if (!set_extension_id) { | 86 if (!set_extension_id) { |
79 HMODULE exe_module = GetModuleHandle(chrome::kBrowserProcessExecutableName); | 87 HMODULE exe_module = GetModuleHandle(chrome::kBrowserProcessExecutableName); |
80 if (!exe_module) | 88 if (!exe_module) |
81 return; | 89 return; |
82 set_extension_id = reinterpret_cast<MainSetExtensionID>( | 90 set_extension_id = reinterpret_cast<MainSetExtensionID>( |
83 GetProcAddress(exe_module, "SetExtensionID")); | 91 GetProcAddress(exe_module, "SetExtensionID")); |
84 if (!set_extension_id) | 92 if (!set_extension_id) |
85 return; | 93 return; |
(...skipping 23 matching lines...) Expand all Loading... |
109 } | 117 } |
110 (set_gpu_info)( | 118 (set_gpu_info)( |
111 base::UintToString16(gpu_info.vendor_id()).c_str(), | 119 base::UintToString16(gpu_info.vendor_id()).c_str(), |
112 base::UintToString16(gpu_info.device_id()).c_str(), | 120 base::UintToString16(gpu_info.device_id()).c_str(), |
113 gpu_info.driver_version().c_str(), | 121 gpu_info.driver_version().c_str(), |
114 base::UintToString16(gpu_info.pixel_shader_version()).c_str(), | 122 base::UintToString16(gpu_info.pixel_shader_version()).c_str(), |
115 base::UintToString16(gpu_info.vertex_shader_version()).c_str()); | 123 base::UintToString16(gpu_info.vertex_shader_version()).c_str()); |
116 } | 124 } |
117 | 125 |
118 } // namespace child_process_logging | 126 } // namespace child_process_logging |
OLD | NEW |