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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/source_frame/FontView.js

Issue 1574213006: DevTools: beautified styles sidebar toolbar. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments addressed. Created 4 years, 11 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) 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008 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 22 matching lines...) Expand all
33 * @param {!WebInspector.ContentProvider} contentProvider 33 * @param {!WebInspector.ContentProvider} contentProvider
34 */ 34 */
35 WebInspector.FontView = function(mimeType, contentProvider) 35 WebInspector.FontView = function(mimeType, contentProvider)
36 { 36 {
37 WebInspector.VBoxWithToolbarItems.call(this); 37 WebInspector.VBoxWithToolbarItems.call(this);
38 this.registerRequiredCSS("source_frame/fontView.css"); 38 this.registerRequiredCSS("source_frame/fontView.css");
39 this.element.classList.add("font-view"); 39 this.element.classList.add("font-view");
40 this._url = contentProvider.contentURL(); 40 this._url = contentProvider.contentURL();
41 this._mimeType = mimeType; 41 this._mimeType = mimeType;
42 this._contentProvider = contentProvider; 42 this._contentProvider = contentProvider;
43 this._mimeTypeLabel = new WebInspector.ToolbarLabel(mimeType); 43 this._mimeTypeLabel = new WebInspector.ToolbarText(mimeType);
44 } 44 }
45 45
46 WebInspector.FontView._fontPreviewLines = [ "ABCDEFGHIJKLM", "NOPQRSTUVWXYZ", "a bcdefghijklm", "nopqrstuvwxyz", "1234567890" ]; 46 WebInspector.FontView._fontPreviewLines = [ "ABCDEFGHIJKLM", "NOPQRSTUVWXYZ", "a bcdefghijklm", "nopqrstuvwxyz", "1234567890" ];
47 47
48 WebInspector.FontView._fontId = 0; 48 WebInspector.FontView._fontId = 0;
49 49
50 WebInspector.FontView._measureFontSize = 50; 50 WebInspector.FontView._measureFontSize = 50;
51 51
52 WebInspector.FontView.prototype = { 52 WebInspector.FontView.prototype = {
53 /** 53 /**
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 152
153 var widthRatio = containerWidth / width; 153 var widthRatio = containerWidth / width;
154 var heightRatio = containerHeight / height; 154 var heightRatio = containerHeight / height;
155 var finalFontSize = Math.floor(WebInspector.FontView._measureFontSize * Math.min(widthRatio, heightRatio)) - 2; 155 var finalFontSize = Math.floor(WebInspector.FontView._measureFontSize * Math.min(widthRatio, heightRatio)) - 2;
156 156
157 this.fontPreviewElement.style.setProperty("font-size", finalFontSize + " px", null); 157 this.fontPreviewElement.style.setProperty("font-size", finalFontSize + " px", null);
158 }, 158 },
159 159
160 __proto__: WebInspector.VBoxWithToolbarItems.prototype 160 __proto__: WebInspector.VBoxWithToolbarItems.prototype
161 } 161 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698