OLD | NEW |
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 /** | 5 /** |
6 * @fileoverview This file is the controller for generating extension | 6 * @fileoverview This file is the controller for generating extension |
7 * doc pages. | 7 * doc pages. |
8 * | 8 * |
9 * It expects to have available via XHR (relative path): | 9 * It expects to have available via XHR (relative path): |
10 * 1) API_TEMPLATE which is the main template for the api pages. | 10 * 1) API_TEMPLATE which is the main template for the api pages. |
11 * 2) The files located at MODULE_SCHEMAS which are shared with the extension | 11 * 2) The files located at MODULE_SCHEMAS which are shared with the extension |
12 * system and defines the methods and events contained in one api. | 12 * system and defines the methods and events contained in one api. |
13 * 3) (Possibly) A static version of the current page url in /static/. I.e. | 13 * 3) (Possibly) A static version of the current page url in /static/. I.e. |
14 * if called as ../foo.html, it will look for ../static/foo.html. | 14 * if called as ../foo.html, it will look for ../static/foo.html. |
15 * | 15 * |
16 * The "shell" page may have a renderering already contained within it so that | 16 * The "shell" page may have a renderering already contained within it so that |
17 * the docs can be indexed. | 17 * the docs can be indexed. |
18 * | 18 * |
19 */ | 19 */ |
20 | 20 |
21 var API_TEMPLATE = 'template/api_template.html'; | 21 var API_TEMPLATE = 'template/api_template.html'; |
22 var MODULE_SCHEMAS = [ | 22 var MODULE_SCHEMAS = [ |
23 '../api/alarms.json', // autogenerated | 23 '../api/alarms.json', // autogenerated |
24 '../api/bookmarks.json', | 24 '../api/bookmarks.json', |
25 '../api/browserAction.json', | 25 '../api/browser_action.json', |
26 '../api/browsingData.json', | 26 '../api/browsing_data.json', |
27 '../api/chromeAuthPrivate.json', | 27 '../api/chrome_auth_private.json', |
28 '../api/chromeosInfoPrivate.json', | 28 '../api/chromeos_info_private.json', |
29 '../api/contentSettings.json', | 29 '../api/content_settings.json', |
30 '../api/contextMenus.json', | 30 '../api/context_menus.json', |
31 '../api/cookies.json', | 31 '../api/cookies.json', |
32 '../api/debugger.json', | 32 '../api/debugger.json', |
33 '../api/declarative.json', | 33 '../api/declarative.json', |
34 '../api/declarativeWebRequest.json', | 34 '../api/declarative_web_request.json', |
35 '../api/devtools.json', | 35 '../api/devtools.json', |
36 '../api/experimental.accessibility.json', | 36 '../api/experimental_accessibility.json', |
37 '../api/experimental.app.json', | 37 '../api/experimental_app.json', |
38 '../api/experimental.bookmarkManager.json', | 38 '../api/experimental_bookmark_manager.json', |
39 '../api/experimental.downloads.json', | 39 '../api/experimental_downloads.json', |
40 '../api/experimental.fontSettings.json', | 40 '../api/experimental_font_settings.json', |
41 '../api/experimental.identity.json', | 41 '../api/experimental_identity.json', |
42 '../api/experimental.infobars.json', | 42 '../api/experimental_infobars.json', |
43 '../api/experimental.input.ui.json', | 43 '../api/experimental_input_ui.json', |
44 '../api/experimental.input.virtualKeyboard.json', | 44 '../api/experimental_input_virtual_keyboard.json', |
45 '../api/experimental.keybinding.json', | 45 '../api/experimental_keybinding.json', |
46 '../api/experimental.mediaGalleries.json', | 46 '../api/experimental_media_galleries.json', |
47 '../api/experimental.offscreenTabs.json', | 47 '../api/experimental_offscreen_tabs.json', |
48 '../api/experimental.processes.json', | 48 '../api/experimental_processes.json', |
49 '../api/experimental.rlz.json', | 49 '../api/experimental_rlz.json', |
50 '../api/experimental.runtime.json', | 50 '../api/experimental_runtime.json', |
51 '../api/experimental.speechInput.json', | 51 '../api/experimental_speech_input.json', |
52 '../api/extension.json', | 52 '../api/extension.json', |
53 '../api/fileBrowserHandler.json', | 53 '../api/file_browser_handler.json', |
54 '../api/fileBrowserPrivate.json', | 54 '../api/file_browser_private.json', |
55 '../api/history.json', | 55 '../api/history.json', |
56 '../api/i18n.json', | 56 '../api/i18n.json', |
57 '../api/idle.json', | 57 '../api/idle.json', |
58 '../api/input.ime.json', | 58 '../api/input_ime.json', |
59 '../api/inputMethodPrivate.json', | 59 '../api/input_method_private.json', |
60 '../api/managedModePrivate.json', | 60 '../api/managed_mode_private.json', |
61 '../api/management.json', | 61 '../api/management.json', |
62 '../api/mediaPlayerPrivate.json', | 62 '../api/media_player_private.json', |
63 '../api/metricsPrivate.json', | 63 '../api/metrics_private.json', |
64 '../api/omnibox.json', | 64 '../api/omnibox.json', |
65 '../api/pageAction.json', | 65 '../api/page_action.json', |
66 '../api/pageActions.json', | 66 '../api/page_actions.json', |
67 '../api/pageCapture.json', | 67 '../api/page_capture.json', |
68 '../api/permissions.json', | 68 '../api/permissions.json', |
69 '../api/privacy.json', | 69 '../api/privacy.json', |
70 '../api/proxy.json', | 70 '../api/proxy.json', |
71 '../api/storage.json', | 71 '../api/storage.json', |
72 '../api/systemPrivate.json', | 72 '../api/system_private.json', |
73 '../api/tabs.json', | 73 '../api/tabs.json', |
74 '../api/test.json', | 74 '../api/test.json', |
75 '../api/topSites.json', | 75 '../api/top_sites.json', |
76 '../api/tts.json', | 76 '../api/tts.json', |
77 '../api/ttsEngine.json', | 77 '../api/tts_engine.json', |
78 '../api/types.json', | 78 '../api/types.json', |
79 '../api/webNavigation.json', | 79 '../api/web_navigation.json', |
80 '../api/webRequest.json', | 80 '../api/web_request.json', |
81 '../api/webSocketProxyPrivate.json', | 81 '../api/web_socket_proxy_private.json', |
82 '../api/webstore.json', | 82 '../api/webstore.json', |
83 '../api/webstorePrivate.json', | 83 '../api/webstore_private.json', |
84 '../api/windows.json', | 84 '../api/windows.json', |
85 ] | 85 ] |
86 var PERMISSION_FEATURES = '../api/_permission_features.json'; | 86 var PERMISSION_FEATURES = '../api/_permission_features.json'; |
87 var DEVTOOLS_SCHEMA = '../api/devtools_api.json'; | 87 var DEVTOOLS_SCHEMA = '../api/devtools_api.json'; |
88 var USE_DEVTOOLS_SCHEMA = | 88 var USE_DEVTOOLS_SCHEMA = |
89 /devtools[^/]*\.html/.test(location.pathname); | 89 /devtools[^/]*\.html/.test(location.pathname); |
90 var API_MODULE_PREFIX = 'chrome.'; | 90 var API_MODULE_PREFIX = 'chrome.'; |
91 var SAMPLES = 'samples.json'; | 91 var SAMPLES = 'samples.json'; |
92 var REQUEST_TIMEOUT = 2000; | 92 var REQUEST_TIMEOUT = 2000; |
93 | 93 |
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
758 } | 758 } |
759 if (a.name > b.name) { | 759 if (a.name > b.name) { |
760 return 1; | 760 return 1; |
761 } | 761 } |
762 return 0; | 762 return 0; |
763 } | 763 } |
764 | 764 |
765 function disableDocs(obj) { | 765 function disableDocs(obj) { |
766 return !!obj.nodoc; | 766 return !!obj.nodoc; |
767 } | 767 } |
OLD | NEW |