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 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 // Applies the updates in |properties| to all matching shortcuts in |
528 // |location|, i.e.: | 528 // |location|, i.e.: |
529 // - the shortcut's original target is |target_exe|, | 529 // - the shortcut's original target is |target_exe|, |
530 // - the original arguments are non-empty. | 530 // - the original arguments are non-empty. |
531 // Returns true if all updates to matching shortcuts are successful, including | 531 // Returns true if all updates to matching shortcuts are successful, including |
532 // the vacuous case where no matching shortcuts are found. | 532 // the vacuous case where no matching shortcuts are found. |
533 static bool UpdateShortcutsWithArgs( | 533 static bool UpdateShortcutsWithArgs( |
gab
2013/12/23 14:25:01
I don't think this is used anymore, remove it, we
huangs
2013/12/30 20:15:10
Removed, along with ShortcutOpUpdate() in the .cc
| |
534 ShellUtil::ShortcutLocation location, | 534 ShellUtil::ShortcutLocation location, |
535 BrowserDistribution* dist, | 535 BrowserDistribution* dist, |
536 ShellChange level, | 536 ShellChange level, |
537 const base::FilePath& target_exe, | 537 const base::FilePath& target_exe, |
538 const ShellUtil::ShortcutProperties& properties); | 538 const ShellUtil::ShortcutProperties& properties); |
539 | 539 |
540 // Updates the target of all shortcuts in |location| that satisfie the | |
gab
2013/12/23 14:25:01
s/satisfie/satisfy
huangs
2013/12/30 20:15:10
Done.
| |
541 // following: | |
542 // - the shortcut's original target is |old_target_exe|, | |
543 // - the original arguments are non-empty. | |
544 // If the shortcut's icon points to |old_target_exe|, then it also gets | |
545 // redirected to |new_target_exe|. | |
546 // Returns true if all updates to matching shortcuts are successful, including | |
547 // the vacuous case where no matching shortcuts are found. | |
548 static bool RetargetShortcutsWithArgs( | |
gab
2013/12/23 14:25:01
Add tests for this method; you can most likely re-
huangs
2013/12/30 20:15:10
Done.
| |
549 ShellUtil::ShortcutLocation location, | |
550 BrowserDistribution* dist, | |
551 ShellChange level, | |
552 const base::FilePath& old_target_exe, | |
553 const base::FilePath& new_target_exe); | |
554 | |
540 // Sets |suffix| to the base 32 encoding of the md5 hash of this user's sid | 555 // Sets |suffix| to the base 32 encoding of the md5 hash of this user's sid |
541 // preceded by a dot. | 556 // preceded by a dot. |
542 // This is guaranteed to be unique on the machine and 27 characters long | 557 // This is guaranteed to be unique on the machine and 27 characters long |
543 // (including the '.'). | 558 // (including the '.'). |
544 // This suffix is then meant to be added to all registration that may conflict | 559 // This suffix is then meant to be added to all registration that may conflict |
545 // with another user-level Chrome install. | 560 // with another user-level Chrome install. |
546 // Note that prior to Chrome 21, the suffix registered used to be the user's | 561 // Note that prior to Chrome 21, the suffix registered used to be the user's |
547 // username (see GetOldUserSpecificRegistrySuffix() below). We still honor old | 562 // username (see GetOldUserSpecificRegistrySuffix() below). We still honor old |
548 // installs registered that way, but it was wrong because some of the | 563 // installs registered that way, but it was wrong because some of the |
549 // characters allowed in a username are not allowed in a ProgId. | 564 // characters allowed in a username are not allowed in a ProgId. |
(...skipping 16 matching lines...) Expand all Loading... | |
566 // required by the base32 standard for inputs that aren't a multiple of 5 | 581 // required by the base32 standard for inputs that aren't a multiple of 5 |
567 // bytes. | 582 // bytes. |
568 static string16 ByteArrayToBase32(const uint8* bytes, size_t size); | 583 static string16 ByteArrayToBase32(const uint8* bytes, size_t size); |
569 | 584 |
570 private: | 585 private: |
571 DISALLOW_COPY_AND_ASSIGN(ShellUtil); | 586 DISALLOW_COPY_AND_ASSIGN(ShellUtil); |
572 }; | 587 }; |
573 | 588 |
574 | 589 |
575 #endif // CHROME_INSTALLER_UTIL_SHELL_UTIL_H_ | 590 #endif // CHROME_INSTALLER_UTIL_SHELL_UTIL_H_ |
OLD | NEW |