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

Side by Side Diff: generated_files_will_not_submit/windows.h

Issue 9309044: Supporting more APIs with json_schema_compiler (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: more rework 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/windows.json
7 // DO NOT EDIT.
8
9 #ifndef CHROME_COMMON_EXTENSIONS_API_WINDOWS_H__
10 #define CHROME_COMMON_EXTENSIONS_API_WINDOWS_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 using base::Value;
22 using base::DictionaryValue;
23 using base::ListValue;
24
25 namespace extensions {
26 namespace api {
27
28 namespace tabs {
29 struct Tab;
30 }
31
32 namespace windows {
33
34 //
35 // Types
36 //
37
38 struct Window {
39 ~Window();
40 Window();
41
42 // Array of $ref:Tab objects representing the current tabs in the window.
43 scoped_ptr<std::vector<linked_ptr<tabs::Tab> > > tabs;
44
45 // The offset of the window from the top edge of the screen in pixels.
46 int top;
47
48 // The height of the window in pixels.
49 int height;
50
51 // The width of the window in pixels.
52 int width;
53
54 // The state of this browser window.
55 std::string state;
56
57 // Whether the window is currently the focused window.
58 bool focused;
59
60 // The offset of the window from the left edge of the screen in pixels.
61 int left;
62
63 // The type of browser window this is.
64 std::string type;
65
66 // The ID of the window. Window IDs are unique within a browser session.
67 int id;
68
69 // Whether the window is incognito.
70 bool incognito;
71
72 // Populates a Window object from a Value. Returns whether |out| was
73 // successfully populated.
74 static bool Populate(const Value& value, Window* out);
75
76 // Returns a new DictionaryValue representing the serialized form of this
77 // Window object. Passesownership to caller.
78 DictionaryValue* ToValue() const;
79
80 private:
81 DISALLOW_COPY_AND_ASSIGN(Window);
82 };
83
84 //
85 // Functions
86 //
87
88 namespace Get {
89 struct Params {
90 struct GetInfo {
91 ~GetInfo();
92 GetInfo();
93
94 // If true, the window object will have a <var>tabs</var> property that
95 // contains a list of the $ref:Tab objects
96 scoped_ptr<bool> populate;
97
98 // Populates a GetInfo object from a Value. Returns whether |out| was
99 // successfully populated.
100 static bool Populate(const Value& value, GetInfo* out);
101
102
103 private:
104 DISALLOW_COPY_AND_ASSIGN(GetInfo);
105 };
106
107 int window_id;
108
109 scoped_ptr<GetInfo> get_info;
110
111 ~Params();
112
113 static scoped_ptr<Params> Create(const ListValue& args);
114
115 private:
116 Params();
117
118 DISALLOW_COPY_AND_ASSIGN(Params);
119 };
120
121 class Result {
122 public:
123 static Value* Create(const Window& window);
124
125 private:
126 Result() {};
127 DISALLOW_COPY_AND_ASSIGN(Result);
128 };
129
130 };
131
132 namespace GetCurrent {
133 struct Params {
134 struct GetInfo {
135 ~GetInfo();
136 GetInfo();
137
138 // If true, the window object will have a <var>tabs</var> property that
139 // contains a list of the $ref:Tab objects
140 scoped_ptr<bool> populate;
141
142 // Populates a GetInfo object from a Value. Returns whether |out| was
143 // successfully populated.
144 static bool Populate(const Value& value, GetInfo* out);
145
146
147 private:
148 DISALLOW_COPY_AND_ASSIGN(GetInfo);
149 };
150
151 scoped_ptr<GetInfo> get_info;
152
153 ~Params();
154
155 static scoped_ptr<Params> Create(const ListValue& args);
156
157 private:
158 Params();
159
160 DISALLOW_COPY_AND_ASSIGN(Params);
161 };
162
163 class Result {
164 public:
165 static Value* Create(const Window& window);
166
167 private:
168 Result() {};
169 DISALLOW_COPY_AND_ASSIGN(Result);
170 };
171
172 };
173
174 namespace Create {
175 struct Params {
176 struct CreateData {
177 ~CreateData();
178 CreateData();
179
180 // The id of the tab for which you want to adopt to the new window.
181 scoped_ptr<int> tab_id;
182
183 // A URL or list of URLs to open as tabs in the window. Fully-qualified UR Ls
184 // must include a scheme (i.e. 'http://www.google.com', not 'www.google.co m').
185 // Relative URLs will be relative to the current page within the extension .
186 // Defaults to the New Tab Page.
187 scoped_ptr<std::string> url;
188
189 // The number of pixels to position the new window from the top edge of th e
190 // screen. If not specified, the new window is offset naturally from the l ast
191 // focusd window. This value is ignored for panels.
192 scoped_ptr<int> top;
193
194 // The height in pixels of the new window. If not specified defaults to a
195 // natural height.
196 scoped_ptr<int> height;
197
198 // The width in pixels of the new window. If not specified defaults to a
199 // natural width.
200 scoped_ptr<int> width;
201
202 // If true, opens an active window. If false, opens an inactive window.
203 scoped_ptr<bool> focused;
204
205 // The number of pixels to position the new window from the left edge of t he
206 // screen. If not specified, the new window is offset naturally from the l ast
207 // focusd window. This value is ignored for panels.
208 scoped_ptr<int> left;
209
210 // Specifies what type of browser window to create. The 'panel' type creat es a
211 // popup unless the '--enable-panels' flag is set.
212 scoped_ptr<std::string> type;
213
214 // Whether the new window should be an incognito window.
215 scoped_ptr<bool> incognito;
216
217 // Populates a CreateData object from a Value. Returns whether |out| was
218 // successfully populated.
219 static bool Populate(const Value& value, CreateData* out);
220
221
222 private:
223 DISALLOW_COPY_AND_ASSIGN(CreateData);
224 };
225
226 scoped_ptr<CreateData> create_data;
227
228 ~Params();
229
230 static scoped_ptr<Params> Create(const ListValue& args);
231
232 private:
233 Params();
234
235 DISALLOW_COPY_AND_ASSIGN(Params);
236 };
237
238 class Result {
239 public:
240 // Contains details about the created window.
241 static Value* Create(const scoped_ptr<Window>& window);
242
243 private:
244 Result() {};
245 DISALLOW_COPY_AND_ASSIGN(Result);
246 };
247
248 };
249
250 namespace GetAll {
251 struct Params {
252 struct GetInfo {
253 ~GetInfo();
254 GetInfo();
255
256 // If true, each window object will have a <var>tabs</var> property that
257 // contains a list of the $ref:Tab objects for that window.
258 scoped_ptr<bool> populate;
259
260 // Populates a GetInfo object from a Value. Returns whether |out| was
261 // successfully populated.
262 static bool Populate(const Value& value, GetInfo* out);
263
264
265 private:
266 DISALLOW_COPY_AND_ASSIGN(GetInfo);
267 };
268
269 scoped_ptr<GetInfo> get_info;
270
271 ~Params();
272
273 static scoped_ptr<Params> Create(const ListValue& args);
274
275 private:
276 Params();
277
278 DISALLOW_COPY_AND_ASSIGN(Params);
279 };
280
281 class Result {
282 public:
283 static Value* Create(const std::vector<linked_ptr<Window> > windows);
284
285 private:
286 Result() {};
287 DISALLOW_COPY_AND_ASSIGN(Result);
288 };
289
290 };
291
292 namespace Update {
293 struct Params {
294 struct UpdateInfo {
295 ~UpdateInfo();
296 UpdateInfo();
297
298 // The offset from the top edge of the screen to move the window to in pix els.
299 // This value is ignored for panels.
300 scoped_ptr<int> top;
301
302 // If true, causes the window to be displayed in a manner that draws the u ser's
303 // attention to the window, without changing the focused window. The effec t
304 // lasts until the user changes focus to the window. This option has no ef fect
305 // if the window already has focus. Set to false to cancel a previous draw
306 // attention request.
307 scoped_ptr<bool> draw_attention;
308
309 // The height to resize the window to in pixels. This value is ignored for
310 // panels.
311 scoped_ptr<int> height;
312
313 // The width to resize the window to in pixels. This value is ignored for
314 // panels.
315 scoped_ptr<int> width;
316
317 // The new state of the window. The 'minimized' and 'maximized' states can not
318 // be combined with 'left', 'top', 'width' or 'height'.
319 scoped_ptr<std::string> state;
320
321 // If true, brings the window to the front. If false, brings the next wind ow in
322 // the z-order to the front.
323 scoped_ptr<bool> focused;
324
325 // The offset from the left edge of the screen to move the window to in pi xels.
326 // This value is ignored for panels.
327 scoped_ptr<int> left;
328
329 // Populates a UpdateInfo object from a Value. Returns whether |out| was
330 // successfully populated.
331 static bool Populate(const Value& value, UpdateInfo* out);
332
333
334 private:
335 DISALLOW_COPY_AND_ASSIGN(UpdateInfo);
336 };
337
338 int window_id;
339
340 UpdateInfo update_info;
341
342 ~Params();
343
344 static scoped_ptr<Params> Create(const ListValue& args);
345
346 private:
347 Params();
348
349 DISALLOW_COPY_AND_ASSIGN(Params);
350 };
351
352 class Result {
353 public:
354 static Value* Create(const Window& window);
355
356 private:
357 Result() {};
358 DISALLOW_COPY_AND_ASSIGN(Result);
359 };
360
361 };
362
363 namespace Remove {
364 struct Params {
365 int window_id;
366
367 ~Params();
368
369 static scoped_ptr<Params> Create(const ListValue& args);
370
371 private:
372 Params();
373
374 DISALLOW_COPY_AND_ASSIGN(Params);
375 };
376
377 class Result {
378 public:
379 static Value* Create();
380
381 private:
382 Result() {};
383 DISALLOW_COPY_AND_ASSIGN(Result);
384 };
385
386 };
387
388 namespace GetLastFocused {
389 struct Params {
390 struct GetInfo {
391 ~GetInfo();
392 GetInfo();
393
394 // If true, the window object will have a <var>tabs</var> property that
395 // contains a list of the $ref:Tab objects
396 scoped_ptr<bool> populate;
397
398 // Populates a GetInfo object from a Value. Returns whether |out| was
399 // successfully populated.
400 static bool Populate(const Value& value, GetInfo* out);
401
402
403 private:
404 DISALLOW_COPY_AND_ASSIGN(GetInfo);
405 };
406
407 scoped_ptr<GetInfo> get_info;
408
409 ~Params();
410
411 static scoped_ptr<Params> Create(const ListValue& args);
412
413 private:
414 Params();
415
416 DISALLOW_COPY_AND_ASSIGN(Params);
417 };
418
419 class Result {
420 public:
421 static Value* Create(const Window& window);
422
423 private:
424 Result() {};
425 DISALLOW_COPY_AND_ASSIGN(Result);
426 };
427
428 };
429
430
431 } // windows
432 } // api
433 } // extensions
434
435 #endif // CHROME_COMMON_EXTENSIONS_API_WINDOWS_H__
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698