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

Unified Diff: chrome/installer/launcher_support/chrome_launcher_support.cc

Issue 685103004: Refactor chrome_launcher_support::GetAnyChromePath. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Respond to comments. Created 5 years, 11 months 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
Index: chrome/installer/launcher_support/chrome_launcher_support.cc
diff --git a/chrome/installer/launcher_support/chrome_launcher_support.cc b/chrome/installer/launcher_support/chrome_launcher_support.cc
index 1c95519c6e9e7f771c7769fd8e03b54c96b76440..554d0b0cdd5cdd9f6eb0052ffe8b6df764a1c829 100644
--- a/chrome/installer/launcher_support/chrome_launcher_support.cc
+++ b/chrome/installer/launcher_support/chrome_launcher_support.cc
@@ -132,20 +132,17 @@ base::FilePath GetChromePathForInstallationLevel(InstallationLevel level) {
GetSetupExeForInstallationLevel(level), kChromeExe);
}
-base::FilePath GetAnyChromePath() {
- base::FilePath chrome_path;
- if (chrome_path.empty())
- chrome_path = GetChromePathForInstallationLevel(SYSTEM_LEVEL_INSTALLATION);
- if (chrome_path.empty())
- chrome_path = GetChromePathForInstallationLevel(USER_LEVEL_INSTALLATION);
- return chrome_path;
-}
-
-base::FilePath GetAnyChromeSxSPath() {
- base::FilePath path =
- GetChromeSxSPathForInstallationLevel(USER_LEVEL_INSTALLATION);
- if (path.empty())
+base::FilePath GetAnyChromePath(bool is_canary) {
+ base::FilePath path;
+ if (is_canary) {
grt (UTC plus 2) 2015/01/09 17:45:28 i think you could simplify this by making GetSetup
Matt Giuca 2015/01/12 06:54:26 I didn't quite follow your example, but I take the
grt (UTC plus 2) 2015/01/12 14:02:41 Sorry if my proposal was confusing. I was suggesti
Matt Giuca 2015/01/13 08:22:00 Acknowledged.
path = GetChromeSxSPathForInstallationLevel(SYSTEM_LEVEL_INSTALLATION);
+ if (path.empty())
+ path = GetChromeSxSPathForInstallationLevel(USER_LEVEL_INSTALLATION);
+ } else {
+ path = GetChromePathForInstallationLevel(SYSTEM_LEVEL_INSTALLATION);
+ if (path.empty())
+ path = GetChromePathForInstallationLevel(USER_LEVEL_INSTALLATION);
+ }
return path;
}

Powered by Google App Engine
This is Rietveld 408576698