Commit 4c360d34 authored by Samuel Huang's avatar Samuel Huang Committed by Commit Bot

Revert "Move UpdateInstallStatus from BrowserDistribution into setup."

This reverts commit f82f3089.

Reason for revert: http://crbug.com/880484

Original change's description:
> Move UpdateInstallStatus from BrowserDistribution into setup.
> 
> This is brand-specific behavior for the installer.
> 
> BUG=879568
> R=​chengx@chromium.org
> 
> Change-Id: Ifac2d4842482c58bf6ce23809217f15632d606ff
> Reviewed-on: https://chromium-review.googlesource.com/1200942
> Commit-Queue: Greg Thompson <grt@chromium.org>
> Reviewed-by: Xi Cheng <chengx@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#588576}

TBR=grt@chromium.org,chengx@chromium.org

Change-Id: Ib0acfabd42ba741d957fa3dd578a87ecb198042d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 879568
Reviewed-on: https://chromium-review.googlesource.com/1204723Reviewed-by: default avatarSamuel Huang <huangs@chromium.org>
Commit-Queue: Samuel Huang <huangs@chromium.org>
Cr-Commit-Position: refs/heads/master@{#588612}
parent 62b56c63
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
#define CHROME_INSTALLER_SETUP_BRAND_BEHAVIORS_H_ #define CHROME_INSTALLER_SETUP_BRAND_BEHAVIORS_H_
#include "base/strings/string16.h" #include "base/strings/string16.h"
#include "chrome/installer/util/util_constants.h"
namespace base { namespace base {
class FilePath; class FilePath;
...@@ -19,13 +18,6 @@ class Version; ...@@ -19,13 +18,6 @@ class Version;
namespace installer { namespace installer {
// Communicates a change in install status to the updater. |archive_type|, if
// not UNKNOWN_ARCHIVE_TYPE, indicates what type of install/update is being
// applied. |install_status|, if not UNKNOWN_STATUS, indicates the result of the
// install/update.
void UpdateInstallStatus(installer::ArchiveType archive_type,
installer::InstallStatus install_status);
// Returns an opaque string holding data relating to the browser being // Returns an opaque string holding data relating to the browser being
// uninstalled. This function is called before the product's Clients key is // uninstalled. This function is called before the product's Clients key is
// deleted. This blob is later passed to DoPostUninstallOperations. // deleted. This blob is later passed to DoPostUninstallOperations.
......
...@@ -6,9 +6,6 @@ ...@@ -6,9 +6,6 @@
namespace installer { namespace installer {
void UpdateInstallStatus(installer::ArchiveType archive_type,
installer::InstallStatus install_status) {}
base::string16 GetDistributionData() { base::string16 GetDistributionData() {
return base::string16(); return base::string16();
} }
......
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
#include "chrome/installer/setup/uninstall_metrics.h" #include "chrome/installer/setup/uninstall_metrics.h"
#include "chrome/installer/util/google_update_constants.h" #include "chrome/installer/util/google_update_constants.h"
#include "chrome/installer/util/google_update_settings.h" #include "chrome/installer/util/google_update_settings.h"
#include "chrome/installer/util/install_util.h"
#include "third_party/crashpad/crashpad/client/crash_report_database.h" #include "third_party/crashpad/crashpad/client/crash_report_database.h"
#include "third_party/crashpad/crashpad/client/settings.h" #include "third_party/crashpad/crashpad/client/settings.h"
#include "third_party/crashpad/crashpad/util/misc/uuid.h" #include "third_party/crashpad/crashpad/util/misc/uuid.h"
...@@ -81,21 +80,6 @@ void NavigateToUrlWithIExplore(const base::string16& url) { ...@@ -81,21 +80,6 @@ void NavigateToUrlWithIExplore(const base::string16& url) {
} // namespace } // namespace
// If |archive_type| is INCREMENTAL_ARCHIVE_TYPE and |install_status| does not
// indicate a successful update, "-full" is appended to Chrome's "ap" value in
// its ClientState key if it is not present, resulting in the full installer
// being returned from the next update check. If |archive_type| is
// FULL_ARCHIVE_TYPE or |install_status| indicates a successful update, "-full"
// is removed from the "ap" value. "-multifail" and "-stage:*" values are
// unconditionally removed from the "ap" value.
void UpdateInstallStatus(installer::ArchiveType archive_type,
installer::InstallStatus install_status) {
GoogleUpdateSettings::UpdateInstallStatus(
install_static::IsSystemInstall(), archive_type,
InstallUtil::GetInstallReturnCode(install_status),
install_static::GetAppGuid());
}
// Returns a string holding the following URL query parameters: // Returns a string holding the following URL query parameters:
// - brand // - brand
// - client // - client
......
...@@ -49,7 +49,6 @@ ...@@ -49,7 +49,6 @@
#include "chrome/install_static/install_details.h" #include "chrome/install_static/install_details.h"
#include "chrome/install_static/install_util.h" #include "chrome/install_static/install_util.h"
#include "chrome/installer/setup/archive_patch_helper.h" #include "chrome/installer/setup/archive_patch_helper.h"
#include "chrome/installer/setup/brand_behaviors.h"
#include "chrome/installer/setup/buildflags.h" #include "chrome/installer/setup/buildflags.h"
#include "chrome/installer/setup/install.h" #include "chrome/installer/setup/install.h"
#include "chrome/installer/setup/install_worker.h" #include "chrome/installer/setup/install_worker.h"
...@@ -648,12 +647,14 @@ installer::InstallStatus InstallProducts( ...@@ -648,12 +647,14 @@ installer::InstallStatus InstallProducts(
InstallerState* installer_state, InstallerState* installer_state,
base::FilePath* installer_directory) { base::FilePath* installer_directory) {
DCHECK(installer_state); DCHECK(installer_state);
const bool system_install = installer_state->system_install();
installer::InstallStatus install_status = installer::UNKNOWN_STATUS; installer::InstallStatus install_status = installer::UNKNOWN_STATUS;
installer::ArchiveType archive_type = installer::UNKNOWN_ARCHIVE_TYPE; installer::ArchiveType archive_type = installer::UNKNOWN_ARCHIVE_TYPE;
installer_state->SetStage(installer::PRECONDITIONS); installer_state->SetStage(installer::PRECONDITIONS);
// Remove any legacy "-multifail" or "-stage:*" values from the product's // Remove any legacy "-multifail" or "-stage:*" values from the product's
// "ap" value. // "ap" value.
installer::UpdateInstallStatus(archive_type, install_status); BrowserDistribution::GetDistribution()->UpdateInstallStatus(
system_install, archive_type, install_status);
// Drop to background processing mode if the process was started below the // Drop to background processing mode if the process was started below the
// normal process priority class. This is done here because InstallProducts- // normal process priority class. This is done here because InstallProducts-
...@@ -688,7 +689,8 @@ installer::InstallStatus InstallProducts( ...@@ -688,7 +689,8 @@ installer::InstallStatus InstallProducts(
} }
} }
UpdateInstallStatus(archive_type, install_status); installer_state->product().distribution()->UpdateInstallStatus(
system_install, archive_type, install_status);
return install_status; return install_status;
} }
......
...@@ -111,3 +111,8 @@ base::string16 BrowserDistribution::GetLongAppDescription() { ...@@ -111,3 +111,8 @@ base::string16 BrowserDistribution::GetLongAppDescription() {
installer::GetLocalizedString(IDS_PRODUCT_DESCRIPTION_BASE); installer::GetLocalizedString(IDS_PRODUCT_DESCRIPTION_BASE);
return app_description; return app_description;
} }
void BrowserDistribution::UpdateInstallStatus(bool system_install,
installer::ArchiveType archive_type,
installer::InstallStatus install_status) {
}
...@@ -48,6 +48,10 @@ class BrowserDistribution { ...@@ -48,6 +48,10 @@ class BrowserDistribution {
virtual base::string16 GetLongAppDescription(); virtual base::string16 GetLongAppDescription();
virtual void UpdateInstallStatus(bool system_install,
installer::ArchiveType archive_type,
installer::InstallStatus install_status);
protected: protected:
explicit BrowserDistribution( explicit BrowserDistribution(
std::unique_ptr<AppRegistrationData> app_reg_data); std::unique_ptr<AppRegistrationData> app_reg_data);
......
...@@ -7,10 +7,12 @@ ...@@ -7,10 +7,12 @@
#include "chrome/installer/util/google_chrome_distribution.h" #include "chrome/installer/util/google_chrome_distribution.h"
#include <memory> #include <utility>
#include "chrome/install_static/install_util.h" #include "chrome/install_static/install_util.h"
#include "chrome/installer/util/app_registration_data.h" #include "chrome/installer/util/app_registration_data.h"
#include "chrome/installer/util/google_update_settings.h"
#include "chrome/installer/util/install_util.h"
#include "chrome/installer/util/installer_util_strings.h" #include "chrome/installer/util/installer_util_strings.h"
#include "chrome/installer/util/l10n_string_util.h" #include "chrome/installer/util/l10n_string_util.h"
#include "chrome/installer/util/updating_app_registration_data.h" #include "chrome/installer/util/updating_app_registration_data.h"
...@@ -24,3 +26,20 @@ base::string16 GoogleChromeDistribution::GetPublisherName() { ...@@ -24,3 +26,20 @@ base::string16 GoogleChromeDistribution::GetPublisherName() {
installer::GetLocalizedString(IDS_ABOUT_VERSION_COMPANY_NAME_BASE); installer::GetLocalizedString(IDS_ABOUT_VERSION_COMPANY_NAME_BASE);
return publisher_name; return publisher_name;
} }
// This method checks if we need to change "ap" key in Google Update to try
// full installer as fall back method in case incremental installer fails.
// - If incremental installer fails we append a magic string ("-full"), if
// it is not present already, so that Google Update server next time will send
// full installer to update Chrome on the local machine
// - If we are currently running full installer, we remove this magic
// string (if it is present) regardless of whether installer failed or not.
// There is no fall-back for full installer :)
void GoogleChromeDistribution::UpdateInstallStatus(bool system_install,
installer::ArchiveType archive_type,
installer::InstallStatus install_status) {
GoogleUpdateSettings::UpdateInstallStatus(
system_install, archive_type,
InstallUtil::GetInstallReturnCode(install_status),
install_static::GetAppGuid());
}
...@@ -14,6 +14,11 @@ class GoogleChromeDistribution : public BrowserDistribution { ...@@ -14,6 +14,11 @@ class GoogleChromeDistribution : public BrowserDistribution {
public: public:
base::string16 GetPublisherName() override; base::string16 GetPublisherName() override;
void UpdateInstallStatus(
bool system_install,
installer::ArchiveType archive_type,
installer::InstallStatus install_status) override;
protected: protected:
// Disallow construction from others. // Disallow construction from others.
GoogleChromeDistribution(); GoogleChromeDistribution();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment