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 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
518 // their target is |target_exe|. | 518 // their target is |target_exe|. |
519 // If |location| is SHORTCUT_LOCATION_START_MENU, the shortcut folder specific | 519 // If |location| is SHORTCUT_LOCATION_START_MENU, the shortcut folder specific |
520 // to |dist| is deleted. | 520 // to |dist| is deleted. |
521 // Returns true if all shortcuts pointing to |target_exe| are successfully | 521 // Returns true if all shortcuts pointing to |target_exe| are successfully |
522 // deleted, including the case where no such shortcuts are found. | 522 // deleted, including the case where no such shortcuts are found. |
523 static bool RemoveShortcuts(ShellUtil::ShortcutLocation location, | 523 static bool RemoveShortcuts(ShellUtil::ShortcutLocation location, |
524 BrowserDistribution* dist, | 524 BrowserDistribution* dist, |
525 ShellChange level, | 525 ShellChange level, |
526 const base::FilePath& target_exe); | 526 const base::FilePath& target_exe); |
527 | 527 |
528 // Applies the updates in |shortcut_properties| to all shortcuts in |location| | 528 // Applies the updates in |shortcut_properties| to all matching shortcuts |
529 // that target |target_exe|. | 529 // in |location|, i.e.: |
530 // Returns true if all shortcuts pointing to |target_exe| are successfully | 530 // - the shortcut's original target is |target_exe|, |
531 // updated, including the case where no such shortcuts are found. | 531 // - if |require_args| is set, the original arguments are non-empty. |
| 532 // Returns true if all updates to matching shortcuts are successful, including |
| 533 // the vacuous case where no matching shortcuts are found. |
532 static bool UpdateShortcuts( | 534 static bool UpdateShortcuts( |
533 ShellUtil::ShortcutLocation location, | 535 ShellUtil::ShortcutLocation location, |
534 BrowserDistribution* dist, | 536 BrowserDistribution* dist, |
535 ShellChange level, | 537 ShellChange level, |
536 const base::FilePath& target_exe, | 538 const base::FilePath& target_exe, |
| 539 bool require_args, |
537 const ShellUtil::ShortcutProperties& properties); | 540 const ShellUtil::ShortcutProperties& properties); |
538 | 541 |
539 // Sets |suffix| to the base 32 encoding of the md5 hash of this user's sid | 542 // Sets |suffix| to the base 32 encoding of the md5 hash of this user's sid |
540 // preceded by a dot. | 543 // preceded by a dot. |
541 // This is guaranteed to be unique on the machine and 27 characters long | 544 // This is guaranteed to be unique on the machine and 27 characters long |
542 // (including the '.'). | 545 // (including the '.'). |
543 // This suffix is then meant to be added to all registration that may conflict | 546 // This suffix is then meant to be added to all registration that may conflict |
544 // with another user-level Chrome install. | 547 // with another user-level Chrome install. |
545 // Note that prior to Chrome 21, the suffix registered used to be the user's | 548 // Note that prior to Chrome 21, the suffix registered used to be the user's |
546 // username (see GetOldUserSpecificRegistrySuffix() below). We still honor old | 549 // username (see GetOldUserSpecificRegistrySuffix() below). We still honor old |
(...skipping 18 matching lines...) Expand all Loading... |
565 // required by the base32 standard for inputs that aren't a multiple of 5 | 568 // required by the base32 standard for inputs that aren't a multiple of 5 |
566 // bytes. | 569 // bytes. |
567 static string16 ByteArrayToBase32(const uint8* bytes, size_t size); | 570 static string16 ByteArrayToBase32(const uint8* bytes, size_t size); |
568 | 571 |
569 private: | 572 private: |
570 DISALLOW_COPY_AND_ASSIGN(ShellUtil); | 573 DISALLOW_COPY_AND_ASSIGN(ShellUtil); |
571 }; | 574 }; |
572 | 575 |
573 | 576 |
574 #endif // CHROME_INSTALLER_UTIL_SHELL_UTIL_H_ | 577 #endif // CHROME_INSTALLER_UTIL_SHELL_UTIL_H_ |
OLD | NEW |