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 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
522 // |target_exe|: Shortcut target exe; shortcuts will only be deleted when | 522 // |target_exe|: Shortcut target exe; shortcuts will only be deleted when |
523 // their target is |target_exe|. | 523 // their target is |target_exe|. |
524 // If |location| is a Chrome-specific folder, it will be deleted as well. | 524 // If |location| is a Chrome-specific folder, it will be deleted as well. |
525 // Returns true if all shortcuts pointing to |target_exe| are successfully | 525 // Returns true if all shortcuts pointing to |target_exe| are successfully |
526 // deleted, including the case where no such shortcuts are found. | 526 // deleted, including the case where no such shortcuts are found. |
527 static bool RemoveShortcuts(ShellUtil::ShortcutLocation location, | 527 static bool RemoveShortcuts(ShellUtil::ShortcutLocation location, |
528 BrowserDistribution* dist, | 528 BrowserDistribution* dist, |
529 ShellChange level, | 529 ShellChange level, |
530 const base::FilePath& target_exe); | 530 const base::FilePath& target_exe); |
531 | 531 |
532 // Applies the updates in |properties| to all matching shortcuts in | 532 // Updates the target of all shortcuts in |location| that satisfy the |
533 // |location|, i.e.: | 533 // following: |
534 // - the shortcut's original target is |target_exe|, | 534 // - the shortcut's original target is |old_target_exe|, |
535 // - the original arguments are non-empty. | 535 // - the original arguments are non-empty. |
| 536 // If the shortcut's icon points to |old_target_exe|, then it also gets |
| 537 // redirected to |new_target_exe|. |
536 // Returns true if all updates to matching shortcuts are successful, including | 538 // Returns true if all updates to matching shortcuts are successful, including |
537 // the vacuous case where no matching shortcuts are found. | 539 // the vacuous case where no matching shortcuts are found. |
538 static bool UpdateShortcutsWithArgs( | 540 static bool RetargetShortcutsWithArgs( |
539 ShellUtil::ShortcutLocation location, | 541 ShellUtil::ShortcutLocation location, |
540 BrowserDistribution* dist, | 542 BrowserDistribution* dist, |
541 ShellChange level, | 543 ShellChange level, |
542 const base::FilePath& target_exe, | 544 const base::FilePath& old_target_exe, |
543 const ShellUtil::ShortcutProperties& properties); | 545 const base::FilePath& new_target_exe); |
544 | 546 |
545 // Sets |suffix| to the base 32 encoding of the md5 hash of this user's sid | 547 // Sets |suffix| to the base 32 encoding of the md5 hash of this user's sid |
546 // preceded by a dot. | 548 // preceded by a dot. |
547 // This is guaranteed to be unique on the machine and 27 characters long | 549 // This is guaranteed to be unique on the machine and 27 characters long |
548 // (including the '.'). | 550 // (including the '.'). |
549 // This suffix is then meant to be added to all registration that may conflict | 551 // This suffix is then meant to be added to all registration that may conflict |
550 // with another user-level Chrome install. | 552 // with another user-level Chrome install. |
551 // Note that prior to Chrome 21, the suffix registered used to be the user's | 553 // Note that prior to Chrome 21, the suffix registered used to be the user's |
552 // username (see GetOldUserSpecificRegistrySuffix() below). We still honor old | 554 // username (see GetOldUserSpecificRegistrySuffix() below). We still honor old |
553 // installs registered that way, but it was wrong because some of the | 555 // installs registered that way, but it was wrong because some of the |
(...skipping 17 matching lines...) Expand all Loading... |
571 // required by the base32 standard for inputs that aren't a multiple of 5 | 573 // required by the base32 standard for inputs that aren't a multiple of 5 |
572 // bytes. | 574 // bytes. |
573 static base::string16 ByteArrayToBase32(const uint8* bytes, size_t size); | 575 static base::string16 ByteArrayToBase32(const uint8* bytes, size_t size); |
574 | 576 |
575 private: | 577 private: |
576 DISALLOW_COPY_AND_ASSIGN(ShellUtil); | 578 DISALLOW_COPY_AND_ASSIGN(ShellUtil); |
577 }; | 579 }; |
578 | 580 |
579 | 581 |
580 #endif // CHROME_INSTALLER_UTIL_SHELL_UTIL_H_ | 582 #endif // CHROME_INSTALLER_UTIL_SHELL_UTIL_H_ |
OLD | NEW |