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

Side by Side Diff: Source/devtools/front_end/elements/ElementsPanel.js

Issue 1175253002: DevTools: move filter bar into the style toolbar (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: review comments addressed. Created 5 years, 6 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com> 3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com>
4 * Copyright (C) 2009 Joseph Pecoraro 4 * Copyright (C) 2009 Joseph Pecoraro
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 9 *
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 this._breadcrumbs.show(crumbsContainer); 77 this._breadcrumbs.show(crumbsContainer);
78 this._breadcrumbs.addEventListener(WebInspector.ElementsBreadcrumbs.Events.N odeSelected, this._crumbNodeSelected, this); 78 this._breadcrumbs.addEventListener(WebInspector.ElementsBreadcrumbs.Events.N odeSelected, this._crumbNodeSelected, this);
79 79
80 this.sidebarPanes = {}; 80 this.sidebarPanes = {};
81 /** @type !Array<!WebInspector.ElementsSidebarViewWrapperPane> */ 81 /** @type !Array<!WebInspector.ElementsSidebarViewWrapperPane> */
82 this._elementsSidebarViewWrappers = []; 82 this._elementsSidebarViewWrappers = [];
83 var sharedSidebarModel = new WebInspector.SharedSidebarModel(); 83 var sharedSidebarModel = new WebInspector.SharedSidebarModel();
84 this.sidebarPanes.platformFonts = WebInspector.PlatformFontsWidget.createSid ebarWrapper(sharedSidebarModel); 84 this.sidebarPanes.platformFonts = WebInspector.PlatformFontsWidget.createSid ebarWrapper(sharedSidebarModel);
85 this.sidebarPanes.styles = new WebInspector.StylesSidebarPane(this._showStyl esSidebar.bind(this)); 85 this.sidebarPanes.styles = new WebInspector.StylesSidebarPane(this._showStyl esSidebar.bind(this));
86 86
87 this._computedStylesFilterBoxContainer = createElement("div"); 87 this.sidebarPanes.computedStyle = WebInspector.ComputedStyleWidget.createSid ebarWrapper(this.sidebarPanes.styles, sharedSidebarModel);
88 this._computedStylesFilterBoxContainer.className = "sidebar-pane-filter-box" ;
89 this.sidebarPanes.computedStyle = WebInspector.ComputedStyleWidget.createSid ebarWrapper(this.sidebarPanes.styles, sharedSidebarModel, this._computedStylesFi lterBoxContainer);
90 88
91 this.sidebarPanes.styles.addEventListener(WebInspector.StylesSidebarPane.Eve nts.SelectorEditingStarted, this._onEditingSelectorStarted.bind(this)); 89 this.sidebarPanes.styles.addEventListener(WebInspector.StylesSidebarPane.Eve nts.SelectorEditingStarted, this._onEditingSelectorStarted.bind(this));
92 this.sidebarPanes.styles.addEventListener(WebInspector.StylesSidebarPane.Eve nts.SelectorEditingEnded, this._onEditingSelectorEnded.bind(this)); 90 this.sidebarPanes.styles.addEventListener(WebInspector.StylesSidebarPane.Eve nts.SelectorEditingEnded, this._onEditingSelectorEnded.bind(this));
93 91
94 this._matchedStylesFilterBoxContainer = createElement("div");
95 this._matchedStylesFilterBoxContainer.className = "sidebar-pane-filter-box";
96 this.sidebarPanes.styles.setFilterBoxContainer(this._matchedStylesFilterBoxC ontainer);
97
98
99 this.sidebarPanes.metrics = new WebInspector.MetricsSidebarPane(); 92 this.sidebarPanes.metrics = new WebInspector.MetricsSidebarPane();
100 this.sidebarPanes.properties = WebInspector.PropertiesWidget.createSidebarWr apper(); 93 this.sidebarPanes.properties = WebInspector.PropertiesWidget.createSidebarWr apper();
101 this.sidebarPanes.domBreakpoints = WebInspector.domBreakpointsSidebarPane.cr eateProxy(this); 94 this.sidebarPanes.domBreakpoints = WebInspector.domBreakpointsSidebarPane.cr eateProxy(this);
102 this.sidebarPanes.eventListeners = WebInspector.EventListenersWidget.createS idebarWrapper(); 95 this.sidebarPanes.eventListeners = WebInspector.EventListenersWidget.createS idebarWrapper();
103 96
104 WebInspector.dockController.addEventListener(WebInspector.DockController.Eve nts.DockSideChanged, this._dockSideChanged.bind(this)); 97 WebInspector.dockController.addEventListener(WebInspector.DockController.Eve nts.DockSideChanged, this._dockSideChanged.bind(this));
105 WebInspector.moduleSetting("splitVerticallyWhenDockedToRight").addChangeList ener(this._dockSideChanged.bind(this)); 98 WebInspector.moduleSetting("splitVerticallyWhenDockedToRight").addChangeList ener(this._dockSideChanged.bind(this));
106 this._dockSideChanged(); 99 this._dockSideChanged();
107 this._loadSidebarViews(); 100 this._loadSidebarViews();
108 101
(...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after
890 } 883 }
891 884
892 this._splitWidget.setVertical(!vertically); 885 this._splitWidget.setVertical(!vertically);
893 886
894 var computedPane = new WebInspector.SidebarPane(WebInspector.UIString("C omputed")); 887 var computedPane = new WebInspector.SidebarPane(WebInspector.UIString("C omputed"));
895 computedPane.element.classList.add("composite"); 888 computedPane.element.classList.add("composite");
896 computedPane.element.classList.add("fill"); 889 computedPane.element.classList.add("fill");
897 890
898 computedPane.element.classList.add("metrics-and-computed"); 891 computedPane.element.classList.add("metrics-and-computed");
899 892
900 var matchedStylePanesWrapper = createElement("div"); 893 var matchedStylePanesWrapper = new WebInspector.VBox();
901 matchedStylePanesWrapper.className = "style-panes-wrapper"; 894 matchedStylePanesWrapper.element.classList.add("style-panes-wrapper");
902 var computedStylePanesWrapper = createElement("div"); 895 var computedStylePanesWrapper = new WebInspector.VBox();
903 computedStylePanesWrapper.className = "style-panes-wrapper"; 896 computedStylePanesWrapper.element.classList.add("style-panes-wrapper");
904 897
905 /** 898 /**
906 * @param {boolean} inComputedStyle 899 * @param {boolean} inComputedStyle
907 * @this {WebInspector.ElementsPanel} 900 * @this {WebInspector.ElementsPanel}
908 */ 901 */
909 function showMetrics(inComputedStyle) 902 function showMetrics(inComputedStyle)
910 { 903 {
911 if (inComputedStyle) 904 if (inComputedStyle)
912 this.sidebarPanes.metrics.show(computedStylePanesWrapper, this.s idebarPanes.computedStyle.element); 905 this.sidebarPanes.metrics.show(computedStylePanesWrapper.element , this.sidebarPanes.computedStyle.element);
913 else 906 else
914 this.sidebarPanes.metrics.show(matchedStylePanesWrapper); 907 this.sidebarPanes.metrics.show(matchedStylePanesWrapper.element) ;
915 } 908 }
916 909
917 /** 910 /**
918 * @param {!WebInspector.Event} event 911 * @param {!WebInspector.Event} event
919 * @this {WebInspector.ElementsPanel} 912 * @this {WebInspector.ElementsPanel}
920 */ 913 */
921 function tabSelected(event) 914 function tabSelected(event)
922 { 915 {
923 var tabId = /** @type {string} */ (event.data.tabId); 916 var tabId = /** @type {string} */ (event.data.tabId);
924 if (tabId === computedPane.title()) 917 if (tabId === computedPane.title())
(...skipping 12 matching lines...) Expand all
937 if (vertically) { 930 if (vertically) {
938 this._splitWidget.installResizer(this.sidebarPaneView.headerElement( )); 931 this._splitWidget.installResizer(this.sidebarPaneView.headerElement( ));
939 932
940 var compositePane = new WebInspector.SidebarPane(this.sidebarPanes.s tyles.title()); 933 var compositePane = new WebInspector.SidebarPane(this.sidebarPanes.s tyles.title());
941 compositePane.element.classList.add("composite"); 934 compositePane.element.classList.add("composite");
942 compositePane.element.classList.add("fill"); 935 compositePane.element.classList.add("fill");
943 936
944 var splitWidget = new WebInspector.SplitWidget(true, true, "stylesPa neSplitViewState", 215); 937 var splitWidget = new WebInspector.SplitWidget(true, true, "stylesPa neSplitViewState", 215);
945 splitWidget.show(compositePane.element); 938 splitWidget.show(compositePane.element);
946 939
947 var vbox1 = new WebInspector.VBox(); 940 splitWidget.setMainWidget(matchedStylePanesWrapper);
948 vbox1.element.appendChild(matchedStylePanesWrapper); 941 splitWidget.setSidebarWidget(computedStylePanesWrapper);
949 vbox1.element.appendChild(this._matchedStylesFilterBoxContainer);
950 splitWidget.setMainWidget(vbox1);
951 942
952 var vbox2 = new WebInspector.VBox(); 943 computedPane.show(computedStylePanesWrapper.element);
953 vbox2.element.appendChild(computedStylePanesWrapper);
954 vbox2.element.appendChild(this._computedStylesFilterBoxContainer);
955 splitWidget.setSidebarWidget(vbox2);
956
957 computedPane.show(computedStylePanesWrapper);
958 this.sidebarPaneView.addPane(compositePane); 944 this.sidebarPaneView.addPane(compositePane);
959 } else { 945 } else {
960 var stylesPane = new WebInspector.SidebarPane(this.sidebarPanes.styl es.title()); 946 var stylesPane = new WebInspector.SidebarPane(this.sidebarPanes.styl es.title());
961 stylesPane.element.classList.add("composite"); 947 stylesPane.element.classList.add("composite", "fill", "metrics-and-s tyles");
962 stylesPane.element.classList.add("fill");
963 stylesPane.element.classList.add("metrics-and-styles");
964 948
965 stylesPane.element.appendChild(matchedStylePanesWrapper); 949 matchedStylePanesWrapper.show(stylesPane.element);
966 computedPane.element.appendChild(computedStylePanesWrapper); 950 computedStylePanesWrapper.show(computedPane.element);
967 951
968 this.sidebarPaneView.addEventListener(WebInspector.TabbedPane.EventT ypes.TabSelected, tabSelected, this); 952 this.sidebarPaneView.addEventListener(WebInspector.TabbedPane.EventT ypes.TabSelected, tabSelected, this);
969 953
970 stylesPane.element.appendChild(this._matchedStylesFilterBoxContainer );
971 computedPane.element.appendChild(this._computedStylesFilterBoxContai ner);
972
973 this.sidebarPaneView.addPane(stylesPane); 954 this.sidebarPaneView.addPane(stylesPane);
974 this.sidebarPaneView.addPane(computedPane); 955 this.sidebarPaneView.addPane(computedPane);
975 } 956 }
976 957
977 this.sidebarPanes.styles.show(matchedStylePanesWrapper); 958 this.sidebarPanes.styles.show(matchedStylePanesWrapper.element);
978 this.sidebarPanes.computedStyle.show(computedStylePanesWrapper); 959 this.sidebarPanes.computedStyle.show(computedStylePanesWrapper.element);
979 showMetrics.call(this, vertically); 960 showMetrics.call(this, vertically);
980 this.sidebarPanes.platformFonts.show(computedStylePanesWrapper); 961 this.sidebarPanes.platformFonts.show(computedStylePanesWrapper.element);
981 962
982 this.sidebarPaneView.addPane(this.sidebarPanes.eventListeners); 963 this.sidebarPaneView.addPane(this.sidebarPanes.eventListeners);
983 this.sidebarPaneView.addPane(this.sidebarPanes.domBreakpoints); 964 this.sidebarPaneView.addPane(this.sidebarPanes.domBreakpoints);
984 this.sidebarPaneView.addPane(this.sidebarPanes.properties); 965 this.sidebarPaneView.addPane(this.sidebarPanes.properties);
985 966
986 for (var sidebarViewWrapper of this._elementsSidebarViewWrappers) 967 for (var sidebarViewWrapper of this._elementsSidebarViewWrappers)
987 this.sidebarPaneView.addPane(sidebarViewWrapper); 968 this.sidebarPaneView.addPane(sidebarViewWrapper);
988 969
989 this._extensionSidebarPanesContainer = this.sidebarPaneView; 970 this._extensionSidebarPanesContainer = this.sidebarPaneView;
990 971
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
1138 WebInspector.ElementsPanelFactory.prototype = { 1119 WebInspector.ElementsPanelFactory.prototype = {
1139 /** 1120 /**
1140 * @override 1121 * @override
1141 * @return {!WebInspector.Panel} 1122 * @return {!WebInspector.Panel}
1142 */ 1123 */
1143 createPanel: function() 1124 createPanel: function()
1144 { 1125 {
1145 return WebInspector.ElementsPanel.instance(); 1126 return WebInspector.ElementsPanel.instance();
1146 } 1127 }
1147 } 1128 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/elements/ComputedStyleWidget.js ('k') | Source/devtools/front_end/elements/StylesSidebarPane.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698