1 // Copyright (c) 2013 Intel Corporation. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 #ifndef XWALK_APPLICATION_COMMON_MANIFEST_HANDLERS_CSP_HANDLER_H_
5 #define XWALK_APPLICATION_COMMON_MANIFEST_HANDLERS_CSP_HANDLER_H_
11 #include "xwalk/application/common/application_data.h"
12 #include "xwalk/application/common/manifest_handler.h"
15 namespace application {
17 class CSPInfo : public ApplicationData::ManifestData {
22 void SetDirective(const std::string& directive_name,
23 const std::vector<std::string>& directive_value) {
24 policies_[directive_name] = directive_value;
26 const std::map<std::string, std::vector<std::string> >&
27 GetDirectives() const { return policies_; }
30 std::map<std::string, std::vector<std::string> > policies_;
33 class CSPHandler : public ManifestHandler {
35 explicit CSPHandler(Package::Type type);
36 virtual ~CSPHandler();
38 virtual bool Parse(scoped_refptr<ApplicationData> application,
39 base::string16* error) OVERRIDE;
40 virtual bool AlwaysParseForType(Manifest::Type type) const OVERRIDE;
41 virtual std::vector<std::string> Keys() const OVERRIDE;
44 Package::Type package_type_;
46 DISALLOW_COPY_AND_ASSIGN(CSPHandler);
49 } // namespace application
52 #endif // XWALK_APPLICATION_COMMON_MANIFEST_HANDLERS_CSP_HANDLER_H_