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 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
506 // location; otherwise remove all shortcuts to |target_exe| at |location|. | 506 // location; otherwise remove all shortcuts to |target_exe| at |location|. |
507 // If |location| is SHORTCUT_LOCATION_START_MENU, the shortcut folder specific | 507 // If |location| is SHORTCUT_LOCATION_START_MENU, the shortcut folder specific |
508 // to |dist| is deleted. | 508 // to |dist| is deleted. |
509 // Also attempts to unpin the removed shortcut(s) from the taskbar. | 509 // Also attempts to unpin the removed shortcut(s) from the taskbar. |
510 // Returns true if the shortcut(s) were successfully deleted (or there were | 510 // Returns true if the shortcut(s) were successfully deleted (or there were |
511 // none at |location| pointing to |target_exe|). | 511 // none at |location| pointing to |target_exe|). |
512 static bool RemoveShortcut(ShellUtil::ShortcutLocation location, | 512 static bool RemoveShortcut(ShellUtil::ShortcutLocation location, |
513 BrowserDistribution* dist, | 513 BrowserDistribution* dist, |
514 const base::FilePath& target_exe, | 514 const base::FilePath& target_exe, |
515 ShellChange level, | 515 ShellChange level, |
516 const string16* shortcut_name); | 516 const string16* shortcut_name); |
gab
2013/04/24 21:41:46
I like the idea of using a pattern here instead of
huangs
2013/04/25 16:27:46
Changing interface:
The old routine is now RemoveS
| |
517 | 517 |
518 // Enumerates all shortcuts pinned to the taskbar and deletes those pointing | 518 // Enumerates all shortcuts pinned to the taskbar and deletes those pointing |
519 // to |target_exe|. | 519 // to |target_exe|. |
520 // base::win::TaskbarUnpinShortcutLink() should be prefered, but this is | 520 // base::win::TaskbarUnpinShortcutLink() should be prefered, but this is |
521 // useful on uninstall as the parent shortcut of a pin might no longer exist | 521 // useful on uninstall as the parent shortcut of a pin might no longer exist |
522 // (thus making it impossible to unpin it via that API). | 522 // (thus making it impossible to unpin it via that API). |
523 static void RemoveTaskbarShortcuts(const string16& target_exe); | 523 static void RemoveTaskbarShortcuts(const string16& target_exe); |
524 | 524 |
525 // This will remove all secondary tiles from the start screen for |dist|. | 525 // This will remove all secondary tiles from the start screen for |dist|. |
526 static void RemoveStartScreenShortcuts(BrowserDistribution* dist, | 526 static void RemoveStartScreenShortcuts(BrowserDistribution* dist, |
527 const string16& target_exe); | 527 const string16& target_exe); |
528 | 528 |
529 // Traverses through instsalles shortcut(s) in a similar fashion as | |
gab
2013/04/24 21:41:46
nit: instsalles ?!
huangs
2013/04/25 16:27:46
installed. Done.
| |
530 // RemoveShortcut(). For each matched shortcut to |old_target_exe|, | |
531 // update the shortcut so that it points to |new_target_exe|. | |
532 static bool MigrateShortcut(ShellUtil::ShortcutLocation location, | |
533 BrowserDistribution* dist, | |
534 const base::FilePath& old_target_exe, | |
535 const base::FilePath& new_target_exe, | |
536 ShellChange level, | |
537 const string16* shortcut_name); | |
538 | |
539 // Simmilar to RemoveTaskbarShortcuts(), but performs migration. | |
540 static void MigrateTaskbarShortcuts(const string16& old_target_exe, | |
541 const string16& new_target_exe); | |
542 | |
543 // Simmilar to RemoveStartScreenShortcuts(), but performs migration. | |
544 static void MigrateStartScreenShortcuts(BrowserDistribution* dist, | |
545 const string16& old_target_exe, | |
546 const string16& new_target_exe); | |
547 | |
529 // Sets |suffix| to the base 32 encoding of the md5 hash of this user's sid | 548 // Sets |suffix| to the base 32 encoding of the md5 hash of this user's sid |
530 // preceded by a dot. | 549 // preceded by a dot. |
531 // This is guaranteed to be unique on the machine and 27 characters long | 550 // This is guaranteed to be unique on the machine and 27 characters long |
532 // (including the '.'). | 551 // (including the '.'). |
533 // This suffix is then meant to be added to all registration that may conflict | 552 // This suffix is then meant to be added to all registration that may conflict |
534 // with another user-level Chrome install. | 553 // with another user-level Chrome install. |
535 // Note that prior to Chrome 21, the suffix registered used to be the user's | 554 // Note that prior to Chrome 21, the suffix registered used to be the user's |
536 // username (see GetOldUserSpecificRegistrySuffix() below). We still honor old | 555 // username (see GetOldUserSpecificRegistrySuffix() below). We still honor old |
537 // installs registered that way, but it was wrong because some of the | 556 // installs registered that way, but it was wrong because some of the |
538 // characters allowed in a username are not allowed in a ProgId. | 557 // characters allowed in a username are not allowed in a ProgId. |
(...skipping 16 matching lines...) Expand all Loading... | |
555 // required by the base32 standard for inputs that aren't a multiple of 5 | 574 // required by the base32 standard for inputs that aren't a multiple of 5 |
556 // bytes. | 575 // bytes. |
557 static string16 ByteArrayToBase32(const uint8* bytes, size_t size); | 576 static string16 ByteArrayToBase32(const uint8* bytes, size_t size); |
558 | 577 |
559 private: | 578 private: |
560 DISALLOW_COPY_AND_ASSIGN(ShellUtil); | 579 DISALLOW_COPY_AND_ASSIGN(ShellUtil); |
561 }; | 580 }; |
562 | 581 |
563 | 582 |
564 #endif // CHROME_INSTALLER_UTIL_SHELL_UTIL_H_ | 583 #endif // CHROME_INSTALLER_UTIL_SHELL_UTIL_H_ |
OLD | NEW |