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_app_host_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/browser_distribution.h" |
| 11 #include "chrome/installer/util/channel_info.h" |
| 12 #include "chrome/installer/util/helper.h" |
| 13 #include "chrome/installer/util/master_preferences.h" |
| 14 #include "chrome/installer/util/master_preferences_constants.h" |
| 15 #include "chrome/installer/util/util_constants.h" |
| 16 |
| 17 namespace installer { |
| 18 |
| 19 void ChromeAppHostOperations::ReadOptions( |
| 20 const MasterPreferences& prefs, |
| 21 std::set<std::wstring>* options) const { |
| 22 DCHECK(options); |
| 23 |
| 24 bool pref_value; |
| 25 if (prefs.GetBool(master_preferences::kMultiInstall, &pref_value) && |
| 26 pref_value) { |
| 27 options->insert(kOptionMultiInstall); |
| 28 } |
| 29 } |
| 30 |
| 31 void ChromeAppHostOperations::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 ChromeAppHostOperations::AddKeyFiles( |
| 41 const std::set<std::wstring>& options, |
| 42 std::vector<FilePath>* key_files) const { |
| 43 } |
| 44 |
| 45 void ChromeAppHostOperations::AddComDllList( |
| 46 const std::set<std::wstring>& options, |
| 47 std::vector<FilePath>* com_dll_list) const { |
| 48 } |
| 49 |
| 50 void ChromeAppHostOperations::AppendProductFlags( |
| 51 const std::set<std::wstring>& options, |
| 52 CommandLine* cmd_line) const { |
| 53 DCHECK(cmd_line); |
| 54 bool is_multi_install = options.find(kOptionMultiInstall) != options.end(); |
| 55 |
| 56 // Non-multi-install not supported for the app host. |
| 57 DCHECK(is_multi_install); |
| 58 |
| 59 // Add --multi-install if it isn't already there. |
| 60 if (is_multi_install && !cmd_line->HasSwitch(switches::kMultiInstall)) |
| 61 cmd_line->AppendSwitch(switches::kMultiInstall); |
| 62 |
| 63 // --app-host is always needed. |
| 64 cmd_line->AppendSwitch(switches::kChromeAppHost); |
| 65 } |
| 66 |
| 67 void ChromeAppHostOperations::AppendRenameFlags( |
| 68 const std::set<std::wstring>& options, |
| 69 CommandLine* cmd_line) const { |
| 70 DCHECK(cmd_line); |
| 71 bool is_multi_install = options.find(kOptionMultiInstall) != options.end(); |
| 72 |
| 73 // Non-multi-install not supported for the app host. |
| 74 DCHECK(is_multi_install); |
| 75 |
| 76 // Add --multi-install if it isn't already there. |
| 77 if (is_multi_install && !cmd_line->HasSwitch(switches::kMultiInstall)) |
| 78 cmd_line->AppendSwitch(switches::kMultiInstall); |
| 79 } |
| 80 |
| 81 bool ChromeAppHostOperations::SetChannelFlags( |
| 82 const std::set<std::wstring>& options, |
| 83 bool set, |
| 84 ChannelInfo* channel_info) const { |
| 85 #if defined(GOOGLE_CHROME_BUILD) |
| 86 DCHECK(channel_info); |
| 87 bool modified = channel_info->SetAppHost(set); |
| 88 |
| 89 return modified; |
| 90 #else |
| 91 return false; |
| 92 #endif |
| 93 } |
| 94 |
| 95 bool ChromeAppHostOperations::ShouldCreateUninstallEntry( |
| 96 const std::set<std::wstring>& options) const { |
| 97 return false; |
| 98 } |
| 99 |
| 100 } // namespace installer |
OLD | NEW |