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 <list> | 8 #include <list> |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
626 bool being_upgraded; | 626 bool being_upgraded; |
627 | 627 |
628 // True if the extension has used the webRequest API. | 628 // True if the extension has used the webRequest API. |
629 bool has_used_webrequest; | 629 bool has_used_webrequest; |
630 | 630 |
631 ExtensionRuntimeData(); | 631 ExtensionRuntimeData(); |
632 ~ExtensionRuntimeData(); | 632 ~ExtensionRuntimeData(); |
633 }; | 633 }; |
634 typedef std::map<std::string, ExtensionRuntimeData> ExtensionRuntimeDataMap; | 634 typedef std::map<std::string, ExtensionRuntimeData> ExtensionRuntimeDataMap; |
635 | 635 |
636 // Populates greylist_. | |
637 void LoadGreylistFromPrefs(); | |
638 | |
636 // Signals *ready_ and sends a notification to the listeners. | 639 // Signals *ready_ and sends a notification to the listeners. |
637 void SetReadyAndNotifyListeners(); | 640 void SetReadyAndNotifyListeners(); |
638 | 641 |
639 // Return true if the sync type of |extension| matches |type|. | 642 // Return true if the sync type of |extension| matches |type|. |
640 void OnExtensionInstallPrefChanged(); | 643 void OnExtensionInstallPrefChanged(); |
641 | 644 |
642 // Adds the given extension to the list of terminated extensions if | 645 // Adds the given extension to the list of terminated extensions if |
643 // it is not already there and unloads it. | 646 // it is not already there and unloads it. |
644 void TrackTerminatedExtension(const extensions::Extension* extension); | 647 void TrackTerminatedExtension(const extensions::Extension* extension); |
645 | 648 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
693 // Helper to search storage directories for extensions with isolated storage | 696 // Helper to search storage directories for extensions with isolated storage |
694 // that have been orphaned by an uninstall. | 697 // that have been orphaned by an uninstall. |
695 void GarbageCollectIsolatedStorage(); | 698 void GarbageCollectIsolatedStorage(); |
696 void OnGarbageCollectIsolatedStorageFinished(); | 699 void OnGarbageCollectIsolatedStorageFinished(); |
697 | 700 |
698 // extensions::Blacklist::Observer implementation. | 701 // extensions::Blacklist::Observer implementation. |
699 virtual void OnBlacklistUpdated() OVERRIDE; | 702 virtual void OnBlacklistUpdated() OVERRIDE; |
700 | 703 |
701 // Manages the blacklisted extensions, intended as callback from | 704 // Manages the blacklisted extensions, intended as callback from |
702 // Blacklist::GetBlacklistedIDs. | 705 // Blacklist::GetBlacklistedIDs. |
703 void ManageBlacklist(const std::set<std::string>& blacklisted_ids); | 706 void ManageBlacklist( |
707 const extensions::Blacklist::BlacklistStateMap& blacklisted_ids); | |
708 | |
709 // Add extensions in |malware| to blacklisted_extensions, remove extensions | |
not at google - send to devlin
2014/01/22 00:33:14
s/malware/blocked? or s/blocked/malware?
Oleg Eterevsky
2014/01/22 21:25:04
Done.
| |
710 // that are neither in |malware|, nor in |unknown|. | |
711 void UpdateBlockedExtensions(const std::set<std::string>& blocked, | |
712 const std::set<std::string>& unknown); | |
713 | |
714 void UpdateGreylistedExtensions(const std::set<std::string>& greylist, | |
715 const std::set<std::string>& unknown); | |
704 | 716 |
705 // Controls if installs are delayed. See comment for | 717 // Controls if installs are delayed. See comment for |
706 // |installs_delayed_for_gc_|. | 718 // |installs_delayed_for_gc_|. |
707 void set_installs_delayed_for_gc(bool value) { | 719 void set_installs_delayed_for_gc(bool value) { |
708 installs_delayed_for_gc_ = value; | 720 installs_delayed_for_gc_ = value; |
709 } | 721 } |
710 bool installs_delayed_for_gc() const { return installs_delayed_for_gc_; } | 722 bool installs_delayed_for_gc() const { return installs_delayed_for_gc_; } |
711 | 723 |
712 // Used only by test code. | 724 // Used only by test code. |
713 void UnloadAllExtensionsInternal(); | 725 void UnloadAllExtensionsInternal(); |
(...skipping 12 matching lines...) Expand all Loading... | |
726 | 738 |
727 // Settings for the owning profile. | 739 // Settings for the owning profile. |
728 scoped_ptr<extensions::SettingsFrontend> settings_frontend_; | 740 scoped_ptr<extensions::SettingsFrontend> settings_frontend_; |
729 | 741 |
730 // The ExtensionSyncService that is used by this ExtensionService. | 742 // The ExtensionSyncService that is used by this ExtensionService. |
731 ExtensionSyncService* extension_sync_service_; | 743 ExtensionSyncService* extension_sync_service_; |
732 | 744 |
733 // Sets of enabled/disabled/terminated/blacklisted extensions. Not owned. | 745 // Sets of enabled/disabled/terminated/blacklisted extensions. Not owned. |
734 extensions::ExtensionRegistry* registry_; | 746 extensions::ExtensionRegistry* registry_; |
735 | 747 |
748 // Set of greylisted extensions. These extensions are disabled if they are | |
749 // already installed in Chromium at the time when they are added to | |
750 // the greylist. Unlike blacklisted extensions, greylisted ones are visible | |
751 // to the user and if user re-enables such an extension, they remain enabled. | |
752 // | |
753 // These extensions should appear in registry_. | |
754 extensions::ExtensionSet greylist_; | |
755 | |
736 // The list of extension installs delayed for various reasons. The reason | 756 // The list of extension installs delayed for various reasons. The reason |
737 // for delayed install is stored in ExtensionPrefs. These are not part of | 757 // for delayed install is stored in ExtensionPrefs. These are not part of |
738 // ExtensionRegistry because they are not yet installed. | 758 // ExtensionRegistry because they are not yet installed. |
739 extensions::ExtensionSet delayed_installs_; | 759 extensions::ExtensionSet delayed_installs_; |
740 | 760 |
741 // Hold the set of pending extensions. | 761 // Hold the set of pending extensions. |
742 extensions::PendingExtensionManager pending_extension_manager_; | 762 extensions::PendingExtensionManager pending_extension_manager_; |
743 | 763 |
744 // The map of extension IDs to their runtime data. | 764 // The map of extension IDs to their runtime data. |
745 ExtensionRuntimeDataMap extension_runtime_data_; | 765 ExtensionRuntimeDataMap extension_runtime_data_; |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
855 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 875 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
856 UnloadBlacklistedExtensionPolicy); | 876 UnloadBlacklistedExtensionPolicy); |
857 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 877 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
858 WillNotLoadBlacklistedExtensionsFromDirectory); | 878 WillNotLoadBlacklistedExtensionsFromDirectory); |
859 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 879 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
860 BlacklistedInPrefsFromStartup); | 880 BlacklistedInPrefsFromStartup); |
861 DISALLOW_COPY_AND_ASSIGN(ExtensionService); | 881 DISALLOW_COPY_AND_ASSIGN(ExtensionService); |
862 }; | 882 }; |
863 | 883 |
864 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ | 884 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ |
OLD | NEW |