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

Side by Side Diff: chrome/installer/setup/setup_main.cc

Issue 6961013: Allow chrome to become the os default handler for arbitrary protocols on mac/win. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Responded to comments Created 9 years, 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <windows.h> 5 #include <windows.h>
6 #include <msi.h> 6 #include <msi.h>
7 #include <shellapi.h> 7 #include <shellapi.h>
8 #include <shlobj.h> 8 #include <shlobj.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 820 matching lines...) Expand 10 before | Expand all | Expand 10 after
831 if (installer::EULA_REJECTED != *exit_code) 831 if (installer::EULA_REJECTED != *exit_code)
832 GoogleUpdateSettings::SetEULAConsent(*installer_state, true); 832 GoogleUpdateSettings::SetEULAConsent(*installer_state, true);
833 } else if (cmd_line.HasSwitch( 833 } else if (cmd_line.HasSwitch(
834 installer::switches::kRegisterChromeBrowser)) { 834 installer::switches::kRegisterChromeBrowser)) {
835 const Product* chrome_install = 835 const Product* chrome_install =
836 installer_state->FindProduct(BrowserDistribution::CHROME_BROWSER); 836 installer_state->FindProduct(BrowserDistribution::CHROME_BROWSER);
837 if (chrome_install) { 837 if (chrome_install) {
838 // If --register-chrome-browser option is specified, register all 838 // If --register-chrome-browser option is specified, register all
839 // Chrome protocol/file associations as well as register it as a valid 839 // Chrome protocol/file associations as well as register it as a valid
840 // browser for Start Menu->Internet shortcut. This option should only 840 // browser for Start Menu->Internet shortcut. This option should only
841 // be used when setup.exe is launched with admin rights. We do not 841 // be used when setup.exe is launched with admin rights. We do not
robertshield 2011/05/24 21:33:44 The behaviour of RegisterChromeBrowser below if se
benwells 2011/05/25 08:07:19 I am reluctant to make this change now as part of
842 // make any user specific changes in this option. 842 // make any user specific changes in this option.
grt (UTC plus 2) 2011/05/24 20:27:53 Please update this comment so that it accurately d
benwells 2011/05/25 08:07:19 Done.
843 std::wstring chrome_exe(cmd_line.GetSwitchValueNative( 843 std::wstring chrome_exe(cmd_line.GetSwitchValueNative(
844 installer::switches::kRegisterChromeBrowser)); 844 installer::switches::kRegisterChromeBrowser));
845 std::wstring suffix; 845 std::wstring suffix;
846 if (cmd_line.HasSwitch( 846 if (cmd_line.HasSwitch(
847 installer::switches::kRegisterChromeBrowserSuffix)) { 847 installer::switches::kRegisterChromeBrowserSuffix)) {
848 suffix = cmd_line.GetSwitchValueNative( 848 suffix = cmd_line.GetSwitchValueNative(
849 installer::switches::kRegisterChromeBrowserSuffix); 849 installer::switches::kRegisterChromeBrowserSuffix);
850 } 850 }
851 *exit_code = ShellUtil::RegisterChromeBrowser( 851 if (cmd_line.HasSwitch(
852 chrome_install->distribution(), chrome_exe, suffix, false); 852 installer::switches::kRegisterURLProtocol)) {
853 std::wstring protocol = cmd_line.GetSwitchValueNative(
854 installer::switches::kRegisterURLProtocol);
855 *exit_code = ShellUtil::RegisterChromeForProtocol(
856 chrome_install->distribution(), chrome_exe, suffix, protocol,
857 false);
robertshield 2011/05/24 21:33:44 The return value here is a bool and is being shove
benwells 2011/05/25 08:07:19 Done.
858 } else {
859 *exit_code = ShellUtil::RegisterChromeBrowser(
860 chrome_install->distribution(), chrome_exe, suffix, false);
861 }
853 } else { 862 } else {
854 LOG(DFATAL) << "Can't register browser - Chrome distribution not found"; 863 LOG(DFATAL) << "Can't register browser - Chrome distribution not found";
855 *exit_code = installer::UNKNOWN_STATUS; 864 *exit_code = installer::UNKNOWN_STATUS;
856 } 865 }
857 } else if (cmd_line.HasSwitch(installer::switches::kRenameChromeExe)) { 866 } else if (cmd_line.HasSwitch(installer::switches::kRenameChromeExe)) {
858 // If --rename-chrome-exe is specified, we want to rename the executables 867 // If --rename-chrome-exe is specified, we want to rename the executables
859 // and exit. 868 // and exit.
860 *exit_code = RenameChromeExecutables(original_state, installer_state); 869 *exit_code = RenameChromeExecutables(original_state, installer_state);
861 } else if (cmd_line.HasSwitch( 870 } else if (cmd_line.HasSwitch(
862 installer::switches::kRemoveChromeRegistration)) { 871 installer::switches::kRemoveChromeRegistration)) {
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
1208 if (!(installer_state.is_msi() && is_uninstall)) 1217 if (!(installer_state.is_msi() && is_uninstall))
1209 // Note that we allow the status installer::UNINSTALL_REQUIRES_REBOOT 1218 // Note that we allow the status installer::UNINSTALL_REQUIRES_REBOOT
1210 // to pass through, since this is only returned on uninstall which is 1219 // to pass through, since this is only returned on uninstall which is
1211 // never invoked directly by Google Update. 1220 // never invoked directly by Google Update.
1212 return_code = InstallUtil::GetInstallReturnCode(install_status); 1221 return_code = InstallUtil::GetInstallReturnCode(install_status);
1213 1222
1214 VLOG(1) << "Installation complete, returning: " << return_code; 1223 VLOG(1) << "Installation complete, returning: " << return_code;
1215 1224
1216 return return_code; 1225 return return_code;
1217 } 1226 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698