Use // for multi-line comments
This commit is contained in:
parent
f4af744519
commit
990dc30e8d
15 changed files with 65 additions and 138 deletions
|
@ -62,11 +62,8 @@ AutoUpdater = (function(superClass) {
|
|||
};
|
||||
|
||||
|
||||
/*
|
||||
Private: Emit both error object and message, this is to keep compatibility
|
||||
with Old APIs.
|
||||
*/
|
||||
|
||||
// Private: Emit both error object and message, this is to keep compatibility
|
||||
// with Old APIs.
|
||||
AutoUpdater.prototype.emitError = function(message) {
|
||||
return this.emit('error', new Error(message), message);
|
||||
};
|
||||
|
|
|
@ -6,24 +6,16 @@ path = require('path');
|
|||
|
||||
spawn = require('child_process').spawn;
|
||||
|
||||
|
||||
// i.e. my-app/app-0.1.13/
|
||||
|
||||
appFolder = path.dirname(process.execPath);
|
||||
|
||||
|
||||
// i.e. my-app/Update.exe
|
||||
|
||||
updateExe = path.resolve(appFolder, '..', 'Update.exe');
|
||||
|
||||
exeName = path.basename(process.execPath);
|
||||
|
||||
|
||||
/*
|
||||
Spawn a command and invoke the callback when it completes with an error
|
||||
and the output from standard out.
|
||||
*/
|
||||
|
||||
// Spawn a command and invoke the callback when it completes with an error
|
||||
// and the output from standard out.
|
||||
spawnUpdate = function(args, detached, callback) {
|
||||
var error, error1, errorEmitted, spawnedProcess, stderr, stdout;
|
||||
try {
|
||||
|
|
|
@ -33,10 +33,8 @@ BrowserWindow.prototype._init = function() {
|
|||
return ipcMain.emit('ATOM_SHELL_GUEST_WINDOW_MANAGER_WINDOW_OPEN', event, url, frameName, options);
|
||||
});
|
||||
|
||||
/*
|
||||
window.resizeTo(...)
|
||||
window.moveTo(...)
|
||||
*/
|
||||
// window.resizeTo(...)
|
||||
// window.moveTo(...)
|
||||
this.webContents.on('move', (function(_this) {
|
||||
return function(event, size) {
|
||||
return _this.setBounds(size);
|
||||
|
@ -69,14 +67,12 @@ BrowserWindow.prototype._init = function() {
|
|||
};
|
||||
})(this));
|
||||
|
||||
/*
|
||||
Sometimes the webContents doesn't get focus when window is shown, so we have
|
||||
to force focusing on webContents in this case. The safest way is to focus it
|
||||
when we first start to load URL, if we do it earlier it won't have effect,
|
||||
if we do it later we might move focus in the page.
|
||||
Though this hack is only needed on OS X when the app is launched from
|
||||
Finder, we still do it on all platforms in case of other bugs we don't know.
|
||||
*/
|
||||
// Sometimes the webContents doesn't get focus when window is shown, so we have
|
||||
// to force focusing on webContents in this case. The safest way is to focus it
|
||||
// when we first start to load URL, if we do it earlier it won't have effect,
|
||||
// if we do it later we might move focus in the page.
|
||||
// Though this hack is only needed on OS X when the app is launched from
|
||||
// Finder, we still do it on all platforms in case of other bugs we don't know.
|
||||
this.webContents.once('load-url', function() {
|
||||
return this.focus();
|
||||
});
|
||||
|
|
|
@ -18,15 +18,11 @@ ipcMain.on('ATOM_SHELL_SYNC_NAVIGATION_CONTROLLER', function() {
|
|||
return event.returnValue = (ref = event.sender)[method].apply(ref, args);
|
||||
});
|
||||
|
||||
|
||||
/*
|
||||
JavaScript implementation of Chromium's NavigationController.
|
||||
Instead of relying on Chromium for history control, we compeletely do history
|
||||
control on user land, and only rely on WebContents.loadURL for navigation.
|
||||
This helps us avoid Chromium's various optimizations so we can ensure renderer
|
||||
process is restarted everytime.
|
||||
*/
|
||||
|
||||
// JavaScript implementation of Chromium's NavigationController.
|
||||
// Instead of relying on Chromium for history control, we compeletely do history
|
||||
// control on user land, and only rely on WebContents.loadURL for navigation.
|
||||
// This helps us avoid Chromium's various optimizations so we can ensure renderer
|
||||
// process is restarted everytime.
|
||||
NavigationController = (function() {
|
||||
function NavigationController(webContents) {
|
||||
this.webContents = webContents;
|
||||
|
|
|
@ -138,10 +138,8 @@ wrapWebContents = function(webContents) {
|
|||
var args;
|
||||
args = 1 <= arguments.length ? slice.call(arguments, 0) : [];
|
||||
|
||||
/*
|
||||
Calling loadURL during this event might cause crash, so delay the event
|
||||
until next tick.
|
||||
*/
|
||||
// Calling loadURL during this event might cause crash, so delay the event
|
||||
// until next tick.
|
||||
return setImmediate((function(_this) {
|
||||
return function() {
|
||||
return _this.emit.apply(_this, ['did-fail-load'].concat(slice.call(args)));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue