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

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: Removing shortcut install (will do in different CL), but keeping some refactoring. 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..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

Powered by Google App Engine
This is Rietveld 408576698