| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 // This function takes an object |imageSpec| with the key |path| - | 5 // This function takes an object |imageSpec| with the key |path| - |
| 6 // corresponding to the internet URL to be translated - and optionally | 6 // corresponding to the internet URL to be translated - and optionally |
| 7 // |width| and |height| which are the maximum dimensions to be used when | 7 // |width| and |height| which are the maximum dimensions to be used when |
| 8 // converting the image. | 8 // converting the image. |
| 9 function loadImageData(imageSpec, callbacks) { | 9 function loadImageData(imageSpec, callbacks) { |
| 10 var path = imageSpec.path; | 10 var path = imageSpec.path; |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 | 71 |
| 72 for (var index = 0; index < imageSpecs.length; index++) { | 72 for (var index = 0; index < imageSpecs.length; index++) { |
| 73 loading[index] = imageSpecs[index]; | 73 loading[index] = imageSpecs[index]; |
| 74 loadImageData(imageSpecs[index], { | 74 loadImageData(imageSpecs[index], { |
| 75 oncomplete: on_complete_index(index, false, loading, finished, callbacks), | 75 oncomplete: on_complete_index(index, false, loading, finished, callbacks), |
| 76 onerror: on_complete_index(index, true, loading, finished, callbacks) | 76 onerror: on_complete_index(index, true, loading, finished, callbacks) |
| 77 }); | 77 }); |
| 78 } | 78 } |
| 79 } | 79 } |
| 80 | 80 |
| 81 exports.loadImageData = loadImageData; | 81 exports.$set('loadImageData', loadImageData); |
| 82 exports.loadAllImages = loadAllImages; | 82 exports.$set('loadAllImages', loadAllImages); |
| OLD | NEW |