OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 21 matching lines...) Expand all Loading... |
32 * @constructor | 32 * @constructor |
33 * @param {!Element=} parentElement | 33 * @param {!Element=} parentElement |
34 */ | 34 */ |
35 WebInspector.Toolbar = function(parentElement) | 35 WebInspector.Toolbar = function(parentElement) |
36 { | 36 { |
37 /** @type {!Array.<!WebInspector.ToolbarItem>} */ | 37 /** @type {!Array.<!WebInspector.ToolbarItem>} */ |
38 this._items = []; | 38 this._items = []; |
39 this.element = parentElement ? parentElement.createChild("div", "toolbar") :
createElementWithClass("div", "toolbar"); | 39 this.element = parentElement ? parentElement.createChild("div", "toolbar") :
createElementWithClass("div", "toolbar"); |
40 | 40 |
41 this._shadowRoot = this.element.createShadowRoot(); | 41 this._shadowRoot = this.element.createShadowRoot(); |
42 this._shadowRoot.appendChild(WebInspector.View.createStyleElement("ui/toolba
r.css")); | 42 this._shadowRoot.appendChild(WebInspector.Widget.createStyleElement("ui/tool
bar.css")); |
43 this._contentElement = this._shadowRoot.createChild("div", "toolbar-shadow")
; | 43 this._contentElement = this._shadowRoot.createChild("div", "toolbar-shadow")
; |
44 this._contentElement.createChild("content"); | 44 this._contentElement.createChild("content"); |
45 WebInspector.installComponentRootStyles(this._contentElement); | 45 WebInspector.installComponentRootStyles(this._contentElement); |
46 } | 46 } |
47 | 47 |
48 WebInspector.Toolbar.prototype = { | 48 WebInspector.Toolbar.prototype = { |
49 makeNarrow: function() | 49 makeNarrow: function() |
50 { | 50 { |
51 this._contentElement.classList.add("narrow"); | 51 this._contentElement.classList.add("narrow"); |
52 }, | 52 }, |
(...skipping 931 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
984 for (var i = 0; i < items.length; ++i) { | 984 for (var i = 0; i < items.length; ++i) { |
985 var item = items[i]; | 985 var item = items[i]; |
986 if (item) | 986 if (item) |
987 this.appendToolbarItem(item); | 987 this.appendToolbarItem(item); |
988 } | 988 } |
989 } | 989 } |
990 }, | 990 }, |
991 | 991 |
992 __proto__: WebInspector.Toolbar.prototype | 992 __proto__: WebInspector.Toolbar.prototype |
993 } | 993 } |
OLD | NEW |