OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * @fileoverview Tools is a main class that wires all components of the | 6 * @fileoverview Tools is a main class that wires all components of the |
7 * DevTools frontend together. It is also responsible for overriding existing | 7 * DevTools frontend together. It is also responsible for overriding existing |
8 * WebInspector functionality while it is getting upstreamed into WebCore. | 8 * WebInspector functionality while it is getting upstreamed into WebCore. |
9 */ | 9 */ |
10 goog.provide('devtools.Tools'); | 10 goog.provide('devtools.Tools'); |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 var styles = goog.json.parse(stylesStr); | 282 var styles = goog.json.parse(stylesStr); |
283 if (!styles.computedStyle) { | 283 if (!styles.computedStyle) { |
284 return; | 284 return; |
285 } | 285 } |
286 node.setStyles(styles.computedStyle, styles.inlineStyle, | 286 node.setStyles(styles.computedStyle, styles.inlineStyle, |
287 styles.styleAttributes, styles.matchedCSSRules); | 287 styles.styleAttributes, styles.matchedCSSRules); |
288 stylesSidebarPane.update(node, null, forceUpdate); | 288 stylesSidebarPane.update(node, null, forceUpdate); |
289 stylesSidebarPane.needsUpdate = false; | 289 stylesSidebarPane.needsUpdate = false; |
290 node.clearStyles(); | 290 node.clearStyles(); |
291 }; | 291 }; |
292 | |
293 devtools.tools.getDomAgent().getNodeStylesAsync( | 292 devtools.tools.getDomAgent().getNodeStylesAsync( |
294 node, | 293 node, |
295 !Preferences.showUserAgentStyles, | 294 !Preferences.showUserAgentStyles, |
296 callback); | 295 callback); |
297 } else { | 296 } else { |
298 stylesSidebarPane.update(null, null, forceUpdate); | 297 stylesSidebarPane.update(null, null, forceUpdate); |
299 stylesSidebarPane.needsUpdate = false; | 298 stylesSidebarPane.needsUpdate = false; |
300 } | 299 } |
301 }; | 300 }; |
302 | 301 |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
563 /** | 562 /** |
564 * @override | 563 * @override |
565 */ | 564 */ |
566 WebInspector.StylePropertyTreeElement.prototype.toggleEnabled = | 565 WebInspector.StylePropertyTreeElement.prototype.toggleEnabled = |
567 function(event) { | 566 function(event) { |
568 var disabled = !event.target.checked; | 567 var disabled = !event.target.checked; |
569 var self = this; | 568 var self = this; |
570 devtools.tools.getDomAgent().toggleNodeStyleAsync(this.style, !disabled, | 569 devtools.tools.getDomAgent().toggleNodeStyleAsync(this.style, !disabled, |
571 this.name, | 570 this.name, |
572 function() { | 571 function() { |
| 572 WebInspector.panels.elements.sidebarPanes.styles.needsUpdate = true; |
573 WebInspector.panels.elements.updateStyles(true); | 573 WebInspector.panels.elements.updateStyles(true); |
574 }); | 574 }); |
575 }; | 575 }; |
OLD | NEW |