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

Unified Diff: chrome/installer/setup/install_worker.cc

Issue 1213913002: Update Chrome's Active Setup version per component instead of as a single string. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@active_setup_onosup_addCB_API
Patch Set: Created 5 years, 6 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/setup/install_worker.cc
diff --git a/chrome/installer/setup/install_worker.cc b/chrome/installer/setup/install_worker.cc
index 4824016a21eafc096c1b9da61ad012fcbcf0dc18..8108e9a6831dc6e05a3a770db4605ab05c79596f 100644
--- a/chrome/installer/setup/install_worker.cc
+++ b/chrome/installer/setup/install_worker.cc
@@ -20,6 +20,7 @@
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "base/path_service.h"
+#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/version.h"
@@ -57,12 +58,6 @@ namespace installer {
namespace {
-// The version identifying the work done by setup.exe --configure-user-settings
-// on user login by way of Active Setup. Increase this value if the work done
-// in setup_main.cc's handling of kConfigureUserSettings changes and should be
-// executed again for all users.
-const wchar_t kActiveSetupVersion[] = L"43,0,0,0";
-
// Although the UUID of the ChromeFrame class is used for the "current" value,
// this is done only as a convenience; there is no need for the GUID of the Low
// Rights policies to match the ChromeFrame class's GUID. Hence, it is safe to
@@ -541,6 +536,36 @@ void CleanupBadCanaryDelegateExecuteRegistration(
}
}
+// Returns the version to be used for Active Setup as MM/XX/YY/ZZ where MM is
grt (UTC plus 2) 2015/06/29 17:41:49 MM,XX,YY,ZZ?
gab 2015/06/30 18:40:39 Major,X,Y,Z -- I don't think Major,Minor,Build,Rev
grt (UTC plus 2) 2015/06/30 18:54:49 My suggestion was to use commas rather than slashe
gab 2015/07/02 03:12:33 Ah I see, hadn't noticed I'd used slashes (indeed
+// |kActiveSetupMajorVersion| and other components may be updated in various
+// situations. At this point YY represents the number of on-os-upgrade that were
+// handled by this installation and XX/ZZ are unused.
+base::string16 GetActiveSetupVersionFromExisting(
+ const base::string16& existing_version) {
+ // The major version and first component of the version identifying the work
+ // done by setup.exe --configure-user- settings on user login by way of Active
grt (UTC plus 2) 2015/06/29 17:41:49 --configure-user-settings
gab 2015/06/30 18:40:38 Done.
+ // Setup. Increase this value if the work done in setup_main.cc's handling of
+ // kConfigureUserSettings changes and should be executed again for all users.
+ const base::char16 kActiveSetupMajorVersion[] = L"43";
+
+ std::vector<base::string16> version_components = base::SplitString(
+ existing_version, L",", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY);
+
+ // If |existing_version| was empty or otherwise corrupted, turn it into a
+ // valid one.
+ if (version_components.size() != 4U) {
grt (UTC plus 2) 2015/06/29 17:41:49 if (version_components.size() != 4U) version_c
gab 2015/06/30 18:40:38 Done.
+ version_components.resize(4U);
+ version_components[1] = L"0";
+ version_components[2] = L"0";
+ version_components[3] = L"0";
+ }
+
+ // Unconditionally update the major version.
+ version_components[0] = kActiveSetupMajorVersion;
+
+ return JoinString(version_components, L",");
grt (UTC plus 2) 2015/06/29 17:41:49 L','
gab 2015/06/30 18:40:38 Done.
+}
+
} // namespace
// This method adds work items to create (or update) Chrome uninstall entry in
@@ -1241,7 +1266,7 @@ void AddInstallWorkItems(const InstallationState& original_state,
AddDelegateExecuteWorkItems(installer_state, target_path, new_version,
product, install_list);
- AddActiveSetupWorkItems(installer_state, setup_path, new_version, product,
+ AddActiveSetupWorkItems(installer_state, new_version, product,
install_list);
}
@@ -1399,7 +1424,6 @@ void AddDelegateExecuteWorkItems(const InstallerState& installer_state,
}
void AddActiveSetupWorkItems(const InstallerState& installer_state,
- const base::FilePath& setup_path,
const Version& new_version,
const Product& product,
WorkItemList* list) {
@@ -1462,8 +1486,7 @@ void AddActiveSetupWorkItems(const InstallerState& installer_state,
active_setup_path,
WorkItem::kWow64Default,
L"Version",
- kActiveSetupVersion,
- true);
+ base::Bind(&GetActiveSetupVersionFromExisting));
}
void AddDeleteOldIELowRightsPolicyWorkItems(

Powered by Google App Engine
This is Rietveld 408576698