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

Unified Diff: third_party/WebKit/Source/devtools/front_end/resources/AppManifestView.js

Issue 2310633002: DevTools: Reduce color parsing by passing in Color to ColorSwatch (Closed)
Patch Set: Get color from model Created 4 years, 3 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: third_party/WebKit/Source/devtools/front_end/resources/AppManifestView.js
diff --git a/third_party/WebKit/Source/devtools/front_end/resources/AppManifestView.js b/third_party/WebKit/Source/devtools/front_end/resources/AppManifestView.js
index c90c911645e8aaab1cf51d90f98d0d5188f91283..faf2c28d47bad68d81d9cd7e23ac88d148fc3c38 100644
--- a/third_party/WebKit/Source/devtools/front_end/resources/AppManifestView.js
+++ b/third_party/WebKit/Source/devtools/front_end/resources/AppManifestView.js
@@ -98,9 +98,11 @@ WebInspector.AppManifestView.prototype = {
this._startURLField.appendChild(WebInspector.linkifyResourceAsNode(/** @type {string} */(WebInspector.ParsedURL.completeURL(url, startURL)), undefined, undefined, undefined, undefined, startURL));
this._themeColorSwatch.classList.toggle("hidden", !stringProperty("theme_color"));
- this._themeColorSwatch.setColorText(stringProperty("theme_color") || "white");
+ var themeColor = WebInspector.Color.parse(stringProperty("theme_color") || "white") || WebInspector.Color.parse("white");
+ this._themeColorSwatch.setColor(/** @type {!WebInspector.Color} */ (themeColor));
this._backgroundColorSwatch.classList.toggle("hidden", !stringProperty("background_color"));
- this._backgroundColorSwatch.setColorText(stringProperty("background_color") || "white");
+ var backgroundColor = WebInspector.Color.parse(stringProperty("background_color") || "white") || WebInspector.Color.parse("white");
+ this._backgroundColorSwatch.setColor(/** @type {!WebInspector.Color} */ (backgroundColor));
this._orientationField.textContent = stringProperty("orientation");
this._displayField.textContent = stringProperty("display");

Powered by Google App Engine
This is Rietveld 408576698