Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(510)

Side by Side Diff: generated_files_will_not_submit/permissions.h

Issue 9309044: Supporting more APIs with json_schema_compiler (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: rework, add a couple of tests Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. 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 // GENERATED FROM THE API DEFINITION IN
6 // chrome/common/extensions/api/permissions.json
7 // DO NOT EDIT.
8
9 #ifndef CHROME_COMMON_EXTENSIONS_API_PERMISSIONS_H__
10 #define CHROME_COMMON_EXTENSIONS_API_PERMISSIONS_H__
11 #pragma once
12
13 #include <string>
14 #include <vector>
15
16 #include "base/basictypes.h"
17 #include "base/memory/linked_ptr.h"
18 #include "base/memory/scoped_ptr.h"
19 #include "base/values.h"
20
21 namespace extensions {
22 namespace api {
23 namespace permissions {
24
25 //
26 // Types
27 //
28
29 struct Permissions {
30 ~Permissions();
31 Permissions();
32
33 // List of origin permissions.
34 scoped_ptr<std::vector<std::string> > origins;
35
36 // List of named permissions (does not include hosts or origins).
37 scoped_ptr<std::vector<std::string> > permissions;
38
39 // Populates a Permissions object from a Value. Returns whether |out| was
40 // successfully populated.
41 static bool Populate(const Value& value, Permissions* out);
42
43 // Returns a new DictionaryValue representing the serialized form of this
44 // Permissions object. Passes ownership to caller.
45 scoped_ptr<DictionaryValue> ToValue() const;
46
47 private:
48 DISALLOW_COPY_AND_ASSIGN(Permissions);
49 };
50
51 //
52 // Functions
53 //
54
55 namespace Contains {
56 struct Params {
57 Permissions permissions;
58
59 ~Params();
60
61 static scoped_ptr<Params> Create(const ListValue& args);
62
63 private:
64 Params();
65
66 DISALLOW_COPY_AND_ASSIGN(Params);
67 };
68
69 namespace Result {
70 // True if the extension has the specified permissions.
71 Value* Create(const bool result);
72 };
73
74 };
75
76 namespace GetAll {
77
78 namespace Result {
79 // The extension's active permissions.
80 Value* Create(const Permissions& permissions);
81 };
82
83 };
84
85 namespace Request {
86 struct Params {
87 Permissions permissions;
88
89 ~Params();
90
91 static scoped_ptr<Params> Create(const ListValue& args);
92
93 private:
94 Params();
95
96 DISALLOW_COPY_AND_ASSIGN(Params);
97 };
98
99 namespace Result {
100 // True if the user granted the specified permissions.
101 Value* Create(const bool granted);
102 };
103
104 };
105
106 namespace Remove {
107 struct Params {
108 Permissions permissions;
109
110 ~Params();
111
112 static scoped_ptr<Params> Create(const ListValue& args);
113
114 private:
115 Params();
116
117 DISALLOW_COPY_AND_ASSIGN(Params);
118 };
119
120 namespace Result {
121 // True if the permissions were removed.
122 Value* Create(const bool removed);
123 };
124
125 };
126
127
128 } // permissions
129 } // api
130 } // extensions
131
132 #endif // CHROME_COMMON_EXTENSIONS_API_PERMISSIONS_H__
OLDNEW
« no previous file with comments | « generated_files_will_not_submit/experimental.declarative.cc ('k') | generated_files_will_not_submit/permissions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698