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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 }; | 124 }; |
125 | 125 |
126 // Manages installed and running Chromium extensions. An instance is shared | 126 // Manages installed and running Chromium extensions. An instance is shared |
127 // between normal and incognito profiles. | 127 // between normal and incognito profiles. |
128 class ExtensionService | 128 class ExtensionService |
129 : public ExtensionServiceInterface, | 129 : public ExtensionServiceInterface, |
130 public extensions::ExternalProviderInterface::VisitorInterface, | 130 public extensions::ExternalProviderInterface::VisitorInterface, |
131 public content::NotificationObserver, | 131 public content::NotificationObserver, |
132 public extensions::Blacklist::Observer { | 132 public extensions::Blacklist::Observer { |
133 public: | 133 public: |
134 // Returns the Extension for a given url or NULL if the url doesn't belong to | |
135 // an installed extension. This may be a hosted app extent or a | |
136 // chrome-extension:// url. | |
137 const extensions::Extension* GetInstalledExtensionByUrl( | |
138 const GURL& url) const; | |
139 | |
140 // Returns the Extension of hosted or packaged apps, NULL otherwise. | 134 // Returns the Extension of hosted or packaged apps, NULL otherwise. |
141 const extensions::Extension* GetInstalledApp(const GURL& url) const; | 135 const extensions::Extension* GetInstalledApp(const GURL& url) const; |
142 | 136 |
143 // Returns whether the URL is from either a hosted or packaged app. | 137 // Returns whether the URL is from either a hosted or packaged app. |
144 bool IsInstalledApp(const GURL& url) const; | 138 bool IsInstalledApp(const GURL& url) const; |
145 | 139 |
146 // Attempts to uninstall an extension from a given ExtensionService. Returns | 140 // Attempts to uninstall an extension from a given ExtensionService. Returns |
147 // true iff the target extension exists. | 141 // true iff the target extension exists. |
148 static bool UninstallExtensionHelper(ExtensionService* extensions_service, | 142 static bool UninstallExtensionHelper(ExtensionService* extensions_service, |
149 const std::string& extension_id); | 143 const std::string& extension_id); |
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
769 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 763 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
770 GreylistedExtensionDisabled); | 764 GreylistedExtensionDisabled); |
771 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 765 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
772 GreylistDontEnableManuallyDisabled); | 766 GreylistDontEnableManuallyDisabled); |
773 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 767 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
774 GreylistUnknownDontChange); | 768 GreylistUnknownDontChange); |
775 DISALLOW_COPY_AND_ASSIGN(ExtensionService); | 769 DISALLOW_COPY_AND_ASSIGN(ExtensionService); |
776 }; | 770 }; |
777 | 771 |
778 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ | 772 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ |
OLD | NEW |