Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /// Native wrappers for the Chrome Packaged App APIs. | 1 /// Native wrappers for the Chrome Packaged App APIs. |
| 2 /// | 2 /// |
| 3 /// These functions allow direct access to the Packaged App APIs, allowing | 3 /// These functions allow direct access to the Packaged App APIs, allowing |
| 4 /// Chrome Packaged Apps to be written using Dart. | 4 /// Chrome Packaged Apps to be written using Dart. |
| 5 /// | 5 /// |
| 6 /// For more information on these APIs, see the | 6 /// For more information on these APIs, see the Chrome.* APIs Documentation: |
| 7 /// [Chrome APIs Documentation](http://developer.chrome.com/extensions/api_index .html) | 7 /// http://developer.chrome.com/extensions/api_index.html |
|
Jennifer Messerly
2013/07/22 20:39:55
I'm not sure why this file keeps getting regenerat
| |
| 8 library chrome; | 8 library chrome; |
| 9 | 9 |
| 10 import 'dart:_foreign_helper' show JS; | 10 import 'dart:_foreign_helper' show JS; |
| 11 import 'dart:_js_helper'; | 11 import 'dart:_js_helper'; |
| 12 import 'dart:html_common'; | 12 import 'dart:html_common'; |
| 13 import 'dart:html'; | 13 import 'dart:html'; |
| 14 | 14 |
| 15 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 15 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 16 // for details. All rights reserved. Use of this source code is governed by a | 16 // for details. All rights reserved. Use of this source code is governed by a |
| 17 // BSD-style license that can be found in the LICENSE file. | 17 // BSD-style license that can be found in the LICENSE file. |
| 18 | 18 |
| 19 // DO NOT EDIT - unless you are editing documentation as per: | 19 // DO NOT EDIT |
| 20 // https://code.google.com/p/dart/wiki/ContributingHTMLDocumentation | |
| 21 // Auto-generated dart:chrome library. | 20 // Auto-generated dart:chrome library. |
| 22 | 21 |
| 23 | 22 |
| 24 /* TODO(sashab): Add "show convertDartClosureToJS" once 'show' works. */ | 23 /* TODO(sashab): Add "show convertDartClosureToJS" once 'show' works. */ |
| 25 | 24 |
| 26 | 25 |
| 27 // Generated files below this line. | 26 // Generated files below this line. |
| 28 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 27 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 29 // for details. All rights reserved. Use of this source code is governed by a | 28 // for details. All rights reserved. Use of this source code is governed by a |
| 30 // BSD-style license that can be found in the LICENSE file. | 29 // BSD-style license that can be found in the LICENSE file. |
| (...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 386 // for details. All rights reserved. Use of this source code is governed by a | 385 // for details. All rights reserved. Use of this source code is governed by a |
| 387 // BSD-style license that can be found in the LICENSE file. | 386 // BSD-style license that can be found in the LICENSE file. |
| 388 | 387 |
| 389 // Generated from namespace: app.window | 388 // Generated from namespace: app.window |
| 390 | 389 |
| 391 | 390 |
| 392 /** | 391 /** |
| 393 * Types | 392 * Types |
| 394 */ | 393 */ |
| 395 | 394 |
| 395 class AppWindowBounds extends ChromeObject { | |
| 396 /* | |
| 397 * Public constructor | |
| 398 */ | |
| 399 AppWindowBounds({int left, int top, int width, int height}) { | |
| 400 if (left != null) | |
| 401 this.left = left; | |
| 402 if (top != null) | |
| 403 this.top = top; | |
| 404 if (width != null) | |
| 405 this.width = width; | |
| 406 if (height != null) | |
| 407 this.height = height; | |
| 408 } | |
| 409 | |
| 410 /* | |
| 411 * Private constructor | |
| 412 */ | |
| 413 AppWindowBounds._proxy(_jsObject) : super._proxy(_jsObject); | |
| 414 | |
| 415 /* | |
| 416 * Public accessors | |
| 417 */ | |
| 418 int get left => JS('int', '#.left', this._jsObject); | |
| 419 | |
| 420 void set left(int left) { | |
| 421 JS('void', '#.left = #', this._jsObject, left); | |
| 422 } | |
| 423 | |
| 424 int get top => JS('int', '#.top', this._jsObject); | |
| 425 | |
| 426 void set top(int top) { | |
| 427 JS('void', '#.top = #', this._jsObject, top); | |
| 428 } | |
| 429 | |
| 430 int get width => JS('int', '#.width', this._jsObject); | |
| 431 | |
| 432 void set width(int width) { | |
| 433 JS('void', '#.width = #', this._jsObject, width); | |
| 434 } | |
| 435 | |
| 436 int get height => JS('int', '#.height', this._jsObject); | |
| 437 | |
| 438 void set height(int height) { | |
| 439 JS('void', '#.height = #', this._jsObject, height); | |
| 440 } | |
| 441 | |
| 442 } | |
| 443 | |
| 396 class AppWindowCreateWindowOptions extends ChromeObject { | 444 class AppWindowCreateWindowOptions extends ChromeObject { |
| 397 /* | 445 /* |
| 398 * Public constructor | 446 * Public constructor |
| 399 */ | 447 */ |
| 400 AppWindowCreateWindowOptions({String id, int defaultWidth, int defaultHeight, int defaultLeft, int defaultTop, int width, int height, int left, int top, int m inWidth, int minHeight, int maxWidth, int maxHeight, String type, String frame, AppWindowBounds bounds, bool transparentBackground, bool hidden, bool singleton} ) { | 448 AppWindowCreateWindowOptions({String id, int defaultWidth, int defaultHeight, int defaultLeft, int defaultTop, int width, int height, int left, int top, int m inWidth, int minHeight, int maxWidth, int maxHeight, String type, String frame, AppWindowBounds bounds, bool transparentBackground, String state, bool hidden, b ool resizable, bool singleton}) { |
| 401 if (id != null) | 449 if (id != null) |
| 402 this.id = id; | 450 this.id = id; |
| 403 if (defaultWidth != null) | 451 if (defaultWidth != null) |
| 404 this.defaultWidth = defaultWidth; | 452 this.defaultWidth = defaultWidth; |
| 405 if (defaultHeight != null) | 453 if (defaultHeight != null) |
| 406 this.defaultHeight = defaultHeight; | 454 this.defaultHeight = defaultHeight; |
| 407 if (defaultLeft != null) | 455 if (defaultLeft != null) |
| 408 this.defaultLeft = defaultLeft; | 456 this.defaultLeft = defaultLeft; |
| 409 if (defaultTop != null) | 457 if (defaultTop != null) |
| 410 this.defaultTop = defaultTop; | 458 this.defaultTop = defaultTop; |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 425 if (maxHeight != null) | 473 if (maxHeight != null) |
| 426 this.maxHeight = maxHeight; | 474 this.maxHeight = maxHeight; |
| 427 if (type != null) | 475 if (type != null) |
| 428 this.type = type; | 476 this.type = type; |
| 429 if (frame != null) | 477 if (frame != null) |
| 430 this.frame = frame; | 478 this.frame = frame; |
| 431 if (bounds != null) | 479 if (bounds != null) |
| 432 this.bounds = bounds; | 480 this.bounds = bounds; |
| 433 if (transparentBackground != null) | 481 if (transparentBackground != null) |
| 434 this.transparentBackground = transparentBackground; | 482 this.transparentBackground = transparentBackground; |
| 483 if (state != null) | |
| 484 this.state = state; | |
| 435 if (hidden != null) | 485 if (hidden != null) |
| 436 this.hidden = hidden; | 486 this.hidden = hidden; |
| 487 if (resizable != null) | |
| 488 this.resizable = resizable; | |
| 437 if (singleton != null) | 489 if (singleton != null) |
| 438 this.singleton = singleton; | 490 this.singleton = singleton; |
| 439 } | 491 } |
| 440 | 492 |
| 441 /* | 493 /* |
| 442 * Private constructor | 494 * Private constructor |
| 443 */ | 495 */ |
| 444 AppWindowCreateWindowOptions._proxy(_jsObject) : super._proxy(_jsObject); | 496 AppWindowCreateWindowOptions._proxy(_jsObject) : super._proxy(_jsObject); |
| 445 | 497 |
| 446 /* | 498 /* |
| 447 * Public accessors | 499 * Public accessors |
| 448 */ | 500 */ |
| 449 /// Id to identify the window. This will be used to remember the size and | 501 /// Id to identify the window. This will be used to remember the size and |
| 450 /// position of the window and restore that geometry when a window with the | 502 /// position of the window and restore that geometry when a window with the |
| 451 /// same id (and no explicit size or position) is later opened. | 503 /// same id is later opened. |
| 452 String get id => JS('String', '#.id', this._jsObject); | 504 String get id => JS('String', '#.id', this._jsObject); |
| 453 | 505 |
| 454 void set id(String id) { | 506 void set id(String id) { |
| 455 JS('void', '#.id = #', this._jsObject, id); | 507 JS('void', '#.id = #', this._jsObject, id); |
| 456 } | 508 } |
| 457 | 509 |
| 458 /// Default width of the window. (Deprecated; regular bounds act like this | 510 /// Default width of the window. (Deprecated; regular bounds act like this |
| 459 /// now.) | 511 /// now.) |
| 460 int get defaultWidth => JS('int', '#.defaultWidth', this._jsObject); | 512 int get defaultWidth => JS('int', '#.defaultWidth', this._jsObject); |
| 461 | 513 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 508 JS('void', '#.left = #', this._jsObject, left); | 560 JS('void', '#.left = #', this._jsObject, left); |
| 509 } | 561 } |
| 510 | 562 |
| 511 /// Y coordinate of the window. (Deprecated; use 'bounds'.) | 563 /// Y coordinate of the window. (Deprecated; use 'bounds'.) |
| 512 int get top => JS('int', '#.top', this._jsObject); | 564 int get top => JS('int', '#.top', this._jsObject); |
| 513 | 565 |
| 514 void set top(int top) { | 566 void set top(int top) { |
| 515 JS('void', '#.top = #', this._jsObject, top); | 567 JS('void', '#.top = #', this._jsObject, top); |
| 516 } | 568 } |
| 517 | 569 |
| 518 /// Minimum width of the window. | 570 /// Minimum width for the lifetime of the window. |
| 519 int get minWidth => JS('int', '#.minWidth', this._jsObject); | 571 int get minWidth => JS('int', '#.minWidth', this._jsObject); |
| 520 | 572 |
| 521 void set minWidth(int minWidth) { | 573 void set minWidth(int minWidth) { |
| 522 JS('void', '#.minWidth = #', this._jsObject, minWidth); | 574 JS('void', '#.minWidth = #', this._jsObject, minWidth); |
| 523 } | 575 } |
| 524 | 576 |
| 525 /// Minimum height of the window. | 577 /// Minimum height for the lifetime of the window. |
| 526 int get minHeight => JS('int', '#.minHeight', this._jsObject); | 578 int get minHeight => JS('int', '#.minHeight', this._jsObject); |
| 527 | 579 |
| 528 void set minHeight(int minHeight) { | 580 void set minHeight(int minHeight) { |
| 529 JS('void', '#.minHeight = #', this._jsObject, minHeight); | 581 JS('void', '#.minHeight = #', this._jsObject, minHeight); |
| 530 } | 582 } |
| 531 | 583 |
| 532 /// Maximum width of the window. | 584 /// Maximum width for the lifetime of the window. |
| 533 int get maxWidth => JS('int', '#.maxWidth', this._jsObject); | 585 int get maxWidth => JS('int', '#.maxWidth', this._jsObject); |
| 534 | 586 |
| 535 void set maxWidth(int maxWidth) { | 587 void set maxWidth(int maxWidth) { |
| 536 JS('void', '#.maxWidth = #', this._jsObject, maxWidth); | 588 JS('void', '#.maxWidth = #', this._jsObject, maxWidth); |
| 537 } | 589 } |
| 538 | 590 |
| 539 /// Maximum height of the window. | 591 /// Maximum height for the lifetime of the window. |
| 540 int get maxHeight => JS('int', '#.maxHeight', this._jsObject); | 592 int get maxHeight => JS('int', '#.maxHeight', this._jsObject); |
| 541 | 593 |
| 542 void set maxHeight(int maxHeight) { | 594 void set maxHeight(int maxHeight) { |
| 543 JS('void', '#.maxHeight = #', this._jsObject, maxHeight); | 595 JS('void', '#.maxHeight = #', this._jsObject, maxHeight); |
| 544 } | 596 } |
| 545 | 597 |
| 546 /// Window type: 'shell' - the default window type 'panel' - a panel, manage d | 598 /// Type of window to create. |
| 547 /// by the OS (Currently experimental, Ash only) | |
| 548 String get type => JS('String', '#.type', this._jsObject); | 599 String get type => JS('String', '#.type', this._jsObject); |
| 549 | 600 |
| 550 void set type(String type) { | 601 void set type(String type) { |
| 551 JS('void', '#.type = #', this._jsObject, type); | 602 JS('void', '#.type = #', this._jsObject, type); |
| 552 } | 603 } |
| 553 | 604 |
| 554 /// Frame type: 'none' or 'chrome' (defaults to 'chrome'). | 605 /// Frame type: 'none' or 'chrome' (defaults to 'chrome'). |
| 555 String get frame => JS('String', '#.frame', this._jsObject); | 606 String get frame => JS('String', '#.frame', this._jsObject); |
| 556 | 607 |
| 557 void set frame(String frame) { | 608 void set frame(String frame) { |
| 558 JS('void', '#.frame = #', this._jsObject, frame); | 609 JS('void', '#.frame = #', this._jsObject, frame); |
| 559 } | 610 } |
| 560 | 611 |
| 561 /// Size of the content in the window (excluding the titlebar). If specified i n | 612 /// Size and position of the content in the window (excluding the titlebar). I f |
| 562 /// addition to any of the left/top/width/height parameters, this field takes | 613 /// an id is also specified and a window with a matching id has been shown |
| 563 /// precedence. If a frameBounds is specified, the frameBounds take precedence . | 614 /// before, the remembered bounds of the window will be used instead. |
| 564 AppWindowBounds get bounds => new AppWindowBounds._proxy(JS('', '#.bounds', th is._jsObject)); | 615 AppWindowBounds get bounds => new AppWindowBounds._proxy(JS('', '#.bounds', th is._jsObject)); |
| 565 | 616 |
| 566 void set bounds(AppWindowBounds bounds) { | 617 void set bounds(AppWindowBounds bounds) { |
| 567 JS('void', '#.bounds = #', this._jsObject, convertArgument(bounds)); | 618 JS('void', '#.bounds = #', this._jsObject, convertArgument(bounds)); |
| 568 } | 619 } |
| 569 | 620 |
| 570 /// Enable window background transparency. Only supported in ash. Requires | 621 /// Enable window background transparency. Only supported in ash. Requires |
| 571 /// experimental API permission. | 622 /// experimental API permission. |
| 572 bool get transparentBackground => JS('bool', '#.transparentBackground', this._ jsObject); | 623 bool get transparentBackground => JS('bool', '#.transparentBackground', this._ jsObject); |
| 573 | 624 |
| 574 void set transparentBackground(bool transparentBackground) { | 625 void set transparentBackground(bool transparentBackground) { |
| 575 JS('void', '#.transparentBackground = #', this._jsObject, transparentBackgro und); | 626 JS('void', '#.transparentBackground = #', this._jsObject, transparentBackgro und); |
| 576 } | 627 } |
| 577 | 628 |
| 629 /// The initial state of the window, allowing it to be created already | |
| 630 /// fullscreen, maximized, or minimized. Defaults to 'normal'. | |
| 631 String get state => JS('String', '#.state', this._jsObject); | |
| 632 | |
| 633 void set state(String state) { | |
| 634 JS('void', '#.state = #', this._jsObject, state); | |
| 635 } | |
| 636 | |
| 578 /// If true, the window will be created in a hidden state. Call show() on the | 637 /// If true, the window will be created in a hidden state. Call show() on the |
| 579 /// window to show it once it has been created. Defaults to false. | 638 /// window to show it once it has been created. Defaults to false. |
| 580 bool get hidden => JS('bool', '#.hidden', this._jsObject); | 639 bool get hidden => JS('bool', '#.hidden', this._jsObject); |
| 581 | 640 |
| 582 void set hidden(bool hidden) { | 641 void set hidden(bool hidden) { |
| 583 JS('void', '#.hidden = #', this._jsObject, hidden); | 642 JS('void', '#.hidden = #', this._jsObject, hidden); |
| 584 } | 643 } |
| 585 | 644 |
| 645 /// If true, the window will be resizable by the user. Defaults to true. | |
| 646 bool get resizable => JS('bool', '#.resizable', this._jsObject); | |
| 647 | |
| 648 void set resizable(bool resizable) { | |
| 649 JS('void', '#.resizable = #', this._jsObject, resizable); | |
| 650 } | |
| 651 | |
| 586 /// By default if you specify an id for the window, the window will only be | 652 /// By default if you specify an id for the window, the window will only be |
| 587 /// created if another window with the same id doesn't already exist. If a | 653 /// created if another window with the same id doesn't already exist. If a |
| 588 /// window with the same id already exists that window is activated instead. I f | 654 /// window with the same id already exists that window is activated instead. I f |
| 589 /// you do want to create multiple windows with the same id, you can set this | 655 /// you do want to create multiple windows with the same id, you can set this |
| 590 /// property to false. | 656 /// property to false. |
| 591 bool get singleton => JS('bool', '#.singleton', this._jsObject); | 657 bool get singleton => JS('bool', '#.singleton', this._jsObject); |
| 592 | 658 |
| 593 void set singleton(bool singleton) { | 659 void set singleton(bool singleton) { |
| 594 JS('void', '#.singleton = #', this._jsObject, singleton); | 660 JS('void', '#.singleton = #', this._jsObject, singleton); |
| 595 } | 661 } |
| 596 | 662 |
| 597 } | 663 } |
| 598 | 664 |
| 599 class AppWindowBounds extends ChromeObject { | |
| 600 /* | |
| 601 * Public constructor | |
| 602 */ | |
| 603 AppWindowBounds({int left, int top, int width, int height}) { | |
| 604 if (left != null) | |
| 605 this.left = left; | |
| 606 if (top != null) | |
| 607 this.top = top; | |
| 608 if (width != null) | |
| 609 this.width = width; | |
| 610 if (height != null) | |
| 611 this.height = height; | |
| 612 } | |
| 613 | |
| 614 /* | |
| 615 * Private constructor | |
| 616 */ | |
| 617 AppWindowBounds._proxy(_jsObject) : super._proxy(_jsObject); | |
| 618 | |
| 619 /* | |
| 620 * Public accessors | |
| 621 */ | |
| 622 int get left => JS('int', '#.left', this._jsObject); | |
| 623 | |
| 624 void set left(int left) { | |
| 625 JS('void', '#.left = #', this._jsObject, left); | |
| 626 } | |
| 627 | |
| 628 int get top => JS('int', '#.top', this._jsObject); | |
| 629 | |
| 630 void set top(int top) { | |
| 631 JS('void', '#.top = #', this._jsObject, top); | |
| 632 } | |
| 633 | |
| 634 int get width => JS('int', '#.width', this._jsObject); | |
| 635 | |
| 636 void set width(int width) { | |
| 637 JS('void', '#.width = #', this._jsObject, width); | |
| 638 } | |
| 639 | |
| 640 int get height => JS('int', '#.height', this._jsObject); | |
| 641 | |
| 642 void set height(int height) { | |
| 643 JS('void', '#.height = #', this._jsObject, height); | |
| 644 } | |
| 645 | |
| 646 } | |
| 647 | |
| 648 class AppWindowAppWindow extends ChromeObject { | 665 class AppWindowAppWindow extends ChromeObject { |
| 649 /* | 666 /* |
| 650 * Private constructor | 667 * Private constructor |
| 651 */ | 668 */ |
| 652 AppWindowAppWindow._proxy(_jsObject) : super._proxy(_jsObject); | 669 AppWindowAppWindow._proxy(_jsObject) : super._proxy(_jsObject); |
| 653 | 670 |
| 654 /* | 671 /* |
| 655 * Public accessors | 672 * Public accessors |
| 656 */ | 673 */ |
| 657 /// The JavaScript 'window' object for the created child. | 674 /// The JavaScript 'window' object for the created child. |
| 658 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 675 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 659 // for details. All rights reserved. Use of this source code is governed by a | 676 // for details. All rights reserved. Use of this source code is governed by a |
| 660 // BSD-style license that can be found in the LICENSE file. | 677 // BSD-style license that can be found in the LICENSE file. |
| 661 | 678 |
| 662 // TODO(sashab, sra): Detect whether this is the current window, or an | 679 // TODO(sashab, sra): Detect whether this is the current window, or an |
| 663 // external one, and return an appropriately-typed object | 680 // external one, and return an appropriately-typed object |
| 664 WindowBase get contentWindow => | 681 WindowBase get contentWindow => |
| 665 JS("Window", "#.contentWindow", this._jsObject); | 682 JS("Window", "#.contentWindow", this._jsObject); |
| 666 | 683 |
| 667 /* | 684 /* |
| 668 * Methods | 685 * Methods |
| 669 */ | 686 */ |
| 670 /// Focus the window. | 687 /// Focus the window. |
| 671 void focus() => JS('void', '#.focus()', this._jsObject); | 688 void focus() => JS('void', '#.focus()', this._jsObject); |
| 672 | 689 |
| 690 /// Fullscreens the window. | |
| 691 void fullscreen() => JS('void', '#.fullscreen()', this._jsObject); | |
| 692 | |
| 693 /// Is the window fullscreen? | |
| 694 bool isFullscreen() => JS('bool', '#.isFullscreen()', this._jsObject); | |
| 695 | |
| 673 /// Minimize the window. | 696 /// Minimize the window. |
| 674 void minimize() => JS('void', '#.minimize()', this._jsObject); | 697 void minimize() => JS('void', '#.minimize()', this._jsObject); |
| 675 | 698 |
| 676 /// Is the window minimized? | 699 /// Is the window minimized? |
| 677 void isMinimized() => JS('void', '#.isMinimized()', this._jsObject); | 700 bool isMinimized() => JS('bool', '#.isMinimized()', this._jsObject); |
| 678 | 701 |
| 679 /// Maximize the window. | 702 /// Maximize the window. |
| 680 void maximize() => JS('void', '#.maximize()', this._jsObject); | 703 void maximize() => JS('void', '#.maximize()', this._jsObject); |
| 681 | 704 |
| 682 /// Is the window maximized? | 705 /// Is the window maximized? |
| 683 void isMaximized() => JS('void', '#.isMaximized()', this._jsObject); | 706 bool isMaximized() => JS('bool', '#.isMaximized()', this._jsObject); |
| 684 | 707 |
| 685 /// Restore the window. | 708 /// Restore the window, exiting a maximized, minimized, or fullscreen state. |
| 686 void restore() => JS('void', '#.restore()', this._jsObject); | 709 void restore() => JS('void', '#.restore()', this._jsObject); |
| 687 | 710 |
| 688 /// Move the window to the position (|left|, |top|). | 711 /// Move the window to the position (|left|, |top|). |
| 689 void moveTo(int left, int top) => JS('void', '#.moveTo(#, #)', this._jsObject, left, top); | 712 void moveTo(int left, int top) => JS('void', '#.moveTo(#, #)', this._jsObject, left, top); |
| 690 | 713 |
| 691 /// Resize the window to |width|x|height| pixels in size. | 714 /// Resize the window to |width|x|height| pixels in size. |
| 692 void resizeTo(int width, int height) => JS('void', '#.resizeTo(#, #)', this._j sObject, width, height); | 715 void resizeTo(int width, int height) => JS('void', '#.resizeTo(#, #)', this._j sObject, width, height); |
| 693 | 716 |
| 694 /// Draw attention to the window. | 717 /// Draw attention to the window. |
| 695 void drawAttention() => JS('void', '#.drawAttention()', this._jsObject); | 718 void drawAttention() => JS('void', '#.drawAttention()', this._jsObject); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 745 class Event_app_window_onClosed extends Event { | 768 class Event_app_window_onClosed extends Event { |
| 746 void addListener(void callback()) => super.addListener(callback); | 769 void addListener(void callback()) => super.addListener(callback); |
| 747 | 770 |
| 748 void removeListener(void callback()) => super.removeListener(callback); | 771 void removeListener(void callback()) => super.removeListener(callback); |
| 749 | 772 |
| 750 bool hasListener(void callback()) => super.hasListener(callback); | 773 bool hasListener(void callback()) => super.hasListener(callback); |
| 751 | 774 |
| 752 Event_app_window_onClosed(jsObject) : super._(jsObject, 0); | 775 Event_app_window_onClosed(jsObject) : super._(jsObject, 0); |
| 753 } | 776 } |
| 754 | 777 |
| 778 /// Fired when the window is fullscreened. | |
| 779 class Event_app_window_onFullscreened extends Event { | |
| 780 void addListener(void callback()) => super.addListener(callback); | |
| 781 | |
| 782 void removeListener(void callback()) => super.removeListener(callback); | |
| 783 | |
| 784 bool hasListener(void callback()) => super.hasListener(callback); | |
| 785 | |
| 786 Event_app_window_onFullscreened(jsObject) : super._(jsObject, 0); | |
| 787 } | |
| 788 | |
| 755 /// Fired when the window is maximized. | 789 /// Fired when the window is maximized. |
| 756 class Event_app_window_onMaximized extends Event { | 790 class Event_app_window_onMaximized extends Event { |
| 757 void addListener(void callback()) => super.addListener(callback); | 791 void addListener(void callback()) => super.addListener(callback); |
| 758 | 792 |
| 759 void removeListener(void callback()) => super.removeListener(callback); | 793 void removeListener(void callback()) => super.removeListener(callback); |
| 760 | 794 |
| 761 bool hasListener(void callback()) => super.hasListener(callback); | 795 bool hasListener(void callback()) => super.hasListener(callback); |
| 762 | 796 |
| 763 Event_app_window_onMaximized(jsObject) : super._(jsObject, 0); | 797 Event_app_window_onMaximized(jsObject) : super._(jsObject, 0); |
| 764 } | 798 } |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 793 /* | 827 /* |
| 794 * API connection | 828 * API connection |
| 795 */ | 829 */ |
| 796 Object _jsObject; | 830 Object _jsObject; |
| 797 | 831 |
| 798 /* | 832 /* |
| 799 * Events | 833 * Events |
| 800 */ | 834 */ |
| 801 Event_app_window_onBoundsChanged onBoundsChanged; | 835 Event_app_window_onBoundsChanged onBoundsChanged; |
| 802 Event_app_window_onClosed onClosed; | 836 Event_app_window_onClosed onClosed; |
| 837 Event_app_window_onFullscreened onFullscreened; | |
| 803 Event_app_window_onMaximized onMaximized; | 838 Event_app_window_onMaximized onMaximized; |
| 804 Event_app_window_onMinimized onMinimized; | 839 Event_app_window_onMinimized onMinimized; |
| 805 Event_app_window_onRestored onRestored; | 840 Event_app_window_onRestored onRestored; |
| 806 | 841 |
| 807 /* | 842 /* |
| 808 * Functions | 843 * Functions |
| 809 */ | 844 */ |
| 810 /// The size and position of a window can be specified in a number of differen t | 845 /// The size and position of a window can be specified in a number of differen t |
| 811 /// ways. The most simple option is not specifying anything at all, in which | 846 /// ways. The most simple option is not specifying anything at all, in which |
| 812 /// case a default size and platform dependent position will be used.<br/><br/ > | 847 /// case a default size and platform dependent position will be used.<br/><br/ > |
| 813 /// Another option is to use the top/left and width/height properties, which | 848 /// Another option is to use the bounds property, which will put the window at |
| 814 /// will always put the window at the specified coordinates with the specified | 849 /// the specified coordinates with the specified size. If the window has a |
| 815 /// size.<br/><br/> Yet another option is to give the window a (unique) id. | 850 /// frame, it's total size will be the size given plus the size of the frame; |
| 816 /// This id is then used to remember the size and position of the window | 851 /// that is, the size in bounds is the content size, not the window |
| 817 /// whenever it is moved or resized. This size and position is then used | 852 /// size.<br/><br/> To automatically remember the positions of windows you can |
| 818 /// instead of the specified bounds on subsequent opening of a window with the | 853 /// give them ids. If a window has an id, This id is used to remember the size |
| 819 /// same id. If you need to open a window with an id at a location other than | 854 /// and position of the window whenever it is moved or resized. This size and |
| 820 /// the remembered default, you can create it hidden, move it to the desired | 855 /// position is then used instead of the specified bounds on subsequent openin g |
| 821 /// location, then show it.<br/><br/> You can also combine these various | 856 /// of a window with the same id. If you need to open a window with an id at a |
| 822 /// options, explicitly specifying for example the size while having the | 857 /// location other than the remembered default, you can create it hidden, move |
| 823 /// position be remembered or other combinations like that. Size and position | 858 /// it to the desired location, then show it. |
| 824 /// are dealt with seperately, but individual coordinates are not. So if you | |
| 825 /// specify a top (or left) coordinate, you should also specify a left (or top ) | |
| 826 /// coordinate, and similar for size.<br/><br/> If you specify both a regular | |
| 827 /// and a default value for the same option the regular value is the only one | |
| 828 /// that takes effect. | |
| 829 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 859 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 830 // for details. All rights reserved. Use of this source code is governed by a | 860 // for details. All rights reserved. Use of this source code is governed by a |
| 831 // BSD-style license that can be found in the LICENSE file. | 861 // BSD-style license that can be found in the LICENSE file. |
| 832 | 862 |
| 833 // TODO(sashab): This override is no longer needed once prefixes are removed. | 863 // TODO(sashab): This override is no longer needed once prefixes are removed. |
| 834 void create(String url, | 864 void create(String url, |
| 835 [AppWindowCreateWindowOptions options, | 865 [AppWindowCreateWindowOptions options, |
| 836 void callback(AppWindowAppWindow created_window)]) { | 866 void callback(AppWindowAppWindow created_window)]) { |
| 837 void __proxy_callback(created_window) { | 867 void __proxy_callback(created_window) { |
| 838 if (callback != null) | 868 if (callback != null) |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 853 // TODO(sashab, kalman): Fix IDL parser to read function return values | 883 // TODO(sashab, kalman): Fix IDL parser to read function return values |
| 854 // correctly. Currently, it just reads void for all functions. | 884 // correctly. Currently, it just reads void for all functions. |
| 855 AppWindowAppWindow current() => | 885 AppWindowAppWindow current() => |
| 856 new AppWindowAppWindow._proxy(JS('void', '#.current()', this._jsObject)); | 886 new AppWindowAppWindow._proxy(JS('void', '#.current()', this._jsObject)); |
| 857 | 887 |
| 858 void initializeAppWindow(Object state) => JS('void', '#.initializeAppWindow(#) ', this._jsObject, convertArgument(state)); | 888 void initializeAppWindow(Object state) => JS('void', '#.initializeAppWindow(#) ', this._jsObject, convertArgument(state)); |
| 859 | 889 |
| 860 API_app_window(this._jsObject) { | 890 API_app_window(this._jsObject) { |
| 861 onBoundsChanged = new Event_app_window_onBoundsChanged(JS('', '#.onBoundsCha nged', this._jsObject)); | 891 onBoundsChanged = new Event_app_window_onBoundsChanged(JS('', '#.onBoundsCha nged', this._jsObject)); |
| 862 onClosed = new Event_app_window_onClosed(JS('', '#.onClosed', this._jsObject )); | 892 onClosed = new Event_app_window_onClosed(JS('', '#.onClosed', this._jsObject )); |
| 893 onFullscreened = new Event_app_window_onFullscreened(JS('', '#.onFullscreene d', this._jsObject)); | |
| 863 onMaximized = new Event_app_window_onMaximized(JS('', '#.onMaximized', this. _jsObject)); | 894 onMaximized = new Event_app_window_onMaximized(JS('', '#.onMaximized', this. _jsObject)); |
| 864 onMinimized = new Event_app_window_onMinimized(JS('', '#.onMinimized', this. _jsObject)); | 895 onMinimized = new Event_app_window_onMinimized(JS('', '#.onMinimized', this. _jsObject)); |
| 865 onRestored = new Event_app_window_onRestored(JS('', '#.onRestored', this._js Object)); | 896 onRestored = new Event_app_window_onRestored(JS('', '#.onRestored', this._js Object)); |
| 866 } | 897 } |
| 867 } | 898 } |
| 868 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 899 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 869 // for details. All rights reserved. Use of this source code is governed by a | 900 // for details. All rights reserved. Use of this source code is governed by a |
| 870 // BSD-style license that can be found in the LICENSE file. | 901 // BSD-style license that can be found in the LICENSE file. |
| 871 | 902 |
| 872 // Generated from namespace: app.runtime | 903 // Generated from namespace: app.runtime |
| 873 | 904 |
| 874 | 905 |
| 875 /** | 906 /** |
| 876 * Types | 907 * Types |
| 877 */ | 908 */ |
| 878 | 909 |
| 879 class AppRuntimeIntent extends ChromeObject { | |
| 880 /* | |
| 881 * Private constructor | |
| 882 */ | |
| 883 AppRuntimeIntent._proxy(_jsObject) : super._proxy(_jsObject); | |
| 884 | |
| 885 /* | |
| 886 * Public accessors | |
| 887 */ | |
| 888 /// The WebIntent being invoked. | |
| 889 String get action => JS('String', '#.action', this._jsObject); | |
| 890 | |
| 891 void set action(String action) { | |
| 892 JS('void', '#.action = #', this._jsObject, action); | |
| 893 } | |
| 894 | |
| 895 /// The MIME type of the data. | |
| 896 String get type => JS('String', '#.type', this._jsObject); | |
| 897 | |
| 898 void set type(String type) { | |
| 899 JS('void', '#.type = #', this._jsObject, type); | |
| 900 } | |
| 901 | |
| 902 /// Data associated with the intent. | |
| 903 Object get data => JS('Object', '#.data', this._jsObject); | |
| 904 | |
| 905 void set data(Object data) { | |
| 906 JS('void', '#.data = #', this._jsObject, convertArgument(data)); | |
| 907 } | |
| 908 | |
| 909 | |
| 910 /* | |
| 911 * Methods | |
| 912 */ | |
| 913 /// Callback to be compatible with WebIntents. | |
| 914 void postResult() => JS('void', '#.postResult()', this._jsObject); | |
| 915 | |
| 916 /// Callback to be compatible with WebIntents. | |
| 917 void postFailure() => JS('void', '#.postFailure()', this._jsObject); | |
| 918 | |
| 919 } | |
| 920 | |
| 921 class AppRuntimeLaunchItem extends ChromeObject { | 910 class AppRuntimeLaunchItem extends ChromeObject { |
| 922 /* | 911 /* |
| 923 * Public constructor | 912 * Public constructor |
| 924 */ | 913 */ |
| 925 AppRuntimeLaunchItem({FileEntry entry, String type}) { | 914 AppRuntimeLaunchItem({FileEntry entry, String type}) { |
| 926 if (entry != null) | 915 if (entry != null) |
| 927 this.entry = entry; | 916 this.entry = entry; |
| 928 if (type != null) | 917 if (type != null) |
| 929 this.type = type; | 918 this.type = type; |
| 930 } | 919 } |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 950 void set type(String type) { | 939 void set type(String type) { |
| 951 JS('void', '#.type = #', this._jsObject, type); | 940 JS('void', '#.type = #', this._jsObject, type); |
| 952 } | 941 } |
| 953 | 942 |
| 954 } | 943 } |
| 955 | 944 |
| 956 class AppRuntimeLaunchData extends ChromeObject { | 945 class AppRuntimeLaunchData extends ChromeObject { |
| 957 /* | 946 /* |
| 958 * Public constructor | 947 * Public constructor |
| 959 */ | 948 */ |
| 960 AppRuntimeLaunchData({AppRuntimeIntent intent, String id, List<AppRuntimeLaunc hItem> items}) { | 949 AppRuntimeLaunchData({String id, List<AppRuntimeLaunchItem> items}) { |
| 961 if (intent != null) | |
| 962 this.intent = intent; | |
| 963 if (id != null) | 950 if (id != null) |
| 964 this.id = id; | 951 this.id = id; |
| 965 if (items != null) | 952 if (items != null) |
| 966 this.items = items; | 953 this.items = items; |
| 967 } | 954 } |
| 968 | 955 |
| 969 /* | 956 /* |
| 970 * Private constructor | 957 * Private constructor |
| 971 */ | 958 */ |
| 972 AppRuntimeLaunchData._proxy(_jsObject) : super._proxy(_jsObject); | 959 AppRuntimeLaunchData._proxy(_jsObject) : super._proxy(_jsObject); |
| 973 | 960 |
| 974 /* | 961 /* |
| 975 * Public accessors | 962 * Public accessors |
| 976 */ | 963 */ |
| 977 AppRuntimeIntent get intent => new AppRuntimeIntent._proxy(JS('', '#.intent', this._jsObject)); | |
| 978 | |
| 979 void set intent(AppRuntimeIntent intent) { | |
| 980 JS('void', '#.intent = #', this._jsObject, convertArgument(intent)); | |
| 981 } | |
| 982 | |
| 983 /// The id of the file handler that the app is being invoked with. | 964 /// The id of the file handler that the app is being invoked with. |
| 984 String get id => JS('String', '#.id', this._jsObject); | 965 String get id => JS('String', '#.id', this._jsObject); |
| 985 | 966 |
| 986 void set id(String id) { | 967 void set id(String id) { |
| 987 JS('void', '#.id = #', this._jsObject, id); | 968 JS('void', '#.id = #', this._jsObject, id); |
| 988 } | 969 } |
| 989 | 970 |
| 990 List<AppRuntimeLaunchItem> get items { | 971 List<AppRuntimeLaunchItem> get items { |
| 991 List<AppRuntimeLaunchItem> __proxy_items = new List<AppRuntimeLaunchItem>(); | 972 List<AppRuntimeLaunchItem> __proxy_items = new List<AppRuntimeLaunchItem>(); |
| 992 for (var o in JS('List', '#.items', this._jsObject)) { | 973 int count = JS('int', '#.items.length', this._jsObject); |
| 993 __proxy_items.add(new AppRuntimeLaunchItem._proxy(o)); | 974 for (int i = 0; i < count; i++) { |
| 975 var item = JS('', '#.items[#]', this._jsObject, i); | |
| 976 __proxy_items.add(new AppRuntimeLaunchItem._proxy(item)); | |
| 994 } | 977 } |
| 995 return __proxy_items; | 978 return __proxy_items; |
| 996 } | 979 } |
| 997 | 980 |
| 998 void set items(List<AppRuntimeLaunchItem> items) { | 981 void set items(List<AppRuntimeLaunchItem> items) { |
| 999 JS('void', '#.items = #', this._jsObject, convertArgument(items)); | 982 JS('void', '#.items = #', this._jsObject, convertArgument(items)); |
| 1000 } | 983 } |
| 1001 | 984 |
| 1002 } | 985 } |
| 1003 | 986 |
| 1004 class AppRuntimeIntentResponse extends ChromeObject { | |
| 1005 /* | |
| 1006 * Public constructor | |
| 1007 */ | |
| 1008 AppRuntimeIntentResponse({int intentId, bool success, Object data}) { | |
| 1009 if (intentId != null) | |
| 1010 this.intentId = intentId; | |
| 1011 if (success != null) | |
| 1012 this.success = success; | |
| 1013 if (data != null) | |
| 1014 this.data = data; | |
| 1015 } | |
| 1016 | |
| 1017 /* | |
| 1018 * Private constructor | |
| 1019 */ | |
| 1020 AppRuntimeIntentResponse._proxy(_jsObject) : super._proxy(_jsObject); | |
| 1021 | |
| 1022 /* | |
| 1023 * Public accessors | |
| 1024 */ | |
| 1025 /// Identifies the intent. | |
| 1026 int get intentId => JS('int', '#.intentId', this._jsObject); | |
| 1027 | |
| 1028 void set intentId(int intentId) { | |
| 1029 JS('void', '#.intentId = #', this._jsObject, intentId); | |
| 1030 } | |
| 1031 | |
| 1032 /// Was this intent successful? (i.e., postSuccess vs postFailure). | |
| 1033 bool get success => JS('bool', '#.success', this._jsObject); | |
| 1034 | |
| 1035 void set success(bool success) { | |
| 1036 JS('void', '#.success = #', this._jsObject, success); | |
| 1037 } | |
| 1038 | |
| 1039 /// Data associated with the intent response. | |
| 1040 Object get data => JS('Object', '#.data', this._jsObject); | |
| 1041 | |
| 1042 void set data(Object data) { | |
| 1043 JS('void', '#.data = #', this._jsObject, convertArgument(data)); | |
| 1044 } | |
| 1045 | |
| 1046 } | |
| 1047 | |
| 1048 /** | 987 /** |
| 1049 * Events | 988 * Events |
| 1050 */ | 989 */ |
| 1051 | 990 |
| 1052 /// Fired when an app is launched from the launcher or in response to a web | 991 /// Fired when an app is launched from the launcher. |
| 1053 /// intent. | |
| 1054 class Event_app_runtime_onLaunched extends Event { | 992 class Event_app_runtime_onLaunched extends Event { |
| 1055 void addListener(void callback(AppRuntimeLaunchData launchData)) { | 993 void addListener(void callback(AppRuntimeLaunchData launchData)) { |
| 1056 void __proxy_callback(launchData) { | 994 void __proxy_callback(launchData) { |
| 1057 if (callback != null) { | 995 if (callback != null) { |
| 1058 callback(new AppRuntimeLaunchData._proxy(launchData)); | 996 callback(new AppRuntimeLaunchData._proxy(launchData)); |
| 1059 } | 997 } |
| 1060 } | 998 } |
| 1061 super.addListener(callback); | 999 super.addListener(__proxy_callback); |
| 1062 } | 1000 } |
| 1063 | 1001 |
| 1064 void removeListener(void callback(AppRuntimeLaunchData launchData)) { | 1002 void removeListener(void callback(AppRuntimeLaunchData launchData)) { |
| 1065 void __proxy_callback(launchData) { | 1003 void __proxy_callback(launchData) { |
| 1066 if (callback != null) { | 1004 if (callback != null) { |
| 1067 callback(new AppRuntimeLaunchData._proxy(launchData)); | 1005 callback(new AppRuntimeLaunchData._proxy(launchData)); |
| 1068 } | 1006 } |
| 1069 } | 1007 } |
| 1070 super.removeListener(callback); | 1008 super.removeListener(__proxy_callback); |
| 1071 } | 1009 } |
| 1072 | 1010 |
| 1073 bool hasListener(void callback(AppRuntimeLaunchData launchData)) { | 1011 bool hasListener(void callback(AppRuntimeLaunchData launchData)) { |
| 1074 void __proxy_callback(launchData) { | 1012 void __proxy_callback(launchData) { |
| 1075 if (callback != null) { | 1013 if (callback != null) { |
| 1076 callback(new AppRuntimeLaunchData._proxy(launchData)); | 1014 callback(new AppRuntimeLaunchData._proxy(launchData)); |
| 1077 } | 1015 } |
| 1078 } | 1016 } |
| 1079 super.hasListener(callback); | 1017 super.hasListener(__proxy_callback); |
| 1080 } | 1018 } |
| 1081 | 1019 |
| 1082 Event_app_runtime_onLaunched(jsObject) : super._(jsObject, 1); | 1020 Event_app_runtime_onLaunched(jsObject) : super._(jsObject, 1); |
| 1083 } | 1021 } |
| 1084 | 1022 |
| 1085 /// Fired at Chrome startup to apps that were running when Chrome last shut | 1023 /// Fired at Chrome startup to apps that were running when Chrome last shut |
| 1086 /// down. | 1024 /// down. |
| 1087 class Event_app_runtime_onRestarted extends Event { | 1025 class Event_app_runtime_onRestarted extends Event { |
| 1088 void addListener(void callback()) => super.addListener(callback); | 1026 void addListener(void callback()) => super.addListener(callback); |
| 1089 | 1027 |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 1102 /* | 1040 /* |
| 1103 * API connection | 1041 * API connection |
| 1104 */ | 1042 */ |
| 1105 Object _jsObject; | 1043 Object _jsObject; |
| 1106 | 1044 |
| 1107 /* | 1045 /* |
| 1108 * Events | 1046 * Events |
| 1109 */ | 1047 */ |
| 1110 Event_app_runtime_onLaunched onLaunched; | 1048 Event_app_runtime_onLaunched onLaunched; |
| 1111 Event_app_runtime_onRestarted onRestarted; | 1049 Event_app_runtime_onRestarted onRestarted; |
| 1112 | |
| 1113 /* | |
| 1114 * Functions | |
| 1115 */ | |
| 1116 /// postIntentResponse is an internal method to responds to an intent | |
| 1117 /// previously sent to a packaged app. This is identified by intentId, and | |
| 1118 /// should only be invoked at most once per intentId. | |
| 1119 void postIntentResponse(AppRuntimeIntentResponse intentResponse) => JS('void', '#.postIntentResponse(#)', this._jsObject, convertArgument(intentResponse)); | |
| 1120 | |
| 1121 API_app_runtime(this._jsObject) { | 1050 API_app_runtime(this._jsObject) { |
| 1122 onLaunched = new Event_app_runtime_onLaunched(JS('', '#.onLaunched', this._j sObject)); | 1051 onLaunched = new Event_app_runtime_onLaunched(JS('', '#.onLaunched', this._j sObject)); |
| 1123 onRestarted = new Event_app_runtime_onRestarted(JS('', '#.onRestarted', this ._jsObject)); | 1052 onRestarted = new Event_app_runtime_onRestarted(JS('', '#.onRestarted', this ._jsObject)); |
| 1124 } | 1053 } |
| 1125 } | 1054 } |
| 1055 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | |
| 1056 // for details. All rights reserved. Use of this source code is governed by a | |
| 1057 // BSD-style license that can be found in the LICENSE file. | |
| 1058 | |
| 1059 // Generated from namespace: fileSystem | |
| 1060 | |
| 1061 | |
| 1062 /** | |
| 1063 * Types | |
| 1064 */ | |
| 1065 | |
| 1066 class FilesystemAcceptOption extends ChromeObject { | |
| 1067 /* | |
| 1068 * Public constructor | |
| 1069 */ | |
| 1070 FilesystemAcceptOption({String description, List<String> mimeTypes, List<Strin g> extensions}) { | |
| 1071 if (description != null) | |
| 1072 this.description = description; | |
| 1073 if (mimeTypes != null) | |
| 1074 this.mimeTypes = mimeTypes; | |
| 1075 if (extensions != null) | |
| 1076 this.extensions = extensions; | |
| 1077 } | |
| 1078 | |
| 1079 /* | |
| 1080 * Private constructor | |
| 1081 */ | |
| 1082 FilesystemAcceptOption._proxy(_jsObject) : super._proxy(_jsObject); | |
| 1083 | |
| 1084 /* | |
| 1085 * Public accessors | |
| 1086 */ | |
| 1087 /// This is the optional text description for this option. If not present, a | |
| 1088 /// description will be automatically generated; typically containing an | |
| 1089 /// expanded list of valid extensions (e.g. "text/html" may expand to "*.html, | |
| 1090 /// *.htm"). | |
| 1091 String get description => JS('String', '#.description', this._jsObject); | |
| 1092 | |
| 1093 void set description(String description) { | |
| 1094 JS('void', '#.description = #', this._jsObject, description); | |
| 1095 } | |
| 1096 | |
| 1097 /// Mime-types to accept, e.g. "image/jpeg" or "audio/*". One of mimeTypes or | |
| 1098 /// extensions must contain at least one valid element. | |
| 1099 List<String> get mimeTypes => JS('List<String>', '#.mimeTypes', this._jsObject ); | |
| 1100 | |
| 1101 void set mimeTypes(List<String> mimeTypes) { | |
| 1102 JS('void', '#.mimeTypes = #', this._jsObject, mimeTypes); | |
| 1103 } | |
| 1104 | |
| 1105 /// Extensions to accept, e.g. "jpg", "gif", "crx". | |
| 1106 List<String> get extensions => JS('List<String>', '#.extensions', this._jsObje ct); | |
| 1107 | |
| 1108 void set extensions(List<String> extensions) { | |
| 1109 JS('void', '#.extensions = #', this._jsObject, extensions); | |
| 1110 } | |
| 1111 | |
| 1112 } | |
| 1113 | |
| 1114 class FilesystemChooseEntryOptions extends ChromeObject { | |
| 1115 /* | |
| 1116 * Public constructor | |
| 1117 */ | |
| 1118 FilesystemChooseEntryOptions({String type, String suggestedName, List<Filesyst emAcceptOption> accepts, bool acceptsAllTypes}) { | |
| 1119 if (type != null) | |
| 1120 this.type = type; | |
| 1121 if (suggestedName != null) | |
| 1122 this.suggestedName = suggestedName; | |
| 1123 if (accepts != null) | |
| 1124 this.accepts = accepts; | |
| 1125 if (acceptsAllTypes != null) | |
| 1126 this.acceptsAllTypes = acceptsAllTypes; | |
| 1127 } | |
| 1128 | |
| 1129 /* | |
| 1130 * Private constructor | |
| 1131 */ | |
| 1132 FilesystemChooseEntryOptions._proxy(_jsObject) : super._proxy(_jsObject); | |
| 1133 | |
| 1134 /* | |
| 1135 * Public accessors | |
| 1136 */ | |
| 1137 /// Type of the prompt to show. The default is 'openFile'. | |
| 1138 String get type => JS('String', '#.type', this._jsObject); | |
| 1139 | |
| 1140 void set type(String type) { | |
| 1141 JS('void', '#.type = #', this._jsObject, type); | |
| 1142 } | |
| 1143 | |
| 1144 /// The suggested file name that will be presented to the user as the default | |
| 1145 /// name to read or write. This is optional. | |
| 1146 String get suggestedName => JS('String', '#.suggestedName', this._jsObject); | |
| 1147 | |
| 1148 void set suggestedName(String suggestedName) { | |
| 1149 JS('void', '#.suggestedName = #', this._jsObject, suggestedName); | |
| 1150 } | |
| 1151 | |
| 1152 /// The optional list of accept options for this file opener. Each option will | |
| 1153 /// be presented as a unique group to the end-user. | |
| 1154 List<FilesystemAcceptOption> get accepts { | |
| 1155 List<FilesystemAcceptOption> __proxy_accepts = new List<FilesystemAcceptOpti on>(); | |
| 1156 int count = JS('int', '#.accepts.length', this._jsObject); | |
| 1157 for (int i = 0; i < count; i++) { | |
| 1158 var item = JS('', '#.accepts[#]', this._jsObject, i); | |
| 1159 __proxy_accepts.add(new FilesystemAcceptOption._proxy(item)); | |
| 1160 } | |
| 1161 return __proxy_accepts; | |
| 1162 } | |
| 1163 | |
| 1164 void set accepts(List<FilesystemAcceptOption> accepts) { | |
| 1165 JS('void', '#.accepts = #', this._jsObject, convertArgument(accepts)); | |
| 1166 } | |
| 1167 | |
| 1168 /// Whether to accept all file types, in addition to the options specified in | |
| 1169 /// the accepts argument. The default is true. If the accepts field is unset o r | |
| 1170 /// contains no valid entries, this will always be reset to true. | |
| 1171 bool get acceptsAllTypes => JS('bool', '#.acceptsAllTypes', this._jsObject); | |
| 1172 | |
| 1173 void set acceptsAllTypes(bool acceptsAllTypes) { | |
| 1174 JS('void', '#.acceptsAllTypes = #', this._jsObject, acceptsAllTypes); | |
| 1175 } | |
| 1176 | |
| 1177 } | |
| 1178 | |
| 1179 /** | |
| 1180 * Functions | |
| 1181 */ | |
| 1182 | |
| 1183 class API_file_system { | |
| 1184 /* | |
| 1185 * API connection | |
| 1186 */ | |
| 1187 Object _jsObject; | |
| 1188 | |
| 1189 /* | |
| 1190 * Functions | |
| 1191 */ | |
| 1192 /// Get the display path of a FileEntry object. The display path is based on | |
| 1193 /// the full path of the file on the local file system, but may be made more | |
| 1194 /// readable for display purposes. | |
| 1195 void getDisplayPath(FileEntry fileEntry, void callback(String displayPath)) => JS('void', '#.getDisplayPath(#, #)', this._jsObject, convertArgument(fileEntry) , convertDartClosureToJS(callback, 1)); | |
| 1196 | |
| 1197 /// Get a writable FileEntry from another FileEntry. This call will fail if th e | |
| 1198 /// application does not have the 'write' permission under 'fileSystem'. | |
| 1199 void getWritableEntry(FileEntry fileEntry, void callback(FileEntry fileEntry)) { | |
| 1200 void __proxy_callback(fileEntry) { | |
| 1201 if (callback != null) { | |
| 1202 callback(fileEntry); | |
| 1203 } | |
| 1204 } | |
| 1205 JS('void', '#.getWritableEntry(#, #)', this._jsObject, convertArgument(fileE ntry), convertDartClosureToJS(__proxy_callback, 1)); | |
| 1206 } | |
| 1207 | |
| 1208 /// Gets whether this FileEntry is writable or not. | |
| 1209 void isWritableEntry(FileEntry fileEntry, void callback(bool isWritable)) => J S('void', '#.isWritableEntry(#, #)', this._jsObject, convertArgument(fileEntry), convertDartClosureToJS(callback, 1)); | |
| 1210 | |
| 1211 /// Ask the user to choose a file. | |
| 1212 void chooseEntry(void callback(FileEntry fileEntry), [FilesystemChooseEntryOpt ions options]) { | |
| 1213 void __proxy_callback(fileEntry) { | |
| 1214 if (callback != null) { | |
| 1215 callback(fileEntry); | |
| 1216 } | |
| 1217 } | |
| 1218 JS('void', '#.chooseEntry(#, #)', this._jsObject, convertArgument(options), convertDartClosureToJS(__proxy_callback, 1)); | |
| 1219 } | |
| 1220 | |
| 1221 /// Returns the file entry with the given id if it can be restored. This call | |
| 1222 /// will fail otherwise. | |
| 1223 void restoreEntry(String id, void callback(FileEntry fileEntry)) { | |
| 1224 void __proxy_callback(fileEntry) { | |
| 1225 if (callback != null) { | |
| 1226 callback(fileEntry); | |
| 1227 } | |
| 1228 } | |
| 1229 JS('void', '#.restoreEntry(#, #)', this._jsObject, id, convertDartClosureToJ S(__proxy_callback, 1)); | |
| 1230 } | |
| 1231 | |
| 1232 /// Returns whether a file entry for the given id can be restored, i.e. whethe r | |
| 1233 /// restoreEntry would succeed with this id now. | |
| 1234 void isRestorable(String id, void callback(bool isRestorable)) => JS('void', ' #.isRestorable(#, #)', this._jsObject, id, convertDartClosureToJS(callback, 1)); | |
| 1235 | |
| 1236 /// Returns an id that can be passed to restoreEntry to regain access to a | |
| 1237 /// given file entry. Only the 500 most recently used entries are retained, | |
| 1238 /// where calls to retainEntry and restoreEntry count as use. If the app has | |
| 1239 /// the 'retainEntries' permission under 'fileSystem', entries are retained | |
| 1240 /// indefinitely. Otherwise, entries are retained only while the app is runnin g | |
| 1241 /// and across restarts. | |
| 1242 String retainEntry(FileEntry fileEntry) => JS('String', '#.retainEntry(#)', th is._jsObject, convertArgument(fileEntry)); | |
| 1243 | |
| 1244 API_file_system(this._jsObject) { | |
| 1245 } | |
| 1246 } | |
| OLD | NEW |