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

Unified Diff: extensions/renderer/api_binding.h

Issue 2615773002: [Extensions Bindings] Add enum support (Closed)
Patch Set: rebase Created 3 years, 11 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: extensions/renderer/api_binding.h
diff --git a/extensions/renderer/api_binding.h b/extensions/renderer/api_binding.h
index 4c23f54e28b7c2aa274de5cd20aaac778f9cf7bd..6e6e944a311b3901776f8fd064a0a99468c89618 100644
--- a/extensions/renderer/api_binding.h
+++ b/extensions/renderer/api_binding.h
@@ -95,6 +95,12 @@ class APIBinding {
// The names of all events associated with this API.
std::vector<std::string> event_names_;
+ // The pair for enum entry is <original, js-ified>. JS enum entries use
+ // SCREAMING_STYLE (whereas our API enums are just inconsistent).
+ using EnumEntry = std::pair<std::string, std::string>;
+ // A map of <name, values> for the enums on this API.
+ std::map<std::string, std::vector<EnumEntry>> enums_;
+
// The callback to use when an API is invoked with valid arguments.
APIMethodCallback method_callback_;

Powered by Google App Engine
This is Rietveld 408576698