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

Side by Side Diff: generated_files_will_not_submit/permissions_api.h

Issue 9114036: Code generation for extensions api (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: more rework Created 8 years, 11 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_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
42 // whether |out| was successfully populated.
43 static bool Populate(const Value& value, Permissions* out);
44
45 // Returns a new Value representing the serialized form
46 // of this Permissions object.
47 Value* ToValue() const;
48
49 private:
50 DISALLOW_COPY_AND_ASSIGN(Permissions);
51 };
52
53 //
54 // Functions
55 //
56
57 struct Contains {
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 {
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__
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698