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_ |
11 | 11 |
12 #include <windows.h> | 12 #include <windows.h> |
13 | 13 |
14 #include <map> | 14 #include <map> |
15 #include <vector> | 15 #include <vector> |
16 | 16 |
17 #include "base/basictypes.h" | 17 #include "base/basictypes.h" |
18 #include "base/file_path.h" | |
18 #include "base/string16.h" | 19 #include "base/string16.h" |
19 #include "chrome/installer/util/work_item_list.h" | 20 #include "chrome/installer/util/work_item_list.h" |
20 | 21 |
21 class BrowserDistribution; | 22 class BrowserDistribution; |
22 class FilePath; | |
23 | 23 |
24 namespace base { | 24 namespace base { |
25 class DictionaryValue; | 25 class DictionaryValue; |
26 } | 26 } |
27 | 27 |
28 // This is a utility class that provides common shell integration methods | 28 // This is a utility class that provides common shell integration methods |
29 // that can be used by installer as well as Chrome. | 29 // that can be used by installer as well as Chrome. |
30 class ShellUtil { | 30 class ShellUtil { |
31 public: | 31 public: |
32 // Input to any methods that make changes to OS shell. | 32 // Input to any methods that make changes to OS shell. |
33 enum ShellChange { | 33 enum ShellChange { |
34 CURRENT_USER = 0x1, // Make any shell changes only at the user level | 34 CURRENT_USER = 0x1, // Make any shell changes only at the user level |
35 SYSTEM_LEVEL = 0x2 // Make any shell changes only at the system level | 35 SYSTEM_LEVEL = 0x2 // Make any shell changes only at the system level |
36 }; | 36 }; |
37 | 37 |
38 enum VerifyShortcutStatus { | 38 // Typical shortcut directories. Resolved in GetShortcutPath(). |
39 VERIFY_SHORTCUT_SUCCESS = 0, | 39 enum ChromeShortcutLocation { |
40 VERIFY_SHORTCUT_FAILURE_UNEXPECTED, | 40 SHORTCUT_DESKTOP = 0, |
grt (UTC plus 2)
2012/10/02 13:22:30
personal preference: remove " = 0".
gab
2012/10/03 15:14:59
in src/chrome/* 230 instances use " = 0". 474 don'
| |
41 VERIFY_SHORTCUT_FAILURE_PATH, | 41 SHORTCUT_QUICK_LAUNCH, |
42 VERIFY_SHORTCUT_FAILURE_DESCRIPTION, | 42 SHORTCUT_START_MENU, |
43 VERIFY_SHORTCUT_FAILURE_ICON_INDEX, | 43 }; |
44 | |
45 enum ChromeShortcutOperation { | |
46 // Create a new shortcut (overwriting if necessary). | |
47 SHORTCUT_CREATE_ALWAYS = 0, | |
48 // Create the per-user shortcut only if its system-level equivalent is not | |
49 // present on this machine. | |
grt (UTC plus 2)
2012/10/02 13:22:30
" on this machine" is superfluous
gab
2012/10/03 15:14:59
Done.
| |
50 SHORTCUT_CREATE_IF_NO_SYSTEM_LEVEL, | |
51 // Overwrite an existing shortcut (fails if the shortcut doesn't exist). | |
grt (UTC plus 2)
2012/10/02 13:22:30
fails -> fail
gab
2012/10/03 15:14:59
Done.
| |
52 SHORTCUT_REPLACE_EXISTING, | |
53 // Update specified properties only on an existing shortcut. | |
54 SHORTCUT_UPDATE_EXISTING, | |
55 }; | |
56 | |
57 // Properties for Chrome shortcuts. Properties set will be applied to the | |
58 // shortcut on creation/update. On update, non-set properties are ignored; | |
grt (UTC plus 2)
2012/10/02 13:22:30
"non-set" -> "unset" here and below
gab
2012/10/03 15:14:59
Done.
| |
59 // on create non-set properties might have a default value (see individual | |
60 // properties below for details). | |
61 // Callers are encouraged to use the setters provided which take care of | |
62 // setting |options| as desired. | |
63 struct ChromeShortcutProperties { | |
64 enum ChromeIndividualProperties { | |
65 PROPERTIES_TARGET = 1 << 0, | |
66 PROPERTIES_ARGUMENTS = 1 << 1, | |
67 PROPERTIES_DESCRIPTION = 1 << 2, | |
68 PROPERTIES_ICON = 1 << 3, | |
69 PROPERTIES_APP_ID = 1 << 4, | |
70 PROPERTIES_SHORTCUT_NAME = 1 << 5, | |
71 PROPERTIES_DUAL_MODE = 1 << 6, | |
72 }; | |
73 | |
74 ChromeShortcutProperties() | |
75 : options(0U), system_level(false), pin_to_taskbar(false) {} | |
grt (UTC plus 2)
2012/10/02 13:22:30
be sure to list all members of POD type, and alway
gab
2012/10/03 15:14:59
Done.
| |
76 | |
77 void set_target(const FilePath& target_in) { | |
78 target = target_in; | |
79 options |= PROPERTIES_TARGET; | |
80 } | |
81 | |
82 void set_arguments(const string16& arguments_in) { | |
83 arguments = arguments_in; | |
84 options |= PROPERTIES_ARGUMENTS; | |
85 } | |
86 | |
87 void set_description(const string16& description_in) { | |
88 description = description_in; | |
89 options |= PROPERTIES_DESCRIPTION; | |
90 } | |
91 | |
92 void set_icon(const FilePath& icon_in) { | |
93 icon = icon_in; | |
94 options |= PROPERTIES_ICON; | |
95 } | |
96 | |
97 void set_app_id(const string16& app_id_in) { | |
98 app_id = app_id_in; | |
99 options |= PROPERTIES_APP_ID; | |
100 } | |
101 | |
102 void set_shortcut_name(const string16& shortcut_name_in) { | |
103 shortcut_name = shortcut_name_in; | |
104 options |= PROPERTIES_SHORTCUT_NAME; | |
105 } | |
106 | |
107 void set_dual_mode(bool dual_mode_in) { | |
108 dual_mode = dual_mode_in; | |
109 options |= PROPERTIES_DUAL_MODE; | |
110 } | |
111 | |
112 void set_system_level(bool system_level_in) { | |
113 system_level = system_level_in; | |
114 } | |
115 | |
116 void set_pin_to_taskbar(bool pin_to_taskbar_in) { | |
117 pin_to_taskbar = pin_to_taskbar_in; | |
118 } | |
119 | |
120 // The target to launch from this shortcut. This is mandatory when creating | |
grt (UTC plus 2)
2012/10/02 13:22:30
since callers are expected to use the functions, i
gab
2012/10/03 15:14:59
Ya I was also debating doing that, makes sense, do
| |
121 // a shortcut. | |
122 FilePath target; | |
123 // The arguments to be passed to |target| when launching from this shortcut. | |
124 // The length of this string must be less than MAX_PATH. | |
125 string16 arguments; | |
126 // The localized description of the shortcut. If this is not set, the | |
grt (UTC plus 2)
2012/10/02 13:22:30
I think it's nice if the same language is used to
gab
2012/10/03 15:14:59
Agreed, I'll switch to use a specific syntax for e
| |
127 // shortcut is being created, and |target| is chrome.exe, this defaults to | |
128 // the default description for the current distribution. | |
129 // The length of this string must be less than MAX_PATH. | |
130 string16 description; | |
131 // The path to the icon. If this is not set and the shortcut is being | |
132 // created, this defaults to |target| (and if |target| is chrome.exe, the | |
133 // icon's index is determined from master preferences if defined there; | |
134 // otherwise the default icon index for the current distribution is used). | |
135 FilePath icon; | |
136 // The app model id for the shortcut (Win7+). If this is not set, the | |
137 // shortcut is being created, and |target| is chrome.exe, this defaults to | |
138 // the appid for the current distribution. | |
139 string16 app_id; | |
140 // If set, the shortcut's name will be forced to this. By default the | |
141 // shortcut's name is the current distribution's GetAppShortcutName(). | |
142 // The ".lnk" extension will automatically be added to this name. | |
143 string16 shortcut_name; | |
144 // Whether this is a dual mode shortcut (Win8+). | |
145 bool dual_mode; | |
146 // Whether the system-level variant of this shortcut should be installed | |
147 // (the default being to otherwise install the per-user variant of this | |
148 // shortcut). | |
149 // Note: This property doesn't have a mask in |options| as it is always | |
150 // required. It defaults to false. | |
151 bool system_level; | |
152 // Whether to pin this shortcut to the taskbar after creating it (ignored if | |
153 // the shortcut is only being updated). | |
154 // Note: This property doesn't have a mask in |options|. It is only | |
155 // acknowledged if set to true when creating the shortcut on Windows 7+. | |
156 bool pin_to_taskbar; | |
157 // Bitfield made of IndividualProperties. Properties set in |options| will | |
158 // be used to create the shortcut, others will be ignored. | |
159 uint32 options; | |
44 }; | 160 }; |
45 | 161 |
46 // Relative path of the URL Protocol registry entry (prefixed with '\'). | 162 // Relative path of the URL Protocol registry entry (prefixed with '\'). |
47 static const wchar_t* kRegURLProtocol; | 163 static const wchar_t* kRegURLProtocol; |
48 | 164 |
49 // Relative path of DefaultIcon registry entry (prefixed with '\'). | 165 // Relative path of DefaultIcon registry entry (prefixed with '\'). |
50 static const wchar_t* kRegDefaultIcon; | 166 static const wchar_t* kRegDefaultIcon; |
51 | 167 |
52 // Relative path of "shell" registry key. | 168 // Relative path of "shell" registry key. |
53 static const wchar_t* kRegShellPath; | 169 static const wchar_t* kRegShellPath; |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
135 // Registry value name for the OpenWithProgids entry for file associations. | 251 // Registry value name for the OpenWithProgids entry for file associations. |
136 static const wchar_t* kRegOpenWithProgids; | 252 static const wchar_t* kRegOpenWithProgids; |
137 | 253 |
138 // Returns true if |chrome_exe| is registered in HKLM with |suffix|. | 254 // Returns true if |chrome_exe| is registered in HKLM with |suffix|. |
139 // Note: This only checks one deterministic key in HKLM for |chrome_exe| and | 255 // Note: This only checks one deterministic key in HKLM for |chrome_exe| and |
140 // doesn't otherwise validate a full Chrome install in HKLM. | 256 // doesn't otherwise validate a full Chrome install in HKLM. |
141 static bool QuickIsChromeRegisteredInHKLM(BrowserDistribution* dist, | 257 static bool QuickIsChromeRegisteredInHKLM(BrowserDistribution* dist, |
142 const string16& chrome_exe, | 258 const string16& chrome_exe, |
143 const string16& suffix); | 259 const string16& suffix); |
144 | 260 |
145 // Creates Chrome shortcut on the Desktop. | 261 // Sets |path| to the path for a shortcut at the |location| desired at |
262 // |system_level| or not. | |
263 // Returns false on failure (in which case |path| shouldn't to be trusted). | |
grt (UTC plus 2)
2012/10/02 13:22:30
does the "trust" statement mean that |path| might
gab
2012/10/03 15:14:59
This used to be the case, but no longer is, removi
| |
264 static bool GetShortcutPath(ChromeShortcutLocation location, | |
265 BrowserDistribution* dist, | |
266 bool system_level, | |
267 FilePath* path); | |
268 | |
269 // Updates Chrome shortcut in |location| (or creates it if |options| specify | |
270 // SHORTCUT_CREATE_ALWAYS). | |
146 // |dist| gives the type of browser distribution currently in use. | 271 // |dist| gives the type of browser distribution currently in use. |
147 // |chrome_exe| provides the target path information. | 272 // |exe_path| provides the target path information. |
148 // |description| provides the shortcut's "comment" property. | 273 // |description| provides the shortcut's "comment" property. |
149 // |appended_name| provides a string to be appended to the distribution name, | 274 // |appended_name| provides a string to be appended to the distribution name |
grt (UTC plus 2)
2012/10/02 13:22:30
while you're changing this, how about:
// |appende
gab
2012/10/03 15:14:59
Oops, this description was out of date, this metho
| |
150 // and can be the empty string. | 275 // and can be the empty string. |
151 // |arguments| gives a set of arguments to be passed to the executable. | 276 // |arguments| gives a set of arguments to be passed to the executable. |
152 // |icon_path| provides the path to the icon file to use. | 277 // |icon_path| provides the path to the icon file to use. |
153 // |icon_index| provides the index of the icon within the provided icon file. | 278 // |icon_index| provides the index of the icon within the provided icon file. |
154 // If |shell_change| is CURRENT_USER, the shortcut is created in the | 279 // If |icon_path| is |exe_path| and |exe_path| points to chrome.exe: |
155 // Desktop folder of current user's profile. | 280 // |icon_index is overriden with the master preferences value. |
156 // If |shell_change| is SYSTEM_LEVEL, the shortcut is created in the | |
157 // Desktop folder of the "All Users" profile. | |
158 // |options|: bitfield for which the options come from ChromeShortcutOptions. | 281 // |options|: bitfield for which the options come from ChromeShortcutOptions. |
282 // If SHORTCUT_CREATE_ALWAYS is not set in |options|, only specified (non- | |
283 // empty) properties on an existing shortcut will be modified. If the shortcut | |
284 // does not exist, this method is a no-op and returns false. | |
159 // Returns true iff the method causes a shortcut to be created / updated. | 285 // Returns true iff the method causes a shortcut to be created / updated. |
160 static bool CreateChromeDesktopShortcut(BrowserDistribution* dist, | 286 static bool CreateOrUpdateChromeShortcut( |
161 const string16& chrome_exe, | 287 ChromeShortcutLocation location, |
162 const string16& description, | 288 BrowserDistribution* dist, |
163 const string16& appended_name, | 289 const ChromeShortcutProperties& properties, |
164 const string16& arguments, | 290 ChromeShortcutOperation operation); |
165 const string16& icon_path, | |
166 int icon_index, | |
167 ShellChange shell_change, | |
168 uint32 options); | |
169 | |
170 // Create Chrome shortcut on Quick Launch Bar. | |
171 // If shell_change is CURRENT_USER, the shortcut is created in the | |
172 // Quick Launch folder of current user's profile. | |
173 // If shell_change is SYSTEM_LEVEL, the shortcut is created in the | |
174 // Quick Launch folder of "Default User" profile. This will make sure | |
175 // that this shortcut will be seen by all the new users logging into the | |
176 // system. | |
177 // |options|: bitfield for which the options come from ChromeShortcutOptions. | |
178 static bool CreateChromeQuickLaunchShortcut(BrowserDistribution* dist, | |
179 const string16& chrome_exe, | |
180 int shell_change, | |
181 uint32 options); | |
182 | 291 |
183 // This method appends the Chrome icon index inside chrome.exe to the | 292 // This method appends the Chrome icon index inside chrome.exe to the |
184 // chrome.exe path passed in as input, to generate the full path for | 293 // chrome.exe path passed in as input, to generate the full path for |
185 // Chrome icon that can be used as value for Windows registry keys. | 294 // Chrome icon that can be used as value for Windows registry keys. |
186 // |chrome_exe| full path to chrome.exe. | 295 // |chrome_exe| full path to chrome.exe. |
187 static string16 GetChromeIcon(BrowserDistribution* dist, | 296 static string16 GetChromeIcon(BrowserDistribution* dist, |
188 const string16& chrome_exe); | 297 const string16& chrome_exe); |
189 | 298 |
190 // This method returns the command to open URLs/files using chrome. Typically | 299 // This method returns the command to open URLs/files using chrome. Typically |
191 // this command is written to the registry under shell\open\command key. | 300 // this command is written to the registry under shell\open\command key. |
192 // |chrome_exe|: the full path to chrome.exe | 301 // |chrome_exe|: the full path to chrome.exe |
193 static string16 GetChromeShellOpenCmd(const string16& chrome_exe); | 302 static string16 GetChromeShellOpenCmd(const string16& chrome_exe); |
194 | 303 |
195 // This method returns the command to be called by the DelegateExecute verb | 304 // This method returns the command to be called by the DelegateExecute verb |
196 // handler to launch chrome on Windows 8. Typically this command is written to | 305 // handler to launch chrome on Windows 8. Typically this command is written to |
197 // the registry under the HKCR\Chrome\.exe\shell\(open|run)\command key. | 306 // the registry under the HKCR\Chrome\.exe\shell\(open|run)\command key. |
198 // |chrome_exe|: the full path to chrome.exe | 307 // |chrome_exe|: the full path to chrome.exe |
199 static string16 GetChromeDelegateCommand(const string16& chrome_exe); | 308 static string16 GetChromeDelegateCommand(const string16& chrome_exe); |
200 | 309 |
201 // Returns the localized name of Chrome shortcut in |shortcut|. If | |
202 // |appended_name| is not empty, it is included in the shortcut name. If | |
203 // |alternate| is true, a second localized text that is better suited for | |
204 // certain scenarios is used. | |
205 static bool GetChromeShortcutName(BrowserDistribution* dist, | |
206 bool alternate, | |
207 const string16& appended_name, | |
208 string16* shortcut); | |
209 | |
210 // Gets the desktop path for the current user or all users (if system_level | |
211 // is true) and returns it in 'path' argument. Return true if successful, | |
212 // otherwise returns false. | |
213 static bool GetDesktopPath(bool system_level, FilePath* path); | |
214 | |
215 // Gets the Quick Launch shortcuts path for the current user and | |
216 // returns it in 'path' argument. Return true if successful, otherwise | |
217 // returns false. If system_level is true this function returns the path | |
218 // to Default Users Quick Launch shortcuts path. Adding a shortcut to Default | |
219 // User's profile only affects any new user profiles (not existing ones). | |
220 static bool GetQuickLaunchPath(bool system_level, FilePath* path); | |
221 | |
222 // Gets a mapping of all registered browser names (excluding browsers in the | 310 // Gets a mapping of all registered browser names (excluding browsers in the |
223 // |dist| distribution) and their reinstall command (which usually sets | 311 // |dist| distribution) and their reinstall command (which usually sets |
224 // browser as default). | 312 // browser as default). |
225 // Given browsers can be registered in HKCU (as of Win7) and/or in HKLM, this | 313 // Given browsers can be registered in HKCU (as of Win7) and/or in HKLM, this |
226 // method looks in both and gives precedence to values in HKCU as per the msdn | 314 // method looks in both and gives precedence to values in HKCU as per the msdn |
227 // standard: http://goo.gl/xjczJ. | 315 // standard: http://goo.gl/xjczJ. |
228 static void GetRegisteredBrowsers(BrowserDistribution* dist, | 316 static void GetRegisteredBrowsers(BrowserDistribution* dist, |
229 std::map<string16, string16>* browsers); | 317 std::map<string16, string16>* browsers); |
230 | 318 |
231 // Returns the suffix this user's Chrome install is registered with. | 319 // Returns the suffix this user's Chrome install is registered with. |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
371 // to default browser entries names that it creates in the registry. | 459 // to default browser entries names that it creates in the registry. |
372 // |protocol| The protocol to register as being capable of handling.s | 460 // |protocol| The protocol to register as being capable of handling.s |
373 // |elevate_if_not_admin| if true will make this method try alternate methods | 461 // |elevate_if_not_admin| if true will make this method try alternate methods |
374 // as described above. | 462 // as described above. |
375 static bool RegisterChromeForProtocol(BrowserDistribution* dist, | 463 static bool RegisterChromeForProtocol(BrowserDistribution* dist, |
376 const string16& chrome_exe, | 464 const string16& chrome_exe, |
377 const string16& unique_suffix, | 465 const string16& unique_suffix, |
378 const string16& protocol, | 466 const string16& protocol, |
379 bool elevate_if_not_admin); | 467 bool elevate_if_not_admin); |
380 | 468 |
381 // Remove Chrome shortcut from Desktop. | 469 // Removes installed Chrome shortcut at |location|. |
382 // If |shell_change| is CURRENT_USER, the shortcut is removed from the | 470 // |properties|: Only properties.system_level and properties.shortcut_name are |
grt (UTC plus 2)
2012/10/02 13:22:30
i think system_level and shortcut_name should be p
gab
2012/10/03 15:14:59
Done, I was using properties to avoid having NULLs
| |
383 // Desktop folder of current user's profile. | 471 // relevant for this method. |
384 // If |shell_change| is SYSTEM_LEVEL, the shortcut is removed from the | 472 // Also attempts to unpin the removed shortcut from the taskbar. |
385 // Desktop folder of "All Users" profile. | 473 // Returns true unless an unexpected failure occurs (i.e. returns true even if |
386 // |options|: bitfield for which the options come from ChromeShortcutOptions. | 474 // not shortcut is found at that location). |
387 // Only SHORTCUT_ALTERNATE is a valid option for this function. | 475 static bool RemoveChromeShortcut( |
388 static bool RemoveChromeDesktopShortcut(BrowserDistribution* dist, | 476 ChromeShortcutLocation location, |
389 int shell_change, | 477 BrowserDistribution* dist, |
390 uint32 options); | 478 const ChromeShortcutProperties& properties); |
391 | |
392 // Removes a set of existing Chrome desktop shortcuts. |appended_names| is a | |
393 // list of shortcut file names as obtained from | |
394 // ShellUtil::GetChromeShortcutName. | |
395 static bool RemoveChromeDesktopShortcutsWithAppendedNames( | |
396 const std::vector<string16>& appended_names); | |
397 | |
398 // Remove Chrome shortcut from Quick Launch Bar. | |
399 // If shell_change is CURRENT_USER, the shortcut is removed from | |
400 // the Quick Launch folder of current user's profile. | |
401 // If shell_change is SYSTEM_LEVEL, the shortcut is removed from | |
402 // the Quick Launch folder of "Default User" profile. | |
403 static bool RemoveChromeQuickLaunchShortcut(BrowserDistribution* dist, | |
404 int shell_change); | |
405 | 479 |
406 // This will remove all secondary tiles from the start screen for |dist|. | 480 // This will remove all secondary tiles from the start screen for |dist|. |
407 static void RemoveChromeStartScreenShortcuts(BrowserDistribution* dist, | 481 static void RemoveChromeStartScreenShortcuts(BrowserDistribution* dist, |
408 const string16& chrome_exe); | 482 const string16& chrome_exe); |
409 | 483 |
410 enum ChromeShortcutOptions { | |
411 SHORTCUT_NO_OPTIONS = 0, | |
412 // Set DualMode property for Windows 8 Metro-enabled shortcuts. | |
413 SHORTCUT_DUAL_MODE = 1 << 0, | |
414 // Create a new shortcut (overwriting if necessary). | |
415 SHORTCUT_CREATE_ALWAYS = 1 << 1, | |
416 // Use an alternate application name for the shortcut (e.g. "The Internet"). | |
417 // This option is only applied to the Desktop shortcut. | |
418 SHORTCUT_ALTERNATE = 1 << 2, | |
419 }; | |
420 | |
421 // Updates shortcut (or creates a new shortcut) at destination given by | |
422 // shortcut to a target given by chrome_exe. The arguments are given by | |
423 // |arguments| for the target and icon is set based on |icon_path| and | |
424 // |icon_index|. If create_new is set to true, the function will create a new | |
425 // shortcut if it doesn't exist. | |
426 // |options|: bitfield for which the options come from ChromeShortcutOptions. | |
427 // If SHORTCUT_CREATE_ALWAYS is not set in |options|, only specified (non- | |
428 // null) properties on an existing shortcut will be modified. If the shortcut | |
429 // does not exist, this method is a no-op and returns false. | |
430 static bool UpdateChromeShortcut(BrowserDistribution* dist, | |
431 const string16& chrome_exe, | |
432 const string16& shortcut, | |
433 const string16& arguments, | |
434 const string16& description, | |
435 const string16& icon_path, | |
436 int icon_index, | |
437 uint32 options); | |
438 | |
439 // Sets |suffix| to the base 32 encoding of the md5 hash of this user's sid | 484 // Sets |suffix| to the base 32 encoding of the md5 hash of this user's sid |
440 // preceded by a dot. | 485 // preceded by a dot. |
441 // This is guaranteed to be unique on the machine and 27 characters long | 486 // This is guaranteed to be unique on the machine and 27 characters long |
442 // (including the '.'). | 487 // (including the '.'). |
443 // This suffix is then meant to be added to all registration that may conflict | 488 // This suffix is then meant to be added to all registration that may conflict |
444 // with another user-level Chrome install. | 489 // with another user-level Chrome install. |
445 // Note that prior to Chrome 21, the suffix registered used to be the user's | 490 // Note that prior to Chrome 21, the suffix registered used to be the user's |
446 // username (see GetOldUserSpecificRegistrySuffix() below). We still honor old | 491 // username (see GetOldUserSpecificRegistrySuffix() below). We still honor old |
447 // installs registered that way, but it was wrong because some of the | 492 // installs registered that way, but it was wrong because some of the |
448 // characters allowed in a username are not allowed in a ProgId. | 493 // characters allowed in a username are not allowed in a ProgId. |
(...skipping 16 matching lines...) Expand all Loading... | |
465 // required by the base32 standard for inputs that aren't a multiple of 5 | 510 // required by the base32 standard for inputs that aren't a multiple of 5 |
466 // bytes. | 511 // bytes. |
467 static string16 ByteArrayToBase32(const uint8* bytes, size_t size); | 512 static string16 ByteArrayToBase32(const uint8* bytes, size_t size); |
468 | 513 |
469 private: | 514 private: |
470 DISALLOW_COPY_AND_ASSIGN(ShellUtil); | 515 DISALLOW_COPY_AND_ASSIGN(ShellUtil); |
471 }; | 516 }; |
472 | 517 |
473 | 518 |
474 #endif // CHROME_INSTALLER_UTIL_SHELL_UTIL_H_ | 519 #endif // CHROME_INSTALLER_UTIL_SHELL_UTIL_H_ |
OLD | NEW |