Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7720)

Unified Diff: chrome/installer/util/chrome_app_host_operations.cc

Issue 11267023: Implementing --app-launcher install/uninstall flow. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nits; added localized string for App Launcher uninstall shortcut. Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..70b7fb26921c0b4094fdb9fb27070877fed9e5a0 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,9 +93,15 @@ bool ChromeAppHostOperations::SetChannelFlags(
ChannelInfo* channel_info) const {
#if defined(GOOGLE_CHROME_BUILD)
DCHECK(channel_info);
- bool modified = channel_info->SetAppHost(set);
-
- return modified;
+ bool modified_app_host = false;
+ bool modified_app_launcher = false;
+ bool is_app_launcher =
+ (options.find(kOptionAppHostIsLauncher) != options.end());
+ // If set, then App Host and App Launcher are mutually exclusive.
+ // If !set, then remove both.
+ modified_app_host = channel_info->SetAppHost(set && !is_app_launcher);
+ modified_app_launcher = channel_info->SetAppLauncher(set && is_app_launcher);
+ return modified_app_host || modified_app_launcher;
#else
return false;
#endif
@@ -94,7 +109,7 @@ bool ChromeAppHostOperations::SetChannelFlags(
bool ChromeAppHostOperations::ShouldCreateUninstallEntry(
const std::set<std::wstring>& options) const {
- return false;
+ return (options.find(kOptionAppHostIsLauncher) != options.end());
}
} // namespace installer
« no previous file with comments | « chrome/installer/util/chrome_app_host_distribution.cc ('k') | chrome/installer/util/installation_validator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698