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

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: switched namespaces, various 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
25 namespace extensions {
26 namespace permissions_api {
27
28 //
29 // Types
30 //
31
32 struct Permissions {
33 ~Permissions();
34 Permissions();
35
36 // List of origin permissions.
37 scoped_ptr<std::vector<std::string> > origins;
38
39 // List of named permissions (does not include hosts or origins).
40 scoped_ptr<std::vector<std::string> > permissions;
41
42 // Populates a Permissions object from a Value. Returns whether |out| was
43 // successfully populated.
44 static bool Populate(const Value& value, Permissions* out);
45
46 // Returns a new DictionaryValue representing the serialized form of this
47 // Permissions object.
48 DictionaryValue* ToValue() const;
49
50 private:
51 DISALLOW_COPY_AND_ASSIGN(Permissions);
52 };
53
54 //
55 // Functions
56 //
57
58 namespace Contains {
59 struct Params {
60 Permissions permissions;
61
62 Params();
63 ~Params();
64
65 static bool Populate(const ListValue& args, Params* out);
66
67 private:
68 DISALLOW_COPY_AND_ASSIGN(Params);
69 };
70
71 // True if the extension has the specified permissions.
72 class Result {
jstritar 2012/01/23 22:42:07 Are you planning on updating the permission functi
calamity 2012/01/24 22:57:22 Done.
73 public:
74 static Value* Create(const bool result);
75
76 private:
77 Result() {};
78 DISALLOW_COPY_AND_ASSIGN(Result);
79 };
80
81 };
82
83 namespace GetAll {
84
85 // The extension's active permissions.
86 class Result {
87 public:
88 static Value* Create(const Permissions& permissions);
89
90 private:
91 Result() {};
92 DISALLOW_COPY_AND_ASSIGN(Result);
93 };
94
95 };
96
97 namespace Request {
98 struct Params {
99 Permissions permissions;
100
101 Params();
102 ~Params();
103
104 static bool Populate(const ListValue& args, Params* out);
105
106 private:
107 DISALLOW_COPY_AND_ASSIGN(Params);
108 };
109
110 // True if the user granted the specified permissions.
111 class Result {
112 public:
113 static Value* Create(const bool granted);
114
115 private:
116 Result() {};
117 DISALLOW_COPY_AND_ASSIGN(Result);
118 };
119
120 };
121
122 namespace Remove {
123 struct Params {
124 Permissions permissions;
125
126 Params();
127 ~Params();
128
129 static bool Populate(const ListValue& args, Params* out);
130
131 private:
132 DISALLOW_COPY_AND_ASSIGN(Params);
133 };
134
135 // True if the permissions were removed.
136 class Result {
137 public:
138 static Value* Create(const bool removed);
139
140 private:
141 Result() {};
142 DISALLOW_COPY_AND_ASSIGN(Result);
143 };
144
145 };
146
147
148
149 } // namespace extensions
150 } // namespace permissions_api
151
152 #endif // CHROME_COMMON_EXTENSIONS_API_PERMISSIONS_API_H__
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698