Chromium Code Reviews| 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 27 matching lines...) Expand all Loading... | |
| 38 NOT_DEFAULT, | 38 NOT_DEFAULT, |
| 39 IS_DEFAULT, | 39 IS_DEFAULT, |
| 40 }; | 40 }; |
| 41 | 41 |
| 42 // Typical shortcut directories. Resolved in GetShortcutPath(). | 42 // Typical shortcut directories. Resolved in GetShortcutPath(). |
| 43 // Also used in ShortcutLocationIsSupported(). | 43 // Also used in ShortcutLocationIsSupported(). |
| 44 enum ShortcutLocation { | 44 enum ShortcutLocation { |
| 45 SHORTCUT_LOCATION_DESKTOP, | 45 SHORTCUT_LOCATION_DESKTOP, |
| 46 SHORTCUT_LOCATION_QUICK_LAUNCH, | 46 SHORTCUT_LOCATION_QUICK_LAUNCH, |
| 47 SHORTCUT_LOCATION_START_MENU, | 47 SHORTCUT_LOCATION_START_MENU, |
| 48 SHORTCUT_LOCATION_START_MENU_ROOT, | |
|
gab
2013/05/15 22:42:20
Synchronize with https://codereview.chromium.org/1
huangs
2013/05/17 20:59:24
Done; deleted for now.
| |
| 48 SHORTCUT_LOCATION_TASKBAR_PINS, // base::win::VERSION_WIN7 + | 49 SHORTCUT_LOCATION_TASKBAR_PINS, // base::win::VERSION_WIN7 + |
| 49 SHORTCUT_LOCATION_APP_SHORTCUTS, // base::win::VERSION_WIN8 + | 50 SHORTCUT_LOCATION_APP_SHORTCUTS, // base::win::VERSION_WIN8 + |
| 50 }; | 51 }; |
| 51 | 52 |
| 52 enum ShortcutOperation { | 53 enum ShortcutOperation { |
| 53 // Create a new shortcut (overwriting if necessary). | 54 // Create a new shortcut (overwriting if necessary). |
| 54 SHELL_SHORTCUT_CREATE_ALWAYS, | 55 SHELL_SHORTCUT_CREATE_ALWAYS, |
| 55 // Create the per-user shortcut only if its system-level equivalent (with | 56 // Create the per-user shortcut only if its system-level equivalent (with |
| 56 // the same name) is not present. | 57 // the same name) is not present. |
| 57 SHELL_SHORTCUT_CREATE_IF_NO_SYSTEM_LEVEL, | 58 SHELL_SHORTCUT_CREATE_IF_NO_SYSTEM_LEVEL, |
| (...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 529 // that target |target_exe|. | 530 // that target |target_exe|. |
| 530 // Returns true if all shortcuts pointing to |target_exe| are successfully | 531 // Returns true if all shortcuts pointing to |target_exe| are successfully |
| 531 // updated, including the case where no such shortcuts are found. | 532 // updated, including the case where no such shortcuts are found. |
| 532 static bool UpdateShortcuts( | 533 static bool UpdateShortcuts( |
| 533 ShellUtil::ShortcutLocation location, | 534 ShellUtil::ShortcutLocation location, |
| 534 BrowserDistribution* dist, | 535 BrowserDistribution* dist, |
| 535 ShellChange level, | 536 ShellChange level, |
| 536 const base::FilePath& target_exe, | 537 const base::FilePath& target_exe, |
| 537 const ShellUtil::ShortcutProperties& properties); | 538 const ShellUtil::ShortcutProperties& properties); |
| 538 | 539 |
| 540 // Similar to UpdateShortcuts(), but operates on shortcuts whose filename | |
| 541 // matches |name_filter|. | |
| 542 static bool UpdateShortcutsFilteredByName( | |
| 543 ShellUtil::ShortcutLocation location, | |
| 544 BrowserDistribution* dist, | |
| 545 ShellChange level, | |
| 546 const string16& name_filter, | |
| 547 const base::FilePath& target_exe, | |
| 548 const ShellUtil::ShortcutProperties& properties); | |
| 549 | |
| 539 // Sets |suffix| to the base 32 encoding of the md5 hash of this user's sid | 550 // Sets |suffix| to the base 32 encoding of the md5 hash of this user's sid |
| 540 // preceded by a dot. | 551 // preceded by a dot. |
| 541 // This is guaranteed to be unique on the machine and 27 characters long | 552 // This is guaranteed to be unique on the machine and 27 characters long |
| 542 // (including the '.'). | 553 // (including the '.'). |
| 543 // This suffix is then meant to be added to all registration that may conflict | 554 // This suffix is then meant to be added to all registration that may conflict |
| 544 // with another user-level Chrome install. | 555 // with another user-level Chrome install. |
| 545 // Note that prior to Chrome 21, the suffix registered used to be the user's | 556 // Note that prior to Chrome 21, the suffix registered used to be the user's |
| 546 // username (see GetOldUserSpecificRegistrySuffix() below). We still honor old | 557 // username (see GetOldUserSpecificRegistrySuffix() below). We still honor old |
| 547 // installs registered that way, but it was wrong because some of the | 558 // installs registered that way, but it was wrong because some of the |
| 548 // characters allowed in a username are not allowed in a ProgId. | 559 // characters allowed in a username are not allowed in a ProgId. |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 565 // required by the base32 standard for inputs that aren't a multiple of 5 | 576 // required by the base32 standard for inputs that aren't a multiple of 5 |
| 566 // bytes. | 577 // bytes. |
| 567 static string16 ByteArrayToBase32(const uint8* bytes, size_t size); | 578 static string16 ByteArrayToBase32(const uint8* bytes, size_t size); |
| 568 | 579 |
| 569 private: | 580 private: |
| 570 DISALLOW_COPY_AND_ASSIGN(ShellUtil); | 581 DISALLOW_COPY_AND_ASSIGN(ShellUtil); |
| 571 }; | 582 }; |
| 572 | 583 |
| 573 | 584 |
| 574 #endif // CHROME_INSTALLER_UTIL_SHELL_UTIL_H_ | 585 #endif // CHROME_INSTALLER_UTIL_SHELL_UTIL_H_ |
| OLD | NEW |