OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_SHARED_MODULE_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_SHARED_MODULE_SERVICE_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_SHARED_MODULE_SERVICE_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_SHARED_MODULE_SERVICE_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 | 9 |
10 #include "base/scoped_observer.h" | 10 #include "base/scoped_observer.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 | 48 |
49 // Checks an extension's shared module imports to see if they are satisfied. | 49 // Checks an extension's shared module imports to see if they are satisfied. |
50 // If they are not, this function adds the dependencies to the pending install | 50 // If they are not, this function adds the dependencies to the pending install |
51 // list if |extension| came from the webstore. | 51 // list if |extension| came from the webstore. |
52 ImportStatus SatisfyImports(const Extension* extension); | 52 ImportStatus SatisfyImports(const Extension* extension); |
53 | 53 |
54 // Returns a set of extensions that import a given extension. | 54 // Returns a set of extensions that import a given extension. |
55 scoped_ptr<ExtensionSet> GetDependentExtensions(const Extension* extension); | 55 scoped_ptr<ExtensionSet> GetDependentExtensions(const Extension* extension); |
56 | 56 |
57 private: | 57 private: |
| 58 // Uninstall shared modules which are not used by other extensions. |
| 59 void PruneSharedModules(); |
| 60 |
58 // ExtensionRegistryObserver implementation. | 61 // ExtensionRegistryObserver implementation. |
| 62 virtual void OnExtensionInstalled(content::BrowserContext* browser_context, |
| 63 const Extension* extension, |
| 64 bool is_update) OVERRIDE; |
59 virtual void OnExtensionUninstalled(content::BrowserContext* browser_context, | 65 virtual void OnExtensionUninstalled(content::BrowserContext* browser_context, |
60 const Extension* extension) OVERRIDE; | 66 const Extension* extension) OVERRIDE; |
61 | 67 |
62 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> | 68 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> |
63 extension_registry_observer_; | 69 extension_registry_observer_; |
64 | 70 |
65 // The context associated with this SharedModuleService. | 71 // The context associated with this SharedModuleService. |
66 content::BrowserContext* browser_context_; | 72 content::BrowserContext* browser_context_; |
67 | 73 |
68 DISALLOW_COPY_AND_ASSIGN(SharedModuleService); | 74 DISALLOW_COPY_AND_ASSIGN(SharedModuleService); |
69 }; | 75 }; |
70 | 76 |
71 } // namespace extensions | 77 } // namespace extensions |
72 | 78 |
73 #endif // CHROME_BROWSER_EXTENSIONS_SHARED_MODULE_SERVICE_H_ | 79 #endif // CHROME_BROWSER_EXTENSIONS_SHARED_MODULE_SERVICE_H_ |
OLD | NEW |