#ifndef CHROME_BROWSER_EXTENSIONS_PLUGIN_MANAGER_H_
#define CHROME_BROWSER_EXTENSIONS_PLUGIN_MANAGER_H_
#include "chrome/common/extensions/manifest_handlers/nacl_modules_handler.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
#include "extensions/browser/browser_context_keyed_api_factory.h"
class GURL;
class Profile;
namespace content {
class BrowserContext;
}
namespace extensions {
class PluginManager : public BrowserContextKeyedAPI,
public content::NotificationObserver {
public:
explicit PluginManager(content::BrowserContext* context);
virtual ~PluginManager();
static BrowserContextKeyedAPIFactory<PluginManager>* GetFactoryInstance();
virtual void Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) OVERRIDE;
private:
friend class BrowserContextKeyedAPIFactory<PluginManager>;
void RegisterNaClModule(const NaClModuleInfo& info);
void UnregisterNaClModule(const NaClModuleInfo& info);
void UpdatePluginListWithNaClModules();
extensions::NaClModuleInfo::List::iterator FindNaClModule(const GURL& url);
static const char* service_name() { return "PluginManager"; }
static const bool kServiceIsNULLWhileTesting = true;
extensions::NaClModuleInfo::List nacl_module_list_;
content::NotificationRegistrar registrar_;
Profile* profile_;
};
}
#endif