| 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 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 488 // to default browser entries names that it creates in the registry. | 488 // to default browser entries names that it creates in the registry. |
| 489 // |protocol| The protocol to register as being capable of handling.s | 489 // |protocol| The protocol to register as being capable of handling.s |
| 490 // |elevate_if_not_admin| if true will make this method try alternate methods | 490 // |elevate_if_not_admin| if true will make this method try alternate methods |
| 491 // as described above. | 491 // as described above. |
| 492 static bool RegisterChromeForProtocol(BrowserDistribution* dist, | 492 static bool RegisterChromeForProtocol(BrowserDistribution* dist, |
| 493 const string16& chrome_exe, | 493 const string16& chrome_exe, |
| 494 const string16& unique_suffix, | 494 const string16& unique_suffix, |
| 495 const string16& protocol, | 495 const string16& protocol, |
| 496 bool elevate_if_not_admin); | 496 bool elevate_if_not_admin); |
| 497 | 497 |
| 498 // Removes installed shortcut at |location|. | 498 // Removes installed shortcut(s) at |location|. |
| 499 // |chrome_exe|: The path to the chrome.exe being uninstalled; the shortcut | 499 // |target_exe|: Shortcut target exe; shortcuts will only be deleted when |
| 500 // will only be deleted if its target is also |chrome_exe|. | 500 // their target is |target_exe|. |
| 501 // |level|: CURRENT_USER to remove the per-user shortcut and SYSTEM_LEVEL to | 501 // |level|: CURRENT_USER to remove the per-user shortcut and SYSTEM_LEVEL to |
| 502 // remove the all-users shortcut. | 502 // remove the all-users shortcut. |
| 503 // |shortcut_name|: If non-null, remove the shortcut named |shortcut_name| at | 503 // |shortcut_name|: If non-null, remove the shortcut named |shortcut_name| at |
| 504 // location; otherwise remove the default shortcut at |location|. | 504 // location; otherwise remove all shortcuts to |target_exe| at |location|. |
| 505 // If |location| is SHORTCUT_LOCATION_START_MENU the shortcut folder specific | 505 // If |location| is SHORTCUT_LOCATION_START_MENU, the shortcut folder specific |
| 506 // to |dist| is deleted. | 506 // to |dist| is deleted. |
| 507 // Also attempts to unpin the removed shortcut from the taskbar. | 507 // Also attempts to unpin the removed shortcut(s) from the taskbar. |
| 508 // Returns true if the shortcut was successfully deleted (or there is no | 508 // Returns true if the shortcut(s) were successfully deleted (or there were |
| 509 // shortcut at |location| pointing to |chrome_exe|). | 509 // none at |location| pointing to |target_exe|). |
| 510 static bool RemoveShortcut(ShellUtil::ShortcutLocation location, | 510 static bool RemoveShortcut(ShellUtil::ShortcutLocation location, |
| 511 BrowserDistribution* dist, | 511 BrowserDistribution* dist, |
| 512 const string16& target_exe, | 512 const FilePath& target_exe, |
| 513 ShellChange level, | 513 ShellChange level, |
| 514 const string16* shortcut_name); | 514 const string16* shortcut_name); |
| 515 | 515 |
| 516 // Enumerates all shortcuts pinned to the taskbar and deletes those pointing | 516 // Enumerates all shortcuts pinned to the taskbar and deletes those pointing |
| 517 // to |target_exe|. | 517 // to |target_exe|. |
| 518 // base::win::TaskbarUnpinShortcutLink() should be prefered, but this is | 518 // base::win::TaskbarUnpinShortcutLink() should be prefered, but this is |
| 519 // useful on uninstall as the parent shortcut of a pin might no longer exist | 519 // useful on uninstall as the parent shortcut of a pin might no longer exist |
| 520 // (thus making it impossible to unpin it via that API). | 520 // (thus making it impossible to unpin it via that API). |
| 521 static void RemoveTaskbarShortcuts(const string16& target_exe); | 521 static void RemoveTaskbarShortcuts(const string16& target_exe); |
| 522 | 522 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 553 // required by the base32 standard for inputs that aren't a multiple of 5 | 553 // required by the base32 standard for inputs that aren't a multiple of 5 |
| 554 // bytes. | 554 // bytes. |
| 555 static string16 ByteArrayToBase32(const uint8* bytes, size_t size); | 555 static string16 ByteArrayToBase32(const uint8* bytes, size_t size); |
| 556 | 556 |
| 557 private: | 557 private: |
| 558 DISALLOW_COPY_AND_ASSIGN(ShellUtil); | 558 DISALLOW_COPY_AND_ASSIGN(ShellUtil); |
| 559 }; | 559 }; |
| 560 | 560 |
| 561 | 561 |
| 562 #endif // CHROME_INSTALLER_UTIL_SHELL_UTIL_H_ | 562 #endif // CHROME_INSTALLER_UTIL_SHELL_UTIL_H_ |
| OLD | NEW |