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