| 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/browser/first_run/first_run_internal.h" | 5 #include "chrome/browser/first_run/first_run_internal.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 #include <shellapi.h> | 8 #include <shellapi.h> |
| 9 | 9 |
| 10 #include "base/base_paths.h" | 10 #include "base/base_paths.h" |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 } | 118 } |
| 119 } | 119 } |
| 120 return false; | 120 return false; |
| 121 } | 121 } |
| 122 | 122 |
| 123 // Writes the EULA to a temporary file, returned in |*eula_path|, and returns | 123 // Writes the EULA to a temporary file, returned in |*eula_path|, and returns |
| 124 // true if successful. | 124 // true if successful. |
| 125 bool WriteEULAtoTempFile(base::FilePath* eula_path) { | 125 bool WriteEULAtoTempFile(base::FilePath* eula_path) { |
| 126 std::string terms = l10n_util::GetStringUTF8(IDS_TERMS_HTML); | 126 std::string terms = l10n_util::GetStringUTF8(IDS_TERMS_HTML); |
| 127 return (!terms.empty() && | 127 return (!terms.empty() && |
| 128 file_util::CreateTemporaryFile(eula_path) && | 128 base::CreateTemporaryFile(eula_path) && |
| 129 file_util::WriteFile(*eula_path, terms.data(), terms.size()) != -1); | 129 file_util::WriteFile(*eula_path, terms.data(), terms.size()) != -1); |
| 130 } | 130 } |
| 131 | 131 |
| 132 // Creates the sentinel indicating that the EULA was required and has been | 132 // Creates the sentinel indicating that the EULA was required and has been |
| 133 // accepted. | 133 // accepted. |
| 134 bool CreateEULASentinel() { | 134 bool CreateEULASentinel() { |
| 135 base::FilePath eula_sentinel; | 135 base::FilePath eula_sentinel; |
| 136 if (!GetEULASentinelFilePath(&eula_sentinel)) | 136 if (!GetEULASentinelFilePath(&eula_sentinel)) |
| 137 return false; | 137 return false; |
| 138 | 138 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 base::FilePath MasterPrefsPath() { | 201 base::FilePath MasterPrefsPath() { |
| 202 // The standard location of the master prefs is next to the chrome binary. | 202 // The standard location of the master prefs is next to the chrome binary. |
| 203 base::FilePath master_prefs; | 203 base::FilePath master_prefs; |
| 204 if (!PathService::Get(base::DIR_EXE, &master_prefs)) | 204 if (!PathService::Get(base::DIR_EXE, &master_prefs)) |
| 205 return base::FilePath(); | 205 return base::FilePath(); |
| 206 return master_prefs.AppendASCII(installer::kDefaultMasterPrefs); | 206 return master_prefs.AppendASCII(installer::kDefaultMasterPrefs); |
| 207 } | 207 } |
| 208 | 208 |
| 209 } // namespace internal | 209 } // namespace internal |
| 210 } // namespace first_run | 210 } // namespace first_run |
| OLD | NEW |