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

Unified Diff: third_party/WebKit/Source/devtools/front_end/ui/DropDownMenu.js

Issue 2533483002: [DevTools] Typed events and event listeners. (Closed)
Patch Set: Created 4 years, 1 month 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: third_party/WebKit/Source/devtools/front_end/ui/DropDownMenu.js
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/DropDownMenu.js b/third_party/WebKit/Source/devtools/front_end/ui/DropDownMenu.js
index 9ee2469e8601c1b175b72bf0f47124dc95cc8f26..f93e17e00a418f5c0096af4cfc1a84cb7c8aa095 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui/DropDownMenu.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui/DropDownMenu.js
@@ -4,7 +4,7 @@
/**
* @unrestricted
*/
-UI.DropDownMenu = class extends Common.Object {
+UI.DropDownMenu = class extends Common.ObjectBase {
/**
* @param {!Element} element
*/
@@ -32,7 +32,7 @@ UI.DropDownMenu = class extends Common.Object {
* @param {string} id
*/
_itemHandler(id) {
- this.dispatchEventToListeners(UI.DropDownMenu.Events.ItemSelected, id);
+ this.dispatchEventToListeners(new UI.DropDownMenu.ItemSelectedEvent(id));
}
/**
@@ -59,7 +59,11 @@ UI.DropDownMenu = class extends Common.Object {
/** @typedef {{id: string, title: string}} */
UI.DropDownMenu.Item;
-/** @enum {symbol} */
-UI.DropDownMenu.Events = {
- ItemSelected: Symbol('ItemSelected')
+UI.DropDownMenu.ItemSelectedEvent = class {
+ /**
+ * @param {string} id
+ */
+ constructor(id) {
+ this.id = id;
+ }
};

Powered by Google App Engine
This is Rietveld 408576698