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

Side by Side Diff: Source/devtools/front_end/elements/PlatformFontsWidget.js

Issue 1210893002: DevTools: [CSS] introduce strong types (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 if (!node || !cssModel) { 70 if (!node || !cssModel) {
71 finishedCallback(); 71 finishedCallback();
72 return; 72 return;
73 } 73 }
74 cssModel.getPlatformFontsForNode(node.id, this._refreshUI.bind(this, nod e, finishedCallback)); 74 cssModel.getPlatformFontsForNode(node.id, this._refreshUI.bind(this, nod e, finishedCallback));
75 }, 75 },
76 76
77 /** 77 /**
78 * @param {!WebInspector.DOMNode} node 78 * @param {!WebInspector.DOMNode} node
79 * @param {!WebInspector.Throttler.FinishCallback} finishedCallback 79 * @param {!WebInspector.Throttler.FinishCallback} finishedCallback
80 * @param {?string} cssFamilyName
81 * @param {?Array.<!CSSAgent.PlatformFontUsage>} platformFonts 80 * @param {?Array.<!CSSAgent.PlatformFontUsage>} platformFonts
82 */ 81 */
83 _refreshUI: function(node, finishedCallback, cssFamilyName, platformFonts) 82 _refreshUI: function(node, finishedCallback, platformFonts)
84 { 83 {
85 if (this._sharedModel.node() !== node) { 84 if (this._sharedModel.node() !== node) {
86 finishedCallback(); 85 finishedCallback();
87 return; 86 return;
88 } 87 }
89 88
90 this._fontStatsSection.removeChildren(); 89 this._fontStatsSection.removeChildren();
91 90
92 var isEmptySection = !platformFonts || !platformFonts.length; 91 var isEmptySection = !platformFonts || !platformFonts.length;
93 this._sectionTitle.classList.toggle("hidden", isEmptySection); 92 this._sectionTitle.classList.toggle("hidden", isEmptySection);
(...skipping 15 matching lines...) Expand all
109 108
110 var fontUsageElement = fontStatElement.createChild("span", "font-usa ge"); 109 var fontUsageElement = fontStatElement.createChild("span", "font-usa ge");
111 var usage = platformFonts[i].glyphCount; 110 var usage = platformFonts[i].glyphCount;
112 fontUsageElement.textContent = usage === 1 ? WebInspector.UIString(" %d glyph", usage) : WebInspector.UIString("%d glyphs", usage); 111 fontUsageElement.textContent = usage === 1 ? WebInspector.UIString(" %d glyph", usage) : WebInspector.UIString("%d glyphs", usage);
113 } 112 }
114 finishedCallback(); 113 finishedCallback();
115 }, 114 },
116 115
117 __proto__: WebInspector.ThrottledWidget.prototype 116 __proto__: WebInspector.ThrottledWidget.prototype
118 } 117 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/elements/MetricsSidebarPane.js ('k') | Source/devtools/front_end/elements/StylesSidebarPane.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698