OLD | NEW |
---|---|
(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_API_H__ | |
10 #define CHROME_COMMON_EXTENSIONS_API_PERMISSIONS_API_H__ | |
11 #pragma once | |
12 | |
13 #include <string> | |
14 #include <vector> | |
15 | |
16 #include "base/basictypes.h" | |
17 #include "base/memory/scoped_ptr.h" | |
18 #include "base/values.h" | |
19 | |
20 using base::Value; | |
21 using base::DictionaryValue; | |
22 using base::ListValue; | |
23 | |
24 namespace extensions { | |
25 namespace permissions_api { | |
26 | |
27 // | |
28 // Types | |
29 // | |
30 | |
31 struct Permissions { | |
32 ~Permissions(); | |
33 Permissions(); | |
34 | |
35 // List of origin permissions. | |
36 scoped_ptr<std::vector<std::string> > origins; | |
37 | |
38 // List of named permissions (does not include hosts or origins). | |
39 scoped_ptr<std::vector<std::string> > permissions; | |
40 | |
41 // Populates a Permissions object from a Value. Returns whether |out| was | |
42 // successfully populated. | |
43 static bool Populate(const Value& value, Permissions* out); | |
Aaron Boodman
2012/01/19 23:31:13
It seems like it would be more natural to have thi
calamity
2012/01/23 05:14:45
One problem that may arise is that Creating for me
| |
44 | |
45 // Returns a new DictionaryValue representing the serialized form of this | |
46 // Permissions object. | |
47 DictionaryValue* ToValue() const; | |
48 | |
49 private: | |
50 DISALLOW_COPY_AND_ASSIGN(Permissions); | |
51 }; | |
52 | |
53 // | |
54 // Functions | |
55 // | |
56 | |
57 struct Contains { | |
Aaron Boodman
2012/01/19 23:31:13
Can anything else go in Contains? If not, it is a
calamity
2012/01/23 05:14:45
Done.
| |
58 struct Params { | |
59 Permissions permissions; | |
60 | |
61 Params(); | |
62 ~Params(); | |
63 | |
64 static bool Populate(const ListValue& args, Params* out); | |
65 | |
66 private: | |
67 DISALLOW_COPY_AND_ASSIGN(Params); | |
68 }; | |
69 | |
70 // True if the extension has the specified permissions. | |
71 class Result { | |
72 public: | |
73 static Value* Create(const bool result); | |
74 | |
75 private: | |
76 Result() {}; | |
77 DISALLOW_COPY_AND_ASSIGN(Result); | |
78 }; | |
79 | |
80 }; | |
81 | |
82 struct GetAll { | |
83 struct Params { | |
Yoyo Zhou
2012/01/19 02:19:40
Can this be omitted?
calamity
2012/01/20 01:10:25
Yeah, it was being generated for consistency.
| |
84 }; | |
85 | |
86 // The extension's active permissions. | |
87 class Result { | |
88 public: | |
89 static Value* Create(const Permissions& permissions); | |
90 | |
91 private: | |
92 Result() {}; | |
93 DISALLOW_COPY_AND_ASSIGN(Result); | |
94 }; | |
95 | |
96 }; | |
97 | |
98 struct Request { | |
99 struct Params { | |
100 Permissions permissions; | |
101 | |
102 Params(); | |
103 ~Params(); | |
104 | |
105 static bool Populate(const ListValue& args, Params* out); | |
106 | |
107 private: | |
108 DISALLOW_COPY_AND_ASSIGN(Params); | |
109 }; | |
110 | |
111 // True if the user granted the specified permissions. | |
112 class Result { | |
113 public: | |
114 static Value* Create(const bool granted); | |
115 | |
116 private: | |
117 Result() {}; | |
118 DISALLOW_COPY_AND_ASSIGN(Result); | |
119 }; | |
120 | |
121 }; | |
122 | |
123 struct Remove { | |
124 struct Params { | |
125 Permissions permissions; | |
126 | |
127 Params(); | |
128 ~Params(); | |
129 | |
130 static bool Populate(const ListValue& args, Params* out); | |
131 | |
132 private: | |
133 DISALLOW_COPY_AND_ASSIGN(Params); | |
134 }; | |
135 | |
136 // True if the permissions were removed. | |
137 class Result { | |
138 public: | |
139 static Value* Create(const bool removed); | |
140 | |
141 private: | |
142 Result() {}; | |
143 DISALLOW_COPY_AND_ASSIGN(Result); | |
144 }; | |
145 | |
146 }; | |
147 | |
148 | |
149 | |
150 } // namespace extensions | |
151 } // namespace permissions_api | |
152 | |
153 #endif // CHROME_COMMON_EXTENSIONS_API_PERMISSIONS_API_H__ | |
OLD | NEW |