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 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
604 static bool GetUserSpecificRegistrySuffix(base::string16* suffix); | 604 static bool GetUserSpecificRegistrySuffix(base::string16* suffix); |
605 | 605 |
606 // Sets |suffix| to this user's username preceded by a dot. This suffix should | 606 // Sets |suffix| to this user's username preceded by a dot. This suffix should |
607 // only be used to support legacy installs that used this suffixing | 607 // only be used to support legacy installs that used this suffixing |
608 // style. | 608 // style. |
609 // Returns true unless the OS call to retrieve the username fails. | 609 // Returns true unless the OS call to retrieve the username fails. |
610 // NOTE: Only the installer should use this suffix directly. Other callers | 610 // NOTE: Only the installer should use this suffix directly. Other callers |
611 // should call GetCurrentInstallationSuffix(). | 611 // should call GetCurrentInstallationSuffix(). |
612 static bool GetOldUserSpecificRegistrySuffix(base::string16* suffix); | 612 static bool GetOldUserSpecificRegistrySuffix(base::string16* suffix); |
613 | 613 |
614 // Returns the base32 encoding (using the [A-Z2-7] alphabet) of |bytes|. | |
615 // |size| is the length of |bytes|. | |
616 // Note: This method does not suffix the output with '=' signs as technically | |
617 // required by the base32 standard for inputs that aren't a multiple of 5 | |
618 // bytes. | |
619 static base::string16 ByteArrayToBase32(const uint8_t* bytes, size_t size); | |
620 | |
621 // Associates a set of file extensions with a particular application in the | 614 // Associates a set of file extensions with a particular application in the |
622 // Windows registry, for the current user only. If an extension has no | 615 // Windows registry, for the current user only. If an extension has no |
623 // existing default association, the given application becomes the default. | 616 // existing default association, the given application becomes the default. |
624 // Otherwise, the application is added to the Open With menu for this type, | 617 // Otherwise, the application is added to the Open With menu for this type, |
625 // but does not become the default. | 618 // but does not become the default. |
626 // | 619 // |
627 // |prog_id| is the ProgId used by Windows for file associations with this | 620 // |prog_id| is the ProgId used by Windows for file associations with this |
628 // application. Must not be empty or start with a '.'. | 621 // application. Must not be empty or start with a '.'. |
629 // |command_line| is the command to execute when opening a file via this | 622 // |command_line| is the command to execute when opening a file via this |
630 // association. It should contain "%1" (to tell Windows to pass the filename | 623 // association. It should contain "%1" (to tell Windows to pass the filename |
(...skipping 23 matching lines...) Expand all Loading... |
654 // Set/CreateRegWorkItems and runs them using WorkItemList. | 647 // Set/CreateRegWorkItems and runs them using WorkItemList. |
655 static bool AddRegistryEntries(HKEY root, | 648 static bool AddRegistryEntries(HKEY root, |
656 const ScopedVector<RegistryEntry>& entries); | 649 const ScopedVector<RegistryEntry>& entries); |
657 | 650 |
658 private: | 651 private: |
659 DISALLOW_COPY_AND_ASSIGN(ShellUtil); | 652 DISALLOW_COPY_AND_ASSIGN(ShellUtil); |
660 }; | 653 }; |
661 | 654 |
662 | 655 |
663 #endif // CHROME_INSTALLER_UTIL_SHELL_UTIL_H_ | 656 #endif // CHROME_INSTALLER_UTIL_SHELL_UTIL_H_ |
OLD | NEW |