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

Unified Diff: third_party/WebKit/Source/devtools/front_end/sources/WorkspaceMappingTip.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/sources/WorkspaceMappingTip.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/WorkspaceMappingTip.js b/third_party/WebKit/Source/devtools/front_end/sources/WorkspaceMappingTip.js
index 83aedaf01493e018117006ad674e00219e13a06d..863e174151dd2db6923a59f7909a3cd96261707e 100644
--- a/third_party/WebKit/Source/devtools/front_end/sources/WorkspaceMappingTip.js
+++ b/third_party/WebKit/Source/devtools/front_end/sources/WorkspaceMappingTip.js
@@ -21,18 +21,19 @@ Sources.WorkspaceMappingTip = class {
if (this._workspaceInfobarDisabledSetting.get() && this._workspaceMappingInfobarDisabledSetting.get())
return;
this._sourcesView.addEventListener(Sources.SourcesView.Events.EditorSelected, this._editorSelected.bind(this));
- Persistence.persistence.addEventListener(Persistence.Persistence.Events.BindingCreated, this._bindingCreated, this);
+ Persistence.persistence.addEventListener(Persistence.Persistence.BindingChangedEvent, this._bindingChanged, this);
}
/**
- * @param {!Common.Event} event
+ * @param {!Persistence.Persistence.BindingChangedEvent} event
*/
- _bindingCreated(event) {
- var binding = /** @type {!Persistence.PersistenceBinding} */ (event.data);
- if (binding.network[Sources.WorkspaceMappingTip._infobarSymbol])
- binding.network[Sources.WorkspaceMappingTip._infobarSymbol].dispose();
- if (binding.fileSystem[Sources.WorkspaceMappingTip._infobarSymbol])
- binding.fileSystem[Sources.WorkspaceMappingTip._infobarSymbol].dispose();
+ _bindingChanged(event) {
+ if (!event.created)
+ return;
+ if (event.binding.network[Sources.WorkspaceMappingTip._infobarSymbol])
+ event.binding.network[Sources.WorkspaceMappingTip._infobarSymbol].dispose();
+ if (event.binding.fileSystem[Sources.WorkspaceMappingTip._infobarSymbol])
+ event.binding.fileSystem[Sources.WorkspaceMappingTip._infobarSymbol].dispose();
}
/**

Powered by Google App Engine
This is Rietveld 408576698