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

Unified Diff: chrome/tools/test/reference_build/chrome_linux/resources/inspector/MetricsSidebarPane.js

Issue 177049: On Linux, move the passing of filedescriptors to a dedicated socketpair(). (Closed)
Patch Set: Removed *.d files from reference build Created 11 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/tools/test/reference_build/chrome_linux/resources/inspector/MetricsSidebarPane.js
diff --git a/chrome/tools/test/reference_build/chrome_linux/resources/inspector/MetricsSidebarPane.js b/chrome/tools/test/reference_build/chrome_linux/resources/inspector/MetricsSidebarPane.js
index a22a000f1878bec16a3dc72d369fee651425906d..c13b5787d383700cedf7ec9949f02a4e2af2407a 100644
--- a/chrome/tools/test/reference_build/chrome_linux/resources/inspector/MetricsSidebarPane.js
+++ b/chrome/tools/test/reference_build/chrome_linux/resources/inspector/MetricsSidebarPane.js
@@ -29,6 +29,7 @@
WebInspector.MetricsSidebarPane = function()
{
WebInspector.SidebarPane.call(this, WebInspector.UIString("Metrics"));
+ this._inlineStyleId = null;
}
WebInspector.MetricsSidebarPane.prototype = {
@@ -46,12 +47,28 @@ WebInspector.MetricsSidebarPane.prototype = {
if (!node || !node.ownerDocument.defaultView)
return;
- var style;
- if (node.nodeType === Node.ELEMENT_NODE)
- style = node.ownerDocument.defaultView.getComputedStyle(node);
- if (!style)
+ if (node.nodeType !== Node.ELEMENT_NODE)
return;
+ var self = this;
+ var callback = function(stylePayload) {
+ if (!stylePayload)
+ return;
+ var style = WebInspector.CSSStyleDeclaration.parseStyle(stylePayload);
+ self._update(node, body, style);
+ };
+ InspectorController.getComputedStyle(node.id, callback);
+
+ var inlineStyleCallback = function(stylePayload) {
+ if (!stylePayload)
+ return;
+ self._inlineStyleId = stylePayload.id;
+ };
+ InspectorController.getInlineStyle(node.id, inlineStyleCallback);
+ },
+
+ _update: function(node, body, style)
+ {
var metricsElement = document.createElement("div");
metricsElement.className = "metrics";
@@ -184,11 +201,14 @@ WebInspector.MetricsSidebarPane.prototype = {
if (/^\d+$/.test(userInput))
userInput += "px";
- this.node.style.setProperty(context.styleProperty, userInput, "");
-
- this.dispatchEventToListeners("metrics edited");
-
- this.update();
+ var self = this;
+ var callback = function(success) {
+ if (!success)
+ return;
+ self.dispatchEventToListeners("metrics edited");
+ self.update();
+ };
+ InspectorController.setStyleProperty(this._inlineStyleId, context.styleProperty, userInput, callback);
}
}

Powered by Google App Engine
This is Rietveld 408576698