Docserver: Show callback parameters in all callback references.

BUG=395430
NOTRY=True

Review URL: https://codereview.chromium.org/406933003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@285056 0039d316-1c4b-4281-b951-d872f2087c98
parent adf0e224
...@@ -382,7 +382,8 @@ class _JSCModel(object): ...@@ -382,7 +382,8 @@ class _JSCModel(object):
if function.callback is not None: if function.callback is not None:
# Show the callback as an extra parameter. # Show the callback as an extra parameter.
function_dict['parameters'].append( function_dict['parameters'].append(
self._GenerateCallbackProperty(function.callback)) self._GenerateCallbackProperty(function.callback,
function_dict['callback']))
if len(function_dict['parameters']) > 0: if len(function_dict['parameters']) > 0:
function_dict['parameters'][-1]['last'] = True function_dict['parameters'][-1]['last'] = True
return function_dict return function_dict
...@@ -429,11 +430,13 @@ class _JSCModel(object): ...@@ -429,11 +430,13 @@ class _JSCModel(object):
callback_object.params = event.params callback_object.params = event.params
if event.callback: if event.callback:
callback_object.callback = event.callback callback_object.callback = event.callback
callback_parameters = self._GenerateCallbackProperty(callback_object) callback = self._GenerateFunction(callback_object)
callback_parameters = self._GenerateCallbackProperty(callback_object,
callback)
callback_parameters['last'] = True callback_parameters['last'] = True
event_dict['byName']['addListener'] = { event_dict['byName']['addListener'] = {
'name': 'addListener', 'name': 'addListener',
'callback': self._GenerateFunction(callback_object), 'callback': callback,
'parameters': [callback_parameters] 'parameters': [callback_parameters]
} }
with self._current_node.Descend(event.simple_name, ignore=('properties',)): with self._current_node.Descend(event.simple_name, ignore=('properties',)):
...@@ -514,12 +517,13 @@ class _JSCModel(object): ...@@ -514,12 +517,13 @@ class _JSCModel(object):
return property_dict return property_dict
def _GenerateCallbackProperty(self, callback): def _GenerateCallbackProperty(self, callback, callback_dict):
property_dict = { property_dict = {
'name': callback.simple_name, 'name': callback.simple_name,
'description': callback.description, 'description': callback.description,
'optional': callback.optional, 'optional': callback.optional,
'is_callback': True, 'isCallback': True,
'asFunction': callback_dict,
'id': _CreateId(callback, 'property'), 'id': _CreateId(callback, 'property'),
'simple_type': 'function', 'simple_type': 'function',
} }
......
application: chrome-apps-doc application: chrome-apps-doc
version: 3-34-0 version: 3-35-0
runtime: python27 runtime: python27
api_version: 1 api_version: 1
threadsafe: false threadsafe: false
......
...@@ -2,4 +2,4 @@ cron: ...@@ -2,4 +2,4 @@ cron:
- description: Repopulates all cached data. - description: Repopulates all cached data.
url: /_cron url: /_cron
schedule: every 5 minutes schedule: every 5 minutes
target: 3-34-0 target: 3-35-0
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
{{+partials.parameter_full {{+partials.parameter_full
parameter:p parameter:p
parentName:name parentName:name
parentCallback:callback
hideParamTOC:true /}} hideParamTOC:true /}}
{{/parameters}} {{/parameters}}
</table> </table>
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
{{+partials.property {{+partials.property
property:parameter property:parameter
parentName:name parentName:name
parentCallback:parentCallback
hideParamTOC:hideParamTOC/}} hideParamTOC:hideParamTOC/}}
</tr> </tr>
{{/parameter}} {{/parameter}}
...@@ -42,8 +42,8 @@ ...@@ -42,8 +42,8 @@
hideParamTOC:hideParamTOC /}} hideParamTOC:hideParamTOC /}}
</table> </table>
{{/parameters}} {{/parameters}}
{{?is_callback}} {{?isCallback}}
{{?parentCallback +partials.callback callback:parentCallback/}} {{+partials.callback callback:asFunction/}}
{{/is_callback}} {{/isCallback}}
</td> </td>
{{/property}} {{/property}}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment