| 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 of hosted or packaged apps, NULL otherwise. | |
| 135 const extensions::Extension* GetInstalledApp(const GURL& url) const; | |
| 136 | |
| 137 // Returns whether the URL is from either a hosted or packaged app. | |
| 138 bool IsInstalledApp(const GURL& url) const; | |
| 139 | |
| 140 // Attempts to uninstall an extension from a given ExtensionService. Returns | 134 // Attempts to uninstall an extension from a given ExtensionService. Returns |
| 141 // true iff the target extension exists. | 135 // true iff the target extension exists. |
| 142 static bool UninstallExtensionHelper(ExtensionService* extensions_service, | 136 static bool UninstallExtensionHelper(ExtensionService* extensions_service, |
| 143 const std::string& extension_id); | 137 const std::string& extension_id); |
| 144 | 138 |
| 145 // Constructor stores pointers to |profile| and |extension_prefs| but | 139 // Constructor stores pointers to |profile| and |extension_prefs| but |
| 146 // ownership remains at caller. | 140 // ownership remains at caller. |
| 147 ExtensionService(Profile* profile, | 141 ExtensionService(Profile* profile, |
| 148 const base::CommandLine* command_line, | 142 const base::CommandLine* command_line, |
| 149 const base::FilePath& install_directory, | 143 const base::FilePath& install_directory, |
| (...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 763 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 757 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
| 764 GreylistedExtensionDisabled); | 758 GreylistedExtensionDisabled); |
| 765 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 759 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
| 766 GreylistDontEnableManuallyDisabled); | 760 GreylistDontEnableManuallyDisabled); |
| 767 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 761 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
| 768 GreylistUnknownDontChange); | 762 GreylistUnknownDontChange); |
| 769 DISALLOW_COPY_AND_ASSIGN(ExtensionService); | 763 DISALLOW_COPY_AND_ASSIGN(ExtensionService); |
| 770 }; | 764 }; |
| 771 | 765 |
| 772 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ | 766 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ |
| OLD | NEW |