| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 if (!base::DirectoryExists(consent_dir)) | 41 if (!base::DirectoryExists(consent_dir)) |
| 42 return false; | 42 return false; |
| 43 | 43 |
| 44 base::FilePath consent_file = consent_dir.AppendASCII(kConsentToSendStats); | 44 base::FilePath consent_file = consent_dir.AppendASCII(kConsentToSendStats); |
| 45 if (consented) { | 45 if (consented) { |
| 46 if ((!base::PathExists(consent_file)) || | 46 if ((!base::PathExists(consent_file)) || |
| 47 (base::PathExists(consent_file) && | 47 (base::PathExists(consent_file) && |
| 48 !google_update::posix_guid().empty())) { | 48 !google_update::posix_guid().empty())) { |
| 49 const char* c_str = google_update::posix_guid().c_str(); | 49 const char* c_str = google_update::posix_guid().c_str(); |
| 50 int size = google_update::posix_guid().size(); | 50 int size = google_update::posix_guid().size(); |
| 51 return file_util::WriteFile(consent_file, c_str, size) == size; | 51 return base::WriteFile(consent_file, c_str, size) == size; |
| 52 } | 52 } |
| 53 } else { | 53 } else { |
| 54 google_update::posix_guid().clear(); | 54 google_update::posix_guid().clear(); |
| 55 return base::DeleteFile(consent_file, false); | 55 return base::DeleteFile(consent_file, false); |
| 56 } | 56 } |
| 57 return true; | 57 return true; |
| 58 } | 58 } |
| 59 | 59 |
| 60 // static | 60 // static |
| 61 bool GoogleUpdateSettings::GetMetricsId(std::string* metrics_id) { | 61 bool GoogleUpdateSettings::GetMetricsId(std::string* metrics_id) { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 84 | 84 |
| 85 // static | 85 // static |
| 86 int GoogleUpdateSettings::GetLastRunTime() { | 86 int GoogleUpdateSettings::GetLastRunTime() { |
| 87 return -1; | 87 return -1; |
| 88 } | 88 } |
| 89 | 89 |
| 90 // static | 90 // static |
| 91 bool GoogleUpdateSettings::SetLastRunTime() { | 91 bool GoogleUpdateSettings::SetLastRunTime() { |
| 92 return false; | 92 return false; |
| 93 } | 93 } |
| OLD | NEW |