| 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 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 517 // |target_exe|: Shortcut target exe; shortcuts will only be deleted when | 517 // |target_exe|: Shortcut target exe; shortcuts will only be deleted when |
| 518 // their target is |target_exe|. | 518 // their target is |target_exe|. |
| 519 // If |location| is a Chrome-specific folder, it will be deleted as well. | 519 // If |location| is a Chrome-specific folder, it will be deleted as well. |
| 520 // Returns true if all shortcuts pointing to |target_exe| are successfully | 520 // Returns true if all shortcuts pointing to |target_exe| are successfully |
| 521 // deleted, including the case where no such shortcuts are found. | 521 // deleted, including the case where no such shortcuts are found. |
| 522 static bool RemoveShortcuts(ShellUtil::ShortcutLocation location, | 522 static bool RemoveShortcuts(ShellUtil::ShortcutLocation location, |
| 523 BrowserDistribution* dist, | 523 BrowserDistribution* dist, |
| 524 ShellChange level, | 524 ShellChange level, |
| 525 const base::FilePath& target_exe); | 525 const base::FilePath& target_exe); |
| 526 | 526 |
| 527 // Applies the updates in |properties| to all matching shortcuts in | 527 // Updates the target of all shortcuts in |location| that satisfy the |
| 528 // |location|, i.e.: | 528 // following: |
| 529 // - the shortcut's original target is |target_exe|, | 529 // - the shortcut's original target is |old_target_exe|, |
| 530 // - the original arguments are non-empty. | 530 // - the original arguments are non-empty. |
| 531 // If the shortcut's icon points to |old_target_exe|, then it also gets |
| 532 // redirected to |new_target_exe|. |
| 531 // Returns true if all updates to matching shortcuts are successful, including | 533 // Returns true if all updates to matching shortcuts are successful, including |
| 532 // the vacuous case where no matching shortcuts are found. | 534 // the vacuous case where no matching shortcuts are found. |
| 533 static bool UpdateShortcutsWithArgs( | 535 static bool RetargetShortcutsWithArgs( |
| 534 ShellUtil::ShortcutLocation location, | 536 ShellUtil::ShortcutLocation location, |
| 535 BrowserDistribution* dist, | 537 BrowserDistribution* dist, |
| 536 ShellChange level, | 538 ShellChange level, |
| 537 const base::FilePath& target_exe, | 539 const base::FilePath& old_target_exe, |
| 538 const ShellUtil::ShortcutProperties& properties); | 540 const base::FilePath& new_target_exe); |
| 539 | 541 |
| 540 // 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 |
| 541 // preceded by a dot. | 543 // preceded by a dot. |
| 542 // 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 |
| 543 // (including the '.'). | 545 // (including the '.'). |
| 544 // 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 |
| 545 // with another user-level Chrome install. | 547 // with another user-level Chrome install. |
| 546 // 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 |
| 547 // username (see GetOldUserSpecificRegistrySuffix() below). We still honor old | 549 // username (see GetOldUserSpecificRegistrySuffix() below). We still honor old |
| 548 // installs registered that way, but it was wrong because some of the | 550 // installs registered that way, but it was wrong because some of the |
| (...skipping 17 matching lines...) Expand all Loading... |
| 566 // 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 |
| 567 // bytes. | 569 // bytes. |
| 568 static string16 ByteArrayToBase32(const uint8* bytes, size_t size); | 570 static string16 ByteArrayToBase32(const uint8* bytes, size_t size); |
| 569 | 571 |
| 570 private: | 572 private: |
| 571 DISALLOW_COPY_AND_ASSIGN(ShellUtil); | 573 DISALLOW_COPY_AND_ASSIGN(ShellUtil); |
| 572 }; | 574 }; |
| 573 | 575 |
| 574 | 576 |
| 575 #endif // CHROME_INSTALLER_UTIL_SHELL_UTIL_H_ | 577 #endif // CHROME_INSTALLER_UTIL_SHELL_UTIL_H_ |
| OLD | NEW |