dart-gde/chrome_gen.dart — pull request #113 by financeCoding (2013-11-16 06:31:27+00:00)
Title: Idea for removing json parameters

@devoncarew what issues do you think we would run into transforming the Map parameters into `ChromeObject`?

Example the `setTitleParamsObject` would be generated as

```
class setTitleParamsObject extends ChromeObject {
setTitleParamsObject({String title, int tabId}) {
if (title != null) this.title = title;
if (tabId != null) this.tabId = tabId;
}
setTitleParamsObject.fromProxy(JsObject jsProxy): super.fromProxy(jsProxy);

/**
* The string the browser action should display when moused over.
*/
String get title => jsProxy['title'];
set title(String value) => jsProxy['title'] = value;

/**
* Limits the change to when a particular tab is selected. Automatically
* resets when the tab is closed.
*/
int get tabId => jsProxy['tabId'];
set tabId(int value) => jsProxy['tabId'] = value;
}
```

from the browser_action.json `setTitle` function

```
"functions": [
{
"name": "setTitle",
"type": "function",
"description": "Sets the title of the browser action. This shows up in the tooltip.",
"parameters": [
{
"name": "details",
"type": "object",
"properties": {
"title": {
"type": "string",
"description": "The string the browser action should display when moused over."
},
"tabId": {
"type": "integer",
"optional": true,
"description": "Limits the change to when a particular tab is selected. Automatically resets when the tab is closed."
}
}
}
]
},
```

This PR is just an example. I think refactoring json_model is required to properly support creating new declared types and assigning them as function parameters.

https://github.com/dart-gde/chrome_gen.dart/issues/25