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

Unified Diff: chrome/installer/util/shell_util.h

Issue 10451074: Always suffix ChromeHTML entries on Windows for user-level installs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: no UAC on uninstall if nothing in HKLM Created 8 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/util/shell_util.h
diff --git a/chrome/installer/util/shell_util.h b/chrome/installer/util/shell_util.h
index 85e5fbd7d0f9e8123a5e2b2157810f3ad4ede95f..04ae40787864142556464dbf88578646a009c894 100644
--- a/chrome/installer/util/shell_util.h
+++ b/chrome/installer/util/shell_util.h
@@ -204,15 +204,57 @@ class ShellUtil {
static void GetRegisteredBrowsers(BrowserDistribution* dist,
std::map<string16, string16>* browsers);
- // This function gets a suffix (user's login name) that can be added
- // to Chromium default browser entry in the registry to create a unique name
- // if there are multiple users on the machine, each with their own copy of
- // Chromium that they want to set as default browser.
- // This suffix value is assigned to |entry|. The function also checks for
- // existence of Default Browser registry key with this suffix and
- // returns true if it exists. In all other cases it returns false.
- static bool GetUserSpecificDefaultBrowserSuffix(BrowserDistribution* dist,
- string16* entry);
+ // Returns the suffix this user's Chrome install is registered with.
+ // Always returns the empty string on system-level installs.
+ //
+ // This method is meant for external methods which need to know the suffix of
+ // the current install at run-time, not for install-time decisions.
+ // There are no guarantees that this suffix will not change later:
+ // (e.g. if two user-level installs were previously installed in parallel on
+ // the same machine, both without admin rights and with no user-level install
+ // having claimed the non-suffixed HKLM registrations, they both have no
+ // suffix in their progId entries (as per the old suffix rules). If they were
+ // to both fully register (i.e. click "Make Chrome Default" and go through
+ // UAC; or upgrade to Win8 and get the automatic no UAC full registration)
+ // they would then both get a suffixed registration as per the new suffix
+ // rules).
+ //
+ // |chrome_exe| The path to the currently installed (or running) chrome.exe.
+ static string16 GetCurrentInstallationSuffix(BrowserDistribution* dist,
+ const string16& chrome_exe);
+
+ // An enum used to tell CurrentUserIsRegisteredWithSuffix() which level of
+ // registration we want to confirm.
+ enum RegistrationConfirmationLevel {
+ // Only look for Chrome's ProgIds.
+ // This is sufficient when we are trying to determine the suffix of the
+ // currently running Chrome as system registrations might not be present.
+ CONFIRM_PROGID_REGISTRATION = 0,
+ // Confirm that Chrome is registered on the system (i.e. registered with
+ // Defaut Programs). These registrations can be in HKCU as of Windows 8.
+ CONFIRM_SYSTEM_REGISTRATION,
+ // Same as CONFIRM_SYSTEM_REGISTRATION, but only look in HKLM (used when
+ // uninstalling to know whether elevation is required to clean up the
+ // registry).
+ CONFIRM_SYSTEM_REGISTRATION_IN_HKLM,
gab 2012/06/08 15:47:38 Added this enum entry to allow uninstall.cc to che
+ };
+
+ // Returns true if the current install's |chrome_exe| has been registered with
+ // |suffix|.
+ // |confirmation_level| is the level of verification desired as described in
+ // the RegistrationConfirmationLevel enum above.
+ // |suffix| can be the empty string (this is used to support old installs
+ // where we used to not suffix user-level installs if they were the first to
+ // request the non-suffixed registry entries on the machine).
+ // NOTE: This a quick check that only validates that a single registry entry
+ // points to |chrome_exe|. This should only be used at run-time to determine
+ // how Chrome is registered, not to know whether the registration is complete
+ // at install-time (IsChromeRegistered() can be used for that).
+ static bool QuickIsChromeRegistered(
+ BrowserDistribution* dist,
+ const string16& chrome_exe,
+ const string16& suffix,
+ RegistrationConfirmationLevel confirmation_level);
// Make Chrome the default browser. This function works by going through
// the url protocols and file associations that are related to general

Powered by Google App Engine
This is Rietveld 408576698