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 3 // found in the LICENSE file. 4 5 #include "chrome/installer/util/chrome_binaries_operations.h" 6 7 #include "base/command_line.h" 8 #include "base/files/file_path.h" 9 #include "base/logging.h" 10 #include "chrome/installer/util/channel_info.h" 11 #include "chrome/installer/util/helper.h" 12 #include "chrome/installer/util/master_preferences.h" 13 #include "chrome/installer/util/master_preferences_constants.h" 14 #include "chrome/installer/util/util_constants.h" 15 16 namespace installer { 17 18 void ChromeBinariesOperations::ReadOptions(const MasterPreferences& prefs, 19 std::set<string16>* options) const { 20 DCHECK(options); 21 options->insert(kOptionMultiInstall); 22 } 23 24 void ChromeBinariesOperations::ReadOptions(const CommandLine& uninstall_command, 25 std::set<string16>* options) const { 26 DCHECK(options); 27 options->insert(kOptionMultiInstall); 28 } 29 30 void ChromeBinariesOperations::AddKeyFiles( 31 const std::set<string16>& options, 32 std::vector<base::FilePath>* key_files) const { 33 DCHECK(key_files); 34 key_files->push_back(base::FilePath(installer::kChromeDll)); 35 } 36 37 void ChromeBinariesOperations::AddComDllList( 38 const std::set<string16>& options, 39 std::vector<base::FilePath>* com_dll_list) const { 40 } 41 42 void ChromeBinariesOperations::AppendProductFlags( 43 const std::set<string16>& options, 44 CommandLine* cmd_line) const { 45 DCHECK(cmd_line); 46 47 DCHECK(options.find(kOptionMultiInstall) != options.end()); 48 49 // Add --multi-install if it isn't already there. 50 if (!cmd_line->HasSwitch(switches::kMultiInstall)) 51 cmd_line->AppendSwitch(switches::kMultiInstall); 52 } 53 54 void ChromeBinariesOperations::AppendRenameFlags( 55 const std::set<string16>& options, 56 CommandLine* cmd_line) const { 57 DCHECK(cmd_line); 58 59 DCHECK(options.find(kOptionMultiInstall) != options.end()); 60 61 // Add --multi-install if it isn't already there. 62 if (!cmd_line->HasSwitch(switches::kMultiInstall)) 63 cmd_line->AppendSwitch(switches::kMultiInstall); 64 } 65 66 bool ChromeBinariesOperations::SetChannelFlags( 67 const std::set<string16>& options, 68 bool set, 69 ChannelInfo* channel_info) const { 70 return false; 71 } 72 73 bool ChromeBinariesOperations::ShouldCreateUninstallEntry( 74 const std::set<string16>& options) const { 75 return false; 76 } 77 78 void ChromeBinariesOperations::AddDefaultShortcutProperties( 79 BrowserDistribution* dist, 80 const base::FilePath& target_exe, 81 ShellUtil::ShortcutProperties* properties) const { 82 NOTREACHED() << "Chrome Binaries do not create shortcuts."; 83 } 84 85 void ChromeBinariesOperations::LaunchUserExperiment( 86 const base::FilePath& setup_path, 87 const std::set<string16>& options, 88 InstallStatus status, 89 bool system_level) const { 90 // Not meaningful to have binaries run experiments. 91 NOTREACHED(); 92 } 93 94 } // namespace installer 95