Chromium Code Reviews| 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 "chrome/installer/util/google_update_settings.h" | 5 #include "chrome/installer/util/google_update_settings.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <limits> | 10 #include <limits> |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 322 root_key, reg_path.c_str(), KEY_SET_VALUE | KEY_WOW64_32KEY); | 322 root_key, reg_path.c_str(), KEY_SET_VALUE | KEY_WOW64_32KEY); |
| 323 if (result != ERROR_SUCCESS) { | 323 if (result != ERROR_SUCCESS) { |
| 324 LOG(ERROR) << "Failed opening key " << reg_path << " to set " | 324 LOG(ERROR) << "Failed opening key " << reg_path << " to set " |
| 325 << google_update::kRegUsageStatsField << "; result: " << result; | 325 << google_update::kRegUsageStatsField << "; result: " << result; |
| 326 } else { | 326 } else { |
| 327 result = key.WriteValue(google_update::kRegUsageStatsField, value); | 327 result = key.WriteValue(google_update::kRegUsageStatsField, value); |
| 328 LOG_IF(ERROR, result != ERROR_SUCCESS) << "Failed setting " | 328 LOG_IF(ERROR, result != ERROR_SUCCESS) << "Failed setting " |
| 329 << google_update::kRegUsageStatsField << " in key " << reg_path | 329 << google_update::kRegUsageStatsField << " in key " << reg_path |
| 330 << "; result: " << result; | 330 << "; result: " << result; |
| 331 } | 331 } |
| 332 | |
| 333 // When opting out, clear registry backup of client id and related values. | |
| 334 if (result == ERROR_SUCCESS && !consented) | |
| 335 GoogleUpdateSettings::StoreMetricsClientInfo(metrics::ClientInfo()); | |
|
grt (UTC plus 2)
2016/08/12 19:43:32
nit: omit "GoogleUpdateSettings::"
Alexei Svitkine (slow)
2016/08/12 22:29:58
Done.
| |
| 336 | |
| 332 return (result == ERROR_SUCCESS); | 337 return (result == ERROR_SUCCESS); |
| 333 } | 338 } |
| 334 | 339 |
| 335 // static | 340 // static |
| 336 bool GoogleUpdateSettings::GetCollectStatsConsentDefault( | 341 bool GoogleUpdateSettings::GetCollectStatsConsentDefault( |
| 337 bool* stats_consent_default) { | 342 bool* stats_consent_default) { |
| 338 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); | 343 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); |
| 339 installer::ChannelInfo channel_info; | 344 installer::ChannelInfo channel_info; |
| 340 bool is_multi_install = false; | 345 bool is_multi_install = false; |
| 341 if (InitChannelInfo(IsSystemInstall(), dist, &channel_info, | 346 if (InitChannelInfo(IsSystemInstall(), dist, &channel_info, |
| (...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1029 } | 1034 } |
| 1030 | 1035 |
| 1031 // If the key or value was not present, return the empty string. | 1036 // If the key or value was not present, return the empty string. |
| 1032 if (result == ERROR_FILE_NOT_FOUND || result == ERROR_PATH_NOT_FOUND) { | 1037 if (result == ERROR_FILE_NOT_FOUND || result == ERROR_PATH_NOT_FOUND) { |
| 1033 experiment_labels->clear(); | 1038 experiment_labels->clear(); |
| 1034 return true; | 1039 return true; |
| 1035 } | 1040 } |
| 1036 | 1041 |
| 1037 return result == ERROR_SUCCESS; | 1042 return result == ERROR_SUCCESS; |
| 1038 } | 1043 } |
| OLD | NEW |