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

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

Issue 1070873002: [Extension DocServer] Remove availability warning for enums (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nits Created 5 years, 8 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
« no previous file with comments | « chrome/common/extensions/docs/server2/cron.yaml ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/docs/server2/jsc_view.py
diff --git a/chrome/common/extensions/docs/server2/jsc_view.py b/chrome/common/extensions/docs/server2/jsc_view.py
index 967d0ef67f3afb68048761636eb2d21b81f0c4d0..2bf46d709ab56e10792650061310f7ed429ca0c2 100644
--- a/chrome/common/extensions/docs/server2/jsc_view.py
+++ b/chrome/common/extensions/docs/server2/jsc_view.py
@@ -233,7 +233,8 @@ class _JSCViewBuilder(object):
'functions': self._GenerateFunctions(type_.functions),
'events': self._GenerateEvents(type_.events),
'id': _CreateId(type_, 'type'),
- 'availability': self._GetAvailabilityTemplate()
+ 'availability': self._GetAvailabilityTemplate(
+ is_enum=type_.property_type == model.PropertyType.ENUM)
}
self._RenderTypeInformation(type_, type_dict)
return type_dict
@@ -444,10 +445,16 @@ class _JSCViewBuilder(object):
'version': version
}
- def _GetAvailabilityTemplate(self):
+ def _GetAvailabilityTemplate(self, is_enum=False):
'''Gets availability for the current node and returns an appropriate
template object.
'''
+ # We don't show an availability warning for enums.
+ # TODO(devlin): We should also render enums differently, indicating that
+ # symbolic constants are available from version 44 onwards.
+ if is_enum:
+ return None
+
# Displaying deprecated status takes precedence over when the API
# became stable.
availability_info = self._current_node.GetDeprecated()
« no previous file with comments | « chrome/common/extensions/docs/server2/cron.yaml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698