Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import copy | 5 import copy |
| 6 import logging | 6 import logging |
| 7 import os | 7 import os |
| 8 | 8 |
| 9 from environment import IsPreviewServer | 9 from environment import IsPreviewServer |
| 10 from extensions_paths import ( | 10 from extensions_paths import ( |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 289 else: | 289 else: |
| 290 self._RenderTypeInformation(type_, property_dict) | 290 self._RenderTypeInformation(type_, property_dict) |
| 291 | 291 |
| 292 return property_dict | 292 return property_dict |
| 293 | 293 |
| 294 def _GenerateCallbackProperty(self, callback): | 294 def _GenerateCallbackProperty(self, callback): |
| 295 property_dict = { | 295 property_dict = { |
| 296 'name': callback.simple_name, | 296 'name': callback.simple_name, |
| 297 'description': self._FormatDescription(callback.description), | 297 'description': self._FormatDescription(callback.description), |
| 298 'optional': callback.optional, | 298 'optional': callback.optional, |
| 299 'is_callback': True, | |
|
not at google - send to devlin
2014/01/03 23:30:24
you will need to bump the app version due to this
Renato Mangini (chromium)
2014/02/06 03:19:17
Done.
| |
| 299 'id': _CreateId(callback, 'property'), | 300 'id': _CreateId(callback, 'property'), |
| 300 'simple_type': 'function', | 301 'simple_type': 'function', |
| 301 } | 302 } |
| 302 if (callback.parent is not None and | 303 if (callback.parent is not None and |
| 303 not isinstance(callback.parent, model.Namespace)): | 304 not isinstance(callback.parent, model.Namespace)): |
| 304 property_dict['parentName'] = callback.parent.simple_name | 305 property_dict['parentName'] = callback.parent.simple_name |
| 305 return property_dict | 306 return property_dict |
| 306 | 307 |
| 307 def _RenderTypeInformation(self, type_, dst_dict): | 308 def _RenderTypeInformation(self, type_, dst_dict): |
| 308 dst_dict['is_object'] = type_.property_type == model.PropertyType.OBJECT | 309 dst_dict['is_object'] = type_.property_type == model.PropertyType.OBJECT |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 560 # anything. Don't do it. | 561 # anything. Don't do it. |
| 561 if not IsPreviewServer(): | 562 if not IsPreviewServer(): |
| 562 handlebar_dict['samples'] = _LazySamplesGetter( | 563 handlebar_dict['samples'] = _LazySamplesGetter( |
| 563 handlebar_dict['name'], | 564 handlebar_dict['name'], |
| 564 self._samples) | 565 self._samples) |
| 565 return handlebar_dict | 566 return handlebar_dict |
| 566 | 567 |
| 567 def get(self, api_name, disable_refs=False): | 568 def get(self, api_name, disable_refs=False): |
| 568 return self._GenerateHandlebarContext( | 569 return self._GenerateHandlebarContext( |
| 569 self._get_schema_model(api_name, disable_refs)) | 570 self._get_schema_model(api_name, disable_refs)) |
| OLD | NEW |