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

Side by Side Diff: extensions/renderer/resources/set_icon.js

Issue 302463005: Add support for AMD to the extensions module system. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 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
« no previous file with comments | « extensions/renderer/resources/send_request.js ('k') | extensions/renderer/resources/utils.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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('set_icon_natives').SetIconCommon;
6 var sendRequest = require('sendRequest').sendRequest; 6 var sendRequest = require('sendRequest').sendRequest;
7 7
8 function loadImagePath(path, iconSize, actionType, callback) { 8 function loadImagePath(path, iconSize, actionType, callback) {
9 var img = new Image(); 9 var img = new Image();
10 img.onerror = function() { 10 img.onerror = function() {
11 console.error('Could not load ' + actionType + ' icon \'' + 11 console.error('Could not load ' + actionType + ' icon \'' +
12 path + '\'.'); 12 path + '\'.');
13 }; 13 };
14 img.onload = function() { 14 img.onload = function() {
15 var canvas = document.createElement('canvas'); 15 var canvas = document.createElement('canvas');
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 throw new Error('The path property should contain either string or ' + 122 throw new Error('The path property should contain either string or ' +
123 'dictionary of strings.'); 123 'dictionary of strings.');
124 } 124 }
125 } else { 125 } else {
126 throw new Error( 126 throw new Error(
127 'Either the path or imageData property must be specified.'); 127 'Either the path or imageData property must be specified.');
128 } 128 }
129 } 129 }
130 130
131 exports.setIcon = setIcon; 131 exports.setIcon = setIcon;
OLDNEW
« no previous file with comments | « extensions/renderer/resources/send_request.js ('k') | extensions/renderer/resources/utils.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698