| 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 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 base::StringToInt64(installation_date_str, &client_info->installation_date); | 327 base::StringToInt64(installation_date_str, &client_info->installation_date); |
| 328 } | 328 } |
| 329 | 329 |
| 330 base::string16 reporting_enbaled_date_date_str; | 330 base::string16 reporting_enbaled_date_date_str; |
| 331 if (ReadGoogleUpdateStrKey(google_update::kRegMetricsIdEnabledDate, | 331 if (ReadGoogleUpdateStrKey(google_update::kRegMetricsIdEnabledDate, |
| 332 &reporting_enbaled_date_date_str)) { | 332 &reporting_enbaled_date_date_str)) { |
| 333 base::StringToInt64(reporting_enbaled_date_date_str, | 333 base::StringToInt64(reporting_enbaled_date_date_str, |
| 334 &client_info->reporting_enabled_date); | 334 &client_info->reporting_enabled_date); |
| 335 } | 335 } |
| 336 | 336 |
| 337 return client_info.Pass(); | 337 return client_info; |
| 338 } | 338 } |
| 339 | 339 |
| 340 void GoogleUpdateSettings::StoreMetricsClientInfo( | 340 void GoogleUpdateSettings::StoreMetricsClientInfo( |
| 341 const metrics::ClientInfo& client_info) { | 341 const metrics::ClientInfo& client_info) { |
| 342 // Attempt a best-effort at backing |client_info| in the registry (but don't | 342 // Attempt a best-effort at backing |client_info| in the registry (but don't |
| 343 // handle/report failures). | 343 // handle/report failures). |
| 344 WriteGoogleUpdateStrKey(google_update::kRegMetricsId, | 344 WriteGoogleUpdateStrKey(google_update::kRegMetricsId, |
| 345 base::UTF8ToUTF16(client_info.client_id)); | 345 base::UTF8ToUTF16(client_info.client_id)); |
| 346 WriteGoogleUpdateStrKey(google_update::kRegMetricsIdInstallDate, | 346 WriteGoogleUpdateStrKey(google_update::kRegMetricsIdInstallDate, |
| 347 base::Int64ToString16(client_info.installation_date)); | 347 base::Int64ToString16(client_info.installation_date)); |
| (...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 998 } | 998 } |
| 999 | 999 |
| 1000 // If the key or value was not present, return the empty string. | 1000 // If the key or value was not present, return the empty string. |
| 1001 if (result == ERROR_FILE_NOT_FOUND || result == ERROR_PATH_NOT_FOUND) { | 1001 if (result == ERROR_FILE_NOT_FOUND || result == ERROR_PATH_NOT_FOUND) { |
| 1002 experiment_labels->clear(); | 1002 experiment_labels->clear(); |
| 1003 return true; | 1003 return true; |
| 1004 } | 1004 } |
| 1005 | 1005 |
| 1006 return result == ERROR_SUCCESS; | 1006 return result == ERROR_SUCCESS; |
| 1007 } | 1007 } |
| OLD | NEW |