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

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

Issue 14031025: Implementing unified Chrome / App Launcher flow, and migrating old stand-alone App Launcher. (Closed) Base URL: http://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 8 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/installer_state.cc
diff --git a/chrome/installer/util/installer_state.cc b/chrome/installer/util/installer_state.cc
index 00906292c31514cf2d4333150d52fb9b5383555d..23698efa06f3690b44ca1ff31948f615f42e59bf 100644
--- a/chrome/installer/util/installer_state.cc
+++ b/chrome/installer/util/installer_state.cc
@@ -78,7 +78,8 @@ InstallerState::InstallerState()
root_key_(NULL),
msi_(false),
verbose_logging_(false),
- ensure_google_update_present_(false) {
+ ensure_google_update_present_(false),
+ create_app_launcher_shortcuts_(false) {
}
InstallerState::InstallerState(Level level)
@@ -90,7 +91,8 @@ InstallerState::InstallerState(Level level)
root_key_(NULL),
msi_(false),
verbose_logging_(false),
- ensure_google_update_present_(false) {
+ ensure_google_update_present_(false),
+ create_app_launcher_shortcuts_(false) {
// Use set_level() so that root_key_ is updated properly.
set_level(level);
}
@@ -118,12 +120,24 @@ void InstallerState::Initialize(const CommandLine& command_line,
const bool is_uninstall = command_line.HasSwitch(switches::kUninstall);
- if (prefs.install_chrome()) {
- Product* p = AddProductFromPreferences(
+ // App Launcher and Chrome are unified.
gab 2013/04/29 20:25:41 The Chrome product (i.e. the shortcuts) is always
huangs 2013/04/30 14:01:49 This is the main premise of the Chrome / App Launc
+ if (prefs.install_chrome() || prefs.install_chrome_app_launcher()) {
+ Product* p1 = AddProductFromPreferences(
BrowserDistribution::CHROME_BROWSER, prefs, machine_state);
VLOG(1) << (is_uninstall ? "Uninstall" : "Install")
- << " distribution: " << p->distribution()->GetAppShortCutName();
+ << " distribution: " << p1->distribution()->GetAppShortCutName();
+
+ if (is_multi_install()) {
+ Product* p2 = AddProductFromPreferences(
+ BrowserDistribution::CHROME_APP_HOST, prefs, machine_state);
+ VLOG(1) << (is_uninstall ? "Uninstall" : "Install")
+ << " distribution: " << p2->distribution()->GetAppShortCutName();
+ }
}
+ // TODO(huangs): Remove by M29.
+ // Create App Launcher shortcuts if --app-launcher is specified.
+ create_app_launcher_shortcuts_ = prefs.install_chrome_app_launcher();
+
if (prefs.install_chrome_frame()) {
Product* p = AddProductFromPreferences(
BrowserDistribution::CHROME_FRAME, prefs, machine_state);
@@ -131,38 +145,18 @@ void InstallerState::Initialize(const CommandLine& command_line,
<< " distribution: " << p->distribution()->GetAppShortCutName();
}
- if (prefs.install_chrome_app_launcher()) {
- Product* p = AddProductFromPreferences(
- BrowserDistribution::CHROME_APP_HOST, prefs, machine_state);
- VLOG(1) << (is_uninstall ? "Uninstall" : "Install")
- << " distribution: " << p->distribution()->GetAppShortCutName();
- }
-
if (!is_uninstall && is_multi_install()) {
bool need_binaries = false;
- if (FindProduct(BrowserDistribution::CHROME_APP_HOST)) {
- // App Host will happily use Chrome at system level, or binaries at system
- // level, even if app host is user level.
- const ProductState* chrome_state = machine_state.GetProductState(
- true, // system level
- BrowserDistribution::CHROME_BROWSER);
- // If Chrome is at system-level, multi- or otherwise. We'll use it.
- if (!chrome_state) {
- const ProductState* binaries_state = machine_state.GetProductState(
- true, // system level
- BrowserDistribution::CHROME_BINARIES);
- if (!binaries_state)
- need_binaries = true;
- }
- }
-
- // Chrome/Chrome Frame multi need Binaries at their own level.
+ // Chrome/Chrome Frame/App Launcher multi need Binaries at their own level.
if (FindProduct(BrowserDistribution::CHROME_BROWSER))
need_binaries = true;
if (FindProduct(BrowserDistribution::CHROME_FRAME))
need_binaries = true;
+ if (FindProduct(BrowserDistribution::CHROME_APP_HOST))
gab 2013/04/29 20:25:41 Why does CHROME_APP_HOST even still exist if it is
huangs 2013/04/30 14:01:49 Because we need to create the Omaha Product / Prod
+ need_binaries = true;
+
if (need_binaries && !FindProduct(BrowserDistribution::CHROME_BINARIES)) {
// Force binaries to be installed/updated.
Product* p = AddProductFromPreferences(

Powered by Google App Engine
This is Rietveld 408576698