Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(461)

Unified Diff: chrome/browser/first_run/first_run_win.cc

Issue 11299038: Return first_run_win to using the Chrome path provider to look up the user data dir. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/first_run/first_run_internal.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/first_run/first_run_win.cc
diff --git a/chrome/browser/first_run/first_run_win.cc b/chrome/browser/first_run/first_run_win.cc
index 4fede55363a22791c4d8b703feb29d322b9522dc..54231376d74cbd6e4b80ab76496c35abac88f91c 100644
--- a/chrome/browser/first_run/first_run_win.cc
+++ b/chrome/browser/first_run/first_run_win.cc
@@ -153,11 +153,23 @@ bool LaunchSetupForEula(const FilePath::StringType& value, int* ret_code) {
}
}
+// Populates |path| with the path to |file| in the sentinel directory. This is
+// the application directory for user-level installs, and the default user data
+// dir for system-level installs. Returns false on error.
+bool GetSentinelFilePath(const wchar_t* file, FilePath* path) {
+ FilePath exe_path;
+ if (!PathService::Get(base::DIR_EXE, &exe_path))
+ return false;
+ if (InstallUtil::IsPerUserInstall(exe_path.value().c_str()))
+ *path = exe_path;
+ else if (!PathService::Get(chrome::DIR_USER_DATA, path))
+ return false;
+ *path = path->Append(file);
+ return true;
+}
+
bool GetEULASentinelFilePath(FilePath* path) {
- return InstallUtil::GetSentinelFilePath(
- installer::kEULASentinelFile,
- BrowserDistribution::GetDistribution(),
- path);
+ return GetSentinelFilePath(installer::kEULASentinelFile, path);
}
// Returns true if the EULA is required but has not been accepted by this user.
@@ -471,10 +483,7 @@ bool ImportSettings(Profile* profile,
}
bool GetFirstRunSentinelFilePath(FilePath* path) {
- return InstallUtil::GetSentinelFilePath(
- chrome::kFirstRunSentinel,
- BrowserDistribution::GetDistribution(),
- path);
+ return GetSentinelFilePath(chrome::kFirstRunSentinel, path);
}
void SetImportPreferencesAndLaunchImport(
« no previous file with comments | « chrome/browser/first_run/first_run_internal.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698