| 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/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 | 
|  | 112     ~Params(); | 
|  | 113 | 
|  | 114     static scoped_ptr<Params> Create(const ListValue& args); | 
|  | 115 | 
|  | 116    private: | 
|  | 117     Params(); | 
|  | 118 | 
|  | 119     DISALLOW_COPY_AND_ASSIGN(Params); | 
|  | 120   }; | 
|  | 121 | 
|  | 122   class Result { | 
|  | 123    public: | 
|  | 124     static Value* Create(const Window& window); | 
|  | 125 | 
|  | 126    private: | 
|  | 127     Result() {}; | 
|  | 128     DISALLOW_COPY_AND_ASSIGN(Result); | 
|  | 129   }; | 
|  | 130 | 
|  | 131 }; | 
|  | 132 | 
|  | 133 namespace GetCurrent { | 
|  | 134   struct Params { | 
|  | 135     struct GetInfo { | 
|  | 136       ~GetInfo(); | 
|  | 137       GetInfo(); | 
|  | 138 | 
|  | 139       // If true, the window object will have a <var>tabs</var> property that | 
|  | 140       // contains a list of the $ref:Tab objects | 
|  | 141       scoped_ptr<bool> populate; | 
|  | 142 | 
|  | 143       // Populates a GetInfo object from a Value. Returns whether |out| was | 
|  | 144       // successfully populated. | 
|  | 145       static bool Populate(const Value& value, GetInfo* out); | 
|  | 146 | 
|  | 147 | 
|  | 148      private: | 
|  | 149       DISALLOW_COPY_AND_ASSIGN(GetInfo); | 
|  | 150     }; | 
|  | 151 | 
|  | 152     scoped_ptr<GetInfo> get_info; | 
|  | 153 | 
|  | 154 | 
|  | 155     ~Params(); | 
|  | 156 | 
|  | 157     static scoped_ptr<Params> Create(const ListValue& args); | 
|  | 158 | 
|  | 159    private: | 
|  | 160     Params(); | 
|  | 161 | 
|  | 162     DISALLOW_COPY_AND_ASSIGN(Params); | 
|  | 163   }; | 
|  | 164 | 
|  | 165   class Result { | 
|  | 166    public: | 
|  | 167     static Value* Create(const Window& window); | 
|  | 168 | 
|  | 169    private: | 
|  | 170     Result() {}; | 
|  | 171     DISALLOW_COPY_AND_ASSIGN(Result); | 
|  | 172   }; | 
|  | 173 | 
|  | 174 }; | 
|  | 175 | 
|  | 176 namespace Create { | 
|  | 177   struct Params { | 
|  | 178     struct CreateData { | 
|  | 179       ~CreateData(); | 
|  | 180       CreateData(); | 
|  | 181 | 
|  | 182       // The id of the tab for which you want to adopt to the new window. | 
|  | 183       scoped_ptr<int> tab_id; | 
|  | 184 | 
|  | 185       // A URL or list of URLs to open as tabs in the window. Fully-qualified UR
     Ls | 
|  | 186       // must include a scheme (i.e. 'http://www.google.com', not 'www.google.co
     m'). | 
|  | 187       // Relative URLs will be relative to the current page within the extension
     . | 
|  | 188       // Defaults to the New Tab Page. | 
|  | 189       scoped_ptr<std::string> url; | 
|  | 190 | 
|  | 191       // The number of pixels to position the new window from the top edge of th
     e | 
|  | 192       // screen. If not specified, the new window is offset naturally from the l
     ast | 
|  | 193       // focusd window. This value is ignored for panels. | 
|  | 194       scoped_ptr<int> top; | 
|  | 195 | 
|  | 196       // The height in pixels of the new window. If not specified defaults to a | 
|  | 197       // natural height. | 
|  | 198       scoped_ptr<int> height; | 
|  | 199 | 
|  | 200       // The width in pixels of the new window. If not specified defaults to a | 
|  | 201       // natural width. | 
|  | 202       scoped_ptr<int> width; | 
|  | 203 | 
|  | 204       // If true, opens an active window. If false, opens an inactive window. | 
|  | 205       scoped_ptr<bool> focused; | 
|  | 206 | 
|  | 207       // The number of pixels to position the new window from the left edge of t
     he | 
|  | 208       // screen. If not specified, the new window is offset naturally from the l
     ast | 
|  | 209       // focusd window. This value is ignored for panels. | 
|  | 210       scoped_ptr<int> left; | 
|  | 211 | 
|  | 212       // Specifies what type of browser window to create. The 'panel' type creat
     es a | 
|  | 213       // popup unless the '--enable-panels' flag is set. | 
|  | 214       scoped_ptr<std::string> type; | 
|  | 215 | 
|  | 216       // Whether the new window should be an incognito window. | 
|  | 217       scoped_ptr<bool> incognito; | 
|  | 218 | 
|  | 219       // Populates a CreateData object from a Value. Returns whether |out| was | 
|  | 220       // successfully populated. | 
|  | 221       static bool Populate(const Value& value, CreateData* out); | 
|  | 222 | 
|  | 223 | 
|  | 224      private: | 
|  | 225       DISALLOW_COPY_AND_ASSIGN(CreateData); | 
|  | 226     }; | 
|  | 227 | 
|  | 228     scoped_ptr<CreateData> create_data; | 
|  | 229 | 
|  | 230 | 
|  | 231     ~Params(); | 
|  | 232 | 
|  | 233     static scoped_ptr<Params> Create(const ListValue& args); | 
|  | 234 | 
|  | 235    private: | 
|  | 236     Params(); | 
|  | 237 | 
|  | 238     DISALLOW_COPY_AND_ASSIGN(Params); | 
|  | 239   }; | 
|  | 240 | 
|  | 241   class Result { | 
|  | 242    public: | 
|  | 243     // Contains details about the created window. | 
|  | 244     static Value* Create(const scoped_ptr<Window>& window); | 
|  | 245 | 
|  | 246    private: | 
|  | 247     Result() {}; | 
|  | 248     DISALLOW_COPY_AND_ASSIGN(Result); | 
|  | 249   }; | 
|  | 250 | 
|  | 251 }; | 
|  | 252 | 
|  | 253 namespace GetAll { | 
|  | 254   struct Params { | 
|  | 255     struct GetInfo { | 
|  | 256       ~GetInfo(); | 
|  | 257       GetInfo(); | 
|  | 258 | 
|  | 259       // If true, each window object will have a <var>tabs</var> property that | 
|  | 260       // contains a list of the $ref:Tab objects for that window. | 
|  | 261       scoped_ptr<bool> populate; | 
|  | 262 | 
|  | 263       // Populates a GetInfo object from a Value. Returns whether |out| was | 
|  | 264       // successfully populated. | 
|  | 265       static bool Populate(const Value& value, GetInfo* out); | 
|  | 266 | 
|  | 267 | 
|  | 268      private: | 
|  | 269       DISALLOW_COPY_AND_ASSIGN(GetInfo); | 
|  | 270     }; | 
|  | 271 | 
|  | 272     scoped_ptr<GetInfo> get_info; | 
|  | 273 | 
|  | 274 | 
|  | 275     ~Params(); | 
|  | 276 | 
|  | 277     static scoped_ptr<Params> Create(const ListValue& args); | 
|  | 278 | 
|  | 279    private: | 
|  | 280     Params(); | 
|  | 281 | 
|  | 282     DISALLOW_COPY_AND_ASSIGN(Params); | 
|  | 283   }; | 
|  | 284 | 
|  | 285   class Result { | 
|  | 286    public: | 
|  | 287     static Value* Create(const std::vector<linked_ptr<Window> > windows); | 
|  | 288 | 
|  | 289    private: | 
|  | 290     Result() {}; | 
|  | 291     DISALLOW_COPY_AND_ASSIGN(Result); | 
|  | 292   }; | 
|  | 293 | 
|  | 294 }; | 
|  | 295 | 
|  | 296 namespace Update { | 
|  | 297   struct Params { | 
|  | 298     struct UpdateInfo { | 
|  | 299       ~UpdateInfo(); | 
|  | 300       UpdateInfo(); | 
|  | 301 | 
|  | 302       // The offset from the top edge of the screen to move the window to in pix
     els. | 
|  | 303       // This value is ignored for panels. | 
|  | 304       scoped_ptr<int> top; | 
|  | 305 | 
|  | 306       // If true, causes the window to be displayed in a manner that draws the u
     ser's | 
|  | 307       // attention to the window, without changing the focused window. The effec
     t | 
|  | 308       // lasts until the user changes focus to the window. This option has no ef
     fect | 
|  | 309       // if the window already has focus. Set to false to cancel a previous draw | 
|  | 310       // attention request. | 
|  | 311       scoped_ptr<bool> draw_attention; | 
|  | 312 | 
|  | 313       // The height to resize the window to in pixels. This value is ignored for | 
|  | 314       // panels. | 
|  | 315       scoped_ptr<int> height; | 
|  | 316 | 
|  | 317       // The width to resize the window to in pixels. This value is ignored for | 
|  | 318       // panels. | 
|  | 319       scoped_ptr<int> width; | 
|  | 320 | 
|  | 321       // The new state of the window. The 'minimized' and 'maximized' states can
     not | 
|  | 322       // be combined with 'left', 'top', 'width' or 'height'. | 
|  | 323       scoped_ptr<std::string> state; | 
|  | 324 | 
|  | 325       // If true, brings the window to the front. If false, brings the next wind
     ow in | 
|  | 326       // the z-order to the front. | 
|  | 327       scoped_ptr<bool> focused; | 
|  | 328 | 
|  | 329       // The offset from the left edge of the screen to move the window to in pi
     xels. | 
|  | 330       // This value is ignored for panels. | 
|  | 331       scoped_ptr<int> left; | 
|  | 332 | 
|  | 333       // Populates a UpdateInfo object from a Value. Returns whether |out| was | 
|  | 334       // successfully populated. | 
|  | 335       static bool Populate(const Value& value, UpdateInfo* out); | 
|  | 336 | 
|  | 337 | 
|  | 338      private: | 
|  | 339       DISALLOW_COPY_AND_ASSIGN(UpdateInfo); | 
|  | 340     }; | 
|  | 341 | 
|  | 342     int window_id; | 
|  | 343 | 
|  | 344     UpdateInfo update_info; | 
|  | 345 | 
|  | 346 | 
|  | 347     ~Params(); | 
|  | 348 | 
|  | 349     static scoped_ptr<Params> Create(const ListValue& args); | 
|  | 350 | 
|  | 351    private: | 
|  | 352     Params(); | 
|  | 353 | 
|  | 354     DISALLOW_COPY_AND_ASSIGN(Params); | 
|  | 355   }; | 
|  | 356 | 
|  | 357   class Result { | 
|  | 358    public: | 
|  | 359     static Value* Create(const Window& window); | 
|  | 360 | 
|  | 361    private: | 
|  | 362     Result() {}; | 
|  | 363     DISALLOW_COPY_AND_ASSIGN(Result); | 
|  | 364   }; | 
|  | 365 | 
|  | 366 }; | 
|  | 367 | 
|  | 368 namespace Remove { | 
|  | 369   struct Params { | 
|  | 370     int window_id; | 
|  | 371 | 
|  | 372 | 
|  | 373     ~Params(); | 
|  | 374 | 
|  | 375     static scoped_ptr<Params> Create(const ListValue& args); | 
|  | 376 | 
|  | 377    private: | 
|  | 378     Params(); | 
|  | 379 | 
|  | 380     DISALLOW_COPY_AND_ASSIGN(Params); | 
|  | 381   }; | 
|  | 382 | 
|  | 383   class Result { | 
|  | 384    public: | 
|  | 385     static Value* Create(); | 
|  | 386 | 
|  | 387    private: | 
|  | 388     Result() {}; | 
|  | 389     DISALLOW_COPY_AND_ASSIGN(Result); | 
|  | 390   }; | 
|  | 391 | 
|  | 392 }; | 
|  | 393 | 
|  | 394 namespace GetLastFocused { | 
|  | 395   struct Params { | 
|  | 396     struct GetInfo { | 
|  | 397       ~GetInfo(); | 
|  | 398       GetInfo(); | 
|  | 399 | 
|  | 400       // If true, the window object will have a <var>tabs</var> property that | 
|  | 401       // contains a list of the $ref:Tab objects | 
|  | 402       scoped_ptr<bool> populate; | 
|  | 403 | 
|  | 404       // Populates a GetInfo object from a Value. Returns whether |out| was | 
|  | 405       // successfully populated. | 
|  | 406       static bool Populate(const Value& value, GetInfo* out); | 
|  | 407 | 
|  | 408 | 
|  | 409      private: | 
|  | 410       DISALLOW_COPY_AND_ASSIGN(GetInfo); | 
|  | 411     }; | 
|  | 412 | 
|  | 413     scoped_ptr<GetInfo> get_info; | 
|  | 414 | 
|  | 415 | 
|  | 416     ~Params(); | 
|  | 417 | 
|  | 418     static scoped_ptr<Params> Create(const ListValue& args); | 
|  | 419 | 
|  | 420    private: | 
|  | 421     Params(); | 
|  | 422 | 
|  | 423     DISALLOW_COPY_AND_ASSIGN(Params); | 
|  | 424   }; | 
|  | 425 | 
|  | 426   class Result { | 
|  | 427    public: | 
|  | 428     static Value* Create(const Window& window); | 
|  | 429 | 
|  | 430    private: | 
|  | 431     Result() {}; | 
|  | 432     DISALLOW_COPY_AND_ASSIGN(Result); | 
|  | 433   }; | 
|  | 434 | 
|  | 435 }; | 
|  | 436 | 
|  | 437 | 
|  | 438 }  // windows | 
|  | 439 }  // api | 
|  | 440 }  // extensions | 
|  | 441 | 
|  | 442 #endif  // CHROME_COMMON_EXTENSIONS_API_WINDOWS_H__ | 
| OLD | NEW | 
|---|