Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 10 matching lines...) Expand all Loading... | |
| 21 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 21 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
| 22 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 22 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| 23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
| 24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
| 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 */ | 27 */ |
| 28 | 28 |
| 29 /** | 29 /** |
| 30 * @constructor | 30 * @constructor |
| 31 * @extends {WebInspector.VBoxWithToolbarItems} | 31 * @extends {WebInspector.View} |
| 32 * @param {string} mimeType | 32 * @param {string} mimeType |
| 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.View.call(this, WebInspector.UIString("Front")); |
|
dgozman
2016/07/20 01:37:16
typo: Front -> Font
| |
| 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.ToolbarText(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 |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 150 return; | 150 return; |
| 151 } | 151 } |
| 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.View.prototype |
| 161 } | 161 } |
| OLD | NEW |