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

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

Issue 2349343002: DevTools: introduce persistence/ module (Closed)
Patch Set: reupload Created 4 years, 3 months 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/NavigatorView.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/NavigatorView.js b/third_party/WebKit/Source/devtools/front_end/sources/NavigatorView.js
index ceaf37b22ca839073806e37a4f5beeb4c28f2d0a..a7debf6cf6401a1544d4b7c378cdc20e9305f2a5 100644
--- a/third_party/WebKit/Source/devtools/front_end/sources/NavigatorView.js
+++ b/third_party/WebKit/Source/devtools/front_end/sources/NavigatorView.js
@@ -61,6 +61,8 @@ WebInspector.NavigatorView = function()
WebInspector.targetManager.addModelListener(WebInspector.ResourceTreeModel, WebInspector.ResourceTreeModel.Events.FrameNavigated, this._frameNavigated, this);
WebInspector.targetManager.addModelListener(WebInspector.ResourceTreeModel, WebInspector.ResourceTreeModel.Events.FrameDetached, this._frameDetached, this);
WebInspector.targetManager.observeTargets(this);
+ WebInspector.persistence.addEventListener(WebInspector.Persistence.Events.BindingCreated, this._onBindingCreated, this);
+ WebInspector.persistence.addEventListener(WebInspector.Persistence.Events.BindingRemoved, this._onBindingRemoved, this);
this._resetWorkspace(WebInspector.workspace);
}
@@ -152,6 +154,25 @@ WebInspector.NavigatorView.appendSearchItem = function(contextMenu, path)
WebInspector.NavigatorView.prototype = {
/**
+ * @param {!WebInspector.Event} event
+ */
+ _onBindingCreated: function(event)
+ {
+ var binding = /** @type {!WebInspector.PersistenceBinding} */(event.data);
+ // TODO(lushnikov): show network UISourceCodes in navigator.
+ this._removeUISourceCode(binding.network);
+ },
+
+ /**
+ * @param {!WebInspector.Event} event
+ */
+ _onBindingRemoved: function(event)
+ {
+ var binding = /** @type {!WebInspector.PersistenceBinding} */(event.data);
+ this._addUISourceCode(binding.network);
+ },
+
+ /**
* @override
*/
focus: function()
@@ -210,6 +231,10 @@ WebInspector.NavigatorView.prototype = {
if (!this.accept(uiSourceCode))
return;
+ var binding = WebInspector.persistence.binding(uiSourceCode);
+ if (binding && binding.network === uiSourceCode)
+ return;
+
var isFromSourceMap = uiSourceCode.contentType().isFromSourceMap();
var path;
if (uiSourceCode.project().type() === WebInspector.projectTypes.FileSystem)
@@ -439,6 +464,9 @@ WebInspector.NavigatorView.prototype = {
*/
revealUISourceCode: function(uiSourceCode, select)
{
+ var binding = WebInspector.persistence.binding(uiSourceCode);
+ if (binding && binding.network === uiSourceCode)
+ uiSourceCode = binding.fileSystem;
var node = this._uiSourceCodeNodes.get(uiSourceCode);
if (!node)
return;
@@ -1262,7 +1290,7 @@ WebInspector.NavigatorUISourceCodeTreeNode.prototype = {
return;
var titleText = this._uiSourceCode.displayName();
- if (!ignoreIsDirty && (this._uiSourceCode.isDirty() || this._uiSourceCode.hasUnsavedCommittedChanges()))
+ if (!ignoreIsDirty && (this._uiSourceCode.isDirty() || WebInspector.persistence.hasUnsavedCommittedChanges(this._uiSourceCode)))
titleText = "*" + titleText;
this._treeElement.title = titleText;

Powered by Google App Engine
This is Rietveld 408576698