Chromium Code Reviews| Index: chrome/installer/util/chrome_app_host_operations.cc |
| diff --git a/chrome/installer/util/chrome_app_host_operations.cc b/chrome/installer/util/chrome_app_host_operations.cc |
| index 07427f5194a6d24a784a2e777b054e3b0a43cf3a..b9809eca4e6f214bb83ec2abea530693ae903ef5 100644 |
| --- a/chrome/installer/util/chrome_app_host_operations.cc |
| +++ b/chrome/installer/util/chrome_app_host_operations.cc |
| @@ -26,6 +26,10 @@ void ChromeAppHostOperations::ReadOptions( |
| pref_value) { |
| options->insert(kOptionMultiInstall); |
| } |
| + if (prefs.GetBool(master_preferences::kChromeAppLauncher, &pref_value) && |
| + pref_value) { |
| + options->insert(kOptionAppHostIsLauncher); |
| + } |
| } |
| void ChromeAppHostOperations::ReadOptions( |
| @@ -35,6 +39,8 @@ void ChromeAppHostOperations::ReadOptions( |
| if (uninstall_command.HasSwitch(switches::kMultiInstall)) |
| options->insert(kOptionMultiInstall); |
| + if (uninstall_command.HasSwitch(switches::kChromeAppLauncher)) |
| + options->insert(kOptionAppHostIsLauncher); |
| } |
| void ChromeAppHostOperations::AddKeyFiles( |
| @@ -60,8 +66,11 @@ void ChromeAppHostOperations::AppendProductFlags( |
| if (is_multi_install && !cmd_line->HasSwitch(switches::kMultiInstall)) |
| cmd_line->AppendSwitch(switches::kMultiInstall); |
| - // --app-host is always needed. |
| - cmd_line->AppendSwitch(switches::kChromeAppHost); |
| + // Either --app-launcher or --app-host is always needed. |
| + if (options.find(kOptionAppHostIsLauncher) != options.end()) |
| + cmd_line->AppendSwitch(switches::kChromeAppLauncher); |
| + else |
| + cmd_line->AppendSwitch(switches::kChromeAppHost); |
| } |
| void ChromeAppHostOperations::AppendRenameFlags( |
| @@ -84,8 +93,17 @@ bool ChromeAppHostOperations::SetChannelFlags( |
| ChannelInfo* channel_info) const { |
| #if defined(GOOGLE_CHROME_BUILD) |
| DCHECK(channel_info); |
| - bool modified = channel_info->SetAppHost(set); |
| - |
| + bool modified = false; |
| + // App Host and App Launcher are mutually exclusive. |
| + if (options.find(kOptionAppHostIsLauncher) != options.end()) { |
| + modified = channel_info->SetAppLauncher(set); |
| + if (set && channel_info->SetAppHost(false)) |
|
erikwright (departed)
2012/10/30 14:20:39
My intuition is that, if we are being asked to rem
grt (UTC plus 2)
2012/10/30 14:29:22
Yes, good catch!
huangs
2012/10/30 20:35:07
Indeed! Done and shortened.
|
| + modified = true; |
| + } else { |
| + modified = channel_info->SetAppHost(set); |
| + if (set && channel_info->SetAppLauncher(false)) |
| + modified = true; |
| + } |
| return modified; |
| #else |
| return false; |
| @@ -94,7 +112,7 @@ bool ChromeAppHostOperations::SetChannelFlags( |
| bool ChromeAppHostOperations::ShouldCreateUninstallEntry( |
| const std::set<std::wstring>& options) const { |
| - return false; |
| + return (options.find(kOptionAppHostIsLauncher) != options.end()); |
| } |
| } // namespace installer |