#ifndef CHROME_COMMON_EXTENSIONS_CHROME_EXTENSIONS_CLIENT_H_
#define CHROME_COMMON_EXTENSIONS_CHROME_EXTENSIONS_CLIENT_H_
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/lazy_instance.h"
#include "chrome/common/extensions/permissions/chrome_api_permissions.h"
#include "chrome/common/extensions/permissions/chrome_permission_message_provider.h"
#include "extensions/common/extensions_client.h"
namespace extensions {
class ChromeExtensionsClient : public ExtensionsClient {
public:
ChromeExtensionsClient();
virtual ~ChromeExtensionsClient();
virtual void Initialize() OVERRIDE;
virtual const PermissionsProvider& GetPermissionsProvider() const OVERRIDE;
virtual const PermissionMessageProvider& GetPermissionMessageProvider() const
OVERRIDE;
virtual FeatureProvider* GetFeatureProviderByName(const std::string& name)
const OVERRIDE;
virtual void FilterHostPermissions(
const URLPatternSet& hosts,
URLPatternSet* new_hosts,
std::set<PermissionMessage>* messages) const OVERRIDE;
virtual void SetScriptingWhitelist(const ScriptingWhitelist& whitelist)
OVERRIDE;
virtual const ScriptingWhitelist& GetScriptingWhitelist() const OVERRIDE;
virtual URLPatternSet GetPermittedChromeSchemeHosts(
const Extension* extension,
const APIPermissionSet& api_permissions) const OVERRIDE;
virtual bool IsScriptableURL(const GURL& url, std::string* error) const
OVERRIDE;
virtual bool IsAPISchemaGenerated(const std::string& name) const OVERRIDE;
virtual base::StringPiece GetAPISchema(const std::string& name) const
OVERRIDE;
virtual void AddExtraFeatureFilters(SimpleFeature* feature) const OVERRIDE;
static ChromeExtensionsClient* GetInstance();
private:
const ChromeAPIPermissions chrome_api_permissions_;
const ChromePermissionMessageProvider permission_message_provider_;
ScriptingWhitelist scripting_whitelist_;
friend struct base::DefaultLazyInstanceTraits<ChromeExtensionsClient>;
DISALLOW_COPY_AND_ASSIGN(ChromeExtensionsClient);
};
}
#endif