diff options
Diffstat (limited to 'chrome/installer/setup/setup_util.cc')
-rw-r--r-- | chrome/installer/setup/setup_util.cc | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/chrome/installer/setup/setup_util.cc b/chrome/installer/setup/setup_util.cc index 7356ecf..985d704 100644 --- a/chrome/installer/setup/setup_util.cc +++ b/chrome/installer/setup/setup_util.cc @@ -8,6 +8,49 @@ #include "base/file_util.h" #include "base/logging.h" +#include "chrome/installer/util/master_preferences.h" +#include "chrome/installer/util/util_constants.h" + + +DictionaryValue* setup_util::GetInstallPreferences( + const CommandLine& cmd_line) { + DictionaryValue* prefs = NULL; + + if (cmd_line.HasSwitch(installer_util::switches::kInstallerData)) { + FilePath prefs_path( + cmd_line.GetSwitchValue(installer_util::switches::kInstallerData)); + prefs = installer_util::ParseDistributionPreferences(prefs_path); + } + + if (!prefs) + prefs = new DictionaryValue(); + + if (cmd_line.HasSwitch(installer_util::switches::kCreateAllShortcuts)) + installer_util::SetDistroBooleanPreference( + prefs, installer_util::master_preferences::kCreateAllShortcuts, true); + + if (cmd_line.HasSwitch(installer_util::switches::kDoNotLaunchChrome)) + installer_util::SetDistroBooleanPreference( + prefs, installer_util::master_preferences::kDoNotLaunchChrome, true); + + if (cmd_line.HasSwitch(installer_util::switches::kMakeChromeDefault)) + installer_util::SetDistroBooleanPreference( + prefs, installer_util::master_preferences::kMakeChromeDefault, true); + + if (cmd_line.HasSwitch(installer_util::switches::kSystemLevel)) + installer_util::SetDistroBooleanPreference( + prefs, installer_util::master_preferences::kSystemLevel, true); + + if (cmd_line.HasSwitch(installer_util::switches::kVerboseLogging)) + installer_util::SetDistroBooleanPreference( + prefs, installer_util::master_preferences::kVerboseLogging, true); + + if (cmd_line.HasSwitch(installer_util::switches::kAltDesktopShortcut)) + installer_util::SetDistroBooleanPreference( + prefs, installer_util::master_preferences::kAltShortcutText, true); + + return prefs; +} installer::Version* setup_util::GetVersionFromDir( const std::wstring& chrome_path) { |