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 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
654 // Gets the set of loaded app ids. Component apps are not included. | 654 // Gets the set of loaded app ids. Component apps are not included. |
655 extensions::ExtensionIdSet GetAppIds() const; | 655 extensions::ExtensionIdSet GetAppIds() const; |
656 | 656 |
657 // Record a histogram using the PermissionMessage enum values for each | 657 // Record a histogram using the PermissionMessage enum values for each |
658 // permission in |e|. | 658 // permission in |e|. |
659 // NOTE: If this is ever called with high frequency, the implementation may | 659 // NOTE: If this is ever called with high frequency, the implementation may |
660 // need to be made more efficient. | 660 // need to be made more efficient. |
661 static void RecordPermissionMessagesHistogram( | 661 static void RecordPermissionMessagesHistogram( |
662 const extensions::Extension* e, const char* histogram); | 662 const extensions::Extension* e, const char* histogram); |
663 | 663 |
664 // Open a dev tools window for the background page for the given extension, | |
665 // starting the background page first if necessary. | |
666 void InspectBackgroundPage(const extensions::Extension* extension); | |
667 | |
668 #if defined(UNIT_TEST) | 664 #if defined(UNIT_TEST) |
669 void TrackTerminatedExtensionForTest(const extensions::Extension* extension) { | 665 void TrackTerminatedExtensionForTest(const extensions::Extension* extension) { |
670 TrackTerminatedExtension(extension); | 666 TrackTerminatedExtension(extension); |
671 } | 667 } |
672 | 668 |
673 void FinishInstallationForTest(const extensions::Extension* extension) { | 669 void FinishInstallationForTest(const extensions::Extension* extension) { |
674 FinishInstallation(extension); | 670 FinishInstallation(extension); |
675 } | 671 } |
676 #endif | 672 #endif |
677 | 673 |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
779 void UpdateActivePermissions(const extensions::Extension* extension); | 775 void UpdateActivePermissions(const extensions::Extension* extension); |
780 | 776 |
781 // Disables the extension if the privilege level has increased | 777 // Disables the extension if the privilege level has increased |
782 // (e.g., due to an upgrade). | 778 // (e.g., due to an upgrade). |
783 void CheckPermissionsIncrease(const extensions::Extension* extension, | 779 void CheckPermissionsIncrease(const extensions::Extension* extension, |
784 bool is_extension_installed); | 780 bool is_extension_installed); |
785 | 781 |
786 // Helper that updates the active extension list used for crash reporting. | 782 // Helper that updates the active extension list used for crash reporting. |
787 void UpdateActiveExtensionsInCrashReporter(); | 783 void UpdateActiveExtensionsInCrashReporter(); |
788 | 784 |
789 // Helper to inspect an ExtensionHost after it has been loaded. | |
790 void InspectExtensionHost(extensions::ExtensionHost* host); | |
791 | |
792 // Helper to determine whether we should initially enable an installed | 785 // Helper to determine whether we should initially enable an installed |
793 // (or upgraded) extension. | 786 // (or upgraded) extension. |
794 bool ShouldEnableOnInstall(const extensions::Extension* extension); | 787 bool ShouldEnableOnInstall(const extensions::Extension* extension); |
795 | 788 |
796 // Helper to determine if an extension is idle, and it should be safe | 789 // Helper to determine if an extension is idle, and it should be safe |
797 // to update the extension. | 790 // to update the extension. |
798 bool IsExtensionIdle(const std::string& extension_id) const; | 791 bool IsExtensionIdle(const std::string& extension_id) const; |
799 | 792 |
800 // Helper to determine if updating an extensions should proceed immediately, | 793 // Helper to determine if updating an extensions should proceed immediately, |
801 // or if we should delay the update until further notice. | 794 // or if we should delay the update until further notice. |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
983 #endif | 976 #endif |
984 | 977 |
985 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 978 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
986 InstallAppsWithUnlimtedStorage); | 979 InstallAppsWithUnlimtedStorage); |
987 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 980 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
988 InstallAppsAndCheckStorageProtection); | 981 InstallAppsAndCheckStorageProtection); |
989 DISALLOW_COPY_AND_ASSIGN(ExtensionService); | 982 DISALLOW_COPY_AND_ASSIGN(ExtensionService); |
990 }; | 983 }; |
991 | 984 |
992 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ | 985 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ |
OLD | NEW |