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

Unified Diff: third_party/WebKit/Source/devtools/front_end/persistence/PersistenceUtils.js

Issue 2487293002: DevTools: introduce sync checkmarks icons in StylesSidebarPane. (Closed)
Patch Set: DevTools: introduce icons in linkifier. 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/persistence/PersistenceUtils.js
diff --git a/third_party/WebKit/Source/devtools/front_end/persistence/PersistenceUtils.js b/third_party/WebKit/Source/devtools/front_end/persistence/PersistenceUtils.js
index 62b9de0e24e7c9975399f2302f192c4a6be4a28f..3db5bfd2614c6c40cd3620289f95f1423aaf2214 100644
--- a/third_party/WebKit/Source/devtools/front_end/persistence/PersistenceUtils.js
+++ b/third_party/WebKit/Source/devtools/front_end/persistence/PersistenceUtils.js
@@ -18,3 +18,37 @@ WebInspector.PersistenceUtils = class {
return WebInspector.UIString('Linked to %s', binding.network.url().trimMiddle(150));
}
};
+
+/**
+ * @extends {WebInspector.Object}
+ * @implements {WebInspector.LinkDecorator}
+ */
+WebInspector.PersistenceUtils.LinkDecorator = class extends WebInspector.Object {
+ constructor(persistence) {
dgozman 2016/11/10 01:01:43 JSDoc
lushnikov 2016/11/10 01:13:45 Done.
+ 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.LinkDecorator.Events.LinkIconChanged, binding.network);
+ }
+
+ /**
+ * @override
+ * @param {!WebInspector.UISourceCode} uiSourceCode
+ * @return {?WebInspector.Icon}
+ */
+ linkIcon(uiSourceCode) {
+ var binding = WebInspector.persistence.binding(uiSourceCode);
+ if (!binding)
+ return null;
+ var icon = WebInspector.Icon.create('smallicon-green-checkmark');
+ icon.title = WebInspector.PersistenceUtils.tooltipForUISourceCode(uiSourceCode);
+ return icon;
+ }
+};

Powered by Google App Engine
This is Rietveld 408576698