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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 static const wchar_t* kRegStartMenuInternet; | 47 static const wchar_t* kRegStartMenuInternet; |
48 | 48 |
49 // Relative path of Classes registry entry under which file associations | 49 // Relative path of Classes registry entry under which file associations |
50 // are added on Windows. | 50 // are added on Windows. |
51 static const wchar_t* kRegClasses; | 51 static const wchar_t* kRegClasses; |
52 | 52 |
53 // Relative path of RegisteredApplications registry entry under which | 53 // Relative path of RegisteredApplications registry entry under which |
54 // we add Chrome as a Windows application | 54 // we add Chrome as a Windows application |
55 static const wchar_t* kRegRegisteredApplications; | 55 static const wchar_t* kRegRegisteredApplications; |
56 | 56 |
| 57 // The key path and key name required to register Chrome on Windows such |
| 58 // that it can be launched from Start->Run just by name (chrome.exe). |
| 59 static const wchar_t* kAppPathsRegistryKey; |
| 60 static const wchar_t* kAppPathsRegistryPathName; |
| 61 |
57 // Name that we give to Chrome file association handler ProgId. | 62 // Name that we give to Chrome file association handler ProgId. |
58 static const wchar_t* kChromeHTMLProgId; | 63 static const wchar_t* kChromeHTMLProgId; |
59 | 64 |
60 // Description of Chrome file/URL association handler ProgId. | 65 // Description of Chrome file/URL association handler ProgId. |
61 static const wchar_t* kChromeHTMLProgIdDesc; | 66 static const wchar_t* kChromeHTMLProgIdDesc; |
62 | 67 |
63 // Registry path that stores url associations on Vista. | 68 // Registry path that stores url associations on Vista. |
64 static const wchar_t* kRegVistaUrlPrefs; | 69 static const wchar_t* kRegVistaUrlPrefs; |
65 | 70 |
66 // File extensions that Chrome registers itself for. | 71 // File extensions that Chrome registers itself for. |
67 static const wchar_t* kFileAssociations[]; | 72 static const wchar_t* kFileAssociations[]; |
68 | 73 |
69 // Protocols that Chrome registers itself for. | 74 // Protocols that Chrome registers itself for. |
70 static const wchar_t* kProtocolAssociations[]; | 75 static const wchar_t* kProtocolAssociations[]; |
71 | 76 |
72 // Registry value name that is needed for ChromeHTML ProgId | 77 // Registry value name that is needed for ChromeHTML ProgId |
73 static const wchar_t* kRegUrlProtocol; | 78 static const wchar_t* kRegUrlProtocol; |
74 | 79 |
75 // Name that we give to Chrome extension file association handler ProgId. | 80 // Name that we give to Chrome extension file association handler ProgId. |
76 static const wchar_t* kChromeExtProgId; | 81 static const wchar_t* kChromeExtProgId; |
77 | 82 |
78 // Description of Chrome file/URL association handler ProgId. | 83 // Description of Chrome file/URL association handler ProgId. |
79 static const wchar_t* kChromeExtProgIdDesc; | 84 static const wchar_t* kChromeExtProgIdDesc; |
80 | 85 |
81 // Populate work_item_list with WorkItem entries that will add chrome.exe to | |
82 // the set of App Paths registry keys so that ShellExecute can find it. Note | |
83 // that this is done in HKLM, regardless of whether this is a single-user | |
84 // install or not. For non-admin users, this will fail. | |
85 // chrome_exe: full path to chrome.exe | |
86 // work_item_list: pointer to the WorkItemList that will be populated | |
87 static void AddChromeAppPathWorkItems(const std::wstring& chrome_exe, | |
88 WorkItemList* work_item_list); | |
89 | |
90 // This method adds Chrome to the list that shows up in Add/Remove Programs-> | 86 // This method adds Chrome to the list that shows up in Add/Remove Programs-> |
91 // Set Program Access and Defaults and also creates Chrome ProgIds under | 87 // Set Program Access and Defaults and also creates Chrome ProgIds under |
92 // Software\Classes. This method requires write access to HKLM so is just | 88 // Software\Classes. This method requires write access to HKLM so is just |
93 // best effort deal. If write to HKLM fails and skip_if_not_admin is false, | 89 // best effort deal. If write to HKLM fails and skip_if_not_admin is false, |
94 // this method will: | 90 // this method will: |
95 // - add the ProgId entries to HKCU on XP. HKCU entries will not make | 91 // - add the ProgId entries to HKCU on XP. HKCU entries will not make |
96 // Chrome show in Set Program Access and Defaults but they are still useful | 92 // Chrome show in Set Program Access and Defaults but they are still useful |
97 // because we can make Chrome run when user clicks on http link or html | 93 // because we can make Chrome run when user clicks on http link or html |
98 // file. | 94 // file. |
99 // - will try to launch setup.exe with admin priviledges on Vista to do | 95 // - will try to launch setup.exe with admin priviledges on Vista to do |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 static bool UpdateChromeShortcut(const std::wstring& chrome_exe, | 193 static bool UpdateChromeShortcut(const std::wstring& chrome_exe, |
198 const std::wstring& shortcut, | 194 const std::wstring& shortcut, |
199 bool create_new); | 195 bool create_new); |
200 | 196 |
201 private: | 197 private: |
202 DISALLOW_EVIL_CONSTRUCTORS(ShellUtil); | 198 DISALLOW_EVIL_CONSTRUCTORS(ShellUtil); |
203 }; | 199 }; |
204 | 200 |
205 | 201 |
206 #endif // CHROME_INSTALLER_UTIL_SHELL_UTIL_H__ | 202 #endif // CHROME_INSTALLER_UTIL_SHELL_UTIL_H__ |
207 | |
OLD | NEW |