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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/elements/ComputedStyleWidget.js

Issue 2157713002: DevTools: introduce View: a named widget with the toolbar. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: lcean Created 4 years, 5 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 Apple Inc. All rights reserved. 2 * Copyright (C) 2007 Apple Inc. All rights reserved.
3 * Copyright (C) 2009 Joseph Pecoraro 3 * Copyright (C) 2009 Joseph Pecoraro
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 11 matching lines...) Expand all
22 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */ 28 */
29 29
30 /** 30 /**
31 * @constructor 31 * @constructor
32 * @extends {WebInspector.ThrottledWidget} 32 * @extends {WebInspector.ThrottledView}
33 */ 33 */
34 WebInspector.ComputedStyleWidget = function() 34 WebInspector.ComputedStyleWidget = function()
35 { 35 {
36 WebInspector.ThrottledWidget.call(this); 36 WebInspector.ThrottledView.call(this, WebInspector.UIString("Computed Style" ));
37 this.element.classList.add("computed-style-sidebar-pane"); 37 this.element.classList.add("computed-style-sidebar-pane");
38 38
39 this.registerRequiredCSS("elements/computedStyleSidebarPane.css"); 39 this.registerRequiredCSS("elements/computedStyleSidebarPane.css");
40 this._alwaysShowComputedProperties = { "display": true, "height": true, "wid th": true }; 40 this._alwaysShowComputedProperties = { "display": true, "height": true, "wid th": true };
41 41
42 this._computedStyleModel = new WebInspector.ComputedStyleModel(); 42 this._computedStyleModel = new WebInspector.ComputedStyleModel();
43 this._computedStyleModel.addEventListener(WebInspector.ComputedStyleModel.Ev ents.ComputedStyleChanged, this.update, this); 43 this._computedStyleModel.addEventListener(WebInspector.ComputedStyleModel.Ev ents.ComputedStyleChanged, this.update, this);
44 44
45 this._showInheritedComputedStylePropertiesSetting = WebInspector.settings.cr eateSetting("showInheritedComputedStyleProperties", false); 45 this._showInheritedComputedStylePropertiesSetting = WebInspector.settings.cr eateSetting("showInheritedComputedStyleProperties", false);
46 this._showInheritedComputedStylePropertiesSetting.addChangeListener(this._sh owInheritedComputedStyleChanged.bind(this)); 46 this._showInheritedComputedStylePropertiesSetting.addChangeListener(this._sh owInheritedComputedStyleChanged.bind(this));
(...skipping 21 matching lines...) Expand all
68 function filterCallback(regex) 68 function filterCallback(regex)
69 { 69 {
70 this._filterRegex = regex; 70 this._filterRegex = regex;
71 this._updateFilter(regex); 71 this._updateFilter(regex);
72 } 72 }
73 73
74 var fontsWidget = new WebInspector.PlatformFontsWidget(this._computedStyleMo del); 74 var fontsWidget = new WebInspector.PlatformFontsWidget(this._computedStyleMo del);
75 fontsWidget.show(this.element); 75 fontsWidget.show(this.element);
76 } 76 }
77 77
78 /**
79 * @return {!WebInspector.ElementsSidebarViewWrapperPane}
80 */
81 WebInspector.ComputedStyleWidget.createSidebarWrapper = function()
82 {
83 var widget = new WebInspector.ComputedStyleWidget();
84 return new WebInspector.ElementsSidebarViewWrapperPane(WebInspector.UIString ("Computed Style"), widget)
85 }
86
87 WebInspector.ComputedStyleWidget._propertySymbol = Symbol("property"); 78 WebInspector.ComputedStyleWidget._propertySymbol = Symbol("property");
88 79
89 WebInspector.ComputedStyleWidget.prototype = { 80 WebInspector.ComputedStyleWidget.prototype = {
90 _showInheritedComputedStyleChanged: function() 81 _showInheritedComputedStyleChanged: function()
91 { 82 {
92 this.update(); 83 this.update();
93 }, 84 },
94 85
95 /** 86 /**
96 * @override 87 * @override
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 _updateFilter: function(regex) 348 _updateFilter: function(regex)
358 { 349 {
359 var children = this._propertiesOutline.rootElement().children(); 350 var children = this._propertiesOutline.rootElement().children();
360 for (var child of children) { 351 for (var child of children) {
361 var property = child[WebInspector.ComputedStyleWidget._propertySymbo l]; 352 var property = child[WebInspector.ComputedStyleWidget._propertySymbo l];
362 var matched = !regex || regex.test(property.name) || regex.test(prop erty.value); 353 var matched = !regex || regex.test(property.name) || regex.test(prop erty.value);
363 child.hidden = !matched; 354 child.hidden = !matched;
364 } 355 }
365 }, 356 },
366 357
367 __proto__: WebInspector.ThrottledWidget.prototype 358 __proto__: WebInspector.ThrottledView.prototype
368 } 359 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698