#ifndef EXTENSIONS_COMMON_MANIFEST_HANDLERS_CSP_INFO_H_
#define EXTENSIONS_COMMON_MANIFEST_HANDLERS_CSP_INFO_H_
#include <string>
#include "extensions/common/extension.h"
#include "extensions/common/manifest_handler.h"
namespace extensions {
struct CSPInfo : public Extension::ManifestData {
explicit CSPInfo(const std::string& security_policy);
virtual ~CSPInfo();
std::string content_security_policy;
static const std::string& GetContentSecurityPolicy(
const Extension* extension);
static const std::string& GetResourceContentSecurityPolicy(
const Extension* extension,
const std::string& relative_path);
};
class CSPHandler : public ManifestHandler {
public:
explicit CSPHandler(bool is_platform_app);
virtual ~CSPHandler();
virtual bool Parse(Extension* extension, base::string16* error) OVERRIDE;
virtual bool AlwaysParseForType(Manifest::Type type) const OVERRIDE;
private:
virtual const std::vector<std::string> Keys() const OVERRIDE;
bool is_platform_app_;
DISALLOW_COPY_AND_ASSIGN(CSPHandler);
};
}
#endif