| 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 295 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 // Shows to the user a system dialog where Chrome can be set as the |
| 317 // default handler for the given protocol. This is intended for Windows 8 |
| 318 // and above only. This is a blocking call. |
| 319 // |
| 320 // |dist| gives the type of browser distribution currently in use. |
| 321 // |chrome_exe| The chrome.exe path to register as default browser. |
| 322 // |protocol| is the protocol being registered. |
| 323 static bool ShowMakeChromeDefaultProtocolClientSystemUI( |
| 324 BrowserDistribution* dist, |
| 325 const string16& chrome_exe, |
| 326 const string16& protocol); |
| 327 |
| 316 // Registers Chrome as a potential default browser and handler for filetypes | 328 // Registers Chrome as a potential default browser and handler for filetypes |
| 317 // and protocols. | 329 // and protocols. |
| 318 // If Chrome is already registered, this method is a no-op. | 330 // 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 | 331 // This method requires write access to HKLM (prior to Win8) so is just a |
| 320 // best effort deal. | 332 // best effort deal. |
| 321 // If write to HKLM is required, but fails, and: | 333 // If write to HKLM is required, but fails, and: |
| 322 // - |elevate_if_not_admin| is true (and OS is Vista or above): | 334 // - |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 | 335 // tries to launch setup.exe with admin priviledges (by prompting the user |
| 324 // with a UAC) to do these tasks. | 336 // with a UAC) to do these tasks. |
| 325 // - |elevate_if_not_admin| is false (or OS is XP): | 337 // - |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 | 465 // required by the base32 standard for inputs that aren't a multiple of 5 |
| 454 // bytes. | 466 // bytes. |
| 455 static string16 ByteArrayToBase32(const uint8* bytes, size_t size); | 467 static string16 ByteArrayToBase32(const uint8* bytes, size_t size); |
| 456 | 468 |
| 457 private: | 469 private: |
| 458 DISALLOW_COPY_AND_ASSIGN(ShellUtil); | 470 DISALLOW_COPY_AND_ASSIGN(ShellUtil); |
| 459 }; | 471 }; |
| 460 | 472 |
| 461 | 473 |
| 462 #endif // CHROME_INSTALLER_UTIL_SHELL_UTIL_H_ | 474 #endif // CHROME_INSTALLER_UTIL_SHELL_UTIL_H_ |
| OLD | NEW |