| 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 <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 << google_update::kRegUsageStatsField << "; result: " << result; | 289 << google_update::kRegUsageStatsField << "; result: " << result; |
| 290 } else { | 290 } else { |
| 291 result = key.WriteValue(google_update::kRegUsageStatsField, value); | 291 result = key.WriteValue(google_update::kRegUsageStatsField, value); |
| 292 LOG_IF(ERROR, result != ERROR_SUCCESS) << "Failed setting " | 292 LOG_IF(ERROR, result != ERROR_SUCCESS) << "Failed setting " |
| 293 << google_update::kRegUsageStatsField << " in key " << reg_path | 293 << google_update::kRegUsageStatsField << " in key " << reg_path |
| 294 << "; result: " << result; | 294 << "; result: " << result; |
| 295 } | 295 } |
| 296 return (result == ERROR_SUCCESS); | 296 return (result == ERROR_SUCCESS); |
| 297 } | 297 } |
| 298 | 298 |
| 299 bool GoogleUpdateSettings::GetMetricsId(std::string* metrics_id) { | 299 bool GoogleUpdateSettings::RetrieveMetricsId(std::string* metrics_id) { |
| 300 base::string16 metrics_id16; | 300 base::string16 metrics_id16; |
| 301 bool rv = ReadGoogleUpdateStrKey(google_update::kRegMetricsId, &metrics_id16); | 301 bool rv = ReadGoogleUpdateStrKey(google_update::kRegMetricsId, &metrics_id16); |
| 302 *metrics_id = base::UTF16ToUTF8(metrics_id16); | 302 *metrics_id = base::UTF16ToUTF8(metrics_id16); |
| 303 return rv; | 303 return rv; |
| 304 } | 304 } |
| 305 | 305 |
| 306 bool GoogleUpdateSettings::SetMetricsId(const std::string& metrics_id) { | 306 bool GoogleUpdateSettings::SaveMetricsId(const std::string& metrics_id) { |
| 307 base::string16 metrics_id16 = base::UTF8ToUTF16(metrics_id); | 307 base::string16 metrics_id16 = base::UTF8ToUTF16(metrics_id); |
| 308 return WriteGoogleUpdateStrKey(google_update::kRegMetricsId, metrics_id16); | 308 return WriteGoogleUpdateStrKey(google_update::kRegMetricsId, metrics_id16); |
| 309 } | 309 } |
| 310 | 310 |
| 311 // EULA consent is only relevant for system-level installs. | 311 // EULA consent is only relevant for system-level installs. |
| 312 bool GoogleUpdateSettings::SetEULAConsent( | 312 bool GoogleUpdateSettings::SetEULAConsent( |
| 313 const InstallationState& machine_state, | 313 const InstallationState& machine_state, |
| 314 BrowserDistribution* dist, | 314 BrowserDistribution* dist, |
| 315 bool consented) { | 315 bool consented) { |
| 316 DCHECK(dist); | 316 DCHECK(dist); |
| (...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 884 } | 884 } |
| 885 | 885 |
| 886 // If the key or value was not present, return the empty string. | 886 // If the key or value was not present, return the empty string. |
| 887 if (result == ERROR_FILE_NOT_FOUND || result == ERROR_PATH_NOT_FOUND) { | 887 if (result == ERROR_FILE_NOT_FOUND || result == ERROR_PATH_NOT_FOUND) { |
| 888 experiment_labels->clear(); | 888 experiment_labels->clear(); |
| 889 return true; | 889 return true; |
| 890 } | 890 } |
| 891 | 891 |
| 892 return result == ERROR_SUCCESS; | 892 return result == ERROR_SUCCESS; |
| 893 } | 893 } |
| OLD | NEW |