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

Unified Diff: chrome/installer/setup/install.cc

Issue 159172: Allow two user level installs of Chrome to have default browser settings. (Closed)
Patch Set: update comment. Created 11 years, 5 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
« no previous file with comments | « chrome/browser/shell_integration.cc ('k') | chrome/installer/setup/setup_main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/setup/install.cc
diff --git a/chrome/installer/setup/install.cc b/chrome/installer/setup/install.cc
index c409317c6f4bc01c1937d70302dd963d13f7b260..2a3bc3af778ba0d87ee0e12e185379d64e807721 100644
--- a/chrome/installer/setup/install.cc
+++ b/chrome/installer/setup/install.cc
@@ -286,26 +286,19 @@ void RegisterChromeOnMachine(const std::wstring& install_path, int options) {
// have admin rights and we want to ignore the error.
AddChromeToMediaPlayerList();
- // We try to register Chrome as a valid browser on local machine. This
- // will work only if current user has admin rights.
+ // Is --make-chrome-default option is given we make Chrome default browser
+ // otherwise we only register it on the machine as a valid browser.
std::wstring chrome_exe(install_path);
file_util::AppendToPath(&chrome_exe, installer_util::kChromeExe);
LOG(INFO) << "Registering Chrome as browser";
- ShellUtil::RegisterStatus ret = ShellUtil::FAILURE;
if (options & installer_util::MAKE_CHROME_DEFAULT) {
- ret = ShellUtil::AddChromeToSetAccessDefaults(chrome_exe, false);
- if (ret == ShellUtil::SUCCESS) {
- if (system_level) {
- ShellUtil::MakeChromeDefault(
- ShellUtil::CURRENT_USER | ShellUtil::SYSTEM_LEVEL, chrome_exe);
- } else {
- ShellUtil::MakeChromeDefault(ShellUtil::CURRENT_USER, chrome_exe);
- }
- }
+ int level = ShellUtil::CURRENT_USER;
+ if (system_level)
+ level = level | ShellUtil::SYSTEM_LEVEL;
+ ShellUtil::MakeChromeDefault(level, chrome_exe, true);
} else {
- ret = ShellUtil::AddChromeToSetAccessDefaults(chrome_exe, true);
+ ShellUtil::RegisterChromeBrowser(chrome_exe, L"", false);
}
- LOG(INFO) << "Return status of Chrome browser registration " << ret;
}
} // namespace
« no previous file with comments | « chrome/browser/shell_integration.cc ('k') | chrome/installer/setup/setup_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698