summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhuangs@chromium.org <huangs@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-01 03:11:16 +0000
committerhuangs@chromium.org <huangs@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-01 03:11:16 +0000
commitcc12fbb00143737e4cb59b17fb8052f68891859a (patch)
treeb9d7c5334bf8365fe8788ba5c03d98c7bcd6856a
parente856430efde38c9f55bfdce3dda0bddd5e15db3b (diff)
downloadchromium_src-cc12fbb00143737e4cb59b17fb8052f68891859a.zip
chromium_src-cc12fbb00143737e4cb59b17fb8052f68891859a.tar.gz
chromium_src-cc12fbb00143737e4cb59b17fb8052f68891859a.tar.bz2
Removing non-Launcher Apps V2 flow, interpreting --app-host as --app-launcher.
The non-Launcher Apps V2 flow: - Was installed by the "--app-host" switch, and has ap value "-apphost". - Enables V2 apps to appear in the NTP. - Cannot be directly uninstalled. Keeping it around increased complexity, and led to "missed-a-spot" bugs, such as Issue 178025 where app_host.exe passes "--app-host" to setup.exe when app_host.exe updates itself. Now we remove this flow from the installer, and not keep track of the distinction between "App Host" and "App Launcher". However, for backwards compatibility, setup.exe will still interpret "--app-host" as "--app-launcher", but will not genreate commands with "--app-host". BUG=178025,178834 Review URL: https://chromiumcodereview.appspot.com/12388022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@185432 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--apps/app_host/update.cc4
-rw-r--r--chrome/installer/setup/install.cc3
-rw-r--r--chrome/installer/util/channel_info.cc20
-rw-r--r--chrome/installer/util/channel_info.h7
-rw-r--r--chrome/installer/util/chrome_app_host_operations.cc25
-rw-r--r--chrome/installer/util/installation_validator.cc25
-rw-r--r--chrome/installer/util/installer_state.cc10
-rw-r--r--chrome/installer/util/master_preferences.cc16
-rw-r--r--chrome/installer/util/master_preferences.h5
-rw-r--r--chrome/installer/util/master_preferences_constants.cc3
-rw-r--r--chrome/installer/util/master_preferences_constants.h2
-rw-r--r--chrome/installer/util/util_constants.cc6
-rw-r--r--chrome/installer/util/util_constants.h3
13 files changed, 41 insertions, 88 deletions
diff --git a/apps/app_host/update.cc b/apps/app_host/update.cc
index e8b14be8..ee97dfb 100644
--- a/apps/app_host/update.cc
+++ b/apps/app_host/update.cc
@@ -25,7 +25,7 @@ const wchar_t kGoogleRegClientsKey[] = L"Software\\Google\\Update\\Clients\\";
// Copied from util_constants.cc.
const char kMultiInstall[] = "multi-install";
-const char kChromeAppHost[] = "app-host";
+const char kChromeAppLauncher[] = "app-launcher";
const char kVerboseLogging[] = "verbose-logging";
// Copied from google_update_constants.cc.
@@ -75,7 +75,7 @@ bool LaunchAppHostUpdate() {
}
CommandLine cmd_line(setup_exe);
cmd_line.AppendSwitch(kMultiInstall);
- cmd_line.AppendSwitch(kChromeAppHost);
+ cmd_line.AppendSwitch(kChromeAppLauncher);
cmd_line.AppendSwitch(kVerboseLogging);
LOG(INFO) << "Launching: " << cmd_line.GetCommandLineString();
return base::LaunchProcess(cmd_line, base::LaunchOptions(), NULL);
diff --git a/chrome/installer/setup/install.cc b/chrome/installer/setup/install.cc
index aa78944..362acd7 100644
--- a/chrome/installer/setup/install.cc
+++ b/chrome/installer/setup/install.cc
@@ -553,8 +553,7 @@ InstallStatus InstallOrUpdateProduct(
const Product* app_launcher_product =
installer_state.FindProduct(BrowserDistribution::CHROME_APP_HOST);
// Creates shortcuts for App Launcher.
- if (app_launcher_product &&
- app_launcher_product->HasOption(kOptionAppHostIsLauncher)) {
+ if (app_launcher_product) {
// TODO(huangs): Remove this check once we have system-level App Host.
DCHECK(!installer_state.system_install());
const base::FilePath app_host_exe(
diff --git a/chrome/installer/util/channel_info.cc b/chrome/installer/util/channel_info.cc
index ad69d3c..613ab81 100644
--- a/chrome/installer/util/channel_info.cc
+++ b/chrome/installer/util/channel_info.cc
@@ -15,7 +15,8 @@ namespace {
const wchar_t kModChrome[] = L"-chrome";
const wchar_t kModChromeFrame[] = L"-chromeframe";
-const wchar_t kModAppHost[] = L"-apphost";
+// TODO(huangs): Remove by M27.
+const wchar_t kModAppHostDeprecated[] = L"-apphost";
const wchar_t kModAppLauncher[] = L"-applauncher";
const wchar_t kModMultiInstall[] = L"-multi";
const wchar_t kModReadyMode[] = L"-readymode";
@@ -33,7 +34,7 @@ const wchar_t* const kModifiers[] = {
kModMultiInstall,
kModChrome,
kModChromeFrame,
- kModAppHost,
+ kModAppHostDeprecated, // TODO(huangs): Remove by M27.
kModAppLauncher,
kModReadyMode,
kSfxMultiFail,
@@ -45,7 +46,7 @@ enum ModifierIndex {
MOD_MULTI_INSTALL,
MOD_CHROME,
MOD_CHROME_FRAME,
- MOD_APP_HOST,
+ MOD_APP_HOST_DEPRECATED, // TODO(huangs): Remove by M27.
MOD_APP_LAUNCHER,
MOD_READY_MODE,
SFX_MULTI_FAIL,
@@ -199,20 +200,15 @@ bool ChannelInfo::SetChromeFrame(bool value) {
return SetModifier(MOD_CHROME_FRAME, value, &value_);
}
-bool ChannelInfo::IsAppHost() const {
- return HasModifier(MOD_APP_HOST, value_);
-}
-
-bool ChannelInfo::SetAppHost(bool value) {
- return SetModifier(MOD_APP_HOST, value, &value_);
-}
-
bool ChannelInfo::IsAppLauncher() const {
return HasModifier(MOD_APP_LAUNCHER, value_);
}
bool ChannelInfo::SetAppLauncher(bool value) {
- return SetModifier(MOD_APP_LAUNCHER, value, &value_);
+ // Unconditionally remove -apphost since it has been deprecated.
+ bool changed_app_host = SetModifier(MOD_APP_HOST_DEPRECATED, false, &value_);
+ bool changed_app_launcher = SetModifier(MOD_APP_LAUNCHER, value, &value_);
+ return changed_app_host || changed_app_launcher;
}
bool ChannelInfo::IsMultiInstall() const {
diff --git a/chrome/installer/util/channel_info.h b/chrome/installer/util/channel_info.h
index bf84248..fd116af 100644
--- a/chrome/installer/util/channel_info.h
+++ b/chrome/installer/util/channel_info.h
@@ -57,13 +57,6 @@ class ChannelInfo {
// modified.
bool SetChromeFrame(bool value);
- // Returns true if the -apphost modifier is present in the value.
- bool IsAppHost() const;
-
- // Adds or removes the -apphost modifier, returning true if the value is
- // modified.
- bool SetAppHost(bool value);
-
// Returns true if the -applauncher modifier is present in the value.
bool IsAppLauncher() const;
diff --git a/chrome/installer/util/chrome_app_host_operations.cc b/chrome/installer/util/chrome_app_host_operations.cc
index caa7d7e..3690196 100644
--- a/chrome/installer/util/chrome_app_host_operations.cc
+++ b/chrome/installer/util/chrome_app_host_operations.cc
@@ -28,10 +28,6 @@ void ChromeAppHostOperations::ReadOptions(
pref_value) {
options->insert(kOptionMultiInstall);
}
- if (prefs.GetBool(master_preferences::kChromeAppLauncher, &pref_value) &&
- pref_value) {
- options->insert(kOptionAppHostIsLauncher);
- }
}
void ChromeAppHostOperations::ReadOptions(
@@ -41,8 +37,6 @@ void ChromeAppHostOperations::ReadOptions(
if (uninstall_command.HasSwitch(switches::kMultiInstall))
options->insert(kOptionMultiInstall);
- if (uninstall_command.HasSwitch(switches::kChromeAppLauncher))
- options->insert(kOptionAppHostIsLauncher);
}
void ChromeAppHostOperations::AddKeyFiles(
@@ -68,11 +62,8 @@ void ChromeAppHostOperations::AppendProductFlags(
if (is_multi_install && !cmd_line->HasSwitch(switches::kMultiInstall))
cmd_line->AppendSwitch(switches::kMultiInstall);
- // 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);
+ // Add --app-launcher.
+ cmd_line->AppendSwitch(switches::kChromeAppLauncher);
}
void ChromeAppHostOperations::AppendRenameFlags(
@@ -95,15 +86,7 @@ bool ChromeAppHostOperations::SetChannelFlags(
ChannelInfo* channel_info) const {
#if defined(GOOGLE_CHROME_BUILD)
DCHECK(channel_info);
- 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;
+ return channel_info->SetAppLauncher(set);
#else
return false;
#endif
@@ -111,7 +94,7 @@ bool ChromeAppHostOperations::SetChannelFlags(
bool ChromeAppHostOperations::ShouldCreateUninstallEntry(
const std::set<std::wstring>& options) const {
- return (options.find(kOptionAppHostIsLauncher) != options.end());
+ return true;
}
void ChromeAppHostOperations::AddDefaultShortcutProperties(
diff --git a/chrome/installer/util/installation_validator.cc b/chrome/installer/util/installation_validator.cc
index 8b22913..2875beb 100644
--- a/chrome/installer/util/installation_validator.cc
+++ b/chrome/installer/util/installation_validator.cc
@@ -117,14 +117,9 @@ void InstallationValidator::ChromeAppHostRules::AddUninstallSwitchExpectations(
SwitchExpectations* expectations) const {
DCHECK(!ctx.system_install);
- // Either --app-launcher or --app-host must be present.
- if (ctx.state.channel().IsAppLauncher()) {
- expectations->push_back(
- std::make_pair(std::string(switches::kChromeAppLauncher), true));
- } else {
- expectations->push_back(
- std::make_pair(std::string(switches::kChromeAppHost), true));
- }
+ // --app-launcher must be present.
+ expectations->push_back(
+ std::make_pair(std::string(switches::kChromeAppLauncher), true));
// --chrome must not be present.
expectations->push_back(std::make_pair(std::string(switches::kChrome),
@@ -530,7 +525,7 @@ void InstallationValidator::ValidateBinaries(
<< "\"";
}
- // ap must have -apphost iff Chrome Frame is installed multi
+ // ap must have -applauncher iff Chrome App Launcher is installed multi
const ProductState* app_host_state = machine_state.GetProductState(
system_install, BrowserDistribution::CHROME_APP_HOST);
if (app_host_state != NULL) {
@@ -538,17 +533,11 @@ void InstallationValidator::ValidateBinaries(
*is_valid = false;
LOG(ERROR) << "Chrome App Launcher is installed in non-multi mode.";
}
- if (!channel.IsAppHost() && !channel.IsAppLauncher()) {
+ if (!channel.IsAppLauncher()) {
*is_valid = false;
- LOG(ERROR) << "Chrome Binaries are missing \"-apphost\" and"
- " \"-applauncher\" in channel name: \""
- << channel.value() << "\"";
+ LOG(ERROR) << "Chrome Binaries are missing \"-applauncher\" in channel"
+ " name: \"" << channel.value() << "\"";
}
- } else if (channel.IsAppHost()) {
- *is_valid = false;
- LOG(ERROR) << "Chrome Binaries have \"-apphost\" in channel name, yet "
- "Chrome App Host is not installed: \"" << channel.value()
- << "\"";
} else if (channel.IsAppLauncher()) {
*is_valid = false;
LOG(ERROR) << "Chrome Binaries have \"-applauncher\" in channel name, yet "
diff --git a/chrome/installer/util/installer_state.cc b/chrome/installer/util/installer_state.cc
index 66ffb24..0090629 100644
--- a/chrome/installer/util/installer_state.cc
+++ b/chrome/installer/util/installer_state.cc
@@ -131,7 +131,7 @@ void InstallerState::Initialize(const CommandLine& command_line,
<< " distribution: " << p->distribution()->GetAppShortCutName();
}
- if (prefs.install_chrome_app_host() || prefs.install_chrome_app_launcher()) {
+ if (prefs.install_chrome_app_launcher()) {
Product* p = AddProductFromPreferences(
BrowserDistribution::CHROME_APP_HOST, prefs, machine_state);
VLOG(1) << (is_uninstall ? "Uninstall" : "Install")
@@ -286,14 +286,12 @@ void InstallerState::Initialize(const CommandLine& command_line,
if (operand == NULL) {
BrowserDistribution::Type operand_distribution_type =
BrowserDistribution::CHROME_BINARIES;
- if (prefs.install_chrome()) {
+ if (prefs.install_chrome())
operand_distribution_type = BrowserDistribution::CHROME_BROWSER;
- } else if (prefs.install_chrome_frame()) {
+ else if (prefs.install_chrome_frame())
operand_distribution_type = BrowserDistribution::CHROME_FRAME;
- } else if (prefs.install_chrome_app_host() ||
- prefs.install_chrome_app_launcher()) {
+ else if (prefs.install_chrome_app_launcher())
operand_distribution_type = BrowserDistribution::CHROME_APP_HOST;
- }
operand = BrowserDistribution::GetSpecificDistribution(
operand_distribution_type);
diff --git a/chrome/installer/util/master_preferences.cc b/chrome/installer/util/master_preferences.cc
index 665d65d..27c4ff1 100644
--- a/chrome/installer/util/master_preferences.cc
+++ b/chrome/installer/util/master_preferences.cc
@@ -73,7 +73,6 @@ namespace installer {
MasterPreferences::MasterPreferences() : distribution_(NULL),
preferences_read_from_file_(false),
chrome_(true),
- chrome_app_host_(false),
chrome_app_launcher_(false),
chrome_frame_(false),
multi_install_(false) {
@@ -84,7 +83,6 @@ MasterPreferences::MasterPreferences(const CommandLine& cmd_line)
: distribution_(NULL),
preferences_read_from_file_(false),
chrome_(true),
- chrome_app_host_(false),
chrome_app_launcher_(false),
chrome_frame_(false),
multi_install_(false) {
@@ -95,7 +93,6 @@ MasterPreferences::MasterPreferences(const base::FilePath& prefs_path)
: distribution_(NULL),
preferences_read_from_file_(false),
chrome_(true),
- chrome_app_host_(false),
chrome_app_launcher_(false),
chrome_frame_(false),
multi_install_(false) {
@@ -115,7 +112,6 @@ MasterPreferences::MasterPreferences(const std::string& prefs)
: distribution_(NULL),
preferences_read_from_file_(false),
chrome_(true),
- chrome_app_host_(false),
chrome_app_launcher_(false),
chrome_frame_(false),
multi_install_(false) {
@@ -146,8 +142,8 @@ void MasterPreferences::InitializeFromCommandLine(const CommandLine& cmd_line) {
} translate_switches[] = {
{ installer::switches::kAutoLaunchChrome,
installer::master_preferences::kAutoLaunchChrome },
- { installer::switches::kChromeAppHost,
- installer::master_preferences::kChromeAppHost },
+ { installer::switches::kChromeAppHostDeprecated,
+ installer::master_preferences::kChromeAppHostDeprecated },
{ installer::switches::kChromeAppLauncher,
installer::master_preferences::kChromeAppLauncher },
{ installer::switches::kChrome,
@@ -237,17 +233,21 @@ void MasterPreferences::InitializeProductFlags() {
// Make sure we start out with the correct defaults.
multi_install_ = false;
chrome_frame_ = false;
- chrome_app_host_ = false;
chrome_app_launcher_ = false;
chrome_ = true;
GetBool(installer::master_preferences::kMultiInstall, &multi_install_);
GetBool(installer::master_preferences::kChromeFrame, &chrome_frame_);
- GetBool(installer::master_preferences::kChromeAppHost, &chrome_app_host_);
GetBool(installer::master_preferences::kChromeAppLauncher,
&chrome_app_launcher_);
+ // The deprecated switch --app-host behaves like --app-launcher.
+ bool chrome_app_host = false;
+ GetBool(installer::master_preferences::kChromeAppHostDeprecated,
+ &chrome_app_host);
+ chrome_app_launcher_ = chrome_app_launcher_ || chrome_app_host;
+
// When multi-install is specified, the checks are pretty simple (in theory):
// In order to be installed/uninstalled, each product must have its switch
// present on the command line.
diff --git a/chrome/installer/util/master_preferences.h b/chrome/installer/util/master_preferences.h
index 99b1e9d..bdf482a 100644
--- a/chrome/installer/util/master_preferences.h
+++ b/chrome/installer/util/master_preferences.h
@@ -168,10 +168,6 @@ class MasterPreferences {
return chrome_;
}
- bool install_chrome_app_host() const {
- return chrome_app_host_;
- }
-
bool install_chrome_app_launcher() const {
return chrome_app_launcher_;
}
@@ -208,7 +204,6 @@ class MasterPreferences {
base::DictionaryValue* distribution_;
bool preferences_read_from_file_;
bool chrome_;
- bool chrome_app_host_;
bool chrome_app_launcher_;
bool chrome_frame_;
bool multi_install_;
diff --git a/chrome/installer/util/master_preferences_constants.cc b/chrome/installer/util/master_preferences_constants.cc
index 083650b..bf53a29 100644
--- a/chrome/installer/util/master_preferences_constants.cc
+++ b/chrome/installer/util/master_preferences_constants.cc
@@ -9,7 +9,8 @@ namespace master_preferences {
const char kAltShortcutText[] = "alternate_shortcut_text";
const char kAutoLaunchChrome[] = "auto_launch_chrome";
const char kChrome[] = "chrome";
- const char kChromeAppHost[] = "app_host";
+ // TODO(huangs): Remove by M27.
+ const char kChromeAppHostDeprecated[] = "app_host";
const char kChromeAppLauncher[] = "app_launcher";
const char kChromeFrame[] = "chrome_frame";
const char kChromeFrameReadyMode[] = "ready_mode";
diff --git a/chrome/installer/util/master_preferences_constants.h b/chrome/installer/util/master_preferences_constants.h
index 48d6769..6bfee0a 100644
--- a/chrome/installer/util/master_preferences_constants.h
+++ b/chrome/installer/util/master_preferences_constants.h
@@ -23,7 +23,7 @@ extern const char kAutoLaunchChrome[];
// Boolean. This is to be a Chrome install. (When using MultiInstall)
extern const char kChrome[];
// Boolean. This is to be a Chrome App Host install.
-extern const char kChromeAppHost[];
+extern const char kChromeAppHostDeprecated[]; // TODO(huangs): Remove by M27.
// Boolean. This is to be a Chrome App Launcher install.
extern const char kChromeAppLauncher[];
// Boolean. This is to be a Chrome Frame install.
diff --git a/chrome/installer/util/util_constants.cc b/chrome/installer/util/util_constants.cc
index 5136f0a..c380a5f 100644
--- a/chrome/installer/util/util_constants.cc
+++ b/chrome/installer/util/util_constants.cc
@@ -15,8 +15,9 @@ const char kAutoLaunchChrome[] = "auto-launch-chrome";
// Currently this is only required when used in combination with kMultiInstall.
const char kChrome[] = "chrome";
-// Install Chrome App Host.
-const char kChromeAppHost[] = "app-host";
+// Install Chrome App Host. This is now interpreted as kChromeAppLauncher.
+// TODO(huangs): Remove by M27.
+const char kChromeAppHostDeprecated[] = "app-host";
// Install Chrome App Launcher, which subsumes Chrome App Host, i.e.,
// App Launcher install converts App Host to App Launcher, and all subsequent
@@ -248,7 +249,6 @@ const wchar_t kInstallerResultUIString[] = L"InstallerResultUIString";
const wchar_t kInstallerSuccessLaunchCmdLine[] =
L"InstallerSuccessLaunchCmdLine";
-const wchar_t kOptionAppHostIsLauncher[] = L"app-host-is-launcher";
const wchar_t kOptionMultiInstall[] = L"multi-install";
const wchar_t kOptionReadyMode[] = L"ready-mode";
diff --git a/chrome/installer/util/util_constants.h b/chrome/installer/util/util_constants.h
index 0d4a4e3..bb7b693 100644
--- a/chrome/installer/util/util_constants.h
+++ b/chrome/installer/util/util_constants.h
@@ -130,7 +130,7 @@ COMPILE_ASSERT(DEFERRING_TO_HIGHER_VERSION == 18,
namespace switches {
extern const char kAutoLaunchChrome[];
extern const char kChrome[];
-extern const char kChromeAppHost[];
+extern const char kChromeAppHostDeprecated[]; // TODO(huangs): Remove by M27.
extern const char kChromeAppLauncher[];
extern const char kChromeFrame[];
extern const char kChromeFrameQuickEnable[];
@@ -224,7 +224,6 @@ extern const wchar_t kInstallerSuccessLaunchCmdLine[];
// Product options.
extern const wchar_t kOptionMultiInstall[];
extern const wchar_t kOptionReadyMode[];
-extern const wchar_t kOptionAppHostIsLauncher[];
// Chrome channel display names.
// NOTE: Canary is not strictly a 'channel', but rather a separate product