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