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 "chrome/install_static/install_util.h" | 5 #include "chrome/install_static/install_util.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 #include <assert.h> | 8 #include <assert.h> |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <iostream> | 10 #include <iostream> |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 } | 243 } |
244 | 244 |
245 std::wstring GetChromeInstallRegistryPath() { | 245 std::wstring GetChromeInstallRegistryPath() { |
246 std::wstring registry_path = L"Software\\"; | 246 std::wstring registry_path = L"Software\\"; |
247 registry_path += GetChromeInstallSubDirectory(); | 247 registry_path += GetChromeInstallSubDirectory(); |
248 return registry_path; | 248 return registry_path; |
249 } | 249 } |
250 | 250 |
251 bool GetCollectStatsConsentImpl(const std::wstring& exe_path) { | 251 bool GetCollectStatsConsentImpl(const std::wstring& exe_path) { |
252 bool enabled = true; | 252 bool enabled = true; |
253 bool controlled_by_policy = ReportingIsEnforcedByPolicy(&enabled); | |
254 | 253 |
255 if (controlled_by_policy && !enabled) | 254 if (ReportingIsEnforcedByPolicy(&enabled)) |
256 return false; | 255 return enabled; |
257 | 256 |
258 bool system_install = IsSystemInstall(exe_path.c_str()); | 257 bool system_install = IsSystemInstall(exe_path.c_str()); |
259 std::wstring app_guid; | 258 std::wstring app_guid; |
260 | 259 |
261 if (IsSxSChrome(exe_path.c_str())) { | 260 if (IsSxSChrome(exe_path.c_str())) { |
262 app_guid = kAppGuidCanary; | 261 app_guid = kAppGuidCanary; |
263 } else { | 262 } else { |
264 app_guid = IsMultiInstall(system_install) ? kAppGuidGoogleBinaries | 263 app_guid = IsMultiInstall(system_install) ? kAppGuidGoogleBinaries |
265 : kAppGuidGoogleChrome; | 264 : kAppGuidGoogleChrome; |
266 } | 265 } |
(...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
889 switch_value_end_offset = command_line_copy.length(); | 888 switch_value_end_offset = command_line_copy.length(); |
890 | 889 |
891 std::string switch_value = command_line_copy.substr( | 890 std::string switch_value = command_line_copy.substr( |
892 switch_value_start_offset, | 891 switch_value_start_offset, |
893 switch_value_end_offset - (switch_offset + switch_token.length())); | 892 switch_value_end_offset - (switch_offset + switch_token.length())); |
894 TrimT<std::string>(&switch_value); | 893 TrimT<std::string>(&switch_value); |
895 return switch_value; | 894 return switch_value; |
896 } | 895 } |
897 | 896 |
898 } // namespace install_static | 897 } // namespace install_static |
OLD | NEW |