| Index: third_party/WebKit/Source/devtools/front_end/persistence/Persistence.js
|
| diff --git a/third_party/WebKit/Source/devtools/front_end/persistence/Persistence.js b/third_party/WebKit/Source/devtools/front_end/persistence/Persistence.js
|
| index 209cfb6d99c616038bb3263c06df6d1012842075..af560e2efb9b635c64e419c0f4340338e5149107 100644
|
| --- a/third_party/WebKit/Source/devtools/front_end/persistence/Persistence.js
|
| +++ b/third_party/WebKit/Source/devtools/front_end/persistence/Persistence.js
|
| @@ -17,12 +17,15 @@ WebInspector.Persistence = class extends WebInspector.Object {
|
| /** @type {!Map<string, number>} */
|
| this._filePathPrefixesToBindingCount = new Map();
|
|
|
| - if (Runtime.experiments.isEnabled('persistence2'))
|
| + if (Runtime.experiments.isEnabled('persistence2')) {
|
| + var iconProvider = new WebInspector.Persistence.LinkifierIconProvider(this);
|
| + WebInspector.Linkifier.registerIconProvider(iconProvider);
|
| this._mapping =
|
| new WebInspector.Automapping(workspace, this._onBindingCreated.bind(this), this._onBindingRemoved.bind(this));
|
| - else
|
| + } else {
|
| this._mapping = new WebInspector.DefaultMapping(
|
| workspace, fileSystemMapping, this._onBindingCreated.bind(this), this._onBindingRemoved.bind(this));
|
| + }
|
| }
|
|
|
| /**
|
| @@ -254,5 +257,34 @@ WebInspector.PersistenceBinding = class {
|
| }
|
| };
|
|
|
| +/**
|
| + * @extends {WebInspector.Object}
|
| + * @implements {WebInspector.LinkifierIconProvider}
|
| + */
|
| +WebInspector.Persistence.LinkifierIconProvider = class extends WebInspector.Object {
|
| + constructor(persistence) {
|
| + super();
|
| + persistence.addEventListener(WebInspector.Persistence.Events.BindingCreated, this._bindingChanged, this);
|
| + persistence.addEventListener(WebInspector.Persistence.Events.BindingRemoved, this._bindingChanged, this);
|
| + }
|
| +
|
| + /**
|
| + * @param {!WebInspector.Event} event
|
| + */
|
| + _bindingChanged(event) {
|
| + var binding = /** @type {!WebInspector.PersistenceBinding} */(event.data);
|
| + this.dispatchEventToListeners(WebInspector.LinkifierIconProvider.Events.IconChanged, binding.network);
|
| + }
|
| +
|
| + /**
|
| + * @override
|
| + * @param {!WebInspector.UISourceCode} uiSourceCode
|
| + */
|
| + iconType(uiSourceCode) {
|
| + var binding = WebInspector.persistence.binding(uiSourceCode);
|
| + return binding ? 'smallicon-checkmark' : '';
|
| + }
|
| +};
|
| +
|
| /** @type {!WebInspector.Persistence} */
|
| WebInspector.persistence;
|
|
|