Commit eae4f3c3 authored by Greg Thompson's avatar Greg Thompson Committed by Commit Bot

Use the proper registry hive when accessing Chrome's ClientState key.

Google Update and Chrome use Chrome's ClientState key as a bucket for
holding data and to communicate with one another. In general, HKLM is
used for system-level installs and HKCU is used for per-user
installs. GoogleUpdateSettings was looking in both hives for values,
which can lead to incorrect values being used. This CL tightens up
accesses so that only the correct hive is used for each value.

This CL also updates some of the implementation to use install_static
instead of BrowserDistribution, which is deprecated.

Finally, some dead code has been removed.

BUG=none
R=rogerta@chromium.org

Change-Id: I0d70042e2d70d9d33e9eb8c2f5e846e35d5d0634
Reviewed-on: https://chromium-review.googlesource.com/1179743Reviewed-by: default avatarRoger Tawa <rogerta@chromium.org>
Commit-Queue: Greg Thompson <grt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#584046}
parent e690c9cd
......@@ -177,14 +177,6 @@ class GoogleUpdateSettings {
// google_brand::GetReactivationBrand().
static bool GetReactivationBrand(base::string16* brand);
// Returns in |client| the google_update client field, which is currently
// used to track experiments. Returns false if the entry does not exist.
static bool GetClient(base::string16* client);
// Sets the google_update client field. Unlike GetClient() this is set only
// for the current user. Returns false if the operation failed.
static bool SetClient(const base::string16& client);
// Returns in 'client' the RLZ referral available for some distribution
// partners. This value does not exist for most chrome or chromium installs.
static bool GetReferral(base::string16* referral);
......@@ -244,23 +236,6 @@ class GoogleUpdateSettings {
static void UpdateProfileCounts(size_t profiles_active,
size_t profiles_signedin);
// For system-level installs, we need to be able to communicate the results
// of the Toast Experiments back to Google Update. The problem is just that
// the experiment is run in the context of the user, which doesn't have
// write access to the HKLM key that Google Update expects the results in.
// However, when we are about to switch contexts from system to user, we can
// duplicate the handle to the registry key and pass it (through handle
// inheritance) to the newly created child process that is launched as the
// user, allowing the child process to write to the key, with the
// WriteGoogleUpdateSystemClientKey function below.
static int DuplicateGoogleUpdateSystemClientKey();
// Takes a |handle| to a registry key and writes |value| string into the
// specified |key|. See DuplicateGoogleUpdateSystemClientKey for details.
static bool WriteGoogleUpdateSystemClientKey(int handle,
const base::string16& key,
const base::string16& value);
// Returns the effective update policy for |app_guid| as dictated by
// Group Policy settings. |is_overridden|, if non-NULL, is populated with
// true if an app-specific policy override is in force, or false otherwise.
......
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