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

Unified Diff: Source/devtools/front_end/elements/StylesSidebarPane.js

Issue 1304173004: Devtools UI: Add node-specific actions into a ghost toolbar in DOM (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase; remove material breadcrumb from experiment Created 5 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: Source/devtools/front_end/elements/StylesSidebarPane.js
diff --git a/Source/devtools/front_end/elements/StylesSidebarPane.js b/Source/devtools/front_end/elements/StylesSidebarPane.js
index 11bc809f476877aad95dceecc5f10341a89e7f63..9f9c14ee14cdcaabe1a4fd8b6300ecbe009b7a7d 100644
--- a/Source/devtools/front_end/elements/StylesSidebarPane.js
+++ b/Source/devtools/front_end/elements/StylesSidebarPane.js
@@ -45,6 +45,13 @@ WebInspector.StylesSidebarPane = function()
filterContainerElement.appendChild(this._filterInput);
var toolbar = new WebInspector.ExtensibleToolbar("styles-sidebarpane-toolbar", hbox);
+ if (Runtime.experiments.isEnabled("layoutEditor") && !Runtime.queryParam("remoteFrontend")) {
+ this._layoutEditorButton = new WebInspector.ToolbarButton(WebInspector.UIString("Toggle Layout Editor"), "layout-editor-toolbar-item");
+ toolbar.appendToolbarItem(this._layoutEditorButton);
+ this._layoutEditorButton.addEventListener("click", this._toggleLayoutEditor, this);
+ toolbar.appendSeparator();
+ }
+
toolbar.element.classList.add("styles-pane-toolbar", "toolbar-gray-toggled");
this._currentToolbarPane = null;
@@ -136,6 +143,22 @@ WebInspector.StylesSidebarPane.ignoreErrorsForProperty = function(property) {
}
WebInspector.StylesSidebarPane.prototype = {
+ _toggleLayoutEditor: function()
+ {
+ this._showLayoutEditor = !this._showLayoutEditor;
+ this._layoutEditorButton.setToggled(this._showLayoutEditor);
+ var targets = WebInspector.targetManager.targets();
+
+ if (this._showLayoutEditor)
+ WebInspector.inspectElementModeController.disable();
+ else
+ WebInspector.inspectElementModeController.enable();
+
+ var mode = this._showLayoutEditor ? DOMAgent.InspectMode.ShowLayoutEditor : DOMAgent.InspectMode.None;
+ for (var domModel of WebInspector.DOMModel.instances())
+ domModel.setInspectMode(mode);
+ },
+
onUndoOrRedoHappened: function()
{
this.setNode(this.node());
« no previous file with comments | « Source/devtools/front_end/elements/ElementsTreeOutline.js ('k') | Source/devtools/front_end/elements/breadcrumbs.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698