| 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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 }; | 123 }; |
| 124 | 124 |
| 125 // Manages installed and running Chromium extensions. An instance is shared | 125 // Manages installed and running Chromium extensions. An instance is shared |
| 126 // between normal and incognito profiles. | 126 // between normal and incognito profiles. |
| 127 class ExtensionService | 127 class ExtensionService |
| 128 : public ExtensionServiceInterface, | 128 : public ExtensionServiceInterface, |
| 129 public extensions::ExternalProviderInterface::VisitorInterface, | 129 public extensions::ExternalProviderInterface::VisitorInterface, |
| 130 public content::NotificationObserver, | 130 public content::NotificationObserver, |
| 131 public extensions::Blacklist::Observer { | 131 public extensions::Blacklist::Observer { |
| 132 public: | 132 public: |
| 133 // Returns the Extension of hosted or packaged apps, NULL otherwise. | |
| 134 const extensions::Extension* GetInstalledApp(const GURL& url) const; | |
| 135 | |
| 136 // Returns whether the URL is from either a hosted or packaged app. | |
| 137 bool IsInstalledApp(const GURL& url) const; | |
| 138 | |
| 139 // Attempts to uninstall an extension from a given ExtensionService. Returns | 133 // Attempts to uninstall an extension from a given ExtensionService. Returns |
| 140 // true iff the target extension exists. | 134 // true iff the target extension exists. |
| 141 static bool UninstallExtensionHelper(ExtensionService* extensions_service, | 135 static bool UninstallExtensionHelper(ExtensionService* extensions_service, |
| 142 const std::string& extension_id); | 136 const std::string& extension_id); |
| 143 | 137 |
| 144 // Constructor stores pointers to |profile| and |extension_prefs| but | 138 // Constructor stores pointers to |profile| and |extension_prefs| but |
| 145 // ownership remains at caller. | 139 // ownership remains at caller. |
| 146 ExtensionService(Profile* profile, | 140 ExtensionService(Profile* profile, |
| 147 const base::CommandLine* command_line, | 141 const base::CommandLine* command_line, |
| 148 const base::FilePath& install_directory, | 142 const base::FilePath& install_directory, |
| (...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 724 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 718 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
| 725 GreylistedExtensionDisabled); | 719 GreylistedExtensionDisabled); |
| 726 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 720 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
| 727 GreylistDontEnableManuallyDisabled); | 721 GreylistDontEnableManuallyDisabled); |
| 728 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 722 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
| 729 GreylistUnknownDontChange); | 723 GreylistUnknownDontChange); |
| 730 DISALLOW_COPY_AND_ASSIGN(ExtensionService); | 724 DISALLOW_COPY_AND_ASSIGN(ExtensionService); |
| 731 }; | 725 }; |
| 732 | 726 |
| 733 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ | 727 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ |
| OLD | NEW |