| 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 // Set to true when the Document is loaded IFF "test=true" is in the query | 5 // Set to true when the Document is loaded IFF "test=true" is in the query |
| 6 // string. | 6 // string. |
| 7 var isTest = false; | 7 var isTest = false; |
| 8 | 8 |
| 9 // Set to true when loading a "Release" NaCl module, false when loading a | 9 // Set to true when loading a "Release" NaCl module, false when loading a |
| 10 // "Debug" NaCl module. | 10 // "Debug" NaCl module. |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 * @param {string} path Directory name where .nmf file can be found. | 289 * @param {string} path Directory name where .nmf file can be found. |
| 290 * @param {number} width The width to create the plugin. | 290 * @param {number} width The width to create the plugin. |
| 291 * @param {number} height The height to create the plugin. | 291 * @param {number} height The height to create the plugin. |
| 292 * @param {Object} attrs Optional dictionary of additional attributes. | 292 * @param {Object} attrs Optional dictionary of additional attributes. |
| 293 */ | 293 */ |
| 294 function domContentLoaded(name, tool, path, width, height, attrs) { | 294 function domContentLoaded(name, tool, path, width, height, attrs) { |
| 295 // If the page loads before the Native Client module loads, then set the | 295 // If the page loads before the Native Client module loads, then set the |
| 296 // status message indicating that the module is still loading. Otherwise, | 296 // status message indicating that the module is still loading. Otherwise, |
| 297 // do not change the status message. | 297 // do not change the status message. |
| 298 updateStatus('Page loaded.'); | 298 updateStatus('Page loaded.'); |
| 299 isRelease = path.toLowerCase().indexOf('release') != -1; | |
| 300 if (!browserSupportsNaCl(tool)) { | 299 if (!browserSupportsNaCl(tool)) { |
| 301 updateStatus( | 300 updateStatus( |
| 302 'Browser does not support NaCl (' + tool + '), or NaCl is disabled'); | 301 'Browser does not support NaCl (' + tool + '), or NaCl is disabled'); |
| 303 } else if (common.naclModule == null) { | 302 } else if (common.naclModule == null) { |
| 304 updateStatus('Creating embed: ' + tool); | 303 updateStatus('Creating embed: ' + tool); |
| 305 | 304 |
| 306 // We use a non-zero sized embed to give Chrome space to place the bad | 305 // We use a non-zero sized embed to give Chrome space to place the bad |
| 307 // plug-in graphic, if there is a problem. | 306 // plug-in graphic, if there is a problem. |
| 308 width = typeof width !== 'undefined' ? width : 200; | 307 width = typeof width !== 'undefined' ? width : 200; |
| 309 height = typeof height !== 'undefined' ? height : 200; | 308 height = typeof height !== 'undefined' ? height : 200; |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 } | 394 } |
| 396 | 395 |
| 397 var tc = toolchains.indexOf(searchVars.tc) !== -1 ? | 396 var tc = toolchains.indexOf(searchVars.tc) !== -1 ? |
| 398 searchVars.tc : toolchains[0]; | 397 searchVars.tc : toolchains[0]; |
| 399 var config = configs.indexOf(searchVars.config) !== -1 ? | 398 var config = configs.indexOf(searchVars.config) !== -1 ? |
| 400 searchVars.config : configs[0]; | 399 searchVars.config : configs[0]; |
| 401 var pathFormat = body.dataset.path; | 400 var pathFormat = body.dataset.path; |
| 402 var path = pathFormat.replace('{tc}', tc).replace('{config}', config); | 401 var path = pathFormat.replace('{tc}', tc).replace('{config}', config); |
| 403 | 402 |
| 404 isTest = searchVars.test === 'true'; | 403 isTest = searchVars.test === 'true'; |
| 404 isRelease = path.toLowerCase().indexOf('release') != -1; |
| 405 | 405 |
| 406 loadFunction(body.dataset.name, tc, path, body.dataset.width, | 406 loadFunction(body.dataset.name, tc, path, body.dataset.width, |
| 407 body.dataset.height, attrs); | 407 body.dataset.height, attrs); |
| 408 } | 408 } |
| 409 } | 409 } |
| 410 }); | 410 }); |
| OLD | NEW |