| 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 // The EULA is considered having been accepted if the user has gotten past | 105 // The EULA is considered having been accepted if the user has gotten past |
| 106 // first run in the "other" environment (desktop or metro). | 106 // first run in the "other" environment (desktop or metro). |
| 107 bool IsEULANotAccepted(installer::MasterPreferences* install_prefs) { | 107 bool IsEULANotAccepted(installer::MasterPreferences* install_prefs) { |
| 108 bool value = false; | 108 bool value = false; |
| 109 if (install_prefs->GetBool(installer::master_preferences::kRequireEula, | 109 if (install_prefs->GetBool(installer::master_preferences::kRequireEula, |
| 110 &value) && value) { | 110 &value) && value) { |
| 111 base::FilePath eula_sentinel; | 111 base::FilePath eula_sentinel; |
| 112 // Be conservative and show the EULA if the path to the sentinel can't be | 112 // Be conservative and show the EULA if the path to the sentinel can't be |
| 113 // determined. | 113 // determined. |
| 114 if (!GetEULASentinelFilePath(&eula_sentinel) || | 114 if (!GetEULASentinelFilePath(&eula_sentinel) || |
| 115 !file_util::PathExists(eula_sentinel)) { | 115 !base::PathExists(eula_sentinel)) { |
| 116 return true; | 116 return true; |
| 117 } | 117 } |
| 118 } | 118 } |
| 119 return false; | 119 return false; |
| 120 } | 120 } |
| 121 | 121 |
| 122 // Writes the EULA to a temporary file, returned in |*eula_path|, and returns | 122 // Writes the EULA to a temporary file, returned in |*eula_path|, and returns |
| 123 // true if successful. | 123 // true if successful. |
| 124 bool WriteEULAtoTempFile(base::FilePath* eula_path) { | 124 bool WriteEULAtoTempFile(base::FilePath* eula_path) { |
| 125 std::string terms = l10n_util::GetStringUTF8(IDS_TERMS_HTML); | 125 std::string terms = l10n_util::GetStringUTF8(IDS_TERMS_HTML); |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 base::FilePath MasterPrefsPath() { | 200 base::FilePath MasterPrefsPath() { |
| 201 // The standard location of the master prefs is next to the chrome binary. | 201 // The standard location of the master prefs is next to the chrome binary. |
| 202 base::FilePath master_prefs; | 202 base::FilePath master_prefs; |
| 203 if (!PathService::Get(base::DIR_EXE, &master_prefs)) | 203 if (!PathService::Get(base::DIR_EXE, &master_prefs)) |
| 204 return base::FilePath(); | 204 return base::FilePath(); |
| 205 return master_prefs.AppendASCII(installer::kDefaultMasterPrefs); | 205 return master_prefs.AppendASCII(installer::kDefaultMasterPrefs); |
| 206 } | 206 } |
| 207 | 207 |
| 208 } // namespace internal | 208 } // namespace internal |
| 209 } // namespace first_run | 209 } // namespace first_run |
| OLD | NEW |