chore: rename atomBinding to electronBinding (#17419)
This commit is contained in:
parent
5025c991ee
commit
38d75010c7
81 changed files with 167 additions and 164 deletions
|
@ -3,8 +3,8 @@ import * as path from 'path'
|
|||
import * as electron from 'electron'
|
||||
import { EventEmitter } from 'events'
|
||||
|
||||
const bindings = process.atomBinding('app')
|
||||
const commandLine = process.atomBinding('command_line')
|
||||
const bindings = process.electronBinding('app')
|
||||
const commandLine = process.electronBinding('command_line')
|
||||
const { app, App } = bindings
|
||||
|
||||
// Only one app object permitted.
|
||||
|
@ -64,5 +64,5 @@ for (const name of events) {
|
|||
}
|
||||
|
||||
// Wrappers for native classes.
|
||||
const { DownloadItem } = process.atomBinding('download_item')
|
||||
const { DownloadItem } = process.electronBinding('download_item')
|
||||
Object.setPrototypeOf(DownloadItem.prototype, EventEmitter.prototype)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
'use strict'
|
||||
|
||||
const EventEmitter = require('events').EventEmitter
|
||||
const { autoUpdater, AutoUpdater } = process.atomBinding('auto_updater')
|
||||
const { autoUpdater, AutoUpdater } = process.electronBinding('auto_updater')
|
||||
|
||||
// AutoUpdater is an EventEmitter.
|
||||
Object.setPrototypeOf(AutoUpdater.prototype, EventEmitter.prototype)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
'use strict'
|
||||
|
||||
const { EventEmitter } = require('events')
|
||||
const { BrowserView } = process.atomBinding('browser_view')
|
||||
const { BrowserView } = process.electronBinding('browser_view')
|
||||
|
||||
Object.setPrototypeOf(BrowserView.prototype, EventEmitter.prototype)
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
const electron = require('electron')
|
||||
const { WebContentsView, TopLevelWindow } = electron
|
||||
const { BrowserWindow } = process.atomBinding('window')
|
||||
const { BrowserWindow } = process.electronBinding('window')
|
||||
|
||||
Object.setPrototypeOf(BrowserWindow.prototype, TopLevelWindow.prototype)
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
'use strict'
|
||||
const { deprecate } = require('electron')
|
||||
const contentTracing = process.atomBinding('content_tracing')
|
||||
const contentTracing = process.electronBinding('content_tracing')
|
||||
|
||||
contentTracing.getCategories = deprecate.promisify(contentTracing.getCategories)
|
||||
contentTracing.startRecording = deprecate.promisify(contentTracing.startRecording)
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
'use strict'
|
||||
|
||||
const { app, BrowserWindow, deprecate } = require('electron')
|
||||
const binding = process.atomBinding('dialog')
|
||||
const v8Util = process.atomBinding('v8_util')
|
||||
const binding = process.electronBinding('dialog')
|
||||
const v8Util = process.electronBinding('v8_util')
|
||||
|
||||
const fileDialogProperties = {
|
||||
openFile: 1 << 0,
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
'use strict'
|
||||
|
||||
module.exports = process.atomBinding('global_shortcut').globalShortcut
|
||||
module.exports = process.electronBinding('global_shortcut').globalShortcut
|
||||
|
|
|
@ -4,7 +4,7 @@ const { deprecate } = require('electron')
|
|||
|
||||
if (process.platform === 'darwin') {
|
||||
const { EventEmitter } = require('events')
|
||||
const { inAppPurchase, InAppPurchase } = process.atomBinding('in_app_purchase')
|
||||
const { inAppPurchase, InAppPurchase } = process.electronBinding('in_app_purchase')
|
||||
|
||||
// inAppPurchase is an EventEmitter.
|
||||
Object.setPrototypeOf(InAppPurchase.prototype, EventEmitter.prototype)
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
const { TopLevelWindow, MenuItem, webContents } = require('electron')
|
||||
const { sortMenuItems } = require('@electron/internal/browser/api/menu-utils')
|
||||
const EventEmitter = require('events').EventEmitter
|
||||
const v8Util = process.atomBinding('v8_util')
|
||||
const bindings = process.atomBinding('menu')
|
||||
const v8Util = process.electronBinding('v8_util')
|
||||
const bindings = process.electronBinding('menu')
|
||||
|
||||
const { Menu } = bindings
|
||||
let applicationMenu = null
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
'use strict'
|
||||
|
||||
const features = process.atomBinding('features')
|
||||
const features = process.electronBinding('features')
|
||||
|
||||
// Browser side modules, please sort alphabetically.
|
||||
module.exports = [
|
||||
|
|
|
@ -4,8 +4,8 @@ const url = require('url')
|
|||
const { EventEmitter } = require('events')
|
||||
const { Readable } = require('stream')
|
||||
const { app } = require('electron')
|
||||
const { Session } = process.atomBinding('session')
|
||||
const { net, Net } = process.atomBinding('net')
|
||||
const { Session } = process.electronBinding('session')
|
||||
const { net, Net } = process.electronBinding('net')
|
||||
const { URLRequest } = net
|
||||
|
||||
// Net is an EventEmitter.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
'use strict'
|
||||
|
||||
const { EventEmitter } = require('events')
|
||||
const { Notification, isSupported } = process.atomBinding('notification')
|
||||
const { Notification, isSupported } = process.electronBinding('notification')
|
||||
|
||||
Object.setPrototypeOf(Notification.prototype, EventEmitter.prototype)
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
'use strict'
|
||||
|
||||
const { EventEmitter } = require('events')
|
||||
const { powerMonitor, PowerMonitor } = process.atomBinding('power_monitor')
|
||||
const { powerMonitor, PowerMonitor } = process.electronBinding('power_monitor')
|
||||
const { deprecate } = require('electron')
|
||||
|
||||
// PowerMonitor is an EventEmitter.
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
'use strict'
|
||||
|
||||
module.exports = process.atomBinding('power_save_blocker').powerSaveBlocker
|
||||
module.exports = process.electronBinding('power_save_blocker').powerSaveBlocker
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { app, session } from 'electron'
|
||||
|
||||
// Global protocol APIs.
|
||||
const protocol = process.atomBinding('protocol')
|
||||
const protocol = process.electronBinding('protocol')
|
||||
|
||||
// Fallback protocol APIs of default session.
|
||||
Object.setPrototypeOf(protocol, new Proxy({}, {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
'use strict'
|
||||
|
||||
const { EventEmitter } = require('events')
|
||||
const { screen, Screen } = process.atomBinding('screen')
|
||||
const { screen, Screen } = process.electronBinding('screen')
|
||||
|
||||
// Screen is an EventEmitter.
|
||||
Object.setPrototypeOf(Screen.prototype, EventEmitter.prototype)
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
const { EventEmitter } = require('events')
|
||||
const { app, deprecate } = require('electron')
|
||||
const { fromPartition, Session, Cookies, NetLog, Protocol } = process.atomBinding('session')
|
||||
const { fromPartition, Session, Cookies, NetLog, Protocol } = process.electronBinding('session')
|
||||
|
||||
// Public API.
|
||||
Object.defineProperties(exports, {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
'use strict'
|
||||
|
||||
const { EventEmitter } = require('events')
|
||||
const { systemPreferences, SystemPreferences } = process.atomBinding('system_preferences')
|
||||
const { systemPreferences, SystemPreferences } = process.electronBinding('system_preferences')
|
||||
|
||||
// SystemPreferences is an EventEmitter.
|
||||
Object.setPrototypeOf(SystemPreferences.prototype, EventEmitter.prototype)
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
const electron = require('electron')
|
||||
const { EventEmitter } = require('events')
|
||||
const { TopLevelWindow } = process.atomBinding('top_level_window')
|
||||
const { TopLevelWindow } = process.electronBinding('top_level_window')
|
||||
|
||||
Object.setPrototypeOf(TopLevelWindow.prototype, EventEmitter.prototype)
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
'use strict'
|
||||
|
||||
const { EventEmitter } = require('events')
|
||||
const { Tray } = process.atomBinding('tray')
|
||||
const { Tray } = process.electronBinding('tray')
|
||||
|
||||
Object.setPrototypeOf(Tray.prototype, EventEmitter.prototype)
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
'use strict'
|
||||
|
||||
const { EventEmitter } = require('events')
|
||||
const { View } = process.atomBinding('view')
|
||||
const { View } = process.electronBinding('view')
|
||||
|
||||
Object.setPrototypeOf(View.prototype, EventEmitter.prototype)
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
const electron = require('electron')
|
||||
|
||||
const { LayoutManager } = electron
|
||||
const { BoxLayout } = process.atomBinding('box_layout')
|
||||
const { BoxLayout } = process.electronBinding('box_layout')
|
||||
|
||||
Object.setPrototypeOf(BoxLayout.prototype, LayoutManager.prototype)
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
const electron = require('electron')
|
||||
|
||||
const { View } = electron
|
||||
const { Button } = process.atomBinding('button')
|
||||
const { Button } = process.electronBinding('button')
|
||||
|
||||
Object.setPrototypeOf(Button.prototype, View.prototype)
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
const electron = require('electron')
|
||||
|
||||
const { Button } = electron
|
||||
const { LabelButton } = process.atomBinding('label_button')
|
||||
const { LabelButton } = process.electronBinding('label_button')
|
||||
|
||||
Object.setPrototypeOf(LabelButton.prototype, Button.prototype)
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
'use strict'
|
||||
|
||||
const { LayoutManager } = process.atomBinding('layout_manager')
|
||||
const { LayoutManager } = process.electronBinding('layout_manager')
|
||||
|
||||
LayoutManager.prototype._init = function () {
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
const electron = require('electron')
|
||||
|
||||
const { LabelButton } = electron
|
||||
const { MdTextButton } = process.atomBinding('md_text_button')
|
||||
const { MdTextButton } = process.electronBinding('md_text_button')
|
||||
|
||||
Object.setPrototypeOf(MdTextButton.prototype, LabelButton.prototype)
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
const electron = require('electron')
|
||||
|
||||
const { View } = electron
|
||||
const { ResizeArea } = process.atomBinding('resize_area')
|
||||
const { ResizeArea } = process.electronBinding('resize_area')
|
||||
|
||||
Object.setPrototypeOf(ResizeArea.prototype, View.prototype)
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
const electron = require('electron')
|
||||
|
||||
const { View } = electron
|
||||
const { TextField } = process.atomBinding('text_field')
|
||||
const { TextField } = process.electronBinding('text_field')
|
||||
|
||||
Object.setPrototypeOf(TextField.prototype, View.prototype)
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
const electron = require('electron')
|
||||
|
||||
const { View } = electron
|
||||
const { WebContentsView } = process.atomBinding('web_contents_view')
|
||||
const { WebContentsView } = process.electronBinding('web_contents_view')
|
||||
|
||||
Object.setPrototypeOf(WebContentsView.prototype, View.prototype)
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
'use strict'
|
||||
|
||||
const features = process.atomBinding('features')
|
||||
const features = process.electronBinding('features')
|
||||
const { EventEmitter } = require('events')
|
||||
const electron = require('electron')
|
||||
const path = require('path')
|
||||
|
@ -95,7 +95,7 @@ const defaultPrintingSetting = {
|
|||
}
|
||||
|
||||
// JavaScript implementations of WebContents.
|
||||
const binding = process.atomBinding('web_contents')
|
||||
const binding = process.electronBinding('web_contents')
|
||||
const { WebContents } = binding
|
||||
|
||||
Object.setPrototypeOf(NavigationController.prototype, EventEmitter.prototype)
|
||||
|
@ -467,7 +467,7 @@ WebContents.prototype._init = function () {
|
|||
}
|
||||
|
||||
// JavaScript wrapper of Debugger.
|
||||
const { Debugger } = process.atomBinding('debugger')
|
||||
const { Debugger } = process.electronBinding('debugger')
|
||||
|
||||
Debugger.prototype.sendCommand = deprecate.promisify(Debugger.prototype.sendCommand)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue