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..abf05494fd26ff5cd4cd959eb079850c2f3a678a 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(kOptionAppLauncher); |
+ } |
} |
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(kOptionAppLauncher); |
} |
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-host or --app-launcher is always needed. |
+ if (options.find(kOptionAppLauncher) != 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(kOptionAppLauncher) != options.end()) { |
+ modified = channel_info->SetAppLauncher(set); |
+ if (set) |
+ modified |= channel_info->SetAppHost(false); |
grt (UTC plus 2)
2012/10/25 14:46:53
since |= is a bitwise operation, this is subtle.
huangs
2012/10/29 21:15:16
Done (taking note of short-circuiting). Note that
grt (UTC plus 2)
2012/10/30 13:02:55
I don't feel strongly that it should, although I r
|
+ } else { |
+ modified = channel_info->SetAppHost(set); |
+ if (set) |
+ modified |= channel_info->SetAppLauncher(false); |
+ } |
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(kOptionAppLauncher) != options.end()); |
} |
} // namespace installer |