Index: third_party/WebKit/Source/devtools/front_end/ui/Toolbar.js |
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/Toolbar.js b/third_party/WebKit/Source/devtools/front_end/ui/Toolbar.js |
index 6295836985d44b5d972a77727427ec8cb8648622..29a80f96cdba911a924871b7fd4b1a8440fb0e03 100644 |
--- a/third_party/WebKit/Source/devtools/front_end/ui/Toolbar.js |
+++ b/third_party/WebKit/Source/devtools/front_end/ui/Toolbar.js |
@@ -57,7 +57,7 @@ |
static createActionButton(action, toggledOptions, untoggledOptions) { |
var button = new UI.ToolbarToggle(action.title(), action.icon(), action.toggledIcon()); |
button.setToggleWithRedColor(action.toggleWithRedColor()); |
- button.addEventListener(UI.ToolbarButton.Events.Click, action.execute, action); |
+ button.addEventListener('click', action.execute, action); |
action.addEventListener(UI.Action.Events.Enabled, enabledChanged); |
action.addEventListener(UI.Action.Events.Toggled, toggled); |
/** @type {?UI.LongClickController} */ |
@@ -107,7 +107,7 @@ |
function showOptions() { |
var buttons = longClickButtons.slice(); |
var mainButtonClone = new UI.ToolbarToggle(action.title(), action.icon(), action.toggledIcon()); |
- mainButtonClone.addEventListener(UI.ToolbarButton.Events.Click, clicked); |
+ mainButtonClone.addEventListener('click', clicked); |
/** |
* @param {!Common.Event} event |
@@ -511,28 +511,23 @@ |
* @param {!Event} event |
*/ |
_clicked(event) { |
- this.dispatchEventToListeners(UI.ToolbarButton.Events.Click, event); |
+ var defaultPrevented = this.dispatchEventToListeners('click', event); |
+ event.consume(defaultPrevented); |
} |
/** |
* @param {!Event} event |
*/ |
_mouseDown(event) { |
- this.dispatchEventToListeners(UI.ToolbarButton.Events.MouseDown, event); |
+ this.dispatchEventToListeners('mousedown', event); |
} |
/** |
* @param {!Event} event |
*/ |
_mouseUp(event) { |
- this.dispatchEventToListeners(UI.ToolbarButton.Events.MouseUp, event); |
- } |
-}; |
- |
-UI.ToolbarButton.Events = { |
- Click: Symbol('Click'), |
- MouseDown: Symbol('MouseDown'), |
- MouseUp: Symbol('MouseUp') |
+ this.dispatchEventToListeners('mouseup', event); |
+ } |
}; |
/** |
@@ -574,7 +569,7 @@ |
}; |
UI.ToolbarInput.Event = { |
- TextChanged: Symbol('TextChanged') |
+ TextChanged: 'TextChanged' |
}; |
/** |