#ifndef CHROME_BROWSER_EXTENSIONS_SHARED_MODULE_SERVICE_H_
#define CHROME_BROWSER_EXTENSIONS_SHARED_MODULE_SERVICE_H_
#include <list>
#include "chrome/browser/extensions/install_observer.h"
#include "extensions/common/manifest_handlers/shared_module_info.h"
namespace content {
class BrowserContext;
}
namespace extensions {
class Extension;
class ExtensionSet;
class SharedModuleService : public InstallObserver {
public:
enum ImportStatus {
IMPORT_STATUS_OK,
IMPORT_STATUS_UNSATISFIED,
IMPORT_STATUS_UNRECOVERABLE
};
explicit SharedModuleService(content::BrowserContext* context);
virtual ~SharedModuleService();
ImportStatus CheckImports(
const extensions::Extension* extension,
std::list<SharedModuleInfo::ImportInfo>* missing_modules,
std::list<SharedModuleInfo::ImportInfo>* outdated_modules);
ImportStatus SatisfyImports(const extensions::Extension* extension);
private:
scoped_ptr<const ExtensionSet> GetDependentExtensions(
const Extension* extension);
void PruneSharedModulesOnUninstall(const Extension* extension);
virtual void OnExtensionUninstalled(const Extension* extension) OVERRIDE;
virtual void OnShutdown() OVERRIDE;
content::BrowserContext* context_;
bool observing_;
DISALLOW_COPY_AND_ASSIGN(SharedModuleService);
};
}
#endif