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

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

Issue 2388303003: DevTools: hide new navigator interface behind experiment (Closed)
Patch Set: fix test Created 4 years, 2 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
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-navigator.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 c4d2e67a426c1be9e9698b43c975886ef63a4c05..3f4a07dffd2f34ecf1844b9ac6c138593ae72d5b 100644
--- a/third_party/WebKit/Source/devtools/front_end/sources/NavigatorView.js
+++ b/third_party/WebKit/Source/devtools/front_end/sources/NavigatorView.js
@@ -60,8 +60,14 @@ WebInspector.NavigatorView = function()
this._initGrouping();
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.persistence.addEventListener(WebInspector.Persistence.Events.BindingCreated, this._onBindingChanged, this);
- WebInspector.persistence.addEventListener(WebInspector.Persistence.Events.BindingRemoved, this._onBindingChanged, this);
+
+ if (Runtime.experiments.isEnabled("persistence2")) {
+ WebInspector.persistence.addEventListener(WebInspector.Persistence.Events.BindingCreated, this._onBindingChanged, this);
+ WebInspector.persistence.addEventListener(WebInspector.Persistence.Events.BindingRemoved, this._onBindingChanged, this);
+ } else {
+ WebInspector.persistence.addEventListener(WebInspector.Persistence.Events.BindingCreated, this._onBindingCreated, this);
+ WebInspector.persistence.addEventListener(WebInspector.Persistence.Events.BindingRemoved, this._onBindingRemoved, this);
+ }
WebInspector.targetManager.addEventListener(WebInspector.TargetManager.Events.NameChanged, this._targetNameChanged, this);
WebInspector.targetManager.observeTargets(this);
@@ -159,6 +165,24 @@ WebInspector.NavigatorView.prototype = {
/**
* @param {!WebInspector.Event} event
*/
+ _onBindingCreated: function(event)
+ {
+ var binding = /** @type {!WebInspector.PersistenceBinding} */(event.data);
+ this._removeUISourceCode(binding.network);
+ },
+
+ /**
+ * @param {!WebInspector.Event} event
+ */
+ _onBindingRemoved: function(event)
+ {
+ var binding = /** @type {!WebInspector.PersistenceBinding} */(event.data);
+ this._addUISourceCode(binding.network);
+ },
+
+ /**
+ * @param {!WebInspector.Event} event
+ */
_onBindingChanged: function(event)
{
var binding = /** @type {!WebInspector.PersistenceBinding} */(event.data);
@@ -240,6 +264,10 @@ WebInspector.NavigatorView.prototype = {
if (!this.accept(uiSourceCode))
return;
+ var binding = WebInspector.persistence.binding(uiSourceCode);
+ if (!Runtime.experiments.isEnabled("persistence2") && binding && binding.network === uiSourceCode)
+ return;
+
var isFromSourceMap = uiSourceCode.contentType().isFromSourceMap();
var path;
if (uiSourceCode.project().type() === WebInspector.projectTypes.FileSystem)
@@ -1301,7 +1329,7 @@ WebInspector.NavigatorUISourceCodeTreeNode.prototype = {
titleText = "*" + titleText;
var binding = WebInspector.persistence.binding(this._uiSourceCode);
- if (binding) {
+ if (binding && Runtime.experiments.isEnabled("persistence2")) {
var titleElement = createElement("span");
titleElement.textContent = titleText;
var status = titleElement.createChild("span");
@@ -1454,7 +1482,8 @@ WebInspector.NavigatorFolderTreeNode.prototype = {
if (!this._treeElement || this._project.type() !== WebInspector.projectTypes.FileSystem)
return;
var absoluteFileSystemPath = WebInspector.FileSystemWorkspaceBinding.fileSystemPath(this._project.id()) + "/" + this._folderPath;
- this._treeElement.listItemElement.classList.toggle("has-mapped-files", WebInspector.persistence.filePathHasBindings(absoluteFileSystemPath));
+ var hasMappedFiles = Runtime.experiments.isEnabled("persistence2") ? WebInspector.persistence.filePathHasBindings(absoluteFileSystemPath) : true;
+ this._treeElement.listItemElement.classList.toggle("has-mapped-files", hasMappedFiles);
},
/**
@@ -1631,6 +1660,10 @@ WebInspector.NavigatorGroupTreeNode.prototype = {
{
if (!this._treeElement || this._project.type() !== WebInspector.projectTypes.FileSystem)
return;
+ if (!Runtime.experiments.isEnabled("persistence2")) {
+ this._treeElement.listItemElement.classList.add("has-mapped-files");
+ return;
+ }
var fileSystemPath = WebInspector.FileSystemWorkspaceBinding.fileSystemPath(this._project.id());
var wasActive = this._treeElement.listItemElement.classList.contains("has-mapped-files");
var isActive = WebInspector.persistence.filePathHasBindings(fileSystemPath);
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-navigator.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698