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

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: Created 6 years, 2 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 8d052a9b88a5efe36a9eed2a21e786147d93379f..7c53b7c858727bf15419d6e54152402d53483a55 100644
--- a/chrome/installer/launcher_support/chrome_launcher_support.cc
+++ b/chrome/installer/launcher_support/chrome_launcher_support.cc
@@ -116,20 +116,19 @@ 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())
- path = GetChromeSxSPathForInstallationLevel(SYSTEM_LEVEL_INSTALLATION);
+base::FilePath GetAnyChromePath(bool is_canary) {
+ base::FilePath path;
+ if (is_canary) {
+ // TODO(mgiuca): Ask jackhou why this logic is reversed compared to the
+ // non-canary path.
Matt Giuca 2014/10/30 02:54:50 Question for Jack: Is there a reason you prioritiz
jackhou1 2014/10/30 03:59:22 Canary is installed at user level by default.
Matt Giuca 2014/10/30 04:22:58 Thanks, I will update this comment then.
grt (UTC plus 2) 2014/10/30 16:44:53 Not only is it user-level by default, it's always
Vitaly Buka (NO REVIEWS) 2014/10/30 16:46:17 Yes, It's installed. Still, my guess, consistency
grt (UTC plus 2) 2014/10/31 03:29:00 Agreed. This is what I meant with my previous comm
Matt Giuca 2015/01/09 06:17:32 Done.
+ path = GetChromeSxSPathForInstallationLevel(USER_LEVEL_INSTALLATION);
+ if (path.empty())
+ path = GetChromeSxSPathForInstallationLevel(SYSTEM_LEVEL_INSTALLATION);
+ } else {
+ path = GetChromePathForInstallationLevel(SYSTEM_LEVEL_INSTALLATION);
Vitaly Buka (NO REVIEWS) 2014/10/30 16:46:17 Could you fall back here to non-canary if canary i
jackhou1 2014/10/31 00:05:54 For app_installer at least, it would be preferable
grt (UTC plus 2) 2014/10/31 03:29:00 If it makes sense for some consumers to take whate
Matt Giuca 2015/01/09 06:17:32 I'd like to hold off on doing this unless there is
grt (UTC plus 2) 2015/01/09 17:45:28 SGTM
+ if (path.empty())
+ path = GetChromePathForInstallationLevel(USER_LEVEL_INSTALLATION);
+ }
return path;
}

Powered by Google App Engine
This is Rietveld 408576698