| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 | 65 |
| 66 // File extensions that Chrome registers itself for. | 66 // File extensions that Chrome registers itself for. |
| 67 static const wchar_t* kFileAssociations[]; | 67 static const wchar_t* kFileAssociations[]; |
| 68 | 68 |
| 69 // Protocols that Chrome registers itself for. | 69 // Protocols that Chrome registers itself for. |
| 70 static const wchar_t* kProtocolAssociations[]; | 70 static const wchar_t* kProtocolAssociations[]; |
| 71 | 71 |
| 72 // Registry value name that is needed for ChromeHTML ProgId | 72 // Registry value name that is needed for ChromeHTML ProgId |
| 73 static const wchar_t* kRegUrlProtocol; | 73 static const wchar_t* kRegUrlProtocol; |
| 74 | 74 |
| 75 // Populate work_item_list with WorkItem entries that will add chrome.exe to |
| 76 // the set of App Paths registry keys so that ShellExecute can find it. Note |
| 77 // that this is done in HKLM, regardless of whether this is a single-user |
| 78 // install or not. For non-admin users, this will fail. |
| 79 // chrome_exe: full path to chrome.exe |
| 80 // work_item_list: pointer to the WorkItemList that will be populated |
| 81 static void AddChromeAppPathWorkItems(const std::wstring& chrome_exe, |
| 82 WorkItemList* work_item_list); |
| 83 |
| 75 // This method adds Chrome to the list that shows up in Add/Remove Programs-> | 84 // This method adds Chrome to the list that shows up in Add/Remove Programs-> |
| 76 // Set Program Access and Defaults and also creates Chrome ProgIds under | 85 // Set Program Access and Defaults and also creates Chrome ProgIds under |
| 77 // Software\Classes. This method requires write access to HKLM so is just | 86 // Software\Classes. This method requires write access to HKLM so is just |
| 78 // best effort deal. If write to HKLM fails and skip_if_not_admin is false, | 87 // best effort deal. If write to HKLM fails and skip_if_not_admin is false, |
| 79 // this method will: | 88 // this method will: |
| 80 // - add the ProgId entries to HKCU on XP. HKCU entries will not make | 89 // - add the ProgId entries to HKCU on XP. HKCU entries will not make |
| 81 // Chrome show in Set Program Access and Defaults but they are still useful | 90 // Chrome show in Set Program Access and Defaults but they are still useful |
| 82 // because we can make Chrome run when user clicks on http link or html | 91 // because we can make Chrome run when user clicks on http link or html |
| 83 // file. | 92 // file. |
| 84 // - will try to launch setup.exe with admin priviledges on Vista to do | 93 // - will try to launch setup.exe with admin priviledges on Vista to do |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 static bool RemoveChromeQuickLaunchShortcut(int shell_change); | 179 static bool RemoveChromeQuickLaunchShortcut(int shell_change); |
| 171 | 180 |
| 172 // Updates shortcut (or creates a new shortcut) at destination given by | 181 // Updates shortcut (or creates a new shortcut) at destination given by |
| 173 // shortcut to a target given by chrome_exe. The arguments is left NULL | 182 // shortcut to a target given by chrome_exe. The arguments is left NULL |
| 174 // for the target and icon is set as icon at index 0 from exe. | 183 // for the target and icon is set as icon at index 0 from exe. |
| 175 // If create_new is set to true, the function will create a new shortcut if | 184 // If create_new is set to true, the function will create a new shortcut if |
| 176 // if doesn't exist. | 185 // if doesn't exist. |
| 177 static bool UpdateChromeShortcut(const std::wstring& chrome_exe, | 186 static bool UpdateChromeShortcut(const std::wstring& chrome_exe, |
| 178 const std::wstring& shortcut, | 187 const std::wstring& shortcut, |
| 179 bool create_new); | 188 bool create_new); |
| 189 |
| 180 private: | 190 private: |
| 181 DISALLOW_EVIL_CONSTRUCTORS(ShellUtil); | 191 DISALLOW_EVIL_CONSTRUCTORS(ShellUtil); |
| 182 }; | 192 }; |
| 183 | 193 |
| 184 | 194 |
| 185 #endif // CHROME_INSTALLER_UTIL_SHELL_UTIL_H__ | 195 #endif // CHROME_INSTALLER_UTIL_SHELL_UTIL_H__ |
| 186 | 196 |
| OLD | NEW |