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 |
|
grt (UTC plus 2)
2012/09/20 13:10:13
Please put the '.' back at the end of this line.
benwells
2012/09/21 01:15:20
Done.
| |
| 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_ |
| 11 | 11 |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 306 static bool ShowMakeChromeDefaultSystemUI(BrowserDistribution* dist, | 306 static bool ShowMakeChromeDefaultSystemUI(BrowserDistribution* dist, |
| 307 const string16& chrome_exe); | 307 const string16& chrome_exe); |
| 308 | 308 |
| 309 // Make Chrome the default application for a protocol. | 309 // Make Chrome the default application for a protocol. |
| 310 // chrome_exe: The chrome.exe path to register as default browser. | 310 // chrome_exe: The chrome.exe path to register as default browser. |
| 311 // protocol: The protocol to register as the default handler for. | 311 // protocol: The protocol to register as the default handler for. |
| 312 static bool MakeChromeDefaultProtocolClient(BrowserDistribution* dist, | 312 static bool MakeChromeDefaultProtocolClient(BrowserDistribution* dist, |
| 313 const string16& chrome_exe, | 313 const string16& chrome_exe, |
| 314 const string16& protocol); | 314 const string16& protocol); |
| 315 | 315 |
| 316 | |
| 317 // Shows to the user a system dialog where Chrome can be set as the | |
| 318 // default handler for the given protocol. This is intended for Windows 8 | |
| 319 // and above only. This is a blocking call. | |
| 320 // | |
| 321 // |dist| gives the type of browser distribution currently in use. | |
| 322 // |chrome_exe| The chrome.exe path to register as default browser. | |
| 323 // |protocol| is the protocol being registered. | |
| 324 static bool ShowMakeChromeDefaultProtocolClientSystemUI( | |
| 325 BrowserDistribution* dist, | |
| 326 const string16& chrome_exe, | |
| 327 const string16& protocol); | |
| 328 | |
| 316 // Registers Chrome as a potential default browser and handler for filetypes | 329 // Registers Chrome as a potential default browser and handler for filetypes |
| 317 // and protocols. | 330 // and protocols. |
| 318 // If Chrome is already registered, this method is a no-op. | 331 // If Chrome is already registered, this method is a no-op. |
| 319 // This method requires write access to HKLM (prior to Win8) so is just a | 332 // This method requires write access to HKLM (prior to Win8) so is just a |
| 320 // best effort deal. | 333 // best effort deal. |
| 321 // If write to HKLM is required, but fails, and: | 334 // If write to HKLM is required, but fails, and: |
| 322 // - |elevate_if_not_admin| is true (and OS is Vista or above): | 335 // - |elevate_if_not_admin| is true (and OS is Vista or above): |
| 323 // tries to launch setup.exe with admin priviledges (by prompting the user | 336 // tries to launch setup.exe with admin priviledges (by prompting the user |
| 324 // with a UAC) to do these tasks. | 337 // with a UAC) to do these tasks. |
| 325 // - |elevate_if_not_admin| is false (or OS is XP): | 338 // - |elevate_if_not_admin| is false (or OS is XP): |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 453 // required by the base32 standard for inputs that aren't a multiple of 5 | 466 // required by the base32 standard for inputs that aren't a multiple of 5 |
| 454 // bytes. | 467 // bytes. |
| 455 static string16 ByteArrayToBase32(const uint8* bytes, size_t size); | 468 static string16 ByteArrayToBase32(const uint8* bytes, size_t size); |
| 456 | 469 |
| 457 private: | 470 private: |
| 458 DISALLOW_COPY_AND_ASSIGN(ShellUtil); | 471 DISALLOW_COPY_AND_ASSIGN(ShellUtil); |
| 459 }; | 472 }; |
| 460 | 473 |
| 461 | 474 |
| 462 #endif // CHROME_INSTALLER_UTIL_SHELL_UTIL_H_ | 475 #endif // CHROME_INSTALLER_UTIL_SHELL_UTIL_H_ |
| OLD | NEW |