   #              should be in dev mode or not.
   #   :safeMode - A Boolean which controls whether any newly opened windows
   #               should be in safe mode or not.
-  promptForPath: ({type, devMode, safeMode}={}) ->
+  #   :window - An {AtomWindow} to use for opening a selected file path.
+  promptForPath: ({type, devMode, safeMode, window}={}) ->
     type ?= 'all'
     properties =
       switch type

  #   :devMode - Boolean to control the opened window's dev mode.
  #   :safeMode - Boolean to control the opened window's safe mode.
  #   :windowDimensions - Object with height and width keys.
  openPath: ({pathToOpen, pidToKillWhenClosed, newWindow, devMode, safeMode, windowDimensions}={}) ->
    {pathToOpen, initialLine, initialColumn} = @locationForPathToOpen(pathToOpen)

    # Open files in the focused window
    unless pidToKillWhenClosed or newWindow
      if fs.statSyncNoException(pathToOpen).isFile?()
        existingWindow = @topWindow

      existingWindow ?= @windowForPath(pathToOpen) unless devMode



    # A request from the associated render process to open a new render process.
    ipc.on 'open', (event, options) =>
      window = @windowForEvent(event)
      if options?
        if options.pathsToOpen?.length > 0
          options.window = window
          @openPaths(options)
        else
          new AtomWindow(options)
      else
        @promptForPath({window})

    ipc.on 'update-application-menu', (event, template, keystrokesByCommand) =>
      @applicationMenu.update(template, keystrokesByCommand)
