Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4376)

Unified Diff: chrome/common/extensions/docs/server2/template_data_source.py

Issue 12996003: Dynamically generate a heading for Extension Docs API pages (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing issues with experimental_APIs Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..e0b5bf42cf18e9335d02f8c48473939942f784aa 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'],
+ '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

Powered by Google App Engine
This is Rietveld 408576698