| 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 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 // level or user level. If value has ShellChange::SYSTEM_LEVEL | 230 // level or user level. If value has ShellChange::SYSTEM_LEVEL |
| 231 // we should be running as admin user. | 231 // we should be running as admin user. |
| 232 // chrome_exe: The chrome.exe path to register as default browser. | 232 // chrome_exe: The chrome.exe path to register as default browser. |
| 233 // elevate_if_not_admin: On Vista if user is not admin, try to elevate for | 233 // elevate_if_not_admin: On Vista if user is not admin, try to elevate for |
| 234 // Chrome registration. | 234 // Chrome registration. |
| 235 static bool MakeChromeDefault(BrowserDistribution* dist, | 235 static bool MakeChromeDefault(BrowserDistribution* dist, |
| 236 int shell_change, | 236 int shell_change, |
| 237 const string16& chrome_exe, | 237 const string16& chrome_exe, |
| 238 bool elevate_if_not_admin); | 238 bool elevate_if_not_admin); |
| 239 | 239 |
| 240 static bool ShowMakeChromeDefaultSystemUI(BrowserDistribution* dist, |
| 241 int shell_change, |
| 242 const string16& chrome_exe, |
| 243 bool elevate_if_not_admin); |
| 244 |
| 240 // Make Chrome the default application for a protocol. | 245 // Make Chrome the default application for a protocol. |
| 241 // chrome_exe: The chrome.exe path to register as default browser. | 246 // chrome_exe: The chrome.exe path to register as default browser. |
| 242 // protocol: The protocol to register as the default handler for. | 247 // protocol: The protocol to register as the default handler for. |
| 243 static bool MakeChromeDefaultProtocolClient(BrowserDistribution* dist, | 248 static bool MakeChromeDefaultProtocolClient(BrowserDistribution* dist, |
| 244 const string16& chrome_exe, | 249 const string16& chrome_exe, |
| 245 const string16& protocol); | 250 const string16& protocol); |
| 246 | 251 |
| 247 // This method adds Chrome to the list that shows up in Add/Remove Programs-> | 252 // This method registers Chrome with Windows (e.g., with "Set Program Access |
| 248 // Set Program Access and Defaults and also creates Chrome ProgIds under | 253 // and Defaults" or "Default Programs", as an http protocol handler, etc.). |
| 249 // Software\Classes. This method requires write access to HKLM so is just | 254 // This method requires write access to HKLM unless this is a user-level |
| 250 // best effort deal. If write to HKLM fails and elevate_if_not_admin is true, | 255 // install on Windows 8 and above. If writing to HKLM fails and |
| 251 // this method will: | 256 // elevate_if_not_admin is true, this method will: |
| 252 // - add the ProgId entries to HKCU on XP. HKCU entries will not make | 257 // - add the ProgId entries to HKCU on XP. HKCU entries will not make |
| 253 // Chrome show in Set Program Access and Defaults but they are still useful | 258 // Chrome show in Set Program Access and Defaults but they are still useful |
| 254 // because we can make Chrome run when user clicks on http link or html | 259 // because we can make Chrome run when user clicks on http link or html |
| 255 // file. | 260 // file. |
| 256 // - will try to launch setup.exe with admin priviledges on Vista to do | 261 // - will try to launch setup.exe with admin privileges on Vista and above to |
| 257 // these tasks. Users will see standard Vista elevation prompt and if they | 262 // do these tasks. Users will see the standard UAC prompt and if they enter |
| 258 // enter the right credentials, the write operation will work. | 263 // the right credentials, the write operation will work. |
| 259 // Currently elevate_if_not_admin is true only when user tries to make Chrome | 264 // Currently elevate_if_not_admin is true only when user tries to make Chrome |
| 260 // default browser (through the UI or through installer options) and Chrome | 265 // default browser (through the UI or through installer options) and Chrome |
| 261 // is not registered on the machine. | 266 // is not registered on the machine. |
| 262 // | 267 // |
| 263 // |chrome_exe| full path to chrome.exe. | 268 // |chrome_exe| full path to chrome.exe. |
| 264 // |unique_suffix| Optional input. If given, this function appends the value | 269 // |unique_suffix| Optional input. If given, this function appends the value |
| 265 // to default browser entries names that it creates in the registry. | 270 // to default browser entries names that it creates in the registry. |
| 266 // |elevate_if_not_admin| if true will make this method try alternate methods | 271 // |elevate_if_not_admin| if true will make this method try alternate methods |
| 267 // as described above. | 272 // as described above. |
| 268 static bool RegisterChromeBrowser(BrowserDistribution* dist, | 273 static bool RegisterChromeBrowser(BrowserDistribution* dist, |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 const string16& icon_path, | 349 const string16& icon_path, |
| 345 int icon_index, | 350 int icon_index, |
| 346 uint32 options); | 351 uint32 options); |
| 347 | 352 |
| 348 private: | 353 private: |
| 349 DISALLOW_COPY_AND_ASSIGN(ShellUtil); | 354 DISALLOW_COPY_AND_ASSIGN(ShellUtil); |
| 350 }; | 355 }; |
| 351 | 356 |
| 352 | 357 |
| 353 #endif // CHROME_INSTALLER_UTIL_SHELL_UTIL_H_ | 358 #endif // CHROME_INSTALLER_UTIL_SHELL_UTIL_H_ |
| OLD | NEW |