| 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 var SetIconCommon = requireNative('setIcon').SetIconCommon; | 5 var SetIconCommon = requireNative('setIcon').SetIconCommon; |
| 6 var sendRequest = require('sendRequest').sendRequest; | 6 var sendRequest = require('sendRequest').sendRequest; |
| 7 | 7 |
| 8 function loadImagePath(path, iconSize, callback) { | 8 function loadImagePath(path, iconSize, callback) { |
| 9 var img = new Image(); | 9 var img = new Image(); |
| 10 img.onerror = function() { | 10 img.onerror = function() { |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 delete details.path; | 126 delete details.path; |
| 127 callback(SetIconCommon(details)); | 127 callback(SetIconCommon(details)); |
| 128 return; | 128 return; |
| 129 }); | 129 }); |
| 130 } | 130 } |
| 131 return; | 131 return; |
| 132 } | 132 } |
| 133 throw new Error('Either the path or imageData property must be specified.'); | 133 throw new Error('Either the path or imageData property must be specified.'); |
| 134 } | 134 } |
| 135 | 135 |
| 136 exports.setIcon = setIcon; | 136 exports.$set('setIcon', setIcon); |
| OLD | NEW |