Chromium Code Reviews| Index: chrome/common/extensions/docs/server2/template_data_source.py |
| diff --git a/chrome/common/extensions/docs/server2/template_data_source.py b/chrome/common/extensions/docs/server2/template_data_source.py |
| index e00bb3ebc8702d82565246e671a4040cdef2403c..ab8f9606ce346dcb5c1fd9029b2dbc0c01b420fd 100644 |
| --- a/chrome/common/extensions/docs/server2/template_data_source.py |
| +++ b/chrome/common/extensions/docs/server2/template_data_source.py |
| @@ -16,9 +16,16 @@ _VERSION = 2 |
| EXTENSIONS_URL = '/chrome/extensions' |
| -def _MakeChannelDict(channel_name): |
| - channel_dict = { |
| - 'channels': [{'name': name} for name in BranchUtility.GetAllBranchNames()], |
| +def _MakeChannelDict(channel_name, all_channels): |
| + return { |
| + 'channels' : [ |
| + { |
| + 'name': channel['name'].upper(), |
| + 'version': channel['version'], |
| + 'path': channel['name'], |
| + 'isCurrent': channel['name'] == channel_name |
| + } for channel in all_channels |
| + ], |
| 'current': channel_name |
| } |
| for channel in channel_dict['channels']: |
| @@ -53,8 +60,9 @@ class TemplateDataSource(object): |
| cache_factory, |
| ref_resolver_factory, |
| public_template_path, |
| - private_template_path): |
| - self._branch_info = _MakeChannelDict(channel_name) |
| + private_template_path, |
| + all_channels): |
| + self._branch_info = _MakeChannelDict(channel_name, all_channels) |
| self._api_data_source_factory = api_data_source_factory |
| self._api_list_data_source_factory = api_list_data_source_factory |
| self._intro_data_source_factory = intro_data_source_factory |
| @@ -75,6 +83,7 @@ class TemplateDataSource(object): |
| def Create(self, request, path): |
| """Returns a new TemplateDataSource bound to |request|. |
| """ |
| + #branch_info = self._branch_info.copy() |
|
cduvall
2013/03/25 22:59:43
take out?
epeterson
2013/03/27 22:36:09
Done.
|
| return TemplateDataSource( |
| self._branch_info, |
| self._api_data_source_factory.Create(request), |