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

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

Issue 1809773002: DevTools: split platformFontsWidget.css out of elementsPanel.css (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 4 years, 9 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
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 17 matching lines...) Expand all
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 /** 31 /**
32 * @constructor 32 * @constructor
33 * @extends {WebInspector.ThrottledWidget} 33 * @extends {WebInspector.ThrottledWidget}
34 * @param {!WebInspector.SharedSidebarModel} sharedModel 34 * @param {!WebInspector.SharedSidebarModel} sharedModel
35 */ 35 */
36 WebInspector.PlatformFontsWidget = function(sharedModel) 36 WebInspector.PlatformFontsWidget = function(sharedModel)
37 { 37 {
38 WebInspector.ThrottledWidget.call(this); 38 WebInspector.ThrottledWidget.call(this, true);
39 this.element.classList.add("platform-fonts"); 39 this.registerRequiredCSS("elements/platformFontsWidget.css");
40 40
41 this._sharedModel = sharedModel; 41 this._sharedModel = sharedModel;
42 this._sharedModel.addEventListener(WebInspector.SharedSidebarModel.Events.Co mputedStyleChanged, this.update, this); 42 this._sharedModel.addEventListener(WebInspector.SharedSidebarModel.Events.Co mputedStyleChanged, this.update, this);
43 43
44 this._sectionTitle = createElementWithClass("div", "sidebar-separator"); 44 this._sectionTitle = createElementWithClass("div", "title");
45 this.element.appendChild(this._sectionTitle); 45 this.contentElement.appendChild(this._sectionTitle);
46 this._sectionTitle.textContent = WebInspector.UIString("Rendered Fonts"); 46 this._sectionTitle.textContent = WebInspector.UIString("Rendered Fonts");
47 this._fontStatsSection = this.element.createChild("div", "stats-section"); 47 this._fontStatsSection = this.contentElement.createChild("div", "stats-secti on");
48 } 48 }
49 49
50 /** 50 /**
51 * @param {!WebInspector.SharedSidebarModel} sharedModel 51 * @param {!WebInspector.SharedSidebarModel} sharedModel
52 * @return {!WebInspector.ElementsSidebarViewWrapperPane} 52 * @return {!WebInspector.ElementsSidebarViewWrapperPane}
53 */ 53 */
54 WebInspector.PlatformFontsWidget.createSidebarWrapper = function(sharedModel) 54 WebInspector.PlatformFontsWidget.createSidebarWrapper = function(sharedModel)
55 { 55 {
56 var widget = new WebInspector.PlatformFontsWidget(sharedModel); 56 var widget = new WebInspector.PlatformFontsWidget(sharedModel);
57 return new WebInspector.ElementsSidebarViewWrapperPane(WebInspector.UIString ("Fonts"), widget) 57 return new WebInspector.ElementsSidebarViewWrapperPane(WebInspector.UIString ("Fonts"), widget)
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 fontOrigin.textContent = platformFonts[i].isCustomFont? WebInspector .UIString("Network resource") : WebInspector.UIString("Local file"); 106 fontOrigin.textContent = platformFonts[i].isCustomFont? WebInspector .UIString("Network resource") : WebInspector.UIString("Local file");
107 107
108 var fontUsageElement = fontStatElement.createChild("span", "font-usa ge"); 108 var fontUsageElement = fontStatElement.createChild("span", "font-usa ge");
109 var usage = platformFonts[i].glyphCount; 109 var usage = platformFonts[i].glyphCount;
110 fontUsageElement.textContent = usage === 1 ? WebInspector.UIString(" (%d glyph)", usage) : WebInspector.UIString("(%d glyphs)", usage); 110 fontUsageElement.textContent = usage === 1 ? WebInspector.UIString(" (%d glyph)", usage) : WebInspector.UIString("(%d glyphs)", usage);
111 } 111 }
112 }, 112 },
113 113
114 __proto__: WebInspector.ThrottledWidget.prototype 114 __proto__: WebInspector.ThrottledWidget.prototype
115 } 115 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698