| 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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 if (!PathService::Get(base::FILE_EXE, &chrome_exe)) { | 138 if (!PathService::Get(base::FILE_EXE, &chrome_exe)) { |
| 139 NOTREACHED(); | 139 NOTREACHED(); |
| 140 } else if (!InstallUtil::IsPerUserInstall(chrome_exe.value().c_str())) { | 140 } else if (!InstallUtil::IsPerUserInstall(chrome_exe.value().c_str())) { |
| 141 content::BrowserThread::GetBlockingPool()->PostDelayedTask( | 141 content::BrowserThread::GetBlockingPool()->PostDelayedTask( |
| 142 FROM_HERE, | 142 FROM_HERE, |
| 143 base::Bind(&InstallUtil::TriggerActiveSetupCommand), | 143 base::Bind(&InstallUtil::TriggerActiveSetupCommand), |
| 144 base::TimeDelta::FromSeconds(kTiggerActiveSetupDelaySeconds)); | 144 base::TimeDelta::FromSeconds(kTiggerActiveSetupDelaySeconds)); |
| 145 } | 145 } |
| 146 } | 146 } |
| 147 | 147 |
| 148 bool GetFirstRunSentinelFilePath(base::FilePath* path) { | |
| 149 return InstallUtil::GetSentinelFilePath( | |
| 150 chrome::kFirstRunSentinel, BrowserDistribution::GetDistribution(), path); | |
| 151 } | |
| 152 | |
| 153 bool GetLegacyFirstRunSentinelFilePath(base::FilePath* path) { | 148 bool GetLegacyFirstRunSentinelFilePath(base::FilePath* path) { |
| 154 // The first run sentinel for user-level installs on Windows used to | 149 // The first run sentinel for user-level installs on Windows used to |
| 155 // be in the application directory. | 150 // be in the application directory. |
| 156 base::FilePath exe_path; | 151 base::FilePath exe_path; |
| 157 if (!PathService::Get(base::DIR_EXE, &exe_path) || | 152 if (!PathService::Get(base::DIR_EXE, &exe_path) || |
| 158 !InstallUtil::IsPerUserInstall(exe_path.value().c_str())) { | 153 !InstallUtil::IsPerUserInstall(exe_path.value().c_str())) { |
| 159 return false; | 154 return false; |
| 160 } | 155 } |
| 161 *path = exe_path.Append(chrome::kFirstRunSentinel); | 156 *path = exe_path.Append(chrome::kFirstRunSentinel); |
| 162 return true; | 157 return true; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 base::FilePath MasterPrefsPath() { | 191 base::FilePath MasterPrefsPath() { |
| 197 // The standard location of the master prefs is next to the chrome binary. | 192 // The standard location of the master prefs is next to the chrome binary. |
| 198 base::FilePath master_prefs; | 193 base::FilePath master_prefs; |
| 199 if (!PathService::Get(base::DIR_EXE, &master_prefs)) | 194 if (!PathService::Get(base::DIR_EXE, &master_prefs)) |
| 200 return base::FilePath(); | 195 return base::FilePath(); |
| 201 return master_prefs.AppendASCII(installer::kDefaultMasterPrefs); | 196 return master_prefs.AppendASCII(installer::kDefaultMasterPrefs); |
| 202 } | 197 } |
| 203 | 198 |
| 204 } // namespace internal | 199 } // namespace internal |
| 205 } // namespace first_run | 200 } // namespace first_run |
| OLD | NEW |