| 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 "chrome/browser/extensions/install_observer.h" | 10 #include "chrome/browser/extensions/install_observer.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 ImportStatus CheckImports( | 43 ImportStatus CheckImports( |
| 44 const extensions::Extension* extension, | 44 const extensions::Extension* extension, |
| 45 std::list<SharedModuleInfo::ImportInfo>* missing_modules, | 45 std::list<SharedModuleInfo::ImportInfo>* missing_modules, |
| 46 std::list<SharedModuleInfo::ImportInfo>* outdated_modules); | 46 std::list<SharedModuleInfo::ImportInfo>* outdated_modules); |
| 47 | 47 |
| 48 // Checks an extension's shared module imports to see if they are satisfied. | 48 // Checks an extension's shared module imports to see if they are satisfied. |
| 49 // If they are not, this function adds the dependencies to the pending install | 49 // If they are not, this function adds the dependencies to the pending install |
| 50 // list if |extension| came from the webstore. | 50 // list if |extension| came from the webstore. |
| 51 ImportStatus SatisfyImports(const extensions::Extension* extension); | 51 ImportStatus SatisfyImports(const extensions::Extension* extension); |
| 52 | 52 |
| 53 private: | |
| 54 // Returns a set of extensions that import a given extension. | 53 // Returns a set of extensions that import a given extension. |
| 55 scoped_ptr<const ExtensionSet> GetDependentExtensions( | 54 scoped_ptr<const ExtensionSet> GetDependentExtensions( |
| 56 const Extension* extension); | 55 const Extension* extension); |
| 57 | 56 |
| 57 private: |
| 58 // Uninstalls shared modules that were only referenced by |extension|. | 58 // Uninstalls shared modules that were only referenced by |extension|. |
| 59 void PruneSharedModulesOnUninstall(const Extension* extension); | 59 void PruneSharedModulesOnUninstall(const Extension* extension); |
| 60 | 60 |
| 61 // InstallObserver implementation: | 61 // InstallObserver implementation: |
| 62 virtual void OnExtensionUninstalled(const Extension* extension) OVERRIDE; | 62 virtual void OnExtensionUninstalled(const Extension* extension) OVERRIDE; |
| 63 virtual void OnShutdown() OVERRIDE; | 63 virtual void OnShutdown() OVERRIDE; |
| 64 | 64 |
| 65 // The context associated with this SharedModuleService. | 65 // The context associated with this SharedModuleService. |
| 66 content::BrowserContext* context_; | 66 content::BrowserContext* context_; |
| 67 | 67 |
| 68 // Whether or not we are actively observing installs. | 68 // Whether or not we are actively observing installs. |
| 69 bool observing_; | 69 bool observing_; |
| 70 | 70 |
| 71 DISALLOW_COPY_AND_ASSIGN(SharedModuleService); | 71 DISALLOW_COPY_AND_ASSIGN(SharedModuleService); |
| 72 }; | 72 }; |
| 73 | 73 |
| 74 } // namespace extensions | 74 } // namespace extensions |
| 75 | 75 |
| 76 #endif // CHROME_BROWSER_EXTENSIONS_SHARED_MODULE_SERVICE_H_ | 76 #endif // CHROME_BROWSER_EXTENSIONS_SHARED_MODULE_SERVICE_H_ |
| OLD | NEW |