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

Unified Diff: chrome/common/extensions/docs/js/api_page_generator.js

Issue 10657018: Implement the API index doc for platform apps. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: f Created 8 years, 6 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/js/api_page_generator.js
diff --git a/chrome/common/extensions/docs/js/api_page_generator.js b/chrome/common/extensions/docs/js/api_page_generator.js
index 97d44d78761f6f9888c7e0c4666e78b3a2e99a40..8db69f8ddc1acbf9b4e313c6629d3abd38bc5373 100644
--- a/chrome/common/extensions/docs/js/api_page_generator.js
+++ b/chrome/common/extensions/docs/js/api_page_generator.js
@@ -503,19 +503,29 @@ function filterDocumented(things) {
});
}
-function stableAPIs() {
- return schema.filter(function(module) {
- return !disableDocs(module) &&
- module.namespace.indexOf('experimental') < 0;
- }).map(function(module) {
- return module.namespace;
- }).sort();
-}
+function listChromeAPIs(packageType, includeExperimental) {
+ // Super ghetto to use a synchronous XHR here, but this only runs during
+ // generation of docs, so I guess it's ok.
+ var req = new XMLHttpRequest();
+ req.open('GET', '../../api/_permission_features.json', false);
+ req.send(null);
+
+ var permissionFeatures = JSON.parse(JSON.minify(req.responseText));
-function experimentalAPIs() {
return schema.filter(function(module) {
- return !disableDocs(module) &&
- module.namespace.indexOf('experimental') == 0;
+ if (disableDocs(module))
+ return false;
+
+ if ((module.namespace.indexOf('experimental') > -1) !=
+ includeExperimental) {
+ return false;
+ }
+
+ var feature = permissionFeatures[module.namespace];
+ if (feature && feature.extension_types.indexOf(packageType) == -1)
+ return false;
+
+ return true;
}).map(function(module) {
return module.namespace;
}).sort();
« no previous file with comments | « chrome/common/extensions/docs/apps/apps_api_index.html ('k') | chrome/common/extensions/docs/static/api_index.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698