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