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

Side by Side 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 unified diff | Download patch
OLDNEW
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/installer/launcher_support/chrome_launcher_support.h" 5 #include "chrome/installer/launcher_support/chrome_launcher_support.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 8
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 #endif 125 #endif
126 } 126 }
127 127
128 } // namespace 128 } // namespace
129 129
130 base::FilePath GetChromePathForInstallationLevel(InstallationLevel level) { 130 base::FilePath GetChromePathForInstallationLevel(InstallationLevel level) {
131 return FindExeRelativeToSetupExe( 131 return FindExeRelativeToSetupExe(
132 GetSetupExeForInstallationLevel(level), kChromeExe); 132 GetSetupExeForInstallationLevel(level), kChromeExe);
133 } 133 }
134 134
135 base::FilePath GetAnyChromePath() { 135 base::FilePath GetAnyChromePath(bool is_canary) {
136 base::FilePath chrome_path; 136 base::FilePath path;
137 if (chrome_path.empty()) 137 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.
138 chrome_path = GetChromePathForInstallationLevel(SYSTEM_LEVEL_INSTALLATION);
139 if (chrome_path.empty())
140 chrome_path = GetChromePathForInstallationLevel(USER_LEVEL_INSTALLATION);
141 return chrome_path;
142 }
143
144 base::FilePath GetAnyChromeSxSPath() {
145 base::FilePath path =
146 GetChromeSxSPathForInstallationLevel(USER_LEVEL_INSTALLATION);
147 if (path.empty())
148 path = GetChromeSxSPathForInstallationLevel(SYSTEM_LEVEL_INSTALLATION); 138 path = GetChromeSxSPathForInstallationLevel(SYSTEM_LEVEL_INSTALLATION);
139 if (path.empty())
140 path = GetChromeSxSPathForInstallationLevel(USER_LEVEL_INSTALLATION);
141 } else {
142 path = GetChromePathForInstallationLevel(SYSTEM_LEVEL_INSTALLATION);
143 if (path.empty())
144 path = GetChromePathForInstallationLevel(USER_LEVEL_INSTALLATION);
145 }
149 return path; 146 return path;
150 } 147 }
151 148
152 } // namespace chrome_launcher_support 149 } // namespace chrome_launcher_support
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698