Chromium Code Reviews| 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..93ce643ea1dc565fa90da53d173681705776dd05 100644 |
| --- a/chrome/installer/util/shell_util.h |
| +++ b/chrome/installer/util/shell_util.h |
| @@ -204,15 +204,53 @@ 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 |
|
grt (UTC plus 2)
2012/06/08 16:24:13
CurrentUserIsRegisteredWithSuffix -> QuickIsChrome
gab
2012/06/08 20:15:51
Done.
|
| + // registration we want to confirm. |
| + enum RegistrationConfirmationLevel { |
|
grt (UTC plus 2)
2012/06/08 16:24:13
chromium style: enums come before methods in a cla
gab
2012/06/08 20:15:51
Done.
|
| + // 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). |
| + CONFIRM_SYSTEM_REGISTRATION, |
| + }; |
| + |
| + // 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( |
|
grt (UTC plus 2)
2012/06/08 16:24:13
Looks like you can simplify things if you remove R
gab
2012/06/08 20:15:51
Thanks for pointing this out, it turns out that wi
|
| + 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 |