- add third_party src.
[platform/framework/web/crosswalk.git] / src / xwalk / application / common / manifest_handlers / permissions_handler.h
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
5 #ifndef XWALK_APPLICATION_COMMON_MANIFEST_HANDLERS_PERMISSIONS_HANDLER_H_
6 #define XWALK_APPLICATION_COMMON_MANIFEST_HANDLERS_PERMISSIONS_HANDLER_H_
7
8 #include <string>
9 #include <vector>
10
11 #include "xwalk/application/common/manifest_handler.h"
12
13 namespace xwalk {
14 namespace application {
15
16 class PermissionsInfo: public ApplicationData::ManifestData {
17  public:
18   PermissionsInfo();
19   virtual ~PermissionsInfo();
20
21   const std::vector<std::string>& GetAPIPermissions() const {
22     return api_permissions_;}
23   void SetAPIPermissions(const std::vector<std::string>& api_permissions) {
24     api_permissions_ = api_permissions;
25   }
26
27  private:
28   std::vector<std::string> api_permissions_;
29   DISALLOW_COPY_AND_ASSIGN(PermissionsInfo);
30 };
31
32 class PermissionsHandler: public ManifestHandler {
33  public:
34   PermissionsHandler();
35   virtual ~PermissionsHandler();
36
37   virtual bool Parse(scoped_refptr<ApplicationData> application,
38                      string16* error) OVERRIDE;
39   virtual bool AlwaysParseForType(Manifest::Type type) const OVERRIDE;
40   virtual std::vector<std::string> Keys() const OVERRIDE;
41
42  private:
43   DISALLOW_COPY_AND_ASSIGN(PermissionsHandler);
44 };
45
46 }  // namespace application
47 }  // namespace xwalk
48
49 #endif  // XWALK_APPLICATION_COMMON_MANIFEST_HANDLERS_PERMISSIONS_HANDLER_H_