OLD | NEW |
(Empty) | |
| 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/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( |
| 19 const MasterPreferences& prefs, |
| 20 std::set<std::wstring>* options) const { |
| 21 DCHECK(options); |
| 22 |
| 23 bool pref_value; |
| 24 |
| 25 if (prefs.GetBool(master_preferences::kMultiInstall, &pref_value) && |
| 26 pref_value) { |
| 27 options->insert(kOptionMultiInstall); |
| 28 } |
| 29 } |
| 30 |
| 31 void ChromeBinariesOperations::ReadOptions( |
| 32 const CommandLine& uninstall_command, |
| 33 std::set<std::wstring>* options) const { |
| 34 DCHECK(options); |
| 35 |
| 36 if (uninstall_command.HasSwitch(switches::kMultiInstall)) |
| 37 options->insert(kOptionMultiInstall); |
| 38 } |
| 39 |
| 40 void ChromeBinariesOperations::AddKeyFiles( |
| 41 const std::set<std::wstring>& options, |
| 42 std::vector<FilePath>* key_files) const { |
| 43 DCHECK(key_files); |
| 44 key_files->push_back(FilePath(installer::kChromeDll)); |
| 45 } |
| 46 |
| 47 void ChromeBinariesOperations::AddComDllList( |
| 48 const std::set<std::wstring>& options, |
| 49 std::vector<FilePath>* com_dll_list) const { |
| 50 } |
| 51 |
| 52 void ChromeBinariesOperations::AppendProductFlags( |
| 53 const std::set<std::wstring>& options, |
| 54 CommandLine* cmd_line) const { |
| 55 DCHECK(cmd_line); |
| 56 |
| 57 if (options.find(kOptionMultiInstall) != options.end()) { |
| 58 // Add --multi-install if it isn't already there. |
| 59 if (!cmd_line->HasSwitch(switches::kMultiInstall)) |
| 60 cmd_line->AppendSwitch(switches::kMultiInstall); |
| 61 } |
| 62 } |
| 63 |
| 64 void ChromeBinariesOperations::AppendRenameFlags( |
| 65 const std::set<std::wstring>& options, |
| 66 CommandLine* cmd_line) const { |
| 67 DCHECK(cmd_line); |
| 68 |
| 69 // Add --multi-install if it isn't already there. |
| 70 if (options.find(kOptionMultiInstall) != options.end() && |
| 71 !cmd_line->HasSwitch(switches::kMultiInstall)) { |
| 72 cmd_line->AppendSwitch(switches::kMultiInstall); |
| 73 } |
| 74 } |
| 75 |
| 76 bool ChromeBinariesOperations::SetChannelFlags( |
| 77 const std::set<std::wstring>& options, |
| 78 bool set, |
| 79 ChannelInfo* channel_info) const { |
| 80 return false; |
| 81 } |
| 82 |
| 83 bool ChromeBinariesOperations::ShouldCreateUninstallEntry( |
| 84 const std::set<std::wstring>& options) const { |
| 85 return false; |
| 86 } |
| 87 |
| 88 } // namespace installer |
OLD | NEW |