summaryrefslogtreecommitdiffstats
path: root/chrome/common/extensions/docs/server2/sidenav_data_source.py
diff options
context:
space:
mode:
authorkalman@chromium.org <kalman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-19 20:44:04 +0000
committerkalman@chromium.org <kalman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-19 20:44:04 +0000
commit4105bf75ab0b68f2a9a117cca2e52ac01fb12f77 (patch)
treee5e7c21a1e51c66b4382aa4da057010c97001894 /chrome/common/extensions/docs/server2/sidenav_data_source.py
parentbd931cfa493b88c047e3a0720620331379cd7b4f (diff)
downloadchromium_src-4105bf75ab0b68f2a9a117cca2e52ac01fb12f77.zip
chromium_src-4105bf75ab0b68f2a9a117cca2e52ac01fb12f77.tar.gz
chromium_src-4105bf75ab0b68f2a9a117cca2e52ac01fb12f77.tar.bz2
Docserver: move to a single version served from trunk. Permanently redirect requests
from any channel to the non-channel version (served from trunk). Improve the redirect logic in other ways. Fix a few bugs in caching classes that cause this all not to work. Replace the channel switcher (now moot) with a platform switcher. R=cduvall@chromium.org BUG=233978 NOTRY=true Review URL: https://chromiumcodereview.appspot.com/15087006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@212646 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/extensions/docs/server2/sidenav_data_source.py')
-rw-r--r--chrome/common/extensions/docs/server2/sidenav_data_source.py13
1 files changed, 4 insertions, 9 deletions
diff --git a/chrome/common/extensions/docs/server2/sidenav_data_source.py b/chrome/common/extensions/docs/server2/sidenav_data_source.py
index 98d7fd2..bf46727 100644
--- a/chrome/common/extensions/docs/server2/sidenav_data_source.py
+++ b/chrome/common/extensions/docs/server2/sidenav_data_source.py
@@ -13,21 +13,17 @@ class SidenavDataSource(object):
menu.
"""
class Factory(object):
- def __init__(self, compiled_fs_factory, json_path, base_path):
+ def __init__(self, compiled_fs_factory, json_path):
self._cache = compiled_fs_factory.Create(self._CreateSidenavDict,
SidenavDataSource)
self._json_path = json_path
- self._base_path = base_path
def Create(self, path):
"""Create a SidenavDataSource, binding it to |path|. |path| is the url
of the page that is being rendered. It is used to determine which item
in the sidenav should be highlighted.
"""
- return SidenavDataSource(self._cache,
- self._json_path,
- path,
- self._base_path)
+ return SidenavDataSource(self._cache, self._json_path, path)
def _AddLevels(self, items, level):
"""Levels represent how deeply this item is nested in the sidenav. We
@@ -43,11 +39,10 @@ class SidenavDataSource(object):
self._AddLevels(items, 2);
return items
- def __init__(self, cache, json_path, path, base_path):
+ def __init__(self, cache, json_path, path):
self._cache = cache
self._json_path = json_path
self._href = '/' + path
- self._file_dir = base_path
def _AddSelected(self, items):
for item in items:
@@ -70,7 +65,7 @@ class SidenavDataSource(object):
if not href.startswith('/'):
logging.warn('Paths in sidenav must be qualified. %s is not.' % href)
href = '/' + href
- item['href'] = '%s%s' % (self._file_dir, href)
+ item['href'] = href
def get(self, key):
sidenav = copy.deepcopy(self._cache.GetFromFile(