Chromium Code Reviews| Index: chrome/common/extensions/docs/server2/api_data_source.py |
| diff --git a/chrome/common/extensions/docs/server2/api_data_source.py b/chrome/common/extensions/docs/server2/api_data_source.py |
| index 6fdc6f6abd6d575845b47cd4a2e6e8c866077d3c..bb09f70c4135ce6dffc5d5cf57ba0b6b21362fb5 100644 |
| --- a/chrome/common/extensions/docs/server2/api_data_source.py |
| +++ b/chrome/common/extensions/docs/server2/api_data_source.py |
| @@ -231,12 +231,14 @@ class _JSCModel(object): |
| ''' |
| def __init__(self, |
| + api_models, |
| namespace, |
| availability_finder, |
| json_cache, |
| template_cache, |
| features_bundle, |
| event_byname_future): |
| + self._content_script_apis = api_models.GetContentScriptsAPIs().Get() |
| self._availability = availability_finder.GetAPIAvailability(namespace.name) |
| self._current_node = _APINodeCursor(availability_finder, namespace.name) |
| self._api_availabilities = json_cache.GetFromFile( |
| @@ -492,7 +494,7 @@ class _JSCModel(object): |
| intro_rows = [ |
| self._GetIntroDescriptionRow(), |
| self._GetIntroAvailabilityRow() |
| - ] + self._GetIntroDependencyRows() |
| + ] + self._GetIntroDependencyRows() + self._GetIntroContentScriptRow() |
| # Add rows using data from intro_tables.json, overriding any existing rows |
| # if they share the same 'title' attribute. |
| @@ -522,6 +524,21 @@ class _JSCModel(object): |
| 'version': version |
| } |
| + def _GetIntroContentScriptRow(self): |
| + content_script_support = self._content_script_apis.get(self._namespace.name) |
| + if content_script_support is None: |
| + return [] |
| + return [{ |
| + 'title': 'Content Scripts', |
| + 'content': [{ |
| + 'partial': self._template_cache.GetFromFile( |
| + posixpath.join(PRIVATE_TEMPLATES, |
| + 'intro_tables', |
| + 'content_scripts.html')).Get(), |
|
not at google - send to devlin
2014/07/09 02:55:55
this doesn't actually exist
|
| + 'contentScriptSupport': content_script_support |
| + }] |
| + }] |
| + |
| def _GetIntroDescriptionRow(self): |
| ''' Generates the 'Description' row data for an API intro table. |
| ''' |
| @@ -688,6 +705,7 @@ class APIDataSource(DataSource): |
| jsc_model = jsc_model_future.Get() |
| if jsc_model is None: |
| jsc_model = _JSCModel( |
| + self._platform_bundle.GetAPIModels(platform), |
| model_future.Get(), |
| self._platform_bundle.GetAvailabilityFinder(platform), |
| self._json_cache, |