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

Side by Side Diff: chrome/common/extensions/docs/server2/server_instance.py

Issue 12521030: Extension docs: Include sidenav in 404 pages (Closed) Base URL: https://src.chromium.org/svn/trunk/src/
Patch Set: 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 unified diff | Download patch
OLDNEW
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 from fnmatch import fnmatch 5 from fnmatch import fnmatch
6 import mimetypes 6 import mimetypes
7 import os 7 import os
8 8
9 from file_system import FileNotFoundError 9 from file_system import FileNotFoundError
10 import compiled_file_system as compiled_fs 10 import compiled_file_system as compiled_fs
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 elif path.startswith('static/'): 64 elif path.startswith('static/'):
65 content = self._FetchStaticResource(path, response) 65 content = self._FetchStaticResource(path, response)
66 elif path.endswith('.html'): 66 elif path.endswith('.html'):
67 content = templates.Render(path) 67 content = templates.Render(path)
68 68
69 response.headers['x-frame-options'] = 'sameorigin' 69 response.headers['x-frame-options'] = 'sameorigin'
70 if content: 70 if content:
71 response.headers['cache-control'] = 'max-age=300' 71 response.headers['cache-control'] = 'max-age=300'
72 response.out.write(content) 72 response.out.write(content)
73 else: 73 else:
74 response.set_status(404); 74 response.set_status(404)
75 response.out.write(templates.Render('404')) 75 doc_class = path.split('/', 1)[0]
76 content = templates.Render(doc_class + '/404')
77 if not content:
78 content = templates.Render('extensions/404')
79 response.out.write(content)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698