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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
235 const string16& chrome_exe); | 235 const string16& chrome_exe); |
236 | 236 |
237 // Returns the application name of the program under |dist|. | 237 // Returns the application name of the program under |dist|. |
238 // This application name will be suffixed as is appropriate for the current | 238 // This application name will be suffixed as is appropriate for the current |
239 // install. | 239 // install. |
240 // This is the name that is registered with Default Programs on Windows and | 240 // This is the name that is registered with Default Programs on Windows and |
241 // that should thus be used to "make chrome default" and such. | 241 // that should thus be used to "make chrome default" and such. |
242 static string16 GetApplicationName(BrowserDistribution* dist, | 242 static string16 GetApplicationName(BrowserDistribution* dist, |
243 const string16& chrome_exe); | 243 const string16& chrome_exe); |
244 | 244 |
245 // Returns the appid of the program under |dist|. | |
grt (UTC plus 2)
2012/06/15 03:03:03
How about:
// Returns the AppUserModelID for |dist
gab
2012/06/15 19:01:04
Done.
| |
246 // This appid will *always* be suffixed for user-level installs. | |
grt (UTC plus 2)
2012/06/15 03:03:03
please avoid *bold* in comments (blink tag is okay
gab
2012/06/15 19:01:04
<blink>Done.</blink>
| |
247 // NOTE: This is different from ApplicationName and ChromeHTML which are | |
248 // *only* suffixed if the current installation is suffixed. | |
249 // This is the name under which Chrome is known as in the Windows shell | |
250 // environment. | |
251 static string16 GetAppId(BrowserDistribution* dist, | |
252 const string16& chrome_exe); | |
253 | |
245 // Make Chrome the default browser. This function works by going through | 254 // Make Chrome the default browser. This function works by going through |
246 // the url protocols and file associations that are related to general | 255 // the url protocols and file associations that are related to general |
247 // browsing, e.g. http, https, .html etc., and requesting to become the | 256 // browsing, e.g. http, https, .html etc., and requesting to become the |
248 // default handler for each. If any of these fails the operation will return | 257 // default handler for each. If any of these fails the operation will return |
249 // false to indicate failure, which is consistent with the return value of | 258 // false to indicate failure, which is consistent with the return value of |
250 // ShellIntegration::IsDefaultBrowser. | 259 // ShellIntegration::IsDefaultBrowser. |
251 // | 260 // |
252 // In the case of failure any successful changes will be left, however no | 261 // In the case of failure any successful changes will be left, however no |
253 // more changes will be attempted. | 262 // more changes will be attempted. |
254 // TODO(benwells): Attempt to undo any changes that were successfully made. | 263 // TODO(benwells): Attempt to undo any changes that were successfully made. |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
370 // Use an alternate, localized, application name for the shortcut. | 379 // Use an alternate, localized, application name for the shortcut. |
371 SHORTCUT_ALTERNATE = 1 << 2, | 380 SHORTCUT_ALTERNATE = 1 << 2, |
372 }; | 381 }; |
373 | 382 |
374 // Updates shortcut (or creates a new shortcut) at destination given by | 383 // Updates shortcut (or creates a new shortcut) at destination given by |
375 // shortcut to a target given by chrome_exe. The arguments are given by | 384 // shortcut to a target given by chrome_exe. The arguments are given by |
376 // |arguments| for the target and icon is set based on |icon_path| and | 385 // |arguments| for the target and icon is set based on |icon_path| and |
377 // |icon_index|. If create_new is set to true, the function will create a new | 386 // |icon_index|. If create_new is set to true, the function will create a new |
378 // shortcut if it doesn't exist. | 387 // shortcut if it doesn't exist. |
379 // |options|: bitfield for which the options come from ChromeShortcutOptions. | 388 // |options|: bitfield for which the options come from ChromeShortcutOptions. |
389 // This method should only be called after Chrome is registered. | |
grt (UTC plus 2)
2012/06/15 03:03:03
why? because of the DCHECK, or is there a fundame
gab
2012/06/15 19:01:04
This was before we decided to always suffix the ap
| |
380 static bool UpdateChromeShortcut(BrowserDistribution* dist, | 390 static bool UpdateChromeShortcut(BrowserDistribution* dist, |
381 const string16& chrome_exe, | 391 const string16& chrome_exe, |
382 const string16& shortcut, | 392 const string16& shortcut, |
383 const string16& arguments, | 393 const string16& arguments, |
384 const string16& description, | 394 const string16& description, |
385 const string16& icon_path, | 395 const string16& icon_path, |
386 int icon_index, | 396 int icon_index, |
387 uint32 options); | 397 uint32 options); |
388 | 398 |
389 private: | 399 private: |
390 DISALLOW_COPY_AND_ASSIGN(ShellUtil); | 400 DISALLOW_COPY_AND_ASSIGN(ShellUtil); |
391 }; | 401 }; |
392 | 402 |
393 | 403 |
394 #endif // CHROME_INSTALLER_UTIL_SHELL_UTIL_H_ | 404 #endif // CHROME_INSTALLER_UTIL_SHELL_UTIL_H_ |
OLD | NEW |