OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /* | 5 /* |
6 * Base class that Ribbon uses to display photos. | 6 * Base class that Ribbon uses to display photos. |
7 */ | 7 */ |
8 | 8 |
9 function RibbonClient() {} | 9 function RibbonClient() {} |
10 | 10 |
(...skipping 1372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1383 | 1383 |
1384 var url; | 1384 var url; |
1385 var transform; | 1385 var transform; |
1386 | 1386 |
1387 var mediaType = FileType.getMediaType(this.url_); | 1387 var mediaType = FileType.getMediaType(this.url_); |
1388 | 1388 |
1389 if (metadata.thumbnailURL) { | 1389 if (metadata.thumbnailURL) { |
1390 url = metadata.thumbnailURL; | 1390 url = metadata.thumbnailURL; |
1391 transform = metadata.thumbnailTransform; | 1391 transform = metadata.thumbnailTransform; |
1392 } else if (mediaType == 'image' && | 1392 } else if (mediaType == 'image' && |
1393 FileType.canUseImageUrlForPreview(metadata)) { | 1393 FileType.canUseImageUrlForPreview(metadata.width, metadata.height, 0)) { |
1394 url = this.url_; | 1394 url = this.url_; |
1395 transform = metadata.imageTransform; | 1395 transform = metadata.imageTransform; |
1396 } else { | 1396 } else { |
1397 url = FileType.getPreviewArt(mediaType); | 1397 url = FileType.getPreviewArt(mediaType); |
1398 } | 1398 } |
1399 | 1399 |
1400 function percent(ratio) { return Math.round(ratio * 100) + '%' } | 1400 function percent(ratio) { return Math.round(ratio * 100) + '%' } |
1401 | 1401 |
1402 function resizeToFill(img, aspect) { | 1402 function resizeToFill(img, aspect) { |
1403 if ((aspect > 1)) { | 1403 if ((aspect > 1)) { |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1485 ShareMode.prototype.setUp = function() { | 1485 ShareMode.prototype.setUp = function() { |
1486 ImageEditor.Mode.prototype.setUp.apply(this, arguments); | 1486 ImageEditor.Mode.prototype.setUp.apply(this, arguments); |
1487 ImageUtil.setAttribute(this.menu_, 'hidden', false); | 1487 ImageUtil.setAttribute(this.menu_, 'hidden', false); |
1488 ImageUtil.setAttribute(this.button_, 'pressed', false); | 1488 ImageUtil.setAttribute(this.button_, 'pressed', false); |
1489 }; | 1489 }; |
1490 | 1490 |
1491 ShareMode.prototype.cleanUpUI = function() { | 1491 ShareMode.prototype.cleanUpUI = function() { |
1492 ImageEditor.Mode.prototype.cleanUpUI.apply(this, arguments); | 1492 ImageEditor.Mode.prototype.cleanUpUI.apply(this, arguments); |
1493 ImageUtil.setAttribute(this.menu_, 'hidden', true); | 1493 ImageUtil.setAttribute(this.menu_, 'hidden', true); |
1494 }; | 1494 }; |
OLD | NEW |