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

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

Issue 2594883002: DevTools: [Persistence] introduce badged icons instead of checkmarks (Closed)
Patch Set: address comments 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/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 beadea7daadbf5568c36bb15f43b54adf7aed6c2..79eb624f1ba576f9172601921fd9fea2f365b510 100644
--- a/third_party/WebKit/Source/devtools/front_end/persistence/PersistenceUtils.js
+++ b/third_party/WebKit/Source/devtools/front_end/persistence/PersistenceUtils.js
@@ -17,6 +17,26 @@ Persistence.PersistenceUtils = class {
return Common.UIString('Linked to source map: %s', binding.network.url().trimMiddle(150));
return Common.UIString('Linked to %s', binding.network.url().trimMiddle(150));
}
+
+ /**
+ * @param {!Workspace.UISourceCode} uiSourceCode
+ * @return {?UI.Icon}
+ */
+ static iconForUISourceCode(uiSourceCode) {
+ if (!Runtime.experiments.isEnabled('persistence2'))
+ return null;
+ var binding = Persistence.persistence.binding(uiSourceCode);
+ if (binding) {
+ var icon = UI.Icon.create('smallicon-file-sync');
+ icon.title = Persistence.PersistenceUtils.tooltipForUISourceCode(binding.fileSystem);
+ return icon;
+ }
+ if (uiSourceCode.project().type() !== Workspace.projectTypes.FileSystem)
+ return null;
+ var icon = UI.Icon.create('smallicon-file');
+ icon.title = Persistence.PersistenceUtils.tooltipForUISourceCode(uiSourceCode);
+ return icon;
+ }
};
/**
@@ -47,11 +67,6 @@ Persistence.PersistenceUtils.LinkDecorator = class extends Common.Object {
* @return {?UI.Icon}
*/
linkIcon(uiSourceCode) {
- var binding = Persistence.persistence.binding(uiSourceCode);
- if (!binding)
- return null;
- var icon = UI.Icon.create('smallicon-green-checkmark');
- icon.title = Persistence.PersistenceUtils.tooltipForUISourceCode(uiSourceCode);
- return icon;
+ return Persistence.PersistenceUtils.iconForUISourceCode(uiSourceCode);
}
};

Powered by Google App Engine
This is Rietveld 408576698