summaryrefslogtreecommitdiffstats
path: root/chrome/installer/util/helper.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/installer/util/helper.cc')
-rw-r--r--chrome/installer/util/helper.cc20
1 files changed, 16 insertions, 4 deletions
diff --git a/chrome/installer/util/helper.cc b/chrome/installer/util/helper.cc
index cfd6a32..a52f6b5 100644
--- a/chrome/installer/util/helper.cc
+++ b/chrome/installer/util/helper.cc
@@ -16,23 +16,35 @@
#include "chrome/installer/util/version.h"
#include "chrome/installer/util/work_item_list.h"
-std::wstring installer::GetChromeInstallPath(bool system_install) {
+namespace {
+
+std::wstring GetChromeInstallBasePath(bool system_install,
+ const wchar_t* subpath) {
FilePath install_path;
if (system_install) {
PathService::Get(base::DIR_PROGRAM_FILES, &install_path);
} else {
PathService::Get(base::DIR_LOCAL_APP_DATA, &install_path);
}
-
if (!install_path.empty()) {
BrowserDistribution* dist = BrowserDistribution::GetDistribution();
install_path = install_path.Append(dist->GetInstallSubDir());
- install_path = install_path.Append(installer_util::kInstallBinaryDir);
+ install_path = install_path.Append(subpath);
}
-
return install_path.ToWStringHack();
}
+} // namespace
+
+std::wstring installer::GetChromeInstallPath(bool system_install) {
+ return GetChromeInstallBasePath(system_install,
+ installer_util::kInstallBinaryDir);
+}
+
+std::wstring installer::GetChromeUserDataPath() {
+ return GetChromeInstallBasePath(false, installer_util::kInstallUserDataDir);
+}
+
bool installer::LaunchChrome(bool system_install) {
std::wstring chrome_exe(L"\"");
chrome_exe.append(installer::GetChromeInstallPath(system_install));