Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 // | 4 // |
| 5 // This file declares methods that are useful for integrating Chrome in | 5 // This file declares methods that are useful for integrating Chrome in |
| 6 // Windows shell. These methods are all static and currently part of | 6 // Windows shell. These methods are all static and currently part of |
| 7 // ShellUtil class. | 7 // ShellUtil class. |
| 8 | 8 |
| 9 #ifndef CHROME_INSTALLER_UTIL_SHELL_UTIL_H_ | 9 #ifndef CHROME_INSTALLER_UTIL_SHELL_UTIL_H_ |
| 10 #define CHROME_INSTALLER_UTIL_SHELL_UTIL_H_ | 10 #define CHROME_INSTALLER_UTIL_SHELL_UTIL_H_ |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 197 // returns false. If system_level is true this function returns the path | 197 // returns false. If system_level is true this function returns the path |
| 198 // to Default Users Quick Launch shortcuts path. Adding a shortcut to Default | 198 // to Default Users Quick Launch shortcuts path. Adding a shortcut to Default |
| 199 // User's profile only affects any new user profiles (not existing ones). | 199 // User's profile only affects any new user profiles (not existing ones). |
| 200 static bool GetQuickLaunchPath(bool system_level, FilePath* path); | 200 static bool GetQuickLaunchPath(bool system_level, FilePath* path); |
| 201 | 201 |
| 202 // Gets a mapping of all registered browser (on local machine) names and | 202 // Gets a mapping of all registered browser (on local machine) names and |
| 203 // their reinstall command (which usually sets browser as default). | 203 // their reinstall command (which usually sets browser as default). |
| 204 static void GetRegisteredBrowsers(BrowserDistribution* dist, | 204 static void GetRegisteredBrowsers(BrowserDistribution* dist, |
| 205 std::map<string16, string16>* browsers); | 205 std::map<string16, string16>* browsers); |
| 206 | 206 |
| 207 // This function gets a suffix (user's login name) that can be added | 207 // Returns the suffix this user's Chrome install is registered with. |
| 208 // to Chromium default browser entry in the registry to create a unique name | 208 // Note: this method returns the empty string on system-level installs by |
| 209 // if there are multiple users on the machine, each with their own copy of | 209 // design as no system-level installs is ever suffixed. |
| 210 // Chromium that they want to set as default browser. | 210 // |
| 211 // This suffix value is assigned to |entry|. The function also checks for | 211 // This method is meant for external methods which need to know the suffix of |
| 212 // existence of Default Browser registry key with this suffix and | 212 // the current install at run-time, not for install-time decisions. |
| 213 // returns true if it exists. In all other cases it returns false. | 213 // There are no guarantees that this suffix will not change later: |
| 214 static bool GetUserSpecificDefaultBrowserSuffix(BrowserDistribution* dist, | 214 // (e.g. if two user-level installs were previously installed in parallel on |
| 215 string16* entry); | 215 // the same machine, both without admin rights and with no user-level install |
| 216 // having claimed the non-suffixed HKLM registrations, they both have no | |
| 217 // suffix in their progId entries (as per the old suffix rules). If they were | |
| 218 // to both fully register (i.e. click "Make Chrome Default" and go through | |
| 219 // UAC; or upgrade to Win8 and get the automatic no UAC full registration) | |
| 220 // they would then both get a suffixed registration as per the new suffix | |
| 221 // rules). | |
| 222 static string16 GetCurrentInstallationSuffix(); | |
| 223 | |
| 224 // Returns true if any of the possible Chrome registry keys are present in | |
|
grt (UTC plus 2)
2012/05/30 20:37:40
according to the implementation: "any" -> "all"
gab
2012/05/31 06:36:01
As mentionned on another comment, the intention is
| |
| 225 // HKLM with |suffix|. | |
| 226 static bool IsInstallationPresentInHKLM(BrowserDistribution* dist, | |
| 227 const string16& chrome_exe, | |
| 228 const string16& suffix); | |
| 216 | 229 |
| 217 // Make Chrome the default browser. This function works by going through | 230 // Make Chrome the default browser. This function works by going through |
| 218 // the url protocols and file associations that are related to general | 231 // the url protocols and file associations that are related to general |
| 219 // browsing, e.g. http, https, .html etc., and requesting to become the | 232 // browsing, e.g. http, https, .html etc., and requesting to become the |
| 220 // default handler for each. If any of these fails the operation will return | 233 // default handler for each. If any of these fails the operation will return |
| 221 // false to indicate failure, which is consistent with the return value of | 234 // false to indicate failure, which is consistent with the return value of |
| 222 // ShellIntegration::IsDefaultBrowser. | 235 // ShellIntegration::IsDefaultBrowser. |
| 223 // | 236 // |
| 224 // In the case of failure any successful changes will be left, however no | 237 // In the case of failure any successful changes will be left, however no |
| 225 // more changes will be attempted. | 238 // more changes will be attempted. |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 344 const string16& icon_path, | 357 const string16& icon_path, |
| 345 int icon_index, | 358 int icon_index, |
| 346 uint32 options); | 359 uint32 options); |
| 347 | 360 |
| 348 private: | 361 private: |
| 349 DISALLOW_COPY_AND_ASSIGN(ShellUtil); | 362 DISALLOW_COPY_AND_ASSIGN(ShellUtil); |
| 350 }; | 363 }; |
| 351 | 364 |
| 352 | 365 |
| 353 #endif // CHROME_INSTALLER_UTIL_SHELL_UTIL_H_ | 366 #endif // CHROME_INSTALLER_UTIL_SHELL_UTIL_H_ |
| OLD | NEW |