Repository: atom/atom
File: src/main-process/atom-application.js (JavaScript)

Code before:
          if (unloaded) {
            window.close()
            await window.closedPromise
          }
          return unloaded
        })
        const windowUnloadedResults = await Promise.all(windowUnloadPromises)
        if (windowUnloadedResults.every(Boolean)) {
          app.quit()
        } else {
          this.quitting = false
        }
      }

      resolveBeforeQuitPromise()
    }))

    this.disposable.add(ipcHelpers.on(app, 'will-quit', () => {
      this.killAllProcesses()
      this.deleteSocketFile()
      this.deleteSocketSecretFile()
    }))

    // Triggered by the 'open-file' event from Electron:
    // https://electronjs.org/docs/api/app#event-open-file-macos
    // For example, this is fired when a file is dragged and dropped onto the dock.
    this.disposable.add(ipcHelpers.on(app, 'open-file', (event, pathToOpen) => {
      event.preventDefault()
      this.openPath({pathToOpen})
    }))

    this.disposable.add(ipcHelpers.on(app, 'open-url', (event, urlToOpen) => {
      event.preventDefault()
      this.openUrl({urlToOpen, devMode: this.devMode, safeMode: this.safeMode})
    }))

    this.disposable.add(ipcHelpers.on(app, 'activate', (event, hasVisibleWindows) => {
      if (hasVisibleWindows) return
      if (event) event.preventDefault()
      this.emit('application:new-window')
    }))

    this.disposable.add(ipcHelpers.on(ipcMain, 'restart-application', () => {
      this.restart()
    }))

    this.disposable.add(ipcHelpers.on(ipcMain, 'resolve-proxy', (event, requestId, url) => {
      event.sender.session.resolveProxy(url, proxy => {
        if (!event.sender.isDestroyed()) event.sender.send('did-resolve-proxy', requestId, proxy)
      })
    }))

Review comment (suggestion):
Would the following change be an accurate clarification?

```suggestion
    // For example, this is fired when a file is dragged and dropped onto the Atom application icon in the dock.
```

Code after:
          if (unloaded) {
            window.close()
            await window.closedPromise
          }
          return unloaded
        })
        const windowUnloadedResults = await Promise.all(windowUnloadPromises)
        if (windowUnloadedResults.every(Boolean)) {
          app.quit()
        } else {
          this.quitting = false
        }
      }

      resolveBeforeQuitPromise()
    }))

    this.disposable.add(ipcHelpers.on(app, 'will-quit', () => {
      this.killAllProcesses()
      this.deleteSocketFile()
      this.deleteSocketSecretFile()
    }))

    // Triggered by the 'open-file' event from Electron:
    // https://electronjs.org/docs/api/app#event-open-file-macos
    // For example, this is fired when a file is dragged and dropped onto the Atom application icon in the dock.
    this.disposable.add(ipcHelpers.on(app, 'open-file', (event, pathToOpen) => {
      event.preventDefault()
      this.openPath({pathToOpen})
    }))

    this.disposable.add(ipcHelpers.on(app, 'open-url', (event, urlToOpen) => {
      event.preventDefault()
      this.openUrl({urlToOpen, devMode: this.devMode, safeMode: this.safeMode})
    }))

    this.disposable.add(ipcHelpers.on(app, 'activate', (event, hasVisibleWindows) => {
      if (hasVisibleWindows) return
      if (event) event.preventDefault()
      this.emit('application:new-window')
    }))

    this.disposable.add(ipcHelpers.on(ipcMain, 'restart-application', () => {
      this.restart()
    }))

    this.disposable.add(ipcHelpers.on(ipcMain, 'resolve-proxy', (event, requestId, url) => {
      event.sender.session.resolveProxy(url, proxy => {
        if (!event.sender.isDestroyed()) event.sender.send('did-resolve-proxy', requestId, proxy)
      })
    }))