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

Unified Diff: third_party/WebKit/Source/devtools/front_end/sources/WatchExpressionsSidebarPane.js

Issue 2573323002: Revert of [DevTools] Remove methods on Common.Event. (Closed)
Patch Set: Created 4 years 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/sources/WatchExpressionsSidebarPane.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/WatchExpressionsSidebarPane.js b/third_party/WebKit/Source/devtools/front_end/sources/WatchExpressionsSidebarPane.js
index fd346033580c18eb6a0cd6ded0b9991a8bafb5d2..6385a2a01b5b3fb80f49921824044abd8f649456 100644
--- a/third_party/WebKit/Source/devtools/front_end/sources/WatchExpressionsSidebarPane.js
+++ b/third_party/WebKit/Source/devtools/front_end/sources/WatchExpressionsSidebarPane.js
@@ -43,9 +43,9 @@
this._watchExpressionsSetting = Common.settings.createLocalSetting('watchExpressions', []);
this._addButton = new UI.ToolbarButton(Common.UIString('Add expression'), 'largeicon-add');
- this._addButton.addEventListener(UI.ToolbarButton.Events.Click, this._addButtonClicked.bind(this));
+ this._addButton.addEventListener('click', this._addButtonClicked.bind(this));
this._refreshButton = new UI.ToolbarButton(Common.UIString('Refresh'), 'largeicon-refresh');
- this._refreshButton.addEventListener(UI.ToolbarButton.Events.Click, this.update, this);
+ this._refreshButton.addEventListener('click', this._refreshButtonClicked.bind(this));
this._bodyElement = this.element.createChild('div', 'vbox watch-expressions');
this._bodyElement.addEventListener('contextmenu', this._contextMenu.bind(this), false);
@@ -82,9 +82,22 @@
this._watchExpressionsSetting.set(toSave);
}
- _addButtonClicked() {
+ /**
+ * @param {!Common.Event=} event
+ */
+ _addButtonClicked(event) {
+ if (event)
+ event.consume(true);
UI.viewManager.showView('sources.watch');
this._createWatchExpression(null).startEditing();
+ }
+
+ /**
+ * @param {!Common.Event} event
+ */
+ _refreshButtonClicked(event) {
+ event.consume();
+ this.update();
}
/**

Powered by Google App Engine
This is Rietveld 408576698