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

Side by Side Diff: Source/devtools/front_end/MetricsSidebarPane.js

Issue 84643002: Update the metrics side bar pane and computed style pane after main frame resize. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years 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 * 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 20 matching lines...) Expand all
31 * @extends {WebInspector.SidebarPane} 31 * @extends {WebInspector.SidebarPane}
32 */ 32 */
33 WebInspector.MetricsSidebarPane = function() 33 WebInspector.MetricsSidebarPane = function()
34 { 34 {
35 WebInspector.SidebarPane.call(this, WebInspector.UIString("Metrics")); 35 WebInspector.SidebarPane.call(this, WebInspector.UIString("Metrics"));
36 36
37 WebInspector.cssModel.addEventListener(WebInspector.CSSStyleModel.Events.Sty leSheetChanged, this._styleSheetOrMediaQueryResultChanged, this); 37 WebInspector.cssModel.addEventListener(WebInspector.CSSStyleModel.Events.Sty leSheetChanged, this._styleSheetOrMediaQueryResultChanged, this);
38 WebInspector.cssModel.addEventListener(WebInspector.CSSStyleModel.Events.Med iaQueryResultChanged, this._styleSheetOrMediaQueryResultChanged, this); 38 WebInspector.cssModel.addEventListener(WebInspector.CSSStyleModel.Events.Med iaQueryResultChanged, this._styleSheetOrMediaQueryResultChanged, this);
39 WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.AttrModi fied, this._attributesUpdated, this); 39 WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.AttrModi fied, this._attributesUpdated, this);
40 WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.AttrRemo ved, this._attributesUpdated, this); 40 WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.AttrRemo ved, this._attributesUpdated, this);
41 WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeMod el.EventTypes.FrameResized, this._frameResized, this);
41 } 42 }
42 43
43 WebInspector.MetricsSidebarPane.prototype = { 44 WebInspector.MetricsSidebarPane.prototype = {
44 /** 45 /**
45 * @param {WebInspector.DOMNode=} node 46 * @param {WebInspector.DOMNode=} node
46 */ 47 */
47 update: function(node) 48 update: function(node)
48 { 49 {
49 if (node) 50 if (node)
50 this.node = node; 51 this.node = node;
(...skipping 30 matching lines...) Expand all
81 this.inlineStyle = style; 82 this.inlineStyle = style;
82 } 83 }
83 WebInspector.cssModel.getInlineStylesAsync(node.id, inlineStyleCallback. bind(this)); 84 WebInspector.cssModel.getInlineStylesAsync(node.id, inlineStyleCallback. bind(this));
84 }, 85 },
85 86
86 _styleSheetOrMediaQueryResultChanged: function() 87 _styleSheetOrMediaQueryResultChanged: function()
87 { 88 {
88 this._innerUpdate(); 89 this._innerUpdate();
89 }, 90 },
90 91
92 _frameResized: function()
93 {
94 this._innerUpdate();
pfeldman 2013/11/26 16:26:02 We probably want to throttle this.
95 },
96
91 _attributesUpdated: function(event) 97 _attributesUpdated: function(event)
92 { 98 {
93 if (this.node !== event.data.node) 99 if (this.node !== event.data.node)
94 return; 100 return;
95 101
96 this._innerUpdate(); 102 this._innerUpdate();
97 }, 103 },
98 104
99 _getPropertyValueAsPx: function(style, propertyName) 105 _getPropertyValueAsPx: function(style, propertyName)
100 { 106 {
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 }, 423 },
418 424
419 editingCommitted: function(element, userInput, previousContent, context) 425 editingCommitted: function(element, userInput, previousContent, context)
420 { 426 {
421 this.editingEnded(element, context); 427 this.editingEnded(element, context);
422 this._applyUserInput(element, userInput, previousContent, context, true) ; 428 this._applyUserInput(element, userInput, previousContent, context, true) ;
423 }, 429 },
424 430
425 __proto__: WebInspector.SidebarPane.prototype 431 __proto__: WebInspector.SidebarPane.prototype
426 } 432 }
OLDNEW
« no previous file with comments | « Source/core/inspector/InspectorPageAgent.cpp ('k') | Source/devtools/front_end/ResourceTreeModel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698