dart-gde/chrome.dart — pull request #186 by financeCoding (2014-07-30 22:20:44+00:00)
Title: Adding support for `or` choice on field type declarations.

@devoncarew Lets see what the email to Ben returns. This should work for now. All tests pass.

Regenerating the APIs has some side effect with `context_menus.dart` wanting to import `import 'context_menus_internal.dart';` which does not exist. Are you aware of this?

``` diff
diff --git a/lib/gen/app.dart b/lib/gen/app.dart
index 848b0c2..9d18771 100644
--- a/lib/gen/app.dart
+++ b/lib/gen/app.dart
@@ -377,7 +377,7 @@ class FrameOptions extends ChromeObject {
}

class CreateWindowOptions extends ChromeObject {
- CreateWindowOptions({String id, BoundsSpecification innerBounds, BoundsSpecification outerBounds, int defaultWidth, int defaultHeight, int defaultLeft, int defaultTop, int width, int height, int left, int top, int minWidth, int minHeight, int maxWidth, int maxHeight, WindowType type, String frame, ContentBounds bounds, bool transparentBackground, State state, bool hidden, bool resizable, bool singleton, bool alwaysOnTop, bool focused}) {
+ CreateWindowOptions({String id, BoundsSpecification innerBounds, BoundsSpecification outerBounds, int defaultWidth, int defaultHeight, int defaultLeft, int defaultTop, int width, int height, int left, int top, int minWidth, int minHeight, int maxWidth, int maxHeight, WindowType type, var frame, ContentBounds bounds, bool transparentBackground, State state, bool hidden, bool resizable, bool singleton, bool alwaysOnTop, bool focused}) {
if (id != null) this.id = id;
if (innerBounds != null) this.innerBounds = innerBounds;
if (outerBounds != null) this.outerBounds = outerBounds;
@@ -454,8 +454,8 @@ class CreateWindowOptions extends ChromeObject {
WindowType get type => _createWindowType(jsProxy['type']);
set type(WindowType value) => jsProxy['type'] = jsify(value);

- String get frame => jsProxy['frame'];
- set frame(String value) => jsProxy['frame'] = value;
+ dynamic get frame => jsProxy['frame'];
+ set frame(var value) => jsProxy['frame'] = jsify(value);

ContentBounds get bounds => _createContentBounds(jsProxy['bounds']);
set bounds(ContentBounds value) => jsProxy['bounds'] = jsify(value);
diff --git a/lib/gen/context_menus.dart b/lib/gen/context_menus.dart
index 593872f..53ae6c4 100644
--- a/lib/gen/context_menus.dart
+++ b/lib/gen/context_menus.dart
@@ -7,6 +7,8 @@
*/
library chrome.contextMenus;

+import 'context_menus_internal.dart';
+import 'tabs.dart';
import '../src/common.dart';

/**
@@ -31,11 +33,11 @@ class ChromeContextMenus extends ChromeApi {
* Creates a new context menu item. Note that if an error occurs during
* creation, you may not find out until the creation callback fires (the
* details will be in chrome.runtime.lastError).
- *
+ *
* [callback] Called when the item has been created in the browser. If there
* were any problems creating the item, details will be available in
* chrome.runtime.lastError.
- *
+ *
* Returns:
* The ID of the newly created item.
*/
@@ -47,9 +49,9 @@ class ChromeContextMenus extends ChromeApi {

/**
* Updates a previously created context menu item.
- *
+ *
* [id] The ID of the item to update.
- *
+ *
* [updateProperties] The properties to update. Accepts the same values as the
* create function.
*/
@@ -63,7 +65,7 @@ class ChromeContextMenus extends ChromeApi {

/**
* Removes a context menu item.
- *
+ *
* [menuItemId] The ID of the context menu item to remove.
*/
Future remove(dynamic menuItemId) {
```