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

Unified Diff: Source/devtools/front_end/Panel.js

Issue 23474010: DevTools: "Jump between editing locations" experiment (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: making reveal() to return boolean value Created 7 years, 4 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: Source/devtools/front_end/Panel.js
diff --git a/Source/devtools/front_end/Panel.js b/Source/devtools/front_end/Panel.js
index 5348b5963e5ff2a8cc0ffaaeca2b05d2e05e9cfb..128cd03e26e5f5ef4775200e4a37ac7f6eef8e99 100644
--- a/Source/devtools/front_end/Panel.js
+++ b/Source/devtools/front_end/Panel.js
@@ -79,6 +79,17 @@ WebInspector.Panel.prototype = {
}
this.focus();
+ var defaultJumpHistoryEntry = this.createPanelJumpHistoryEntry();
+ if (defaultJumpHistoryEntry)
+ WebInspector.jumpHistoryManager.jumpToPosition(null, defaultJumpHistoryEntry);
+ },
+
+ /**
+ * @return {?WebInspector.JumpHistoryEntry}
+ */
+ createPanelJumpHistoryEntry: function()
+ {
+ return new WebInspector.PanelJumpHistoryEntry(this);
},
willHide: function()
@@ -344,3 +355,51 @@ WebInspector.PanelDescriptor.prototype = {
registerShortcuts: function() {}
}
+
+/**
+ * @constructor
+ * @implements {WebInspector.JumpHistoryEntry}
+ * @param {WebInspector.Panel} panel
+ */
+WebInspector.PanelJumpHistoryEntry = function(panel)
+{
+ this._panel = panel;
+}
+
+WebInspector.PanelJumpHistoryEntry.prototype = {
+ /**
+ * @return {boolean}
+ */
+ valid: function()
+ {
+ return true;
+ },
+
+ /**
+ * @param {WebInspector.JumpHistoryEntry} entry
+ */
+ merge: function(entry)
+ {
+ },
+
+ /**
+ * @return {boolean}
+ */
+ reveal: function()
+ {
+ if (this._panel.isShowing())
+ return false;
+ WebInspector.inspectorView.setCurrentPanel(this._panel);
+ return true;
+ },
+
+ /**
+ * @param {WebInspector.JumpHistoryEntry} entry
+ */
+ equal: function(entry)
+ {
+ if (!(entry instanceof WebInspector.PanelJumpHistoryEntry))
+ return false;
+ return this._panel === entry._panel;
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698