Compare commits

...

88 Commits

Author SHA1 Message Date
Electron Bot
dba3927b4e Bump v8.0.0-nightly.20190817 2019-08-17 08:31:36 -07:00
Micha Hanselmann
56d10aeef7 docs: add mising return desc (#19778) 2019-08-16 09:24:17 -07:00
Shelley Vohr
6a76540cb6 fix: return type in open/save dialogs (#19781) 2019-08-16 08:55:01 -07:00
Electron Bot
2c002a3342 Bump v8.0.0-nightly.20190816 2019-08-16 08:32:35 -07:00
Jean-Philippe Morin
42ac64284f docs: MessageBoxOptions.icon should allow type string (#19782)
In the `dialog` documentation (and the generated typings in `electron.d.ts`), it is mentionned that the `icon` property only supports `NativeImage`, but the `nativeImage` documentation says that:

```
In Electron, for the APIs that take images, you can pass either file paths or NativeImage
```
2019-08-16 17:06:02 +02:00
Cheng Zhao
2595cb5698 fix: compilation failure after chromium upgrade (#19787) 2019-08-16 07:55:34 -07:00
Cheng Zhao
c3bb73a711 feat: migrate webRequest module to NetworkService (Part 6) (#19752)
* Implement OnBeforeSendHeaders

* Pass the request

* Handle simple listeners

* Handle response listeners

* Read responses from listener
2019-08-16 10:19:05 +09:00
Micha Hanselmann
e59095423e docs: add exemplary fiddle for launch in fiddle feat (#19759)
* add fit-screen

* new url format

* nit
2019-08-15 15:37:37 -07:00
Electron Bot
db21391156 chore: bump chromium to cbeb16cf544f79c1990f1eae4d4fe (master) (#19610)
Co-authored-by: Erick Zhao <erickzhao@github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by Micha Hanselmann <DeerMichel@github.com>
2019-08-15 13:50:58 -07:00
Shelley Vohr
12df0e8994 fix: use GTK3 stock i18n strings (#19756) 2019-08-15 10:31:07 -07:00
Electron Bot
ca0cf5415e Bump v8.0.0-nightly.20190815 2019-08-15 08:31:20 -07:00
Shelley Vohr
33f2ec6355 fix: ensure child_process.fork() doesn't modify main (#19742) 2019-08-15 08:01:58 -07:00
Julien Isorce
680399f476 feat: Implement BrowserWindow.getMediaSourceId() and BrowserWindow.moveAbove(mediaSourceId) (#18926)
* feat: Implement BrowserWindow.moveAbove(mediaSourceId)

BrowserWindow.{focus,blur,moveTop}() are not enough in some
situations. For example when implementing an overlay that
follows another window that can lose focus. In that case
it is useful to move the overlay above the tracked window.

sourceId is a string in the format of DesktopCapturerSource.id,
for example "window:1869:0".

Notes: Added BrowserWindow.moveAbove(mediaSourceId)

https://github.com/electron/electron/issues/18922

* feat: Implement BrowserWindow.getMediaSourceId

Return the Window id in the format of DesktopCapturerSource's id.
For example "window:1234:0".

https://github.com/electron/electron/issues/16460

Notes: Added BrowserWindow.getMediaSourceId
2019-08-15 15:51:15 +09:00
Micha Hanselmann
d0c7a91a50 move image converter to gin (#19655) 2019-08-15 11:18:34 +09:00
Heilig Benedek
27b2747b61 fix: make sure that menu bar gets focus even when you click an item to focus it first (#19710) 2019-08-14 18:11:41 -07:00
Micha Hanselmann
9b1f698770 docs: mention QuickEdit in Windows troubleshooting (#19701)
* shot a trouble

* change title
2019-08-14 14:23:12 -07:00
Samuel Attard
efa1818cb4 feat: add new nativeTheme API (#19656)
* feat: add new nativeTheme API

* chore: deprecate and clean up old systemPreferences theme APIs in favor of new nativeTheme module

* chore: clean up and deprecate things per feedback

* chore: add tests for deprecate and clean up invert impl

* build: when is a boolean not a boolean???
2019-08-14 13:42:55 -07:00
Electron Bot
246187a20f Bump v8.0.0-nightly.20190814 2019-08-14 08:31:05 -07:00
Micha Hanselmann
4c54cfc692 move net converter to gin (#19734) 2019-08-14 14:15:34 +09:00
Erick Zhao
5d892a557f fix: proper l10n on Linux dialog buttons (#19725)
* fix: proper l10n on linux dialog

* switch string
2019-08-13 20:22:25 -07:00
Cheng Zhao
49fe2604b3 Revert "fix: activate the uv_loop on incoming IPC messages (#19449)" (#19727)
This reverts commit 8028c57b42.
2019-08-13 14:03:25 -07:00
Shelley Vohr
28466a39d8 feat: add property customization to save dialogs (#19672) 2019-08-13 13:40:07 -07:00
Shelley Vohr
e1824c00a9 feat: macOS removal fallback when moveItemToTrash fails (#19700)
* feat: macOS removal fallback when moveItemToTrash fails

* platform_util shouldn't know about mate::Arguments

* pull full_path from args as well
2019-08-13 12:31:53 -07:00
Shelley Vohr
b5798326e8 feat: add dontAddToRecent to windows showOpenDialog (#19669) 2019-08-13 08:48:22 -07:00
Electron Bot
fee84de782 Bump v8.0.0-nightly.20190813 2019-08-13 08:33:27 -07:00
Shelley Vohr
e8fa248571 fix: crash in window.print() (#19690)
* fix: crash in window.print()

* add preliminary tests
2019-08-12 23:44:14 -07:00
Micha Hanselmann
ba5ee79af8 move file dialog converter to gin (#19709) 2019-08-13 14:49:48 +09:00
Cheng Zhao
69eac0d9d2 feat: migrate webRequest module to NetworkService (Part 5) (#19714)
* Pass WebRequest to ProxyingURLLoaderFactory

* Call WebRequestAPI in InProgressRequest

* Store the listeners

* Pass the request and response

* Add stub to handle the events

* Use extensions::WebRequestInfo

* Make sure webRequest is managed by Session

* chore: make creation of WebRequestNS more clear

* fix: check WebContents for service workers
2019-08-13 14:47:35 +09:00
Electron Bot
9713fa09e7 chore: bump node to v12.8.0 (master) (#19521)
* chore: bump node in DEPS to v12.7.0

* chore: update node patches v12.6 to v12.7

Removed patches that are no longer necessary because we've upstreamed few changes already, and 3 way merge others

* fix: update build gn patch

* chore: bump node in DEPS to v12.8.0

* chore: update node patches v12.7 to v12.8

Removed patches that are no longer necessary because we've upstreamed few changes already, and 3 way merge others

* fix: Add patch to revert crypto createhash changes

The original node commit contains changes/calls to functions that are not supported in boringssl.

* disable node tests

* Remove outdated patch, already merged upstream
2019-08-12 17:29:34 -07:00
Erick Zhao
f654da9f56 feat: add about panel customization on Windows (#19420) 2019-08-12 16:32:51 -07:00
Сковорода Никита Андреевич
ef03c4b7bb docs: fix app.on('session-created' example (#19713)
It does not have the 'event' argument.

Refs: https://github.com/electron/electron/pull/12123
Refs: https://github.com/electron/electron/pull/15236
Refs: https://github.com/electron/electron/issues/15203
2019-08-12 14:46:42 -07:00
Samuel Attard
13df748f02 build: fix nightly install command in release notes (#19711) 2019-08-12 13:01:52 -07:00
Cheng Zhao
04dbd5c53f fix: don't handle browser messages before document element is created (#19718)
* fix: don't handle browser messages before document element is created

* fix: bind ElectronApiServiceImpl later

DidCreateDocumentElement is called before the ElectronApiServiceImpl
gets bound.

* chore: add comment
2019-08-12 10:38:41 -07:00
Electron Bot
398c5d553d Bump v8.0.0-nightly.20190812 2019-08-12 08:32:19 -07:00
Electron Bot
39f0bd3e82 Bump v8.0.0-nightly.20190811 2019-08-11 08:31:23 -07:00
Cheng Zhao
2dffc9f6eb feat: migrate webRequest module to NetworkService (Part 4) (#19679)
* chore: use gin in WebRequest

* Add stubs for APIs
2019-08-11 13:24:51 +09:00
Electron Bot
bc0a2d1b28 Bump v8.0.0-nightly.20190810 2019-08-10 08:31:20 -07:00
Erick Zhao
1749af9707 fix: avoid losing focus on inputs when opening menu (Windows/Linux) (#19657)
* remove cause of issue

* remove comment
2019-08-09 14:10:11 -07:00
Micha Hanselmann
57507ca37c refactor: move native window gin converter (#19577)
* move native window gin converter

* extract to new file
2019-08-09 13:43:18 -07:00
Shelley Vohr
7861e9f728 feat: allow customization of print page header and footer (#19688)
* feat: allow customization of more print settings

* address feedback from @jkleinsc

* header and footer are optional
2019-08-09 13:16:25 -07:00
Electron Bot
84cbc1d6c0 Bump v8.0.0-nightly.20190809 2019-08-09 08:32:09 -07:00
Milan Burda
03debb4ef9 feat: add tray.focus() (#19548) 2019-08-09 07:43:48 -07:00
Shelley Vohr
ed3b69ffb1 docs: update hasShadow for win and linux (#19675) 2019-08-08 15:49:43 -07:00
Milan Burda
0fb3c8cb7c feat: add new options to tray.displayBalloon() (#19544) 2019-08-08 14:43:33 -07:00
Richard Townsend
58840f39bb docs: document device scaling issue (#19387) 2019-08-08 13:59:44 -07:00
Pedro Pontes
da29ce355f fix: always use new site instance for a new navigation. (#18860) 2019-08-08 11:48:33 -07:00
Electron Bot
7a9e6659f0 Bump v8.0.0-nightly.20190808 2019-08-08 08:32:04 -07:00
Micha Hanselmann
9eb89b4ac7 fix: return correct bounds on will-resize (#19639) 2019-08-07 19:58:56 -07:00
Shelley Vohr
fec54c9c5d test: remove ffi specs (#19661) 2019-08-07 11:41:56 -07:00
Electron Bot
67169a5d0c Bump v8.0.0-nightly.20190807 2019-08-07 08:31:14 -07:00
Robo
eebea63bed chore: remove pre network service classes from shell/browser/net (#19644)
* refactor: rm IOThread class

* chore: rm expose-net-observer-api.patch

* chore: rm unused shell/browser/net/ classes

* chore: mv CertVerifierClient to separate header

* chore: rm url_request_context_getter references
2019-08-07 11:04:09 -04:00
Shelley Vohr
9c7a216814 fix: crash on print cancellation and silent print settings (#19598)
* fix: crash on print cancellation

* fix: update printing patch for new options

* refactor: use DictionaryValue for printBackground
2019-08-07 10:47:24 -04:00
Micha Hanselmann
a8861e6a66 move gurl converter to gin (#19578) 2019-08-07 16:18:26 +09:00
Erick Zhao
8a9a5d69b6 fix: normalize behavior of win.setOpacity() for invalid number values across operating systems (#19535)
* fix: define behavior for out-of-bounds setOpacity

* fix linux issue

* fix getOpacity behaviour

* wrong variable

* normalize more stuff

* docs

* test: use ifdescribe helper

* Update spec-main/api-browser-window-spec.ts

Co-Authored-By: Charles Kerr <ckerr@github.com>

* fixes

* more tests!!!

* Update shell/browser/native_window_views.cc

Co-Authored-By: Charles Kerr <ckerr@github.com>

* Update shell/browser/native_window_mac.mm

Co-Authored-By: Charles Kerr <ckerr@github.com>
2019-08-07 16:17:32 +09:00
Cheng Zhao
761a4deab3 feat: associate InProgressRequest with requests (#19648) 2019-08-07 09:21:53 +09:00
CezaryKulakowski
50cc54e50b fix: keep references to active menus created by api Menu (#19427)
Without this such menus would be destroyed by js garbage collector even
when they are still displayed.
2019-08-06 14:55:00 -07:00
Shelley Vohr
da2401ff39 spec: fix dirtyChai spec failures (#19652) 2019-08-06 10:27:33 -07:00
Electron Bot
c3d0fed9ed Bump v8.0.0-nightly.20190806 2019-08-06 08:31:49 -07:00
András Polgár
c0982d7316 docs: update link to webContents.send (#19608) 2019-08-05 20:58:06 -07:00
Shelley Vohr
f0396c19be fix: clearRecentDocuments role on Windows (#19599)
* fix: clear recent documents on windows

* chore: don't check for version < win 7
2019-08-05 15:11:43 -07:00
Samuel Attard
33a9d898a6 fix: make child windows not crash when ipc messages are received (#19553) 2019-08-05 12:50:51 -07:00
Samuel Attard
cfd230d7f1 docs: remove implicit 'any' and 'Object' types from the docs (#19585)
* docs: remove implicit 'any' and 'Object' types from the docs

* docs: more docs improvements, remove all remaining empty interfaces

* chore: update tests for better types
2019-08-05 10:45:58 -07:00
Milan Burda
ee674acca4 feat: add tray.removeBalloon() (#19547) 2019-08-05 08:52:47 -07:00
Electron Bot
8f043bbdaa Bump v8.0.0-nightly.20190805 2019-08-05 08:32:11 -07:00
Erick Zhao
750005f02b fix: handle edge behavior for about panel on Linux (#19586)
* fix: graceful About dialog fail/exit (Linux)

* Allow current to travel along path with no electrical impedance
2019-08-05 07:53:40 -07:00
Shelley Vohr
0bb227f8a4 fix: crash on window.print() (#19601) 2019-08-05 09:19:01 -04:00
Zach Bloomquist
40d9f828d4 docs: Fix process.enablePromiseAPI typo in promisification.md (#19576)
* Fix `process.enablePromiseAPI` typo in promisification.md

* Update promisification.md
2019-08-05 10:19:48 +09:00
Jeremy Apthorp
49f2071e22 test: tsify netlog spec (#19605) 2019-08-05 09:47:42 +09:00
Jeremy Apthorp
f08be2162a test: tsify callbacks-registry spec (#19606) 2019-08-05 09:46:58 +09:00
Electron Bot
45e452557b Bump v8.0.0-nightly.20190804 2019-08-04 08:32:25 -07:00
Electron Bot
df94cc1b13 Bump v8.0.0-nightly.20190803 2019-08-03 08:31:26 -07:00
Jeremy Apthorp
bd28b876a0 fix: disable 'reopen windows?' dialog after crash (#19584) 2019-08-02 17:04:41 -07:00
Electron Bot
e959137a4b chore: bump chromium to 32e0bab929213da1019992bf31d29 (master) (#19488) 2019-08-02 16:56:46 -07:00
Jeremy Apthorp
d0800aa200 test: report hexadecimal status codes on windows (#19597) 2019-08-02 14:23:11 -07:00
Milan Burda
3011a0f14f refactor: convert ipc-renderer.ts to TypeScript (#19556)
* refactor: convert ipc-renderer.ts to TypeScript

* Update typings/internal-ambient.d.ts

Co-Authored-By: Samuel Attard <sattard@slack-corp.com>
2019-08-02 14:35:04 -05:00
Micha Hanselmann
ee64c6ab86 refactor: move file path gin converter to new file (#19575)
* move file path gin converter to new file

* move string16 gin conv to new file
2019-08-02 14:34:30 -05:00
Electron Bot
79277cc383 Bump v8.0.0-nightly.20190802 2019-08-02 08:31:00 -07:00
Andy Dill
e78b902a7d fix: expose setMenuBarVisibility again (#19557) 2019-08-01 14:01:05 -07:00
Milan Burda
e8c4e6f0b3 fix: use correct constants for tray icon messages (#19549) 2019-08-01 14:00:37 -07:00
Electron Bot
2e785899dd Bump v8.0.0-nightly.20190801 2019-08-01 08:31:16 -07:00
Milan Burda
115b57649e docs: fix TouchBar related documentation (#19444) 2019-08-01 10:59:26 -04:00
Micha Hanselmann
b80429ab7f refactor: migrate dialog API to //gin (#19482)
* get ShowMessageBoxSync working with gin

* move more dialog methods

* all methods moved

* cleanup

* add util func for template creation
2019-08-01 10:57:41 -04:00
Samuel Attard
c190e64012 build: update the ABI version for electron 8 nightlies (#19551) 2019-08-01 10:54:26 -04:00
John Kleinschmidt
3a6cafaf0a fix: use WeakPtr to detect deletion (#19257) 2019-07-31 19:48:40 -04:00
Milan Burda
c76b0b70c1 refactor: remove content::WebContentsObserver from Event (#19251) 2019-07-31 15:20:28 -07:00
Jeremy Apthorp
c71cdce0b7 chore: disable JS impl when //extensions support is on (#19512) 2019-07-31 14:25:41 -07:00
Shelley Vohr
a5f87cee6b doc: add missing MenuItem roles (#19329) 2019-07-31 14:13:56 -07:00
Samuel Attard
bf66fe51f6 build: fix first beta version choosing logic 2019-07-31 11:04:19 -07:00
340 changed files with 4636 additions and 9115 deletions

View File

@@ -304,10 +304,6 @@ source_set("manifests") {
if (enable_basic_printing) {
deps += [ "//components/services/pdf_compositor/public/cpp:manifest" ]
}
if (enable_print_preview) {
deps += [ "//chrome/services/printing/public/cpp:manifest" ]
}
}
npm_action("electron_version_args") {
@@ -354,6 +350,7 @@ source_set("electron_lib") {
"//base:base_static",
"//base/allocator:buildflags",
"//chrome/app/resources:platform_locale_settings",
"//chrome/services/printing/public/mojom",
"//components/certificate_transparency",
"//components/net_log",
"//components/network_session_configurator/common",
@@ -371,7 +368,7 @@ source_set("electron_lib") {
"//device/bluetooth/public/cpp",
"//gin",
"//media/capture/mojom:video_capture",
"//media/mojo/interfaces",
"//media/mojo/mojom",
"//net:extras",
"//net:net_resources",
"//net:net_with_v8",
@@ -384,7 +381,7 @@ source_set("electron_lib") {
"//services/device/public/mojom",
"//services/proxy_resolver:lib",
"//services/video_capture/public/mojom:constants",
"//services/viz/privileged/interfaces/compositing",
"//services/viz/privileged/mojom/compositing",
"//skia",
"//third_party/blink/public:blink",
"//third_party/boringssl",
@@ -579,7 +576,7 @@ source_set("electron_lib") {
]
deps += [
"//components/viz/service",
"//services/viz/public/interfaces",
"//services/viz/public/mojom",
"//ui/compositor",
]
}

4
DEPS
View File

@@ -10,9 +10,9 @@ gclient_gn_args = [
vars = {
'chromium_version':
'9eecb7a9f652bbf84f6437b49c70922b65b38bf3',
'956a430350ccbeb16cf544f79c1990f1eae4d4fe',
'node_version':
'v12.6.0',
'v12.8.0',
'nan_version':
'2ee313aaca52e2b478965ac50eb5082520380d1b',

View File

@@ -1 +1 @@
7.0.0-nightly.20190731
8.0.0-nightly.20190817

View File

@@ -3,7 +3,7 @@ use_jumbo_build = true
root_extra_deps = [ "//electron" ]
# Registry of NMVs --> https://github.com/nodejs/node/blob/master/doc/abi_version_registry.json
node_module_version = 75
node_module_version = 76
v8_promise_internal_field_count = 1
v8_typed_array_max_size_in_heap = 0

View File

@@ -37,6 +37,8 @@ static_library("chrome") {
"//chrome/browser/net/proxy_config_monitor.h",
"//chrome/browser/net/proxy_service_factory.cc",
"//chrome/browser/net/proxy_service_factory.h",
"//chrome/browser/printing/printing_service.cc",
"//chrome/browser/printing/printing_service.h",
"//chrome/browser/ssl/security_state_tab_helper.cc",
"//chrome/browser/ssl/security_state_tab_helper.h",
"//chrome/browser/ui/autofill/popup_view_common.cc",

View File

@@ -32,7 +32,7 @@ In most cases, you should do everything in the `ready` event handler.
Returns:
* `launchInfo` Object _macOS_
* `launchInfo` unknown _macOS_
Emitted when Electron has finished initializing. On macOS, `launchInfo` holds
the `userInfo` of the `NSUserNotification` that was used to open the application,
@@ -146,7 +146,7 @@ Returns:
* `event` Event
* `type` String - A string identifying the activity. Maps to
[`NSUserActivity.activityType`][activity-type].
* `userInfo` Object - Contains app-specific state stored by the activity on
* `userInfo` unknown - Contains app-specific state stored by the activity on
another device.
Emitted during [Handoff][handoff] when an activity from a different device wants
@@ -189,7 +189,7 @@ Returns:
* `event` Event
* `type` String - A string identifying the activity. Maps to
[`NSUserActivity.activityType`][activity-type].
* `userInfo` Object - Contains app-specific state stored by the activity.
* `userInfo` unknown - Contains app-specific state stored by the activity.
Emitted during [Handoff][handoff] after an activity from this device was successfully
resumed on another one.
@@ -201,7 +201,7 @@ Returns:
* `event` Event
* `type` String - A string identifying the activity. Maps to
[`NSUserActivity.activityType`][activity-type].
* `userInfo` Object - Contains app-specific state stored by the activity.
* `userInfo` unknown - Contains app-specific state stored by the activity.
Emitted when [Handoff][handoff] is about to be resumed on another device. If you need to update the state to be transferred, you should call `event.preventDefault()` immediately, construct a new `userInfo` dictionary and call `app.updateCurrentActiviy()` in a timely manner. Otherwise, the operation will fail and `continue-activity-error` will be called.
@@ -390,7 +390,7 @@ Emitted when Electron has created a new `session`.
```javascript
const { app } = require('electron')
app.on('session-created', (event, session) => {
app.on('session-created', (session) => {
console.log(session)
})
```
@@ -949,7 +949,7 @@ allow multiple instances of the application to once again run side by side.
* `type` String - Uniquely identifies the activity. Maps to
[`NSUserActivity.activityType`][activity-type].
* `userInfo` Object - App-specific state to store for use by another device.
* `userInfo` any - App-specific state to store for use by another device.
* `webpageURL` String (optional) - The webpage to load in a browser if no suitable app is
installed on the resuming device. The scheme must be `http` or `https`.
@@ -972,7 +972,7 @@ Marks the current [Handoff][handoff] user activity as inactive without invalidat
* `type` String - Uniquely identifies the activity. Maps to
[`NSUserActivity.activityType`][activity-type].
* `userInfo` Object - App-specific state to store for use by another device.
* `userInfo` any - App-specific state to store for use by another device.
Updates the current activity if its type matches `type`, merging the entries from
`userInfo` into its current `userInfo` dictionary.
@@ -1166,21 +1166,21 @@ This API must be called after the `ready` event is emitted.
**[Deprecated](modernization/property-updates.md)**
### `app.showAboutPanel()` _macOS_ _Linux_
### `app.showAboutPanel()`
Show the app's about panel options. These options can be overridden with `app.setAboutPanelOptions(options)`.
### `app.setAboutPanelOptions(options)` _macOS_ _Linux_
### `app.setAboutPanelOptions(options)`
* `options` Object
* `applicationName` String (optional) - The app's name.
* `applicationVersion` String (optional) - The app's version.
* `copyright` String (optional) - Copyright information.
* `version` String (optional) _macOS_ - The app's build version number.
* `credits` String (optional) _macOS_ - Credit information.
* `credits` String (optional) _macOS_ _Windows_ - Credit information.
* `authors` String[] (optional) _Linux_ - List of app authors.
* `website` String (optional) _Linux_ - The app's website.
* `iconPath` String (optional) _Linux_ - Path to the app's icon. Will be shown as 64x64 pixels while retaining aspect ratio.
* `iconPath` String (optional) _Linux_ _Windows_ - Path to the app's icon. On Linux, will be shown as 64x64 pixels while retaining aspect ratio.
Set the about panel options. This will override the values defined in the app's
`.plist` file on MacOS. See the [Apple docs][about-panel-options] for more details. On Linux, values must be set in order to be shown; there are no defaults.

View File

@@ -103,7 +103,7 @@ The `autoUpdater` object has the following methods:
* `options` Object
* `url` String
* `headers` Object (optional) _macOS_ - HTTP request headers.
* `headers` Record<String, String> (optional) _macOS_ - HTTP request headers.
* `serverType` String (optional) _macOS_ - Either `json` or `default`, see the [Squirrel.Mac][squirrel-mac]
README for more information.

View File

@@ -691,7 +691,7 @@ is emitted.
#### `BrowserWindow.getExtensions()`
Returns `Object` - The keys are the extension names and each value is
Returns `Record<String, ExtensionInfo>` - The keys are the extension names and each value is
an Object containing `name` and `version` properties.
**Note:** This API cannot be called before the `ready` event of the `app` module
@@ -724,7 +724,7 @@ is emitted.
#### `BrowserWindow.getDevToolsExtensions()`
Returns `Object` - The keys are the extension names and each value is
Returns `Record<string, ExtensionInfo>` - The keys are the extension names and each value is
an Object containing `name` and `version` properties.
To check if a DevTools extension is installed you can run the following:
@@ -1194,6 +1194,14 @@ can not be focused on.
Returns `Boolean` - Whether the window is always on top of other windows.
#### `win.moveAbove(mediaSourceId)`
* `mediaSourceId` String - Window id in the format of DesktopCapturerSource's id. For example "window:1869:0".
Moves window above the source window in the sense of z-order. If the
`mediaSourceId` is not of type window or if the window does not exist then
this method throws an error.
#### `win.moveTop()`
Moves window to top(z-order) regardless of focus
@@ -1266,6 +1274,15 @@ Enters or leaves the kiosk mode.
Returns `Boolean` - Whether the window is in kiosk mode.
#### `win.getMediaSourceId()`
Returns `String` - Window id in the format of DesktopCapturerSource's id. For example "window:1234:0".
More precisely the format is `window:id:other_id` where `id` is `HWND` on
Windows, `CGWindowID` (`uint64_t`) on macOS and `Window` (`unsigned long`) on
Linux. `other_id` is used to identify web contents (tabs) so within the same
top level window.
#### `win.getNativeWindowHandle()`
Returns `Buffer` - The platform-specific handle of the window.
@@ -1381,7 +1398,7 @@ win.loadURL('http://localhost:8000/post', {
* `filePath` String
* `options` Object (optional)
* `query` Object (optional) - Passed to `url.format()`.
* `query` Record<String, String> (optional) - Passed to `url.format()`.
* `search` String (optional) - Passed to `url.format()`.
* `hash` String (optional) - Passed to `url.format()`.
@@ -1437,29 +1454,27 @@ screen readers
Sets a 16 x 16 pixel overlay onto the current taskbar icon, usually used to
convey some sort of application status or to passively notify the user.
#### `win.setHasShadow(hasShadow)` _macOS_
#### `win.setHasShadow(hasShadow)`
* `hasShadow` Boolean
Sets whether the window should have a shadow. On Windows and Linux does
nothing.
Sets whether the window should have a shadow.
#### `win.hasShadow()` _macOS_
#### `win.hasShadow()`
Returns `Boolean` - Whether the window has a shadow.
On Windows and Linux always returns
`true`.
#### `win.setOpacity(opacity)` _Windows_ _macOS_
* `opacity` Number - between 0.0 (fully transparent) and 1.0 (fully opaque)
Sets the opacity of the window. On Linux does nothing.
Sets the opacity of the window. On Linux, does nothing. Out of bound number
values are clamped to the [0, 1] range.
#### `win.getOpacity()` _Windows_ _macOS_
#### `win.getOpacity()`
Returns `Number` - between 0.0 (fully transparent) and 1.0 (fully opaque)
Returns `Number` - between 0.0 (fully transparent) and 1.0 (fully opaque). On
Linux, always returns 1.
#### `win.setShape(rects)` _Windows_ _Linux_ _Experimental_

View File

@@ -16,7 +16,7 @@ following properties:
method.
* `url` String (optional) - The request URL. Must be provided in the absolute
form with the protocol scheme specified as http or https.
* `session` Object (optional) - The [`Session`](session.md) instance with
* `session` Session (optional) - The [`Session`](session.md) instance with
which the request is associated.
* `partition` String (optional) - The name of the [`partition`](session.md)
with which the request is associated. Defaults to the empty string. The
@@ -134,7 +134,7 @@ Returns:
* `statusCode` Integer
* `method` String
* `redirectUrl` String
* `responseHeaders` Object
* `responseHeaders` Record<String, String[]>
Emitted when there is redirection and the mode is `manual`. Calling
[`request.followRedirect`](#requestfollowredirect) will continue with the redirection.
@@ -158,7 +158,7 @@ internally buffered inside Electron process memory.
#### `request.setHeader(name, value)`
* `name` String - An extra HTTP header name.
* `value` Object - An extra HTTP header value.
* `value` String - An extra HTTP header value.
Adds an extra HTTP header. The header name will be issued as-is without
lowercasing. It can be called only before first write. Calling this method after
@@ -169,7 +169,7 @@ the first write will throw an error. If the passed value is not a `String`, its
* `name` String - Specify an extra header name.
Returns `Object` - The value of a previously set extra header name.
Returns `String` - The value of a previously set extra header name.
#### `request.removeHeader(name)`

View File

@@ -74,6 +74,9 @@ will be returned in the promise.
Returns `Promise<Object>` - Resolves with an object containing the `value` and `percentage` of trace buffer maximum usage
* `value` Number
* `percentage` Number
Get the maximum usage across processes of trace buffer as a percentage of the
full state.

View File

@@ -48,7 +48,7 @@ The `crashReporter` module has the following methods:
* `productName` String (optional) - Defaults to `app.name`.
* `uploadToServer` Boolean (optional) - Whether crash reports should be sent to the server. Default is `true`.
* `ignoreSystemCrashHandler` Boolean (optional) - Default is `false`.
* `extra` Object (optional) - An object you can define that will be sent along with the
* `extra` Record<String, String> (optional) - An object you can define that will be sent along with the
report. Only string properties are sent correctly. Nested objects are not
supported. When using Windows, the property names and values must be fewer than 64 characters.
* `crashesDirectory` String (optional) - Directory to store the crash reports temporarily (only used when the crash reporter is started via `process.crashReporter.start`).

View File

@@ -50,7 +50,7 @@ Returns:
* `event` Event
* `method` String - Method name.
* `params` Object - Event parameters defined by the 'parameters'
* `params` unknown - Event parameters defined by the 'parameters'
attribute in the remote debugging protocol.
Emitted whenever the debugging target issues an instrumentation event.
@@ -78,7 +78,7 @@ Detaches the debugger from the `webContents`.
* `method` String - Method name, should be one of the methods defined by the
[remote debugging protocol][rdp].
* `commandParams` Object (optional) - JSON object with request parameters.
* `commandParams` any (optional) - JSON object with request parameters.
Returns `Promise<any>` - A promise that resolves with the response defined by
the 'returns' attribute of the command description in the remote debugging protocol

View File

@@ -48,10 +48,13 @@ The `dialog` module has the following methods:
their target path.
* `treatPackageAsDirectory` _macOS_ - Treat packages, such as `.app` folders,
as a directory instead of a file.
* `dontAddToRecent` _Windows_ - Do not add the item being opened to the recent documents list.
* `message` String (optional) _macOS_ - Message to display above input
boxes.
* `securityScopedBookmarks` Boolean (optional) _macOS_ _mas_ - Create [security scoped bookmarks](https://developer.apple.com/library/content/documentation/Security/Conceptual/AppSandboxDesignGuide/AppSandboxInDepth/AppSandboxInDepth.html#//apple_ref/doc/uid/TP40011183-CH3-SW16) when packaged for the Mac App Store.
Returns `String[] | undefined`, the file paths chosen by the user; if the dialog is cancelled it returns `undefined`.
The `browserWindow` argument allows the dialog to attach itself to a parent window, making it modal.
The `filters` specifies an array of file types that can be displayed or
@@ -108,6 +111,7 @@ dialog.showOpenDialogSync(mainWindow, {
their target path.
* `treatPackageAsDirectory` _macOS_ - Treat packages, such as `.app` folders,
as a directory instead of a file.
* `dontAddToRecent` _Windows_ - Do not add the item being opened to the recent documents list.
* `message` String (optional) _macOS_ - Message to display above input
boxes.
* `securityScopedBookmarks` Boolean (optional) _macOS_ _mas_ - Create [security scoped bookmarks](https://developer.apple.com/library/content/documentation/Security/Conceptual/AppSandboxDesignGuide/AppSandboxInDepth/AppSandboxInDepth.html#//apple_ref/doc/uid/TP40011183-CH3-SW16) when packaged for the Mac App Store.
@@ -169,6 +173,13 @@ dialog.showOpenDialog(mainWindow, {
displayed in front of the filename text field.
* `showsTagField` Boolean (optional) _macOS_ - Show the tags input box,
defaults to `true`.
* `properties` String[] (optional)
* `showHiddenFiles` - Show hidden files in dialog.
* `createDirectory` _macOS_ - Allow creating new directories from dialog.
* `treatPackageAsDirectory` _macOS_ - Treat packages, such as `.app` folders,
as a directory instead of a file.
* `showOverwriteConfirmation` _Linux_ - Sets whether the user will be presented a confirmation dialog if the user types a file name that already exists.
* `dontAddToRecent` _Windows_ - Do not add the item being saved to the recent documents list.
* `securityScopedBookmarks` Boolean (optional) _macOS_ _mas_ - Create a [security scoped bookmark](https://developer.apple.com/library/content/documentation/Security/Conceptual/AppSandboxDesignGuide/AppSandboxInDepth/AppSandboxInDepth.html#//apple_ref/doc/uid/TP40011183-CH3-SW16) when packaged for the Mac App Store. If this option is enabled and the file doesn't already exist a blank file will be created at the chosen path.
Returns `String | undefined`, the path of the file chosen by the user; if the dialog is cancelled it returns `undefined`.
@@ -191,8 +202,14 @@ The `filters` specifies an array of file types that can be displayed, see
* `message` String (optional) _macOS_ - Message to display above text fields.
* `nameFieldLabel` String (optional) _macOS_ - Custom label for the text
displayed in front of the filename text field.
* `showsTagField` Boolean (optional) _macOS_ - Show the tags input box,
defaults to `true`.
* `showsTagField` Boolean (optional) _macOS_ - Show the tags input box, defaults to `true`.
* `properties` String[] (optional)
* `showHiddenFiles` - Show hidden files in dialog.
* `createDirectory` _macOS_ - Allow creating new directories from dialog.
* `treatPackageAsDirectory` _macOS_ - Treat packages, such as `.app` folders,
as a directory instead of a file.
* `showOverwriteConfirmation` _Linux_ - Sets whether the user will be presented a confirmation dialog if the user types a file name that already exists.
* `dontAddToRecent` _Windows_ - Do not add the item being saved to the recent documents list.
* `securityScopedBookmarks` Boolean (optional) _macOS_ _mas_ - Create a [security scoped bookmark](https://developer.apple.com/library/content/documentation/Security/Conceptual/AppSandboxDesignGuide/AppSandboxInDepth/AppSandboxInDepth.html#//apple_ref/doc/uid/TP40011183-CH3-SW16) when packaged for the Mac App Store. If this option is enabled and the file doesn't already exist a blank file will be created at the chosen path.
Returns `Promise<Object>` - Resolve with an object containing the following:
@@ -227,7 +244,7 @@ expanding and collapsing the dialog.
include a checkbox with the given label.
* `checkboxChecked` Boolean (optional) - Initial checked state of the
checkbox. `false` by default.
* `icon` [NativeImage](native-image.md) (optional)
* `icon` ([NativeImage](native-image.md) | String) (optional)
* `cancelId` Integer (optional) - The index of the button to be used to cancel the dialog, via
the `Esc` key. By default this is assigned to the first button with "cancel" or "no" as the
label. If no such labeled buttons exist and this option is not set, `0` will be used as the

View File

@@ -51,7 +51,7 @@ A `String` representing the HTTP status message.
#### `response.headers`
An `Object` representing the response HTTP headers. The `headers` object is
An `Record<string, string[]>` representing the response HTTP headers. The `headers` object is
formatted as follows:
* All header names are lowercased.

View File

@@ -90,7 +90,7 @@ Removes listeners of the specified `channel`.
### `ipcMain.handle(channel, listener)`
* `channel` String
* `listener` Function<Promise> | Function<any>
* `listener` Function<Promise<void> | any>
* `event` IpcMainInvokeEvent
* `...args` any[]
@@ -122,7 +122,7 @@ WebContents is the source of the invoke request.
### `ipcMain.handleOnce(channel, listener)`
* `channel` String
* `listener` Function<Promise> | Function<any>
* `listener` Function<Promise<void> | any>
* `event` IpcMainInvokeEvent
* `...args` any[]
@@ -147,4 +147,4 @@ found in the [`ipc-main-invoke-event`](structures/ipc-main-invoke-event.md)
structure docs.
[event-emitter]: https://nodejs.org/api/events.html#events_class_eventemitter
[web-contents-send]: web-contents.md#contentssendchannel-args
[web-contents-send]: web-contents.md#contentssendchannel-arg1-arg2-

View File

@@ -14,7 +14,7 @@ See [`Menu`](menu.md) for examples.
* `menuItem` MenuItem
* `browserWindow` [BrowserWindow](browser-window.md)
* `event` [KeyboardEvent](structures/keyboard-event.md)
* `role` String (optional) - Can be `undo`, `redo`, `cut`, `copy`, `paste`, `pasteandmatchstyle`, `delete`, `selectall`, `reload`, `forcereload`, `toggledevtools`, `resetzoom`, `zoomin`, `zoomout`, `togglefullscreen`, `window`, `minimize`, `close`, `help`, `about`, `services`, `hide`, `hideothers`, `unhide`, `quit`, `startspeaking`, `stopspeaking`, `close`, `minimize`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu` or `windowMenu` - Define the action of the menu item, when specified the
* `role` String (optional) - Can be `undo`, `redo`, `cut`, `copy`, `paste`, `pasteAndMatchStyle`, `delete`, `selectAll`, `reload`, `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`, `zoomOut`, `togglefullscreen`, `window`, `minimize`, `close`, `help`, `about`, `services`, `hide`, `hideOthers`, `unhide`, `quit`, `startSpeaking`, `stopSpeaking`, `close`, `minimize`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu`, `recentDocuments`, `toggleTabBar`, `selectNextTab`, `selectPreviousTab`, `mergeAllWindows`, `clearRecentDocuments`, `moveTabToNewWindow` or `windowMenu` - Define the action of the menu item, when specified the
`click` property will be ignored. See [roles](#roles).
* `type` String (optional) - Can be `normal`, `separator`, `submenu`, `checkbox` or
`radio`.
@@ -82,7 +82,7 @@ The `role` property can have following values:
* `reload` - Reload the current window.
* `forceReload` - Reload the current window ignoring the cache.
* `toggleDevTools` - Toggle developer tools in the current window.
* `toggleFullScreen` - Toggle full screen mode on the current window.
* `togglefullscreen` - Toggle full screen mode on the current window.
* `resetZoom` - Reset the focused page's zoom level to the original size.
* `zoomIn` - Zoom in the focused page by 10%.
* `zoomOut` - Zoom out the focused page by 10%.
@@ -152,7 +152,7 @@ A `String` indicating the type of the item. Can be `normal`, `separator`, `subme
#### `menuItem.role`
A `String` (optional) indicating the item's role, if set. Can be `undo`, `redo`, `cut`, `copy`, `paste`, `pasteandmatchstyle`, `delete`, `selectall`, `reload`, `forcereload`, `toggledevtools`, `resetzoom`, `zoomin`, `zoomout`, `togglefullscreen`, `window`, `minimize`, `close`, `help`, `about`, `services`, `hide`, `hideothers`, `unhide`, `quit`, `startspeaking`, `stopspeaking`, `close`, `minimize`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu` or `windowMenu`
A `String` (optional) indicating the item's role, if set. Can be `undo`, `redo`, `cut`, `copy`, `paste`, `pasteAndMatchStyle`, `delete`, `selectAll`, `reload`, `forceReload`, `toggleDevTools`, `resetZoom`, `zoomIn`, `zoomOut`, `togglefullscreen`, `window`, `minimize`, `close`, `help`, `about`, `services`, `hide`, `hideOthers`, `unhide`, `quit`, `startSpeaking`, `stopSpeaking`, `close`, `minimize`, `zoom`, `front`, `appMenu`, `fileMenu`, `editMenu`, `viewMenu`, `recentDocuments`, `toggleTabBar`, `selectNextTab`, `selectPreviousTab`, `mergeAllWindows`, `clearRecentDocuments`, `moveTabToNewWindow` or `windowMenu`
#### `menuItem.accelerator`

View File

@@ -2,7 +2,7 @@
The Electron team is currently undergoing an initiative to convert callback-based functions in Electron to return Promises. During this transition period, both the callback and Promise-based versions of these functions will work correctly, and will both be documented.
To enable deprecation warnings for these updated functions, use the `process.enablePromiseAPI` runtime flag.
To enable deprecation warnings for these updated functions, use the [`process.enablePromiseAPIs` runtime flag](../process.md#processenablepromiseapis).
When a majority of affected functions are migrated, this flag will be enabled by default and all developers will be able to see these deprecation warnings. At that time, the callback-based versions will also be removed from documentation. This document will be continuously updated as more functions are converted.

35
docs/api/native-theme.md Normal file
View File

@@ -0,0 +1,35 @@
# nativeTheme
> Read and respond to changes in Chromium's native color theme.
Process: [Main](../glossary.md#main-process), [Renderer](../glossary.md#renderer-process)
## Events
The `nativeTheme` module emits the following events:
### Event: 'updated'
Emitted when something in the underlying NativeTheme has changed. This normally
means that either the value of `shouldUseDarkColors`,
`shouldUseHighContrastColors` or `shouldUseInvertedColorScheme` has changed.
You will have to check them to determine which one has changed.
## Properties
The `nativeTheme` module has the following properties:
### `nativeTheme.shouldUseDarkColors` _Readonly_
A `Boolean` for if the OS / Chromium currently has a dark mode enabled or is
being instructed to show a dark-style UI.
### `nativeTheme.shouldUseHighContrastColors` _macOS_ _Windows_ _Readonly_
A `Boolean` for if the OS / Chromium currently has high-contrast mode enabled
or is being instructed to show a high-constrast UI.
### `nativeTheme.shouldUseInvertedColorScheme` _macOS_ _Windows_ _Readonly_
A `Boolean` for if the OS / Chromium currently has an inverted color scheme
or is being instructed to use an inverted color scheme.

View File

@@ -54,7 +54,7 @@ The `net` module has the following methods:
### `net.request(options)`
* `options` (Object | String) - The `ClientRequest` constructor options.
* `options` (ClientRequestConstructorOptions | String) - The `ClientRequest` constructor options.
Returns [`ClientRequest`](./client-request.md)

View File

@@ -228,7 +228,7 @@ should be called with either a `String` or an object that has the `data`,
* `redirectRequest` Object
* `url` String
* `method` String (optional)
* `session` Object (optional)
* `session` Session | null (optional)
* `uploadData` [ProtocolResponseUploadData](structures/protocol-response-upload-data.md) (optional)
* `completion` Function (optional)
* `error` Error
@@ -388,7 +388,7 @@ which sends a `Buffer` as a response.
* `redirectRequest` Object
* `url` String
* `method` String (optional)
* `session` Object | null (optional)
* `session` Session | null (optional)
* `uploadData` Object (optional)
* `contentType` String - MIME type of the content.
* `data` String - Content to be sent.

View File

@@ -14,7 +14,7 @@ property, so writing `let { screen } = require('electron')` will not work.
An example of creating a window that fills the whole screen:
```javascript
```javascript fiddle='docs/fiddles/screen/fit-screen'
const { app, BrowserWindow, screen } = require('electron')
let win

View File

@@ -43,11 +43,12 @@ Returns `Promise<void>`
Open the given external protocol URL in the desktop's default manner. (For example, mailto: URLs in the user's default mail agent).
### `shell.moveItemToTrash(fullPath)`
### `shell.moveItemToTrash(fullPath[, deleteOnFail])`
* `fullPath` String
* `deleteOnFail` Boolean (optional) - Whether or not to unilaterally remove the item if the Trash is disabled or unsupported on the volume. _macOS_
Returns `Boolean` - Whether the item was successfully moved to the trash.
Returns `Boolean` - Whether the item was successfully moved to the trash or otherwise deleted.
Move the given file to trash and returns a boolean status for the operation.

View File

@@ -0,0 +1,4 @@
# ExtensionInfo Object
* `name` String
* `version` String

View File

@@ -19,7 +19,7 @@
include in the trace. If not specified, trace all processes.
* `histogram_names` String[] (optional) - a list of [histogram][] names to report
with the trace.
* `memory_dump_config` Object (optional) - if the
* `memory_dump_config` Record<String, any> (optional) - if the
`disabled-by-default-memory-infra` category is enabled, this contains
optional additional configuration for data collection. See the [Chromium
memory-infra docs][memory-infra docs] for more information.

View File

@@ -27,28 +27,34 @@ Returns:
* `event` Event
### Event: 'inverted-color-scheme-changed' _Windows_
### Event: 'inverted-color-scheme-changed' _Windows_ _Deprecated_
Returns:
* `event` Event
* `invertedColorScheme` Boolean - `true` if an inverted color scheme (a high contrast color scheme with light text and dark backgrounds) is being used, `false` otherwise.
### Event: 'high-contrast-color-scheme-changed' _Windows_
**Deprecated:** Should use the new [`updated`](native-theme.md#event-updated) event on the `nativeTheme` module.
### Event: 'high-contrast-color-scheme-changed' _Windows_ _Deprecated_
Returns:
* `event` Event
* `highContrastColorScheme` Boolean - `true` if a high contrast theme is being used, `false` otherwise.
**Deprecated:** Should use the new [`updated`](native-theme.md#event-updated) event on the `nativeTheme` module.
## Methods
### `systemPreferences.isDarkMode()` _macOS_ _Windows_
### `systemPreferences.isDarkMode()` _macOS_ _Windows_ _Deprecated_
Returns `Boolean` - Whether the system is in Dark Mode.
**Note:** On macOS 10.15 Catalina in order for this API to return the correct value when in the "automatic" dark mode setting you must either have `NSRequiresAquaSystemAppearance=false` in your `Info.plist` or be on Electron `>=7.0.0`. See the [dark mode guide](../tutorial/mojave-dark-mode-guide.md) for more information.
**Deprecated:** Should use the new [`nativeTheme.shouldUseDarkColors`](native-theme.md#nativethemeshouldusedarkcolors-readonly) API.
### `systemPreferences.isSwipeTrackingFromScrollEventsEnabled()` _macOS_
Returns `Boolean` - Whether the Swipe between pages setting is on.
@@ -56,7 +62,7 @@ Returns `Boolean` - Whether the Swipe between pages setting is on.
### `systemPreferences.postNotification(event, userInfo[, deliverImmediately])` _macOS_
* `event` String
* `userInfo` Object
* `userInfo` Record<String, any>
* `deliverImmediately` Boolean (optional) - `true` to post notifications immediately even when the subscribing app is inactive.
Posts `event` as native notifications of macOS. The `userInfo` is an Object
@@ -65,7 +71,7 @@ that contains the user information dictionary sent along with the notification.
### `systemPreferences.postLocalNotification(event, userInfo)` _macOS_
* `event` String
* `userInfo` Object
* `userInfo` Record<String, any>
Posts `event` as native notifications of macOS. The `userInfo` is an Object
that contains the user information dictionary sent along with the notification.
@@ -73,7 +79,7 @@ that contains the user information dictionary sent along with the notification.
### `systemPreferences.postWorkspaceNotification(event, userInfo)` _macOS_
* `event` String
* `userInfo` Object
* `userInfo` Record<String, any>
Posts `event` as native notifications of macOS. The `userInfo` is an Object
that contains the user information dictionary sent along with the notification.
@@ -83,7 +89,7 @@ that contains the user information dictionary sent along with the notification.
* `event` String
* `callback` Function
* `event` String
* `userInfo` Object
* `userInfo` Record<String, unknown>
* `object` String
Returns `Number` - The ID of this subscription
@@ -110,7 +116,7 @@ example values of `event` are:
* `event` String
* `callback` Function
* `event` String
* `userInfo` Object
* `userInfo` Record<String, unknown>
* `object` String
Returns `Number` - The ID of this subscription
@@ -123,7 +129,7 @@ This is necessary for events such as `NSUserDefaultsDidChangeNotification`.
* `event` String
* `callback` Function
* `event` String
* `userInfo` Object
* `userInfo` Record<String, unknown>
* `object` String
Same as `subscribeNotification`, but uses `NSWorkspace.sharedWorkspace.notificationCenter`.
@@ -149,7 +155,7 @@ Same as `unsubscribeNotification`, but removes the subscriber from `NSWorkspace.
### `systemPreferences.registerDefaults(defaults)` _macOS_
* `defaults` Object - a dictionary of (`key: value`) user defaults
* `defaults` Record<String, String | Boolean | Number> - a dictionary of (`key: value`) user defaults
Add the specified defaults to your application's `NSUserDefaults`.
@@ -342,14 +348,18 @@ Returns `String` - The standard system color formatted as `#RRGGBBAA`.
Returns one of several standard system colors that automatically adapt to vibrancy and changes in accessibility settings like 'Increase contrast' and 'Reduce transparency'. See [Apple Documentation](https://developer.apple.com/design/human-interface-guidelines/macos/visual-design/color#system-colors) for more details.
### `systemPreferences.isInvertedColorScheme()` _Windows_
### `systemPreferences.isInvertedColorScheme()` _Windows_ _Deprecated_
Returns `Boolean` - `true` if an inverted color scheme (a high contrast color scheme with light text and dark backgrounds) is active, `false` otherwise.
### `systemPreferences.isHighContrastColorScheme()` _macOS_ _Windows_
**Deprecated:** Should use the new [`nativeTheme.shouldUseInvertedColorScheme`](native-theme.md#nativethemeshoulduseinvertedcolorscheme-macos-windows-readonly) API.
### `systemPreferences.isHighContrastColorScheme()` _macOS_ _Windows_ _Deprecated_
Returns `Boolean` - `true` if a high contrast theme is active, `false` otherwise.
**Depreacted:** Should use the new [`nativeTheme.shouldUseHighContrastColors`](native-theme.md#nativethemeshouldusehighcontrastcolors-macos-windows-readonly) API.
### `systemPreferences.getEffectiveAppearance()` _macOS_
Returns `String` - Can be `dark`, `light` or `unknown`.
@@ -365,7 +375,9 @@ using `electron-packager` or `electron-forge` just set the `enableDarwinDarkMode
packager option to `true`. See the [Electron Packager API](https://github.com/electron/electron-packager/blob/master/docs/api.md#darwindarkmodesupport)
for more details.
### `systemPreferences.getAppLevelAppearance()` _macOS_
**[Deprecated](modernization/property-updates.md)**
### `systemPreferences.getAppLevelAppearance()` _macOS_ _Deprecated_
Returns `String` | `null` - Can be `dark`, `light` or `unknown`.
@@ -375,7 +387,7 @@ You can use the `setAppLevelAppearance` API to set this value.
**[Deprecated](modernization/property-updates.md)**
### `systemPreferences.setAppLevelAppearance(appearance)` _macOS_
### `systemPreferences.setAppLevelAppearance(appearance)` _macOS_ _Deprecated_
* `appearance` String | null - Can be `dark` or `light`
@@ -450,10 +462,25 @@ Returns an object with system animation settings.
### `systemPreferences.appLevelAppearance` _macOS_
A `String` property that determines the macOS appearance setting for
A `String` property that can be `dark`, `light` or `unknown`. It determines the macOS appearance setting for
your application. This maps to values in: [NSApplication.appearance](https://developer.apple.com/documentation/appkit/nsapplication/2967170-appearance?language=objc). Setting this will override the
system default as well as the value of `getEffectiveAppearance`.
Possible values that can be set are `dark` and `light`, and possible return values are `dark`, `light`, and `unknown`.
This property is only available on macOS 10.14 Mojave or newer.
### `systemPreferences.effectiveAppearance` _macOS_ _Readonly_
A `String` property that can be `dark`, `light` or `unknown`.
Returns the macOS appearance setting that is currently applied to your application,
maps to [NSApplication.effectiveAppearance](https://developer.apple.com/documentation/appkit/nsapplication/2967171-effectiveappearance?language=objc)
Please note that until Electron is built targeting the 10.14 SDK, your application's
`effectiveAppearance` will default to 'light' and won't inherit the OS preference. In
the interim in order for your application to inherit the OS preference you must set the
`NSRequiresAquaSystemAppearance` key in your apps `Info.plist` to `false`. If you are
using `electron-packager` or `electron-forge` just set the `enableDarwinDarkMode`
packager option to `true`. See the [Electron Packager API](https://github.com/electron/electron-packager/blob/master/docs/api.md#darwindarkmodesupport)
for more details.

View File

@@ -11,7 +11,7 @@ Process: [Main](../tutorial/application-architecture.md#main-and-renderer-proces
* `backgroundColor` String (optional) - Button background color in hex format,
i.e `#ABCDEF`.
* `icon` [NativeImage](native-image.md) | String (optional) - Button icon.
* `iconPosition` String (optional) - Can be `left`, `right` or `overlay`.
* `iconPosition` String (optional) - Can be `left`, `right` or `overlay`. Defaults to `overlay`.
* `click` Function (optional) - Function to call when the button is clicked.
### Instance Properties

View File

@@ -9,7 +9,7 @@ Process: [Main](../tutorial/application-architecture.md#main-and-renderer-proces
* `options` Object
* `label` String (optional) - Popover button text.
* `icon` [NativeImage](native-image.md) (optional) - Popover button icon.
* `items` [TouchBar](touch-bar.md) (optional) - Items to display in the popover.
* `items` [TouchBar](touch-bar.md) - Items to display in the popover.
* `showCloseButton` Boolean (optional) - `true` to display a close button
on the left of the popover, `false` to not show it. Default is `true`.

View File

@@ -12,10 +12,10 @@ Process: [Main](../tutorial/application-architecture.md#main-and-renderer-proces
* `selectedIndex` Integer - The index of the item the user selected.
* `highlight` Function (optional) - Called when the user taps any item.
* `highlightedIndex` Integer - The index of the item the user touched.
* `selectedStyle` String (optional) - Selected item style. Defaults to `null`.
* `overlayStyle` String (optional) - Selected overlay item style. Defaults to `null`.
* `selectedStyle` String (optional) - Selected item style. Can be `background`, `outline` or `none`. Defaults to `none`.
* `overlayStyle` String (optional) - Selected overlay item style. Can be `background`, `outline` or `none`. Defaults to `none`.
* `showArrowButtons` Boolean (optional) - Defaults to `false`.
* `mode` String (optional) - Defaults to `free`.
* `mode` String (optional) - Can be `fixed` or `free`. The default is `free`.
* `continuous` Boolean (optional) - Defaults to `true`.
### Instance Properties
@@ -34,7 +34,7 @@ updates the control in the touch bar. Possible values:
* `background` - Maps to `[NSScrubberSelectionStyle roundedBackgroundStyle]`.
* `outline` - Maps to `[NSScrubberSelectionStyle outlineOverlayStyle]`.
* `null` - Actually null, not a string, removes all styles.
* `none` - Removes all styles.
#### `touchBarScrubber.overlayStyle`
@@ -44,7 +44,7 @@ touch bar. Possible values:
* `background` - Maps to `[NSScrubberSelectionStyle roundedBackgroundStyle]`.
* `outline` - Maps to `[NSScrubberSelectionStyle outlineOverlayStyle]`.
* `null` - Actually null, not a string, removes all styles.
* `none` - Removes all styles.
#### `touchBarScrubber.showArrowButtons`

View File

@@ -10,23 +10,23 @@ Process: [Main](../tutorial/application-architecture.md#main-and-renderer-proces
* `segmentStyle` String (optional) - Style of the segments:
* `automatic` - Default. The appearance of the segmented control is
automatically determined based on the type of window in which the control
is displayed and the position within the window.
* `rounded` - The control is displayed using the rounded style.
is displayed and the position within the window. Maps to `NSSegmentStyleAutomatic`.
* `rounded` - The control is displayed using the rounded style. Maps to `NSSegmentStyleRounded`.
* `textured-rounded` - The control is displayed using the textured rounded
style.
* `round-rect` - The control is displayed using the round rect style.
style. Maps to `NSSegmentStyleTexturedRounded`.
* `round-rect` - The control is displayed using the round rect style. Maps to `NSSegmentStyleRoundRect`.
* `textured-square` - The control is displayed using the textured square
style.
* `capsule` - The control is displayed using the capsule style.
* `small-square` - The control is displayed using the small square style.
style. Maps to `NSSegmentStyleTexturedSquare`.
* `capsule` - The control is displayed using the capsule style. Maps to `NSSegmentStyleCapsule`.
* `small-square` - The control is displayed using the small square style. Maps to `NSSegmentStyleSmallSquare`.
* `separated` - The segments in the control are displayed very close to each
other but not touching.
other but not touching. Maps to `NSSegmentStyleSeparated`.
* `mode` String (optional) - The selection mode of the control:
* `single` - Default. One item selected at a time, selecting one deselects the previously selected item.
* `multiple` - Multiple items can be selected at a time.
* `buttons` - Make the segments act as buttons, each segment can be pressed and released but never marked as active.
* `single` - Default. One item selected at a time, selecting one deselects the previously selected item. Maps to `NSSegmentSwitchTrackingSelectOne`.
* `multiple` - Multiple items can be selected at a time. Maps to `NSSegmentSwitchTrackingSelectAny`.
* `buttons` - Make the segments act as buttons, each segment can be pressed and released but never marked as active. Maps to `NSSegmentSwitchTrackingMomentary`.
* `segments` [SegmentedControlSegment[]](structures/segmented-control-segment.md) - An array of segments to place in this control.
* `selectedIndex` Integer (optional) - The index of the currently selected segment, will update automatically with user interaction. When the mode is multiple it will be the last selected item.
* `selectedIndex` Integer (optional) - The index of the currently selected segment, will update automatically with user interaction. When the mode is `multiple` it will be the last selected item.
* `change` Function (optional) - Called when the user selects a new segment.
* `selectedIndex` Integer - The index of the segment the user selected.
* `isSelected` Boolean - Whether as a result of user selection the segment is selected or not.

View File

@@ -8,6 +8,6 @@ Process: [Main](../tutorial/application-architecture.md#main-and-renderer-proces
* `options` Object
* `size` String (optional) - Size of spacer, possible values are:
* `small` - Small space between items.
* `large` - Large space between items.
* `flexible` - Take up all available space.
* `small` - Small space between items. Maps to `NSTouchBarItemIdentifierFixedSpaceSmall`. This is the default.
* `large` - Large space between items. Maps to `NSTouchBarItemIdentifierFixedSpaceLarge`.
* `flexible` - Take up all available space. Maps to `NSTouchBarItemIdentifierFlexibleSpace`.

View File

@@ -222,12 +222,31 @@ Returns `Boolean` - Whether double click events will be ignored.
#### `tray.displayBalloon(options)` _Windows_
* `options` Object
* `icon` ([NativeImage](native-image.md) | String) (optional) -
* `icon` ([NativeImage](native-image.md) | String) (optional) - Icon to use when `iconType` is `custom`.
* `iconType` String (optional) - Can be `none`, `info`, `warning`, `error` or `custom`. Default is `custom`.
* `title` String
* `content` String
* `largeIcon` Boolean (optional) - The large version of the icon should be used. Default is `true`. Maps to [`NIIF_LARGE_ICON`][NIIF_LARGE_ICON].
* `noSound` Boolean (optional) - Do not play the associated sound. Default is `false`. Maps to [`NIIF_NOSOUND`][NIIF_NOSOUND].
* `respectQuietTime` Boolean (optional) - Do not display the balloon notification if the current user is in "quiet time". Default is `false`. Maps to [`NIIF_RESPECT_QUIET_TIME`][NIIF_RESPECT_QUIET_TIME].
Displays a tray balloon.
[NIIF_NOSOUND]: https://docs.microsoft.com/en-us/windows/win32/api/shellapi/ns-shellapi-notifyicondataa#niif_nosound-0x00000010
[NIIF_LARGE_ICON]: https://docs.microsoft.com/en-us/windows/win32/api/shellapi/ns-shellapi-notifyicondataa#niif_large_icon-0x00000020
[NIIF_RESPECT_QUIET_TIME]: https://docs.microsoft.com/en-us/windows/win32/api/shellapi/ns-shellapi-notifyicondataa#niif_respect_quiet_time-0x00000080
#### `tray.removeBalloon()` _Windows_
Removes a tray balloon.
#### `tray.focus()` _Windows_
Returns focus to the taskbar notification area.
Notification area icons should use this message when they have completed their UI operation.
For example, if the icon displays a shortcut menu, but the user presses ESC to cancel it,
use `tray.focus()` to return focus to the notification area.
#### `tray.popUpContextMenu([menu, position])` _macOS_ _Windows_
* `menu` Menu (optional)

View File

@@ -143,7 +143,7 @@ Returns:
* `frameName` String
* `disposition` String - Can be `default`, `foreground-tab`, `background-tab`,
`new-window`, `save-to-disk` and `other`.
* `options` Object - The options which will be used for creating the new
* `options` BrowserWindowConstructorOptions - The options which will be used for creating the new
[`BrowserWindow`](browser-window.md).
* `additionalFeatures` String[] - The non-standard features (features not handled
by Chromium or Electron) given to `window.open()`.
@@ -481,7 +481,7 @@ Returns:
* `requestId` Integer
* `activeMatchOrdinal` Integer - Position of the active match.
* `matches` Integer - Number of Matches.
* `selectionArea` Object - Coordinates of first match region.
* `selectionArea` Rectangle - Coordinates of first match region.
* `finalUpdate` Boolean
Emitted when a result is available for
@@ -669,10 +669,10 @@ Emitted when the devtools window instructs the webContents to reload
Returns:
* `event` Event
* `webPreferences` Object - The web preferences that will be used by the guest
* `webPreferences` WebPreferences - The web preferences that will be used by the guest
page. This object can be modified to adjust the preferences for the guest
page.
* `params` Object - The other `<webview>` parameters such as the `src` URL.
* `params` Record<string, string> - The other `<webview>` parameters such as the `src` URL.
This object can be modified to adjust the parameters of the guest page.
Emitted when a `<webview>`'s web contents is being attached to this web
@@ -842,7 +842,7 @@ webContents.loadURL('https://github.com', options)
* `filePath` String
* `options` Object (optional)
* `query` Object (optional) - Passed to `url.format()`.
* `query` Record<String, String> (optional) - Passed to `url.format()`.
* `search` String (optional) - Passed to `url.format()`.
* `hash` String (optional) - Passed to `url.format()`.
@@ -1264,16 +1264,14 @@ Returns [`PrinterInfo[]`](structures/printer-info.md).
* `dpi` Object (optional)
* `horizontal` Number (optional) - The horizontal dpi.
* `vertical` Number (optional) - The vertical dpi.
* `header` String (optional) - String to be printed as page header.
* `footer` String (optional) - String to be printed as page footer.
* `callback` Function (optional)
* `success` Boolean - Indicates success of the print call.
* `failureReason` String - Called back if the print fails; can be `cancelled` or `failed`.
Prints window's web page. When `silent` is set to `true`, Electron will pick
the system's default printer if `deviceName` is empty and the default settings
for printing.
Calling `window.print()` in web page is equivalent to calling
`webContents.print({ silent: false, printBackground: false, deviceName: '' })`.
the system's default printer if `deviceName` is empty and the default settings for printing.
Use `page-break-before: always;` CSS style to force to print to a new page.
@@ -1563,13 +1561,6 @@ Disable device emulation enabled by `webContents.enableDeviceEmulation`.
#### `contents.sendInputEvent(inputEvent)`
* `inputEvent` [MouseInputEvent](structures/mouse-input-event.md) | [MouseWheelInputEvent](structures/mouse-wheel-input-event.md) | [KeyboardInputEvent](structures/keyboard-input-event.md)
* `type` String (**required**) - The type of the event, can be `mouseDown`,
`mouseUp`, `mouseEnter`, `mouseLeave`, `contextMenu`, `mouseWheel`,
`mouseMove`, `keyDown`, `keyUp` or `char`.
* `modifiers` String[] - An array of modifiers of the event, can
include `shift`, `control`, `alt`, `meta`, `isKeypad`, `isAutoRepeat`,
`leftButtonDown`, `middleButtonDown`, `rightButtonDown`, `capsLock`,
`numLock`, `left`, `right`.
Sends an input `event` to the page.
**Note:** The [`BrowserWindow`](browser-window.md) containing the contents needs to be focused for

View File

@@ -593,7 +593,7 @@ examples.
### `<webview>.sendInputEvent(event)`
* `event` Object
* `event` [MouseInputEvent](structures/mouse-input-event.md) | [MouseWheelInputEvent](structures/mouse-wheel-input-event.md) | [KeyboardInputEvent](structures/keyboard-input-event.md)
Returns `Promise<void>`
@@ -767,7 +767,7 @@ Returns:
* `requestId` Integer
* `activeMatchOrdinal` Integer - Position of the active match.
* `matches` Integer - Number of Matches.
* `selectionArea` Object - Coordinates of first match region.
* `selectionArea` Rectangle - Coordinates of first match region.
* `finalUpdate` Boolean
Fired when a result is available for
@@ -791,7 +791,7 @@ Returns:
* `frameName` String
* `disposition` String - Can be `default`, `foreground-tab`, `background-tab`,
`new-window`, `save-to-disk` and `other`.
* `options` Object - The options which should be used for creating the new
* `options` BrowserWindowConstructorOptions - The options which should be used for creating the new
[`BrowserWindow`](browser-window.md).
Fired when the guest page attempts to open a new browser window.
@@ -872,7 +872,7 @@ webview.addEventListener('close', () => {
Returns:
* `channel` String
* `args` Array
* `args` any[]
Fired when the guest page has sent an asynchronous message to embedder page.

View File

@@ -113,3 +113,10 @@ This can happen during build, when Debugging Tools for Windows has been installe
### ImportError: No module named win32file
Make sure you have installed `pywin32` with `pip install pywin32`.
### Build Scripts Hang Until Keypress
This bug is a "feature" of Windows' command prompt. It happens when clicking inside the prompt window with
`QuickEdit` enabled and is intended to allow selecting and copying output text easily.
Since each accidental click will pause the build process, you might want to disable this
feature in the command prompt properties.

View File

@@ -48,3 +48,12 @@ would run `npm run test -- -g ipc`.
1. Push the Windows key and search for _Manage optional features_.
1. Click _Add a feature_.
1. Select _Japanese Supplemental Fonts_ and click _Install_.
Some tests which rely on precise pixel measurements may not work correctly on
devices with Hi-DPI screen settings due to floating point precision errors.
To run these tests correctly, make sure the device is set to 100% scaling.
To configure display scaling:
1. Push the Windows key and search for _Display settings_.
1. Under _Scale and layout_, make sure that the device is set to 100%.

View File

@@ -0,0 +1,20 @@
// Retrieve information about screen size, displays, cursor position, etc.
//
// For more info, see:
// https://electronjs.org/docs/api/screen
const { app, BrowserWindow } = require('electron')
let mainWindow = null
app.on('ready', () => {
// We cannot require the screen module until the app is ready.
const { screen } = require('electron')
// Create a window that fills the screen's available work area.
const primaryDisplay = screen.getPrimaryDisplay()
const { width, height } = primaryDisplay.workAreaSize
mainWindow = new BrowserWindow({ width, height })
mainWindow.loadURL('https://electronjs.org')
})

View File

@@ -34,6 +34,7 @@ auto_filenames = {
"docs/api/menu.md",
"docs/api/modernization",
"docs/api/native-image.md",
"docs/api/native-theme.md",
"docs/api/net-log.md",
"docs/api/net.md",
"docs/api/notification.md",
@@ -76,6 +77,7 @@ auto_filenames = {
"docs/api/structures/desktop-capturer-source.md",
"docs/api/structures/display.md",
"docs/api/structures/event.md",
"docs/api/structures/extension-info.md",
"docs/api/structures/file-filter.md",
"docs/api/structures/file-path-with-headers.md",
"docs/api/structures/gpu-feature-status.md",
@@ -130,6 +132,7 @@ auto_filenames = {
"lib/common/api/deprecate.ts",
"lib/common/api/module-list.js",
"lib/common/api/native-image.js",
"lib/common/api/native-theme.ts",
"lib/common/api/shell.js",
"lib/common/buffer-utils.ts",
"lib/common/clipboard-utils.ts",
@@ -140,7 +143,7 @@ auto_filenames = {
"lib/common/web-view-methods.ts",
"lib/renderer/api/crash-reporter.js",
"lib/renderer/api/desktop-capturer.ts",
"lib/renderer/api/ipc-renderer.js",
"lib/renderer/api/ipc-renderer.ts",
"lib/renderer/api/remote.js",
"lib/renderer/api/web-frame.ts",
"lib/renderer/callbacks-registry.ts",
@@ -228,7 +231,7 @@ auto_filenames = {
"lib/browser/api/protocol.ts",
"lib/browser/api/screen.ts",
"lib/browser/api/session.js",
"lib/browser/api/system-preferences.js",
"lib/browser/api/system-preferences.ts",
"lib/browser/api/top-level-window.js",
"lib/browser/api/touch-bar.js",
"lib/browser/api/tray.js",
@@ -261,6 +264,7 @@ auto_filenames = {
"lib/common/api/exports/electron.js",
"lib/common/api/module-list.js",
"lib/common/api/native-image.js",
"lib/common/api/native-theme.ts",
"lib/common/api/shell.js",
"lib/common/buffer-utils.ts",
"lib/common/clipboard-utils.ts",
@@ -286,6 +290,7 @@ auto_filenames = {
"lib/common/api/exports/electron.js",
"lib/common/api/module-list.js",
"lib/common/api/native-image.js",
"lib/common/api/native-theme.ts",
"lib/common/api/shell.js",
"lib/common/buffer-utils.ts",
"lib/common/clipboard-utils.ts",
@@ -299,7 +304,7 @@ auto_filenames = {
"lib/renderer/api/crash-reporter.js",
"lib/renderer/api/desktop-capturer.ts",
"lib/renderer/api/exports/electron.js",
"lib/renderer/api/ipc-renderer.js",
"lib/renderer/api/ipc-renderer.ts",
"lib/renderer/api/module-list.js",
"lib/renderer/api/remote.js",
"lib/renderer/api/web-frame.ts",
@@ -336,6 +341,7 @@ auto_filenames = {
"lib/common/api/exports/electron.js",
"lib/common/api/module-list.js",
"lib/common/api/native-image.js",
"lib/common/api/native-theme.ts",
"lib/common/api/shell.js",
"lib/common/buffer-utils.ts",
"lib/common/clipboard-utils.ts",
@@ -348,7 +354,7 @@ auto_filenames = {
"lib/renderer/api/crash-reporter.js",
"lib/renderer/api/desktop-capturer.ts",
"lib/renderer/api/exports/electron.js",
"lib/renderer/api/ipc-renderer.js",
"lib/renderer/api/ipc-renderer.ts",
"lib/renderer/api/module-list.js",
"lib/renderer/api/remote.js",
"lib/renderer/api/web-frame.ts",

View File

@@ -75,8 +75,6 @@ filenames = {
"shell/browser/api/atom_api_power_monitor.h",
"shell/browser/api/atom_api_power_save_blocker.cc",
"shell/browser/api/atom_api_power_save_blocker.h",
"shell/browser/api/atom_api_protocol.cc",
"shell/browser/api/atom_api_protocol.h",
"shell/browser/api/atom_api_protocol_ns.cc",
"shell/browser/api/atom_api_protocol_ns.h",
"shell/browser/api/atom_api_screen.cc",
@@ -91,8 +89,6 @@ filenames = {
"shell/browser/api/atom_api_top_level_window.h",
"shell/browser/api/atom_api_tray.cc",
"shell/browser/api/atom_api_tray.h",
"shell/browser/api/atom_api_url_request.cc",
"shell/browser/api/atom_api_url_request.h",
"shell/browser/api/atom_api_url_request_ns.cc",
"shell/browser/api/atom_api_url_request_ns.h",
"shell/browser/api/atom_api_view.cc",
@@ -103,8 +99,6 @@ filenames = {
"shell/browser/api/atom_api_web_contents_mac.mm",
"shell/browser/api/atom_api_web_contents_view.cc",
"shell/browser/api/atom_api_web_contents_view.h",
"shell/browser/api/atom_api_web_request.cc",
"shell/browser/api/atom_api_web_request.h",
"shell/browser/api/atom_api_web_request_ns.cc",
"shell/browser/api/atom_api_web_request_ns.h",
"shell/browser/api/atom_api_web_view_manager.cc",
@@ -116,8 +110,6 @@ filenames = {
"shell/browser/api/event.h",
"shell/browser/api/event_emitter.cc",
"shell/browser/api/event_emitter.h",
"shell/browser/api/stream_subscriber.cc",
"shell/browser/api/stream_subscriber.h",
"shell/browser/api/trackable_object.cc",
"shell/browser/api/trackable_object.h",
"shell/browser/api/frame_subscriber.cc",
@@ -176,8 +168,6 @@ filenames = {
"shell/browser/common_web_contents_delegate.h",
"shell/browser/cookie_change_notifier.cc",
"shell/browser/cookie_change_notifier.h",
"shell/browser/io_thread.cc",
"shell/browser/io_thread.h",
"shell/browser/javascript_environment.cc",
"shell/browser/javascript_environment.h",
"shell/browser/lib/bluetooth_chooser.cc",
@@ -185,8 +175,6 @@ filenames = {
"shell/browser/lib/power_observer.h",
"shell/browser/lib/power_observer_linux.h",
"shell/browser/lib/power_observer_linux.cc",
"shell/browser/loader/layered_resource_handler.cc",
"shell/browser/loader/layered_resource_handler.h",
"shell/browser/login_handler.cc",
"shell/browser/login_handler.h",
"shell/browser/mac/atom_application.h",
@@ -223,58 +211,26 @@ filenames = {
"shell/browser/media/media_device_id_salt.h",
"shell/browser/media/media_stream_devices_controller.cc",
"shell/browser/media/media_stream_devices_controller.h",
"shell/browser/net/about_protocol_handler.cc",
"shell/browser/net/about_protocol_handler.h",
"shell/browser/net/asar/asar_protocol_handler.cc",
"shell/browser/net/asar/asar_protocol_handler.h",
"shell/browser/net/asar/asar_url_loader.cc",
"shell/browser/net/asar/asar_url_loader.h",
"shell/browser/net/asar/url_request_asar_job.cc",
"shell/browser/net/asar/url_request_asar_job.h",
"shell/browser/net/atom_cert_verifier.cc",
"shell/browser/net/atom_cert_verifier.h",
"shell/browser/net/atom_network_delegate.cc",
"shell/browser/net/atom_network_delegate.h",
"shell/browser/net/atom_url_loader_factory.cc",
"shell/browser/net/atom_url_loader_factory.h",
"shell/browser/net/atom_url_request.cc",
"shell/browser/net/atom_url_request.h",
"shell/browser/net/atom_url_request_job_factory.cc",
"shell/browser/net/atom_url_request_job_factory.h",
"shell/browser/net/http_protocol_handler.cc",
"shell/browser/net/http_protocol_handler.h",
"shell/browser/net/cert_verifier_client.cc",
"shell/browser/net/cert_verifier_client.h",
"shell/browser/net/proxying_url_loader_factory.cc",
"shell/browser/net/proxying_url_loader_factory.h",
"shell/browser/net/js_asker.cc",
"shell/browser/net/js_asker.h",
"shell/browser/net/network_context_service_factory.cc",
"shell/browser/net/network_context_service_factory.h",
"shell/browser/net/network_context_service.cc",
"shell/browser/net/network_context_service.h",
"shell/browser/net/node_stream_loader.cc",
"shell/browser/net/node_stream_loader.h",
"shell/browser/net/require_ct_delegate.cc",
"shell/browser/net/require_ct_delegate.h",
"shell/browser/net/resolve_proxy_helper.cc",
"shell/browser/net/resolve_proxy_helper.h",
"shell/browser/net/system_network_context_manager.cc",
"shell/browser/net/system_network_context_manager.h",
"shell/browser/net/url_pipe_loader.cc",
"shell/browser/net/url_pipe_loader.h",
"shell/browser/net/url_request_about_job.cc",
"shell/browser/net/url_request_about_job.h",
"shell/browser/net/url_request_async_asar_job.cc",
"shell/browser/net/url_request_async_asar_job.h",
"shell/browser/net/url_request_string_job.cc",
"shell/browser/net/url_request_string_job.h",
"shell/browser/net/url_request_buffer_job.cc",
"shell/browser/net/url_request_buffer_job.h",
"shell/browser/net/url_request_context_getter.cc",
"shell/browser/net/url_request_context_getter.h",
"shell/browser/net/url_request_fetch_job.cc",
"shell/browser/net/url_request_fetch_job.h",
"shell/browser/net/url_request_stream_job.cc",
"shell/browser/net/url_request_stream_job.h",
"shell/browser/notifications/linux/libnotify_notification.cc",
"shell/browser/notifications/linux/libnotify_notification.h",
"shell/browser/notifications/linux/notification_presenter_linux.cc",
@@ -463,6 +419,8 @@ filenames = {
"shell/common/api/atom_api_native_image.cc",
"shell/common/api/atom_api_native_image.h",
"shell/common/api/atom_api_native_image_mac.mm",
"shell/common/api/atom_api_native_theme.cc",
"shell/common/api/atom_api_native_theme.h",
"shell/common/api/atom_api_shell.cc",
"shell/common/api/atom_api_v8_util.cc",
"shell/common/api/electron_bindings.cc",
@@ -471,6 +429,7 @@ filenames = {
"shell/common/api/event_emitter_caller.cc",
"shell/common/api/event_emitter_caller.h",
"shell/common/api/features.cc",
"shell/common/api/gin_utils.h",
"shell/common/api/locker.cc",
"shell/common/api/locker.h",
"shell/common/api/object_life_monitor.cc",
@@ -508,6 +467,21 @@ filenames = {
"shell/common/crash_reporter/linux/crash_dump_handler.h",
"shell/common/crash_reporter/win/crash_service_main.cc",
"shell/common/crash_reporter/win/crash_service_main.h",
"shell/common/gin_converters/callback_converter_gin_adapter.h",
"shell/common/gin_converters/file_dialog_converter.cc",
"shell/common/gin_converters/file_dialog_converter.h",
"shell/common/gin_converters/file_path_converter.h",
"shell/common/gin_converters/gurl_converter.h",
"shell/common/gin_converters/image_converter.cc",
"shell/common/gin_converters/image_converter.h",
"shell/common/gin_converters/message_box_converter.cc",
"shell/common/gin_converters/message_box_converter.h",
"shell/common/gin_converters/native_window_converter.h",
"shell/common/gin_converters/net_converter.cc",
"shell/common/gin_converters/net_converter.h",
"shell/common/gin_converters/std_converter.h",
"shell/common/gin_converters/string16_converter.h",
"shell/common/gin_converters/value_converter_gin_adapter.h",
"shell/common/gin_util.h",
"shell/common/heap_snapshot.cc",
"shell/common/heap_snapshot.h",
@@ -528,18 +502,14 @@ filenames = {
"shell/common/native_mate_converters/callback.h",
"shell/common/native_mate_converters/content_converter.cc",
"shell/common/native_mate_converters/content_converter.h",
"shell/common/native_mate_converters/file_dialog_converter.cc",
"shell/common/native_mate_converters/file_dialog_converter.h",
"shell/common/native_mate_converters/message_box_converter.cc",
"shell/common/native_mate_converters/message_box_converter.h",
"shell/common/native_mate_converters/file_path_converter.h",
"shell/common/native_mate_converters/gfx_converter.cc",
"shell/common/native_mate_converters/gfx_converter.h",
"shell/common/native_mate_converters/gurl_converter.h",
"shell/common/native_mate_converters/image_converter.cc",
"shell/common/native_mate_converters/image_converter.h",
"shell/common/native_mate_converters/map_converter.h",
"shell/common/native_mate_converters/net_converter.cc",
"shell/common/native_mate_converters/native_window_converter.h",
"shell/common/native_mate_converters/net_converter.h",
"shell/common/native_mate_converters/network_converter.cc",
"shell/common/native_mate_converters/network_converter.h",

View File

@@ -4,15 +4,29 @@ const { app, BrowserWindow, deprecate } = require('electron')
const binding = process.electronBinding('dialog')
const v8Util = process.electronBinding('v8_util')
const fileDialogProperties = {
const DialogType = {
OPEN: 'OPEN',
SAVE: 'SAVE'
}
const saveFileDialogProperties = {
createDirectory: 1 << 0,
showHiddenFiles: 1 << 1,
treatPackageAsDirectory: 1 << 2,
showOverwriteConfirmation: 1 << 3,
dontAddToRecent: 1 << 4
}
const openFileDialogProperties = {
openFile: 1 << 0,
openDirectory: 1 << 1,
multiSelections: 1 << 2,
createDirectory: 1 << 3,
createDirectory: 1 << 3, // macOS
showHiddenFiles: 1 << 4,
promptToCreate: 1 << 5,
noResolveAliases: 1 << 6,
treatPackageAsDirectory: 1 << 7
promptToCreate: 1 << 5, // Windows
noResolveAliases: 1 << 6, // macOS
treatPackageAsDirectory: 1 << 7, // macOS
dontAddToRecent: 1 << 8 // Windows
}
const normalizeAccessKey = (text) => {
@@ -44,6 +58,18 @@ const checkAppInitialized = function () {
}
}
const setupDialogProperties = (type, properties) => {
const dialogPropertiesTypes = (type === DialogType.OPEN) ? openFileDialogProperties : saveFileDialogProperties
let dialogProperties = 0
for (const prop in dialogPropertiesTypes) {
if (properties.includes(prop)) {
dialogProperties |= dialogPropertiesTypes[prop]
}
}
return dialogProperties
}
const saveDialog = (sync, window, options) => {
checkAppInitialized()
@@ -58,6 +84,7 @@ const saveDialog = (sync, window, options) => {
buttonLabel = '',
defaultPath = '',
filters = [],
properties = [],
title = '',
message = '',
securityScopedBookmarks = false,
@@ -72,6 +99,8 @@ const saveDialog = (sync, window, options) => {
if (typeof nameFieldLabel !== 'string') throw new TypeError('Name field label must be a string')
const settings = { buttonLabel, defaultPath, filters, title, message, securityScopedBookmarks, nameFieldLabel, showsTagField, window }
settings.properties = setupDialogProperties(DialogType.SAVE, properties)
return (sync) ? binding.showSaveDialogSync(settings) : binding.showSaveDialog(settings)
}
@@ -102,20 +131,13 @@ const openDialog = (sync, window, options) => {
if (!Array.isArray(properties)) throw new TypeError('Properties must be an array')
let dialogProperties = 0
for (const prop in fileDialogProperties) {
if (properties.includes(prop)) {
dialogProperties |= fileDialogProperties[prop]
}
}
if (typeof title !== 'string') throw new TypeError('Title must be a string')
if (typeof buttonLabel !== 'string') throw new TypeError('Button label must be a string')
if (typeof defaultPath !== 'string') throw new TypeError('Default path must be a string')
if (typeof message !== 'string') throw new TypeError('Message must be a string')
const settings = { title, buttonLabel, defaultPath, filters, message, securityScopedBookmarks, window }
settings.properties = dialogProperties
settings.properties = setupDialogProperties(DialogType.OPEN, properties)
return (sync) ? binding.showOpenDialogSync(settings) : binding.showOpenDialog(settings)
}

View File

@@ -178,7 +178,7 @@ const roles = {
{ role: 'services' },
{ type: 'separator' },
{ role: 'hide' },
{ role: 'hideothers' },
{ role: 'hideOthers' },
{ role: 'unhide' },
{ type: 'separator' },
{ role: 'quit' }
@@ -209,8 +209,8 @@ const roles = {
{
label: 'Speech',
submenu: [
{ role: 'startspeaking' },
{ role: 'stopspeaking' }
{ role: 'startSpeaking' },
{ role: 'stopSpeaking' }
]
}
] : [
@@ -225,12 +225,12 @@ const roles = {
label: 'View',
submenu: [
{ role: 'reload' },
{ role: 'forcereload' },
{ role: 'toggledevtools' },
{ role: 'forceReload' },
{ role: 'toggleDevTools' },
{ type: 'separator' },
{ role: 'resetzoom' },
{ role: 'zoomin' },
{ role: 'zoomout' },
{ role: 'resetZoom' },
{ role: 'zoomIn' },
{ role: 'zoomOut' },
{ type: 'separator' },
{ role: 'togglefullscreen' }
]

View File

@@ -1,15 +0,0 @@
'use strict'
const { EventEmitter } = require('events')
const { deprecate } = require('electron')
const { systemPreferences, SystemPreferences } = process.electronBinding('system_preferences')
// SystemPreferences is an EventEmitter.
Object.setPrototypeOf(SystemPreferences.prototype, EventEmitter.prototype)
EventEmitter.call(systemPreferences)
if ('appLevelAppearance' in systemPreferences) {
deprecate.fnToProperty(SystemPreferences.prototype, 'appLevelAppearance', '_getAppLevelAppearance', '_setAppLevelAppearance')
}
module.exports = systemPreferences

View File

@@ -0,0 +1,42 @@
import { EventEmitter } from 'events'
import { deprecate } from 'electron'
const { systemPreferences, SystemPreferences } = process.electronBinding('system_preferences')
// SystemPreferences is an EventEmitter.
Object.setPrototypeOf(SystemPreferences.prototype, EventEmitter.prototype)
EventEmitter.call(systemPreferences)
if ('appLevelAppearance' in systemPreferences) {
deprecate.fnToProperty(
SystemPreferences.prototype,
'appLevelAppearance',
'_getAppLevelAppearance',
'_setAppLevelAppearance'
)
}
if ('effectiveAppearance' in systemPreferences) {
deprecate.fnToProperty(
SystemPreferences.prototype,
'effectiveAppearance',
'_getEffectiveAppearance'
)
}
SystemPreferences.prototype.isDarkMode = deprecate.moveAPI(
SystemPreferences.prototype.isDarkMode,
'systemPreferences.isDarkMode()',
'nativeTheme.shouldUseDarkColors'
)
SystemPreferences.prototype.isInvertedColorScheme = deprecate.moveAPI(
SystemPreferences.prototype.isInvertedColorScheme,
'systemPreferences.isInvertedColorScheme()',
'nativeTheme.shouldUseInvertedColorScheme'
)
SystemPreferences.prototype.isHighContrastColorScheme = deprecate.moveAPI(
SystemPreferences.prototype.isHighContrastColorScheme,
'systemPreferences.isHighContrastColorScheme()',
'nativeTheme.shouldUseHighContrastColors'
)
module.exports = systemPreferences

View File

@@ -1,5 +1,9 @@
'use strict'
if (process.electronBinding('features').isExtensionsEnabled()) {
throw new Error('Attempted to load JS chrome-extension polyfill with //extensions support enabled')
}
const { app, webContents, BrowserWindow } = require('electron')
const { getAllWebContents } = process.electronBinding('web_contents')
const ipcMainUtils = require('@electron/internal/browser/ipc-main-internal-utils')
@@ -427,11 +431,7 @@ const chromeExtensionHandler = function (request, callback) {
}
app.on('session-created', function (ses) {
ses.protocol.registerBufferProtocol('chrome-extension', chromeExtensionHandler, function (error) {
if (error) {
console.error(`Unable to register chrome-extension protocol: ${error}`)
}
})
ses.protocol.registerBufferProtocol('chrome-extension', chromeExtensionHandler)
})
// The persistent path of "DevTools Extensions" preference file.

View File

@@ -40,9 +40,9 @@ const getEditMenuItems = function (): Electron.MenuItemConstructorOptions[] {
{ role: 'cut' },
{ role: 'copy' },
{ role: 'paste' },
{ role: 'pasteandmatchstyle' },
{ role: 'pasteAndMatchStyle' },
{ role: 'delete' },
{ role: 'selectall' }
{ role: 'selectAll' }
]
}

View File

@@ -34,7 +34,7 @@ const mergeOptions = function (child, parent, visited) {
if (key in child && key !== 'webPreferences') continue
const value = parent[key]
if (typeof value === 'object') {
if (typeof value === 'object' && !Array.isArray(value)) {
child[key] = mergeOptions(child[key] || {}, value, visited)
} else {
child[key] = value

View File

@@ -152,7 +152,9 @@ app._setDefaultAppPaths(packagePath)
require('@electron/internal/browser/devtools')
// Load the chrome extension support.
require('@electron/internal/browser/chrome-extension')
if (!process.electronBinding('features').isExtensionsEnabled()) {
require('@electron/internal/browser/chrome-extension')
}
// Load protocol module to ensure it is populated on app ready
require('@electron/internal/browser/api/protocol')

View File

@@ -9,7 +9,6 @@ const eventBinding = process.electronBinding('event')
const clipboard = process.electronBinding('clipboard')
const features = process.electronBinding('features')
const { getContentScripts } = require('@electron/internal/browser/chrome-extension')
const { crashReporterInit } = require('@electron/internal/browser/crash-reporter-init')
const { ipcMainInternal } = require('@electron/internal/browser/ipc-main-internal')
const ipcMainUtils = require('@electron/internal/browser/ipc-main-internal-utils')
@@ -526,13 +525,24 @@ const getPreloadScript = async function (preloadPath) {
return { preloadPath, preloadSrc, preloadError }
}
ipcMainUtils.handle('ELECTRON_GET_CONTENT_SCRIPTS', () => getContentScripts())
if (process.electronBinding('features').isExtensionsEnabled()) {
ipcMainUtils.handle('ELECTRON_GET_CONTENT_SCRIPTS', () => [])
} else {
const { getContentScripts } = require('@electron/internal/browser/chrome-extension')
ipcMainUtils.handle('ELECTRON_GET_CONTENT_SCRIPTS', () => getContentScripts())
}
ipcMainUtils.handle('ELECTRON_BROWSER_SANDBOX_LOAD', async function (event) {
const preloadPaths = event.sender._getPreloadPaths()
let contentScripts = []
if (!process.electronBinding('features').isExtensionsEnabled()) {
const { getContentScripts } = require('@electron/internal/browser/chrome-extension')
contentScripts = getContentScripts()
}
return {
contentScripts: getContentScripts(),
contentScripts,
preloadScripts: await Promise.all(preloadPaths.map(path => getPreloadScript(path))),
isRemoteModuleEnabled: isRemoteModuleEnabled(event.sender),
isWebViewTagEnabled: guestViewManager.isWebViewTagEnabled(event.sender),

View File

@@ -51,7 +51,15 @@ const deprecate: ElectronInternal.DeprecationUtil = {
const warn = warnOnce(`${fn.name} function`, `${newName} function`)
return function (this: any) {
warn()
fn.apply(this, arguments)
return fn.apply(this, arguments)
}
},
moveAPI: (fn: Function, oldUsage: string, newUsage: string) => {
const warn = warnOnce(oldUsage, newUsage)
return function (this: any) {
warn()
return fn.apply(this, arguments)
}
},
@@ -69,7 +77,7 @@ const deprecate: ElectronInternal.DeprecationUtil = {
},
// deprecate a getter/setter function pair in favor of a property
fnToProperty: (prototype: any, prop: string, getter: string, setter: string) => {
fnToProperty: (prototype: any, prop: string, getter: string, setter?: string) => {
const withWarnOnce = function (obj: any, key: any, oldName: string, newName: string) {
const warn = warnOnce(oldName, newName)
const method = obj[key]
@@ -80,7 +88,9 @@ const deprecate: ElectronInternal.DeprecationUtil = {
}
prototype[getter.substr(1)] = withWarnOnce(prototype, getter, `${getter.substr(1)} function`, `${prop} property`)
prototype[setter.substr(1)] = withWarnOnce(prototype, setter, `${setter.substr(1)} function`, `${prop} property`)
if (setter) {
prototype[setter.substr(1)] = withWarnOnce(prototype, setter, `${setter.substr(1)} function`, `${prop} property`)
}
},
// remove a property with no replacement

View File

@@ -4,6 +4,7 @@
module.exports = [
{ name: 'clipboard', loader: () => require('./clipboard') },
{ name: 'nativeImage', loader: () => require('./native-image') },
{ name: 'nativeTheme', loader: () => require('./native-theme') },
{ name: 'shell', loader: () => require('./shell') },
// The internal modules, invisible unless you know their names.
{ name: 'deprecate', loader: () => require('./deprecate'), private: true }

View File

@@ -0,0 +1,8 @@
import { EventEmitter } from 'events'
const { NativeTheme, nativeTheme } = process.electronBinding('native_theme')
Object.setPrototypeOf(NativeTheme.prototype, EventEmitter.prototype)
EventEmitter.call(nativeTheme as any)
module.exports = nativeTheme

View File

@@ -1,10 +1,8 @@
'use strict'
const { ipc } = process.electronBinding('ipc')
const v8Util = process.electronBinding('v8_util')
// Created by init.js.
const ipcRenderer = v8Util.getHiddenValue(global, 'ipc')
const ipcRenderer = v8Util.getHiddenValue<Electron.IpcRenderer>(global, 'ipc')
const internal = false
ipcRenderer.send = function (channel, ...args) {
@@ -23,10 +21,6 @@ ipcRenderer.sendTo = function (webContentsId, channel, ...args) {
return ipc.sendTo(internal, false, webContentsId, channel, args)
}
ipcRenderer.sendToAll = function (webContentsId, channel, ...args) {
return ipc.sendTo(internal, true, webContentsId, channel, args)
}
ipcRenderer.invoke = function (channel, ...args) {
return ipc.invoke(channel, args).then(({ error, result }) => {
if (error) { throw new Error(`Error invoking remote method '${channel}': ${error}`) }
@@ -34,4 +28,4 @@ ipcRenderer.invoke = function (channel, ...args) {
})
}
module.exports = ipcRenderer
export default ipcRenderer

View File

@@ -67,6 +67,10 @@ class Port {
// Inject chrome API to the |context|
export function injectTo (extensionId: string, context: any) {
if (process.electronBinding('features').isExtensionsEnabled()) {
throw new Error('Attempted to load JS chrome-extension polyfill with //extensions support enabled')
}
const chrome = context.chrome = context.chrome || {}
ipcRendererInternal.on(`CHROME_RUNTIME_ONCONNECT_${extensionId}`, (

View File

@@ -1,17 +1,16 @@
import { Event } from '@electron/internal/renderer/extensions/event'
import { IpcMainEvent } from 'electron'
const { ipcRendererInternal } = require('@electron/internal/renderer/ipc-renderer-internal')
import { ipcRendererInternal } from '@electron/internal/renderer/ipc-renderer-internal'
class WebNavigation {
private onBeforeNavigate = new Event()
private onCompleted = new Event()
constructor () {
ipcRendererInternal.on('CHROME_WEBNAVIGATION_ONBEFORENAVIGATE', (event: IpcMainEvent, details: any) => {
ipcRendererInternal.on('CHROME_WEBNAVIGATION_ONBEFORENAVIGATE', (event: Electron.IpcRendererEvent, details: any) => {
this.onBeforeNavigate.emit(details)
})
ipcRendererInternal.on('CHROME_WEBNAVIGATION_ONCOMPLETED', (event: IpcMainEvent, details: any) => {
ipcRendererInternal.on('CHROME_WEBNAVIGATION_ONCOMPLETED', (event: Electron.IpcRendererEvent, details: any) => {
this.onCompleted.emit(details)
})
}

View File

@@ -48,7 +48,6 @@ v8Util.setHiddenValue(global, 'ipcNative', {
onMessage (internal: boolean, channel: string, args: any[], senderId: number) {
const sender = internal ? ipcInternalEmitter : ipcEmitter
sender.emit(channel, { sender, senderId }, ...args)
process.activateUvLoop()
}
})
@@ -101,7 +100,9 @@ switch (window.location.protocol) {
}
case 'chrome-extension:': {
// Inject the chrome.* APIs that chrome extensions require
require('@electron/internal/renderer/chrome-api').injectTo(window.location.hostname, window)
if (!process.electronBinding('features').isExtensionsEnabled()) {
require('@electron/internal/renderer/chrome-api').injectTo(window.location.hostname, window)
}
break
}
case 'chrome:':
@@ -112,8 +113,10 @@ switch (window.location.protocol) {
windowSetup(guestInstanceId, openerId, isHiddenPage, usesNativeWindowOpen)
// Inject content scripts.
const contentScripts = ipcRendererUtils.invokeSync('ELECTRON_GET_CONTENT_SCRIPTS') as Electron.ContentScriptEntry[]
require('@electron/internal/renderer/content-scripts-injector')(contentScripts)
if (!process.electronBinding('features').isExtensionsEnabled()) {
const contentScripts = ipcRendererUtils.invokeSync('ELECTRON_GET_CONTENT_SCRIPTS') as Electron.ContentScriptEntry[]
require('@electron/internal/renderer/content-scripts-injector')(contentScripts)
}
}
}

View File

@@ -1,22 +1,22 @@
const binding = process.electronBinding('ipc')
const { ipc } = process.electronBinding('ipc')
const v8Util = process.electronBinding('v8_util')
// Created by init.js.
export const ipcRendererInternal: Electron.IpcRendererInternal = v8Util.getHiddenValue(global, 'ipc-internal')
export const ipcRendererInternal = v8Util.getHiddenValue<Electron.IpcRendererInternal>(global, 'ipc-internal')
const internal = true
ipcRendererInternal.send = function (channel, ...args) {
return binding.ipc.send(internal, channel, args)
return ipc.send(internal, channel, args)
}
ipcRendererInternal.sendSync = function (channel, ...args) {
return binding.ipc.sendSync(internal, channel, args)[0]
return ipc.sendSync(internal, channel, args)[0]
}
ipcRendererInternal.sendTo = function (webContentsId, channel, ...args) {
return binding.ipc.sendTo(internal, false, webContentsId, channel, args)
return ipc.sendTo(internal, false, webContentsId, channel, args)
}
ipcRendererInternal.sendToAll = function (webContentsId, channel, ...args) {
return binding.ipc.sendTo(internal, true, webContentsId, channel, args)
return ipc.sendTo(internal, true, webContentsId, channel, args)
}

View File

@@ -11,10 +11,10 @@ const v8Util = process.electronBinding('v8_util')
// Expose Buffer shim as a hidden value. This is used by C++ code to
// deserialize Buffer instances sent from browser process.
v8Util.setHiddenValue(global, 'Buffer', Buffer)
// The `lib/renderer/api/ipc-renderer.js` module looks for the ipc object in the
// The `lib/renderer/api/ipc-renderer.ts` module looks for the ipc object in the
// "ipc" hidden value
v8Util.setHiddenValue(global, 'ipc', new EventEmitter())
// The `lib/renderer/ipc-renderer-internal.js` module looks for the ipc object in the
// The `lib/renderer/ipc-renderer-internal.ts` module looks for the ipc object in the
// "ipc-internal" hidden value
v8Util.setHiddenValue(global, 'ipc-internal', new EventEmitter())
// The process object created by webpack is not an event emitter, fix it so
@@ -116,7 +116,9 @@ switch (window.location.protocol) {
}
case 'chrome-extension:': {
// Inject the chrome.* APIs that chrome extensions require
require('@electron/internal/renderer/chrome-api').injectTo(window.location.hostname, window)
if (!process.electronBinding('features').isExtensionsEnabled()) {
require('@electron/internal/renderer/chrome-api').injectTo(window.location.hostname, window)
}
break
}
case 'chrome': {
@@ -124,7 +126,9 @@ switch (window.location.protocol) {
}
default: {
// Inject content scripts.
require('@electron/internal/renderer/content-scripts-injector')(contentScripts)
if (!process.electronBinding('features').isExtensionsEnabled()) {
require('@electron/internal/renderer/content-scripts-injector')(contentScripts)
}
}
}

View File

@@ -1,15 +1,16 @@
{
"name": "electron",
"version": "7.0.0-nightly.20190731",
"version": "8.0.0-nightly.20190817",
"repository": "https://github.com/electron/electron",
"description": "Build cross platform desktop apps with JavaScript, HTML, and CSS",
"devDependencies": {
"@electron/docs-parser": "^0.4.1",
"@electron/typescript-definitions": "^8.5.0",
"@electron/docs-parser": "^0.4.2",
"@electron/typescript-definitions": "^8.6.1",
"@octokit/rest": "^16.3.2",
"@primer/octicons": "^9.1.1",
"@types/chai": "^4.1.7",
"@types/chai-as-promised": "^7.1.0",
"@types/dirty-chai": "^2.0.0",
"@types/express": "^4.16.1",
"@types/fs-extra": "^5.0.5",
"@types/mocha": "^5.2.6",

View File

@@ -35,7 +35,6 @@ mas-cfisobjc.patch
mas-cgdisplayusesforcetogray.patch
mas-audiodeviceduck.patch
mas-lssetapplicationlaunchservicesserverconnectionstatus.patch
allow_webview_file_url.patch
ignore_rc_check.patch
enable_widevine.patch
chrome_key_systems.patch
@@ -43,7 +42,6 @@ allow_nested_error_trackers.patch
blink_initialization_order.patch
ssl_security_state_tab_helper.patch
exclude-a-few-test-files-from-build.patch
expose-net-observer-api.patch
desktop_media_list.patch
proxy_config_monitor.patch
gritsettings_resource_ids.patch
@@ -60,7 +58,6 @@ autofill_size_calculation.patch
fix_disable_usage_of_abort_report_np_in_mas_builds.patch
fix_disable_usage_of_pthread_fchdir_np_and_pthread_chdir_np_in_mas.patch
fix_disable_usage_of_setapplicationisdaemon_and.patch
disable_network_services_by_default.patch
unsandboxed_ppapi_processes_skip_zygote.patch
patch_the_ensure_gn_version_py_script_to_work_on_mac_ci.patch
build_add_electron_tracing_category.patch
@@ -69,7 +66,6 @@ feat_offscreen_rendering_with_viz_compositor.patch
worker_context_will_destroy.patch
fix_breakpad_symbol_generation_on_linux_arm.patch
frame_host_manager.patch
cross_site_document_resource_handler.patch
crashpad_pid_check.patch
chore_add_debounce_on_the_updatewebcontentsvisibility_method_to.patch
network_service_allow_remote_certificate_verification_logic.patch
@@ -77,3 +73,4 @@ put_back_deleted_colors_for_autofill.patch
build_win_disable_zc_twophase.patch
disable_color_correct_rendering.patch
add_contentgpuclient_precreatemessageloop_callback.patch
fix_vc_incompatible_inline_calls.patch

View File

@@ -9,10 +9,10 @@ Allows Electron to restore WER when ELECTRON_DEFAULT_ERROR_MODE is set.
This should be upstreamed
diff --git a/content/gpu/gpu_main.cc b/content/gpu/gpu_main.cc
index 69cb584e3b99a6989dbb2906bfa5bdf1c5cd3df5..7d1d9f871f7a0676b040651cf5a7122ee6cf2732 100644
index 46d92835eadd6429ea0c6a53c5a39ff04f1c2634..1b99a1e601f4226280cdf1382af555b4d61b92fa 100644
--- a/content/gpu/gpu_main.cc
+++ b/content/gpu/gpu_main.cc
@@ -235,6 +235,10 @@ int GpuMain(const MainFunctionParams& parameters) {
@@ -236,6 +236,10 @@ int GpuMain(const MainFunctionParams& parameters) {
logging::SetLogMessageHandler(GpuProcessLogMessageHandler);
@@ -23,7 +23,7 @@ index 69cb584e3b99a6989dbb2906bfa5bdf1c5cd3df5..7d1d9f871f7a0676b040651cf5a7122e
// We are experiencing what appear to be memory-stomp issues in the GPU
// process. These issues seem to be impacting the task executor and listeners
// registered to it. Create the task executor on the heap to guard against
@@ -348,7 +352,6 @@ int GpuMain(const MainFunctionParams& parameters) {
@@ -349,7 +353,6 @@ int GpuMain(const MainFunctionParams& parameters) {
GpuProcess gpu_process(io_thread_priority);
#endif
@@ -32,10 +32,10 @@ index 69cb584e3b99a6989dbb2906bfa5bdf1c5cd3df5..7d1d9f871f7a0676b040651cf5a7122e
client->PostIOThreadCreated(gpu_process.io_task_runner());
diff --git a/content/public/gpu/content_gpu_client.h b/content/public/gpu/content_gpu_client.h
index 20e31e1bd96395cb4350aa6ae84cc16c4ca2116b..d89af81ef9426c197a62027b514011afd10ea3ce 100644
index 830d5e89af7bd3ddb409ac7bf9d8eb3109830d41..7d544536ec846c294deb6626f51d5de7846fc5c2 100644
--- a/content/public/gpu/content_gpu_client.h
+++ b/content/public/gpu/content_gpu_client.h
@@ -35,6 +35,10 @@ class CONTENT_EXPORT ContentGpuClient {
@@ -39,6 +39,10 @@ class CONTENT_EXPORT ContentGpuClient {
public:
virtual ~ContentGpuClient() {}

View File

@@ -39,10 +39,10 @@ index 2aef366ac8194aa261cbca6abc051f7da8a988d3..3c7d66c81032636abcca4f1538ce9b7f
GIN_EXPORT static ArrayBufferAllocator* SharedInstance();
diff --git a/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc b/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc
index fc77a1d2c717cbf6a4066082c4e941d73e707847..cde4f969cb799b9ede05f29148fba32d32309cc2 100644
index e44b0d054d61914b43f4a3c36fa2578f452e1797..8b46714d15db976968ad084e7941ab503e11e65d 100644
--- a/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc
+++ b/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc
@@ -643,6 +643,10 @@ class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator {
@@ -644,6 +644,10 @@ class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator {
size, WTF::ArrayBufferContents::kDontInitialize);
}
@@ -54,7 +54,7 @@ index fc77a1d2c717cbf6a4066082c4e941d73e707847..cde4f969cb799b9ede05f29148fba32d
WTF::ArrayBufferContents::FreeMemory(data);
}
diff --git a/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_contents.cc b/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_contents.cc
index 0031242152ce5190b0dfc77b53af2d984e5fad82..a6370ec793ce6c38eb7dab189583ea11cca51c1f 100644
index ac76d127b96b80c8260a7e2cda0b669cd98787ad..dcab64586700a8740262aede8dba2755f652d8e8 100644
--- a/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_contents.cc
+++ b/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_contents.cc
@@ -130,6 +130,11 @@ void* ArrayBufferContents::AllocateMemoryOrNull(size_t size,
@@ -70,7 +70,7 @@ index 0031242152ce5190b0dfc77b53af2d984e5fad82..a6370ec793ce6c38eb7dab189583ea11
Partitions::ArrayBufferPartition()->Free(data);
}
diff --git a/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_contents.h b/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_contents.h
index 601046eca671613693d3fc083cf48a0d530c8fd3..a94b7ea29bbd6d5e6cc6fb3a850be7e1ef00c5ad 100644
index 929468d9d4885953576b777785609e9b54d5ebd0..ee35b4782b9797278209280c2a031e5f3d5ce6c6 100644
--- a/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_contents.h
+++ b/third_party/blink/renderer/platform/wtf/typed_arrays/array_buffer_contents.h
@@ -135,6 +135,7 @@ class WTF_EXPORT ArrayBufferContents {

View File

@@ -1,20 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Cheng Zhao <zcbenz@gmail.com>
Date: Thu, 20 Sep 2018 17:49:42 -0700
Subject: allow_webview_file_url.patch
Allow webview to load non-web URLs.
diff --git a/content/browser/loader/resource_dispatcher_host_impl.cc b/content/browser/loader/resource_dispatcher_host_impl.cc
index 76bcf34f58ef62dc42927a94d1e4410c1a0bde2e..008d89fe6b46facb7b3f8ca908c76c36d19c396b 100644
--- a/content/browser/loader/resource_dispatcher_host_impl.cc
+++ b/content/browser/loader/resource_dispatcher_host_impl.cc
@@ -1426,6 +1426,8 @@ void ResourceDispatcherHostImpl::BeginNavigationRequest(
!policy->IsWebSafeScheme(info.common_params.url.scheme()) &&
!is_external_protocol;
+ non_web_url_in_guest = false;
+
if (is_shutdown_ || non_web_url_in_guest) {
url_loader_client->OnComplete(
network::URLLoaderCompletionStatus(net::ERR_ABORTED));

View File

@@ -5,7 +5,7 @@ Subject: blink-worker-enable-csp-in-file-scheme.patch
diff --git a/third_party/blink/renderer/core/workers/worker_classic_script_loader.cc b/third_party/blink/renderer/core/workers/worker_classic_script_loader.cc
index 873bf34f0f6fff5ee955f84a5019ddf9c6aefc9c..8fca091c4a430f7109aa59400e1ffbea533938d9 100644
index b1b9f451951bb7b11eefe6453a71a6b44be838a5..0f62ba09ef99538a5b0b306f601d10c44a7a7abf 100644
--- a/third_party/blink/renderer/core/workers/worker_classic_script_loader.cc
+++ b/third_party/blink/renderer/core/workers/worker_classic_script_loader.cc
@@ -308,7 +308,6 @@ void WorkerClassicScriptLoader::ProcessContentSecurityPolicy(

View File

@@ -10,10 +10,10 @@ to fix electron/electron#13787. The backport landed in Chromium 67 but the
DidCreateScriptContext re-ordering needs to be upstreamed or kept indefinitely
diff --git a/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc b/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
index 50c06fddeff3647dc99f8ab9f1538723f91ec2a9..fa4b6c3c8081af03055ddeadc53606fcc9030d5c 100644
index b6622fd132cc1b46127a2157b28c2fd2ab63e40d..1a3196aa5737e35237fd467260973fdf260587c4 100644
--- a/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
+++ b/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
@@ -203,11 +203,10 @@ void LocalWindowProxy::Initialize() {
@@ -205,11 +205,10 @@ void LocalWindowProxy::Initialize() {
GetFrame()->IsMainFrame());
MainThreadDebugger::Instance()->ContextCreated(script_state_, GetFrame(),
origin);

View File

@@ -14,10 +14,10 @@ when there is code doing that.
This patch reverts the change to fix the crash in Electron.
diff --git a/third_party/blink/renderer/core/frame/local_frame.cc b/third_party/blink/renderer/core/frame/local_frame.cc
index 60b3fe655dc8c309e3099d15283f8223e9ae2a50..c66465dd1c059e8de6055e44260dd51810c4f202 100644
index f4e7059fa98be4470cf20c26fd7260a442b25585..8eefe09f6ebbc02e3bca3d111c3b47d509a7a2a4 100644
--- a/third_party/blink/renderer/core/frame/local_frame.cc
+++ b/third_party/blink/renderer/core/frame/local_frame.cc
@@ -332,10 +332,6 @@ void LocalFrame::DetachImpl(FrameDetachType type) {
@@ -334,10 +334,6 @@ void LocalFrame::DetachImpl(FrameDetachType type) {
}
CHECK(!view_ || !view_->IsAttached());
@@ -28,7 +28,7 @@ index 60b3fe655dc8c309e3099d15283f8223e9ae2a50..c66465dd1c059e8de6055e44260dd518
if (!Client())
return;
@@ -353,6 +349,10 @@ void LocalFrame::DetachImpl(FrameDetachType type) {
@@ -355,6 +351,10 @@ void LocalFrame::DetachImpl(FrameDetachType type) {
// Notify ScriptController that the frame is closing, since its cleanup ends
// up calling back to LocalFrameClient via WindowProxy.
GetScriptController().ClearForClose();

View File

@@ -5,10 +5,10 @@ Subject: blink_world_context.patch
diff --git a/third_party/blink/public/web/web_local_frame.h b/third_party/blink/public/web/web_local_frame.h
index ea92c2747104615ac876b8322bd5e7acf039924d..1a5b6c4945de6e26a163fe653fef65838431d7b0 100644
index a781a44399a31f048419311d2317229c912752c2..131c0dcb125b00215e3ad469c11c4b47d7cb126b 100644
--- a/third_party/blink/public/web/web_local_frame.h
+++ b/third_party/blink/public/web/web_local_frame.h
@@ -357,6 +357,9 @@ class WebLocalFrame : public WebFrame {
@@ -356,6 +356,9 @@ class WebLocalFrame : public WebFrame {
// be calling this API.
virtual v8::Local<v8::Context> MainWorldScriptContext() const = 0;
@@ -19,10 +19,10 @@ index ea92c2747104615ac876b8322bd5e7acf039924d..1a5b6c4945de6e26a163fe653fef6583
// that the script evaluated to with callback. Script execution can be
// suspend.
diff --git a/third_party/blink/renderer/core/frame/web_local_frame_impl.cc b/third_party/blink/renderer/core/frame/web_local_frame_impl.cc
index 3215cba24c414f235c3149ffd45e30dfc7979060..752e04d1510d54ae525e4c7d1b5a149cba2b087a 100644
index 050494ce5d2389b81fab27506f8ff2204126eb6b..93632d57953a69be01ae5b6b9777d8a6b417b3f3 100644
--- a/third_party/blink/renderer/core/frame/web_local_frame_impl.cc
+++ b/third_party/blink/renderer/core/frame/web_local_frame_impl.cc
@@ -868,6 +868,13 @@ v8::Local<v8::Object> WebLocalFrameImpl::GlobalProxy() const {
@@ -866,6 +866,13 @@ v8::Local<v8::Object> WebLocalFrameImpl::GlobalProxy() const {
return MainWorldScriptContext()->Global();
}
@@ -37,10 +37,10 @@ index 3215cba24c414f235c3149ffd45e30dfc7979060..752e04d1510d54ae525e4c7d1b5a149c
return BindingSecurity::ShouldAllowAccessToFrame(
CurrentDOMWindow(V8PerIsolateData::MainThreadIsolate()),
diff --git a/third_party/blink/renderer/core/frame/web_local_frame_impl.h b/third_party/blink/renderer/core/frame/web_local_frame_impl.h
index c9a5d1d253d7ff16dc88667b07b883842a388c11..ee7079631e3a713f8b001c5d104fc2b1bbe99e8c 100644
index 9fbb94efc829928a1b1e284d529dd5562619dc20..0a0904ab66d55753252ccf484c03c07c8dac002b 100644
--- a/third_party/blink/renderer/core/frame/web_local_frame_impl.h
+++ b/third_party/blink/renderer/core/frame/web_local_frame_impl.h
@@ -149,6 +149,8 @@ class CORE_EXPORT WebLocalFrameImpl final
@@ -150,6 +150,8 @@ class CORE_EXPORT WebLocalFrameImpl final
int argc,
v8::Local<v8::Value> argv[]) override;
v8::Local<v8::Context> MainWorldScriptContext() const override;

View File

@@ -26,7 +26,7 @@ index de89d291e5cbc0981cf06170ed35502a1239136d..656f6c38d55d9f9af569bc772254ca13
viz::mojom::CompositorFrameSinkClient* renderer_compositor_frame_sink);
void OnDidNotProduceFrame(const viz::BeginFrameAck& ack);
diff --git a/content/browser/renderer_host/browser_compositor_view_mac.mm b/content/browser/renderer_host/browser_compositor_view_mac.mm
index 4b3f3c7e97e73ad6d0166ad114f4168d9ed00e11..59e58d693c971742951434f6582140d9179235f2 100644
index 8ddd790decc43af9820c97121a3b359e7cbb49ee..18019d5794f688ca07b35a665cc9800bb1d3047a 100644
--- a/content/browser/renderer_host/browser_compositor_view_mac.mm
+++ b/content/browser/renderer_host/browser_compositor_view_mac.mm
@@ -80,6 +80,12 @@

View File

@@ -8,7 +8,7 @@ categories in use are known / declared. This patch is required for us
to introduce a new Electron category.
diff --git a/base/trace_event/builtin_categories.h b/base/trace_event/builtin_categories.h
index 7c0723ffd4934300fed249e2d3c98532e9382885..b0e5e3f30c2235e4bbe0bd3dc324e99d7f505e79 100644
index b50d4123e44ddee34af0b07bfe5d067c4ccc5809..3e2c639a067fb76848783f35ec112a380da2353e 100644
--- a/base/trace_event/builtin_categories.h
+++ b/base/trace_event/builtin_categories.h
@@ -61,6 +61,7 @@

View File

@@ -5,7 +5,7 @@ Subject: build_gn.patch
diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn
index 23695f67293383fe086ce56a7ab6fe08ed28cce7..1d01c7a33634fc749f7498377e96dc0467e698f5 100644
index 59ab7810e71916e8f0f2d69f06e3c2c3ebc99030..b144e800c94956429ca85fc0aefe6539a6246e4b 100644
--- a/build/config/BUILDCONFIG.gn
+++ b/build/config/BUILDCONFIG.gn
@@ -123,6 +123,9 @@ if (current_os == "") {

View File

@@ -8,7 +8,7 @@ This is to workaround the bug in crbug.com/969698#c10
until fixes have landed in upstream.
diff --git a/build/config/win/BUILD.gn b/build/config/win/BUILD.gn
index a6c0aeaf98f7a860c131dc52161f52f308432a91..7b490d07d0f8383db5cea2703d7451db0108d252 100644
index 8406c060c4e61282433ad40a52744fd7ea80366b..0bb1b871be97fe8275e17669ed0bcd77d9645f9b 100644
--- a/build/config/win/BUILD.gn
+++ b/build/config/win/BUILD.gn
@@ -2,6 +2,7 @@

View File

@@ -5,10 +5,10 @@ Subject: can_create_window.patch
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc
index a9d30fa2e6b9b2f5fd96be4ecf90dafa9e7ea57a..b352615567a2719828626d9ad4b79ea8c494975f 100644
index 269bffc6ebfcf926718aed78f0c1d65e0c21b8b4..98069a4d2e2ab2cf1d880392ece8578c5317a6ef 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -3831,6 +3831,7 @@ void RenderFrameHostImpl::CreateNewWindow(
@@ -3871,6 +3871,7 @@ void RenderFrameHostImpl::CreateNewWindow(
last_committed_origin_, params->window_container_type,
params->target_url, params->referrer.To<Referrer>(),
params->frame_name, params->disposition, *params->features,
@@ -17,10 +17,10 @@ index a9d30fa2e6b9b2f5fd96be4ecf90dafa9e7ea57a..b352615567a2719828626d9ad4b79ea8
&no_javascript_access);
diff --git a/content/common/frame.mojom b/content/common/frame.mojom
index a2fe2dbd0d1c91a0bf5047b5c93f30758a0db277..d9f44fecaae883d861eea94c6cc16727967f0baa 100644
index 380029a373ce17816824c18803ed68380276eaa1..3a846621febecab61a26b31753fdd1d63958ec47 100644
--- a/content/common/frame.mojom
+++ b/content/common/frame.mojom
@@ -305,6 +305,10 @@ struct CreateNewWindowParams {
@@ -303,6 +303,10 @@ struct CreateNewWindowParams {
// The window features to use for the new window.
blink.mojom.WindowFeatures features;
@@ -32,10 +32,10 @@ index a2fe2dbd0d1c91a0bf5047b5c93f30758a0db277..d9f44fecaae883d861eea94c6cc16727
// Operation result when the renderer asks the browser to create a new window.
diff --git a/content/public/browser/content_browser_client.cc b/content/public/browser/content_browser_client.cc
index 21da9c9c43a94411787d7cab8513b88302383e97..44a574d3c621695d7d1304c7b8db08db8cf753d1 100644
index d9f7d1d1aed10c7cd8e7c2938d1fb824b2dce96d..4d4710e8c5382ac9391bb693dc1fd42258efd181 100644
--- a/content/public/browser/content_browser_client.cc
+++ b/content/public/browser/content_browser_client.cc
@@ -494,6 +494,8 @@ bool ContentBrowserClient::CanCreateWindow(
@@ -475,6 +475,8 @@ bool ContentBrowserClient::CanCreateWindow(
const std::string& frame_name,
WindowOpenDisposition disposition,
const blink::mojom::WindowFeatures& features,
@@ -45,10 +45,10 @@ index 21da9c9c43a94411787d7cab8513b88302383e97..44a574d3c621695d7d1304c7b8db08db
bool opener_suppressed,
bool* no_javascript_access) {
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
index b0709c05aec437c36498587e7a3bd79bf311c525..7d83d9e0d0c57511955921d85f15a27a88c3ac37 100644
index 02a0dbcbc2df521079519ecd5464ecd251fdcaec..897c2c1435a8c1a495aa84c928c360d74218bfa7 100644
--- a/content/public/browser/content_browser_client.h
+++ b/content/public/browser/content_browser_client.h
@@ -175,6 +175,7 @@ class RenderFrameHost;
@@ -177,6 +177,7 @@ class RenderFrameHost;
class RenderProcessHost;
class RenderViewHost;
class ResourceContext;
@@ -56,7 +56,7 @@ index b0709c05aec437c36498587e7a3bd79bf311c525..7d83d9e0d0c57511955921d85f15a27a
class SerialDelegate;
class SiteInstance;
class SpeechRecognitionManagerDelegate;
@@ -778,6 +779,8 @@ class CONTENT_EXPORT ContentBrowserClient {
@@ -759,6 +760,8 @@ class CONTENT_EXPORT ContentBrowserClient {
const std::string& frame_name,
WindowOpenDisposition disposition,
const blink::mojom::WindowFeatures& features,
@@ -66,7 +66,7 @@ index b0709c05aec437c36498587e7a3bd79bf311c525..7d83d9e0d0c57511955921d85f15a27a
bool opener_suppressed,
bool* no_javascript_access);
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index d0ca81590d2b5688022ca6045869dcae0ecd778e..7752c1e49dbee49c64a552ec249cabdb4d073109 100644
index 31790be7369a450dec9c2c9a53d0b1a80ee4c41e..e7f22166a777b05f28a78e51934bfc1eb5ea99c8 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -75,6 +75,7 @@
@@ -75,9 +75,9 @@ index d0ca81590d2b5688022ca6045869dcae0ecd778e..7752c1e49dbee49c64a552ec249cabdb
#include "content/renderer/loader/request_extra_data.h"
+#include "content/renderer/loader/web_url_request_util.h"
#include "content/renderer/media/audio/audio_device_factory.h"
#include "content/renderer/media/stream/media_stream_device_observer.h"
#include "content/renderer/media/video_capture/video_capture_impl_manager.h"
@@ -1366,6 +1367,8 @@ WebView* RenderViewImpl::CreateView(
#include "content/renderer/media/webrtc/peer_connection_dependency_factory.h"
#include "content/renderer/media/webrtc/rtc_peer_connection_handler.h"
@@ -1358,6 +1359,8 @@ WebView* RenderViewImpl::CreateView(
}
params->features = ConvertWebWindowFeaturesToMojoWindowFeatures(features);
@@ -87,10 +87,10 @@ index d0ca81590d2b5688022ca6045869dcae0ecd778e..7752c1e49dbee49c64a552ec249cabdb
// moved on send.
bool is_background_tab =
diff --git a/content/shell/browser/web_test/web_test_content_browser_client.cc b/content/shell/browser/web_test/web_test_content_browser_client.cc
index dacecdd4d0195e999f11fd2e1dfaabe95a639263..c5b88ee2561561c0b8a8032d32255645ce30c450 100644
index 4c639ff453f778bee39726231c920fa6e0b65134..3367f6982e047dcc3654ed20e21b74dbb90dc9cc 100644
--- a/content/shell/browser/web_test/web_test_content_browser_client.cc
+++ b/content/shell/browser/web_test/web_test_content_browser_client.cc
@@ -308,6 +308,8 @@ bool WebTestContentBrowserClient::CanCreateWindow(
@@ -305,6 +305,8 @@ bool WebTestContentBrowserClient::CanCreateWindow(
const std::string& frame_name,
WindowOpenDisposition disposition,
const blink::mojom::WindowFeatures& features,
@@ -100,10 +100,10 @@ index dacecdd4d0195e999f11fd2e1dfaabe95a639263..c5b88ee2561561c0b8a8032d32255645
bool opener_suppressed,
bool* no_javascript_access) {
diff --git a/content/shell/browser/web_test/web_test_content_browser_client.h b/content/shell/browser/web_test/web_test_content_browser_client.h
index 4f00217da5a4f6f3d7410b82352fcb94e7f4a8fd..33e30d6a816e87dade0a26710a8f71fc6f630f34 100644
index 8fe2e1d0b24f42ba7b2c7e40db78a3ed1d6f8341..7e6459e68ad3611b128d7f7f7604b77a66c40435 100644
--- a/content/shell/browser/web_test/web_test_content_browser_client.h
+++ b/content/shell/browser/web_test/web_test_content_browser_client.h
@@ -69,6 +69,8 @@ class WebTestContentBrowserClient : public ShellContentBrowserClient {
@@ -67,6 +67,8 @@ class WebTestContentBrowserClient : public ShellContentBrowserClient {
const std::string& frame_name,
WindowOpenDisposition disposition,
const blink::mojom::WindowFeatures& features,

View File

@@ -8,10 +8,10 @@ run before shutdown. This is required to cleanup WebContents asynchronously
in atom::CommonWebContentsDelegate::ResetManageWebContents.
diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc
index 5b9d42a924bdd121a3eab7145d3f62679e44b09e..78d3ce1ab15ffd1fba2a4a4c1d6447c7627ddb50 100644
index 5acff0fbb0babb3fd46d6ec716910f3c97bc73dc..561a5dcb6bbca381875f4765b52fc0df2d5f6d4b 100644
--- a/content/browser/browser_main_loop.cc
+++ b/content/browser/browser_main_loop.cc
@@ -1508,7 +1508,7 @@ void BrowserMainLoop::MainMessageLoopRun() {
@@ -1492,7 +1492,7 @@ void BrowserMainLoop::MainMessageLoopRun() {
NOTREACHED();
#else
base::RunLoop run_loop;

View File

@@ -1,52 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: deepak1556 <hop2deep@gmail.com>
Date: Mon, 3 Jun 2019 14:07:40 -0700
Subject: cross_site_document_resource_handler.patch
Add a content layer hook to disable CORB for a renderer process,
this patch can be removed once we switch to network service,
where the embedders have a chance to design their URLLoaders.
diff --git a/content/browser/loader/cross_site_document_resource_handler.cc b/content/browser/loader/cross_site_document_resource_handler.cc
index b74bbef56038e29ca35403affd284a7a8868c201..d6887e576ac197f80a7e5261bd251cd761d1d814 100644
--- a/content/browser/loader/cross_site_document_resource_handler.cc
+++ b/content/browser/loader/cross_site_document_resource_handler.cc
@@ -582,6 +582,9 @@ bool CrossSiteDocumentResourceHandler::ShouldBlockBasedOnHeaders(
request()->initiator()->scheme() == url::kFileScheme)
return false;
+ if (GetContentClient()->browser()->ShouldBypassCORB(info->GetChildID()))
+ return false;
+
return true;
}
diff --git a/content/public/browser/content_browser_client.cc b/content/public/browser/content_browser_client.cc
index 39d3c28ca33fa1eeab14b67ec31a6ae09f25c354..1fc64dd493536f1aefafd6a683c19289920000b7 100644
--- a/content/public/browser/content_browser_client.cc
+++ b/content/public/browser/content_browser_client.cc
@@ -71,6 +71,10 @@ std::unique_ptr<BrowserMainParts> ContentBrowserClient::CreateBrowserMainParts(
return nullptr;
}
+bool ContentBrowserClient::ShouldBypassCORB(int render_process_id) const {
+ return false;
+}
+
void ContentBrowserClient::PostAfterStartupTask(
const base::Location& from_here,
const scoped_refptr<base::TaskRunner>& task_runner,
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
index 3d518759a3bc190970a2d45ec178c97096fa250d..b2c12759d2cd94d7971f20bc289c7fa70f1fe863 100644
--- a/content/public/browser/content_browser_client.h
+++ b/content/public/browser/content_browser_client.h
@@ -249,6 +249,9 @@ class CONTENT_EXPORT ContentBrowserClient {
virtual std::unique_ptr<BrowserMainParts> CreateBrowserMainParts(
const MainFunctionParams& parameters);
+ // Electron: Allows bypassing CORB checks for a renderer process.
+ virtual bool ShouldBypassCORB(int render_process_id) const;
+
// Allows the embedder to change the default behavior of
// BrowserThread::PostAfterStartupTask to better match whatever
// definition of "startup" the embedder has in mind. This may be

View File

@@ -17,10 +17,10 @@ only one or two specific checks fail. Then it's better to simply comment out the
failing checks and allow the rest of the target to have them enabled.
diff --git a/content/browser/frame_host/navigation_controller_impl.cc b/content/browser/frame_host/navigation_controller_impl.cc
index 6a3cca0f846c944f23afe91ca149a0aa28bc18aa..20b3f2ef31d2f036fb0a08d5d7678bb9e67532e6 100644
index 4bc8bd4c68015dd684702a6afbce74b36160e5a1..55dc200a73ef09b17c0e52d622f86956ba6a7bb7 100644
--- a/content/browser/frame_host/navigation_controller_impl.cc
+++ b/content/browser/frame_host/navigation_controller_impl.cc
@@ -1211,8 +1211,10 @@ NavigationType NavigationControllerImpl::ClassifyNavigation(
@@ -1210,8 +1210,10 @@ NavigationType NavigationControllerImpl::ClassifyNavigation(
return NAVIGATION_TYPE_NEW_SUBFRAME;
}
@@ -33,7 +33,7 @@ index 6a3cca0f846c944f23afe91ca149a0aa28bc18aa..20b3f2ef31d2f036fb0a08d5d7678bb9
if (rfh->GetParent()) {
// All manual subframes would be did_create_new_entry and handled above, so
@@ -1464,7 +1466,10 @@ void NavigationControllerImpl::RendererDidNavigateToNewPage(
@@ -1463,7 +1465,10 @@ void NavigationControllerImpl::RendererDidNavigateToNewPage(
new_entry->GetFavicon() = GetLastCommittedEntry()->GetFavicon();
}

View File

@@ -133,12 +133,12 @@ index 47401abc984e6fe26c7f4c5399aa565c687060b0..ca6a527ffac877c27aac94337ec5a7b5
protected:
virtual ~DesktopMediaListObserver() {}
diff --git a/chrome/browser/media/webrtc/native_desktop_media_list.cc b/chrome/browser/media/webrtc/native_desktop_media_list.cc
index 872152cededb29ca3c04b2deb3fe6491be001af9..4ca62f03abf11bf9d0a48c85a79e098fb6758a30 100644
index dca0ffdfb9fda6ecf45b428cb253e10f8799a6c3..8d09e13073c580ca89e76976a8acc65f4b421868 100644
--- a/chrome/browser/media/webrtc/native_desktop_media_list.cc
+++ b/chrome/browser/media/webrtc/native_desktop_media_list.cc
@@ -7,14 +7,15 @@
#include "base/bind.h"
@@ -8,14 +8,15 @@
#include "base/hash/hash.h"
#include "base/message_loop/message_pump_type.h"
#include "base/single_thread_task_runner.h"
+#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"

View File

@@ -15,7 +15,7 @@ the redraw locking mechanism, which fixes these issues. The electron issue
can be found at https://github.com/electron/electron/issues/1821
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
index 9b683f301913f85b6849439dd230cc4cf32eca1d..44dbae9b1ed1486a0119666eae8a531b7d9c50d3 100644
index c578a96ba41f1a75d8a1ab80321b48fa72ad84ab..7f9405b7f484ef05d222581d222d104f20aa1de1 100644
--- a/ui/views/win/hwnd_message_handler.cc
+++ b/ui/views/win/hwnd_message_handler.cc
@@ -331,6 +331,10 @@ constexpr int kSynthesizedMouseMessagesTimeDifference = 500;
@@ -37,7 +37,7 @@ index 9b683f301913f85b6849439dd230cc4cf32eca1d..44dbae9b1ed1486a0119666eae8a531b
(!(GetWindowLong(hwnd_, GWL_STYLE) & WS_CAPTION) ||
!ui::win::IsAeroGlassEnabled())) {
if (should_lock_)
@@ -989,6 +994,10 @@ bool HWNDMessageHandler::HasChildRenderingWindow() {
@@ -993,6 +998,10 @@ bool HWNDMessageHandler::HasChildRenderingWindow() {
hwnd());
}
@@ -49,10 +49,10 @@ index 9b683f301913f85b6849439dd230cc4cf32eca1d..44dbae9b1ed1486a0119666eae8a531b
// HWNDMessageHandler, gfx::WindowImpl overrides:
diff --git a/ui/views/win/hwnd_message_handler.h b/ui/views/win/hwnd_message_handler.h
index 9f0a1a8698838cd797f22cbc4fb100b024758927..2733d8d0220ef92458ca295484525006ddb9d5e8 100644
index 3bccc5ccdcfecd4a407fab48d70b8fccd0072f60..d726e974e83eee02489fc0669ef31f00ee75a572 100644
--- a/ui/views/win/hwnd_message_handler.h
+++ b/ui/views/win/hwnd_message_handler.h
@@ -193,6 +193,8 @@ class VIEWS_EXPORT HWNDMessageHandler : public gfx::WindowImpl,
@@ -194,6 +194,8 @@ class VIEWS_EXPORT HWNDMessageHandler : public gfx::WindowImpl,
using TouchIDs = std::set<DWORD>;
enum class DwmFrameState { OFF, ON };

View File

@@ -32,7 +32,7 @@ index d62c52b53268b4ffab702a0dac3652edc472ccb9..f1ed520f123802469d94c98c418b9f5c
// Image Decode Service and raster tiles without images until the decode is
// ready.
diff --git a/components/viz/common/display/renderer_settings.h b/components/viz/common/display/renderer_settings.h
index e33255364c18298192cf26a783204235f2daedb5..eec7c487ce0bf2d36a48402773c35556c7fddb67 100644
index 389f2ed29bd85c35b38df92346a8d6c76ce22fd6..02cf492fa4068d10c4b8b2addee8102b35aac3e0 100644
--- a/components/viz/common/display/renderer_settings.h
+++ b/components/viz/common/display/renderer_settings.h
@@ -23,6 +23,7 @@ class VIZ_COMMON_EXPORT RendererSettings {
@@ -44,12 +44,12 @@ index e33255364c18298192cf26a783204235f2daedb5..eec7c487ce0bf2d36a48402773c35556
bool force_antialiasing = false;
bool force_blending_with_shaders = false;
diff --git a/components/viz/host/renderer_settings_creation.cc b/components/viz/host/renderer_settings_creation.cc
index cf3b10af046e7ac0607b1935369e963d969c0b82..6a6c3520fe11511ee3855944091deeb882240d0f 100644
index f17aa1fa451f1b99d7f083e07edd49b11f7639e4..09f7c5d6a92d89c199b296771a8ff60c89a07083 100644
--- a/components/viz/host/renderer_settings_creation.cc
+++ b/components/viz/host/renderer_settings_creation.cc
@@ -12,6 +12,7 @@
#include "components/viz/common/display/renderer_settings.h"
@@ -13,6 +13,7 @@
#include "components/viz/common/features.h"
#include "components/viz/common/switches.h"
#include "ui/base/ui_base_switches.h"
+#include "ui/gfx/switches.h"
@@ -65,7 +65,7 @@ index cf3b10af046e7ac0607b1935369e963d969c0b82..6a6c3520fe11511ee3855944091deeb8
!command_line->HasSwitch(switches::kUIDisablePartialSwap);
#if defined(OS_MACOSX)
diff --git a/components/viz/service/display/gl_renderer.cc b/components/viz/service/display/gl_renderer.cc
index 2fb123aa60201bfa912d0ec1e797a734f351b608..bf2bad3fce525df6e565e0387ffbefb59dd15052 100644
index bc58f3ea501540cbbba465cd8b751b99df45ab3a..e0ee85b9319938c285eb7f19f1b010b408019081 100644
--- a/components/viz/service/display/gl_renderer.cc
+++ b/components/viz/service/display/gl_renderer.cc
@@ -81,6 +81,9 @@
@@ -90,7 +90,7 @@ index 2fb123aa60201bfa912d0ec1e797a734f351b608..bf2bad3fce525df6e565e0387ffbefb5
// Use the full quad_rect for debug quads to not move the edges based on
// partial swaps.
@@ -1406,7 +1410,8 @@ void GLRenderer::ChooseRPDQProgram(DrawRenderPassDrawQuadParams* params,
@@ -1448,7 +1452,8 @@ void GLRenderer::ChooseRPDQProgram(DrawRenderPassDrawQuadParams* params,
params->use_color_matrix, tint_gl_composited_content_,
params->apply_shader_based_rounded_corner &&
ShouldApplyRoundedCorner(params->quad)),
@@ -100,7 +100,7 @@ index 2fb123aa60201bfa912d0ec1e797a734f351b608..bf2bad3fce525df6e565e0387ffbefb5
}
void GLRenderer::UpdateRPDQUniforms(DrawRenderPassDrawQuadParams* params) {
@@ -1877,8 +1882,8 @@ void GLRenderer::DrawSolidColorQuad(const SolidColorDrawQuad* quad,
@@ -1919,8 +1924,8 @@ void GLRenderer::DrawSolidColorQuad(const SolidColorDrawQuad* quad,
SetUseProgram(ProgramKey::SolidColor(use_aa ? USE_AA : NO_AA,
tint_gl_composited_content_,
ShouldApplyRoundedCorner(quad)),
@@ -111,7 +111,7 @@ index 2fb123aa60201bfa912d0ec1e797a734f351b608..bf2bad3fce525df6e565e0387ffbefb5
SetShaderColor(color, opacity);
if (current_program_->rounded_corner_rect_location() != -1) {
SetShaderRoundedCorner(
@@ -2033,8 +2038,8 @@ void GLRenderer::DrawContentQuadAA(const ContentDrawQuadBase* quad,
@@ -2075,8 +2080,8 @@ void GLRenderer::DrawContentQuadAA(const ContentDrawQuadBase* quad,
: NON_PREMULTIPLIED_ALPHA,
false, false, tint_gl_composited_content_,
ShouldApplyRoundedCorner(quad)),
@@ -122,7 +122,7 @@ index 2fb123aa60201bfa912d0ec1e797a734f351b608..bf2bad3fce525df6e565e0387ffbefb5
if (current_program_->tint_color_matrix_location() != -1) {
auto matrix = cc::DebugColors::TintCompositedContentColorTransformMatrix();
@@ -2130,8 +2135,8 @@ void GLRenderer::DrawContentQuadNoAA(const ContentDrawQuadBase* quad,
@@ -2172,8 +2177,8 @@ void GLRenderer::DrawContentQuadNoAA(const ContentDrawQuadBase* quad,
!quad->ShouldDrawWithBlending(), has_tex_clamp_rect,
tint_gl_composited_content_,
ShouldApplyRoundedCorner(quad)),
@@ -133,16 +133,16 @@ index 2fb123aa60201bfa912d0ec1e797a734f351b608..bf2bad3fce525df6e565e0387ffbefb5
if (current_program_->tint_color_matrix_location() != -1) {
auto matrix = cc::DebugColors::TintCompositedContentColorTransformMatrix();
@@ -2234,7 +2239,7 @@ void GLRenderer::DrawYUVVideoQuad(const YUVVideoDrawQuad* quad,
@@ -2276,7 +2281,7 @@ void GLRenderer::DrawYUVVideoQuad(const YUVVideoDrawQuad* quad,
DCHECK_NE(src_color_space, src_color_space.GetAsFullRangeRGB());
gfx::ColorSpace dst_color_space =
- current_frame()->current_render_pass->color_space;
+ PATCH_CS(current_frame()->current_render_pass->color_space);
#if defined(OS_WIN)
// Force sRGB output on Windows for overlay candidate video quads to match
@@ -2393,8 +2398,8 @@ void GLRenderer::DrawStreamVideoQuad(const StreamVideoDrawQuad* quad,
// DirectComposition behavior in case these switch between overlays and
// compositing. See https://crbug.com/811118 for details.
@@ -2432,8 +2437,8 @@ void GLRenderer::DrawStreamVideoQuad(const StreamVideoDrawQuad* quad,
SetUseProgram(ProgramKey::VideoStream(tex_coord_precision,
ShouldApplyRoundedCorner(quad)),
@@ -153,7 +153,7 @@ index 2fb123aa60201bfa912d0ec1e797a734f351b608..bf2bad3fce525df6e565e0387ffbefb5
DCHECK_EQ(GL_TEXTURE0, GetActiveTextureUnit(gl_));
gl_->BindTexture(GL_TEXTURE_EXTERNAL_OES, lock.texture_id());
@@ -2451,8 +2456,8 @@ void GLRenderer::FlushTextureQuadCache(BoundGeometry flush_binding) {
@@ -2490,8 +2495,8 @@ void GLRenderer::FlushTextureQuadCache(BoundGeometry flush_binding) {
draw_cache_.nearest_neighbor ? GL_NEAREST : GL_LINEAR);
// Bind the program to the GL state.
@@ -164,7 +164,7 @@ index 2fb123aa60201bfa912d0ec1e797a734f351b608..bf2bad3fce525df6e565e0387ffbefb5
if (current_program_->rounded_corner_rect_location() != -1) {
SetShaderRoundedCorner(
@@ -3153,7 +3158,9 @@ void GLRenderer::PrepareGeometry(BoundGeometry binding) {
@@ -3184,7 +3189,9 @@ void GLRenderer::PrepareGeometry(BoundGeometry binding) {
void GLRenderer::SetUseProgram(const ProgramKey& program_key_no_color,
const gfx::ColorSpace& src_color_space,
const gfx::ColorSpace& dst_color_space) {
@@ -175,7 +175,7 @@ index 2fb123aa60201bfa912d0ec1e797a734f351b608..bf2bad3fce525df6e565e0387ffbefb5
gfx::ColorSpace adjusted_color_space = src_color_space;
float sdr_white_level = current_frame()->sdr_white_level;
@@ -3540,7 +3547,7 @@ void GLRenderer::CopyRenderPassDrawQuadToOverlayResource(
@@ -3553,7 +3560,7 @@ void GLRenderer::CopyRenderPassDrawQuadToOverlayResource(
*overlay_texture = FindOrCreateOverlayTexture(
params.quad->render_pass_id, iosurface_width, iosurface_height,
@@ -184,7 +184,7 @@ index 2fb123aa60201bfa912d0ec1e797a734f351b608..bf2bad3fce525df6e565e0387ffbefb5
*new_bounds = gfx::RectF(updated_dst_rect.origin(),
gfx::SizeF((*overlay_texture)->texture.size()));
@@ -3759,8 +3766,8 @@ void GLRenderer::FlushOverdrawFeedback(const gfx::Rect& output_rect) {
@@ -3771,8 +3778,8 @@ void GLRenderer::FlushOverdrawFeedback(const gfx::Rect& output_rect) {
PrepareGeometry(SHARED_BINDING);
@@ -195,14 +195,14 @@ index 2fb123aa60201bfa912d0ec1e797a734f351b608..bf2bad3fce525df6e565e0387ffbefb5
gfx::Transform render_matrix;
render_matrix.Translate(0.5 * output_rect.width() + output_rect.x(),
@@ -3920,3 +3927,5 @@ gfx::Size GLRenderer::GetRenderPassBackingPixelSize(
@@ -3932,3 +3939,5 @@ gfx::Size GLRenderer::GetRenderPassBackingPixelSize(
}
} // namespace viz
+
+#undef PATCH_CS
diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc
index a22390afced20c3a898aa5e84c403f90b1eb0fe2..d15b9978f6e9a2e0b51d1cf4c57a7fc5472b2b0c 100644
index 157fbbc34a2217f58f3e5931e1d56d6db3b876cd..68bd4a84e6fe68a4741fcedc50fb47230b11ba37 100644
--- a/content/browser/gpu/gpu_process_host.cc
+++ b/content/browser/gpu/gpu_process_host.cc
@@ -192,6 +192,7 @@ GpuTerminationStatus ConvertToGpuTerminationStatus(
@@ -214,10 +214,10 @@ index a22390afced20c3a898aa5e84c403f90b1eb0fe2..d15b9978f6e9a2e0b51d1cf4c57a7fc5
service_manager::switches::kGpuSandboxAllowSysVShm,
service_manager::switches::kGpuSandboxFailuresFatal,
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
index 6f0671a753879d7b327681979090508e610cc129..f1beaf3433d67014cff527a686fd3239862eb537 100644
index 44ebf7ec0549dadd9621339260c92cbc424b096c..235d382c88327b7a09679b745c28622d78ce12b6 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -219,6 +219,7 @@
@@ -216,6 +216,7 @@
#include "ui/base/ui_base_switches.h"
#include "ui/base/ui_base_switches_util.h"
#include "ui/display/display_switches.h"
@@ -225,7 +225,7 @@ index 6f0671a753879d7b327681979090508e610cc129..f1beaf3433d67014cff527a686fd3239
#include "ui/gl/gl_switches.h"
#include "ui/native_theme/native_theme_features.h"
#include "url/url_constants.h"
@@ -2933,6 +2934,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
@@ -2894,6 +2895,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
// Propagate the following switches to the renderer command line (along
// with any associated values) if present in the browser command line.
static const char* const kSwitchNames[] = {
@@ -234,10 +234,10 @@ index 6f0671a753879d7b327681979090508e610cc129..f1beaf3433d67014cff527a686fd3239
network::switches::kExplicitlyAllowedPorts,
service_manager::switches::kDisableInProcessStackTraces,
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
index 734c561001cc625c60851590d69bc7485928538a..1f56e138ae967e8f7c39a4629f6cb7dc590cf42c 100644
index 91428916eaf20743f54d33df3b7930f52d24e709..879a48448ea9a0c62a1e2e070531be90e49e19ac 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -2854,6 +2854,9 @@ cc::LayerTreeSettings RenderWidget::GenerateLayerTreeSettings(
@@ -2840,6 +2840,9 @@ cc::LayerTreeSettings RenderWidget::GenerateLayerTreeSettings(
settings.main_frame_before_activation_enabled =
cmd.HasSwitch(cc::switches::kEnableMainFrameBeforeActivation);

View File

@@ -5,10 +5,10 @@ Subject: disable_hidden.patch
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
index 8278ff4f07e5a18941521c92c819d099636b96b4..8606461c0422460e5d2d6adab0fea4ad8060ece5 100644
index f9d900c686f6e265c029d281ab04bc37c803fcc5..4e115c09f034cfb6913c97c719b855126ab78624 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -670,6 +670,9 @@ void RenderWidgetHostImpl::WasHidden() {
@@ -676,6 +676,9 @@ void RenderWidgetHostImpl::WasHidden() {
if (is_hidden_)
return;
@@ -19,10 +19,10 @@ index 8278ff4f07e5a18941521c92c819d099636b96b4..8606461c0422460e5d2d6adab0fea4ad
TRACE_EVENT0("renderer_host", "RenderWidgetHostImpl::WasHidden");
diff --git a/content/browser/renderer_host/render_widget_host_impl.h b/content/browser/renderer_host/render_widget_host_impl.h
index 350770092301beffa86a658a5c42276b238d0800..9296c0ad7f83cd4a5dce041de2fb97a537e44858 100644
index e81662ef6b24eb03656a6f1b11b619906edda505..de56061588bb5a26b3ced56a56f56e56900fe10d 100644
--- a/content/browser/renderer_host/render_widget_host_impl.h
+++ b/content/browser/renderer_host/render_widget_host_impl.h
@@ -156,6 +156,9 @@ class CONTENT_EXPORT RenderWidgetHostImpl
@@ -183,6 +183,9 @@ class CONTENT_EXPORT RenderWidgetHostImpl
// RenderWidgetHostImpl.
static RenderWidgetHostImpl* From(RenderWidgetHost* rwh);

View File

@@ -1,26 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Cheng Zhao <zcbenz@gmail.com>
Date: Tue, 9 Apr 2019 14:57:02 -0700
Subject: disable_network_services_by_default.patch
Disable NetworkService by default.
This allows us to enable NetworkService with command line flags, which makes it
easier to work on NetworkService migration.
We should remove this patch after all Electron's code has been migrated to the
NetworkService.
diff --git a/services/network/public/cpp/features.cc b/services/network/public/cpp/features.cc
index d10016967b1ac607166e593fbddf39a8fc533fe0..2f8d69091a3eeb46e52d48c015d76df9fe41e350 100644
--- a/services/network/public/cpp/features.cc
+++ b/services/network/public/cpp/features.cc
@@ -23,7 +23,7 @@ const base::Feature kNetworkService {
#else
"NetworkServiceNotSupported",
#endif
- base::FEATURE_ENABLED_BY_DEFAULT
+ base::FEATURE_DISABLED_BY_DEFAULT
};
// Out of Blink CORS

View File

@@ -6,10 +6,10 @@ Subject: disable_user_gesture_requirement_for_beforeunload_dialogs.patch
See https://github.com/electron/electron/issues/10754
diff --git a/third_party/blink/renderer/core/dom/document.cc b/third_party/blink/renderer/core/dom/document.cc
index ac89475a90cdf889c073c6d7749732285455db8c..ed658f7a115087cdec0778ace5ad80b8643d5e92 100644
index b6d4e4d4f642e5043f07bd48435b8c22c52c3a75..b83f0fc7c90f64cc4ce5fce99f2741d736d7ddb7 100644
--- a/third_party/blink/renderer/core/dom/document.cc
+++ b/third_party/blink/renderer/core/dom/document.cc
@@ -4067,7 +4067,9 @@ bool Document::DispatchBeforeUnloadEvent(ChromeClient* chrome_client,
@@ -4090,7 +4090,9 @@ bool Document::DispatchBeforeUnloadEvent(ChromeClient* chrome_client,
"frame that never had a user gesture since its load. "
"https://www.chromestatus.com/feature/5082396709879808";
Intervention::GenerateReport(frame_, "BeforeUnloadNoGesture", message);

View File

@@ -7,10 +7,10 @@ Compilation of those files fails with the Chromium 68.
Remove the patch during the Chromium 69 upgrade.
diff --git a/third_party/blink/renderer/platform/BUILD.gn b/third_party/blink/renderer/platform/BUILD.gn
index 0764cc88a8c4753a1c682e4164ec1988f7b824dd..cb1314d44fe2150a049e1e6072f036ffd26a5bfb 100644
index f985824f021e14c7bb6a0996afd796bc53820f86..4c7c61676602a825cc604324779fa7c51f7f0826 100644
--- a/third_party/blink/renderer/platform/BUILD.gn
+++ b/third_party/blink/renderer/platform/BUILD.gn
@@ -1706,7 +1706,7 @@ jumbo_source_set("blink_platform_unittests_sources") {
@@ -1722,7 +1722,7 @@ jumbo_source_set("blink_platform_unittests_sources") {
"graphics/paint/drawing_display_item_test.cc",
"graphics/paint/drawing_recorder_test.cc",
"graphics/paint/float_clip_rect_test.cc",

View File

@@ -1,29 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jeremy Apthorp <jeremya@chromium.org>
Date: Thu, 18 Oct 2018 17:06:56 -0700
Subject: expose-net-observer-api.patch
Expose URLRequestContextGetter::{Add,Remove}Observer.
This patch should be removed once we switch to using the net service (cc @robo)
diff --git a/net/url_request/url_request_context_getter.h b/net/url_request/url_request_context_getter.h
index def76d3902f30ae1384ae5f629fa116b3975fa86..e5ee0bfa93f497f18bdb3ad7cd51a6726dc87f3e 100644
--- a/net/url_request/url_request_context_getter.h
+++ b/net/url_request/url_request_context_getter.h
@@ -79,11 +79,16 @@ class NET_EXPORT URLRequestContextGetter
friend class web::NetworkContextOwner;
#endif // defined(OS_IOS)
+ // NOTE(nornagon/robo): electron currently depends on this deprecated API
+ // from net/, but will be removing it soon when we switch to using the
+ // network service.
+ public:
// Adds / removes an observer to watch for shutdown of |this|'s context. Must
// only be called on network thread. May not be called once
// GetURLRequestContext() starts returning nullptr.
void AddObserver(URLRequestContextGetterObserver* observer);
void RemoveObserver(URLRequestContextGetterObserver* observer);
+ private:
// OnDestruct is used to ensure deletion on the thread on which the request
// IO happens.

View File

@@ -45,7 +45,7 @@ index f5e18df4e06e24d3bdd51308abde48e217444848..41017d9d53b1c0d563ea0901f5cae407
#if defined(USE_X11)
void HostDisplayClient::DidCompleteSwapWithNewSize(const gfx::Size& size) {
diff --git a/components/viz/host/host_display_client.h b/components/viz/host/host_display_client.h
index 5e5c5da4a3cfc927df3fb120fcab647e927271c1..8c6ec95f309660fb83012a13c7b9bb64b782e7d9 100644
index b8177277ebca471fc147f2d5b53521cbadd8fa2d..72a807e138f80b4ab37cb1d368bc968e299d903f 100644
--- a/components/viz/host/host_display_client.h
+++ b/components/viz/host/host_display_client.h
@@ -30,17 +30,17 @@ class VIZ_HOST_EXPORT HostDisplayClient : public mojom::DisplayClient {
@@ -85,7 +85,7 @@ index 65c26e2f7ae813e50f6740f73a4d145467da4366..39c04c4d6b644a4ad7b13b4e932b085f
if (!canvas_) {
diff --git a/components/viz/host/layered_window_updater_impl.h b/components/viz/host/layered_window_updater_impl.h
index d9a9730a78b9aec833c64282ca868dbba5594d82..d98426e9f78931bd43061ec994559d594c96151c 100644
index ced30727ab67e557265c3a61f7c213763da973ce..f422786fe6cd9cab47494fe6028f3c3be8bc763e 100644
--- a/components/viz/host/layered_window_updater_impl.h
+++ b/components/viz/host/layered_window_updater_impl.h
@@ -33,7 +33,7 @@ class VIZ_HOST_EXPORT LayeredWindowUpdaterImpl
@@ -98,10 +98,10 @@ index d9a9730a78b9aec833c64282ca868dbba5594d82..d98426e9f78931bd43061ec994559d59
private:
const HWND hwnd_;
diff --git a/components/viz/service/BUILD.gn b/components/viz/service/BUILD.gn
index a43cee43701fc3c139c726d14b128de3ae71c2c2..32ce9f5634ddefd5cd0feaa551f04697b53da68d 100644
index ce7ceb3e82e95e49442d77a61d6bf765e8e86e4e..90db4660e0184daa773c9fbd1314cd64132ebd2e 100644
--- a/components/viz/service/BUILD.gn
+++ b/components/viz/service/BUILD.gn
@@ -113,6 +113,8 @@ viz_component("service") {
@@ -118,6 +118,8 @@ viz_component("service") {
"display_embedder/output_surface_provider_impl.h",
"display_embedder/server_shared_bitmap_manager.cc",
"display_embedder/server_shared_bitmap_manager.h",
@@ -111,7 +111,7 @@ index a43cee43701fc3c139c726d14b128de3ae71c2c2..32ce9f5634ddefd5cd0feaa551f04697
"display_embedder/software_output_surface.h",
"display_embedder/viz_process_context_provider.cc",
diff --git a/components/viz/service/display_embedder/output_surface_provider_impl.cc b/components/viz/service/display_embedder/output_surface_provider_impl.cc
index 7f61cb7c847bae88b50f2c32bbe9be6525a4c587..f059762b2c39c927b6bc6e40ad1c0641913082f2 100644
index e3c8e9dbca69f2665e8dbbd798d45c3b7199e04c..d9fa2d536e977ac966065a9058661f887e995320 100644
--- a/components/viz/service/display_embedder/output_surface_provider_impl.cc
+++ b/components/viz/service/display_embedder/output_surface_provider_impl.cc
@@ -20,6 +20,7 @@
@@ -122,15 +122,15 @@ index 7f61cb7c847bae88b50f2c32bbe9be6525a4c587..f059762b2c39c927b6bc6e40ad1c0641
#include "components/viz/service/display_embedder/software_output_surface.h"
#include "components/viz/service/display_embedder/viz_process_context_provider.h"
#include "components/viz/service/gl/gpu_service_impl.h"
@@ -32,6 +33,7 @@
#include "gpu/ipc/common/surface_handle.h"
@@ -33,6 +34,7 @@
#include "gpu/ipc/scheduler_sequence.h"
#include "gpu/ipc/service/gpu_channel_manager_delegate.h"
#include "gpu/ipc/service/image_transport_surface.h"
+#include "services/viz/privileged/interfaces/compositing/layered_window_updater.mojom.h"
+#include "services/viz/privileged/mojom/compositing/layered_window_updater.mojom.h"
#include "ui/base/ui_base_switches.h"
#include "ui/gl/gl_context.h"
#include "ui/gl/init/gl_factory.h"
@@ -219,6 +221,19 @@ OutputSurfaceProviderImpl::CreateSoftwareOutputDeviceForPlatform(
@@ -223,6 +225,19 @@ OutputSurfaceProviderImpl::CreateSoftwareOutputDeviceForPlatform(
if (headless_)
return std::make_unique<SoftwareOutputDevice>();
@@ -185,7 +185,7 @@ index f3867356e3d641416e00e6d115ae9ae2a0be90ab..b1d192d2b20ccb63fba07093101d745e
diff --git a/components/viz/service/display_embedder/software_output_device_proxy.cc b/components/viz/service/display_embedder/software_output_device_proxy.cc
new file mode 100644
index 0000000000000000000000000000000000000000..f5fc4f37c10bdc8aca8c1618985d46d10c830437
index 0000000000000000000000000000000000000000..c17b03e00089bfd301c63910426bb16afb8cdae7
--- /dev/null
+++ b/components/viz/service/display_embedder/software_output_device_proxy.cc
@@ -0,0 +1,156 @@
@@ -200,7 +200,7 @@ index 0000000000000000000000000000000000000000..f5fc4f37c10bdc8aca8c1618985d46d1
+#include "components/viz/common/resources/resource_sizes.h"
+#include "components/viz/service/display_embedder/output_device_backing.h"
+#include "mojo/public/cpp/system/platform_handle.h"
+#include "services/viz/privileged/interfaces/compositing/layered_window_updater.mojom.h"
+#include "services/viz/privileged/mojom/compositing/layered_window_updater.mojom.h"
+#include "skia/ext/platform_canvas.h"
+#include "third_party/skia/include/core/SkCanvas.h"
+#include "ui/gfx/skia_util.h"
@@ -347,7 +347,7 @@ index 0000000000000000000000000000000000000000..f5fc4f37c10bdc8aca8c1618985d46d1
+} // namespace viz
diff --git a/components/viz/service/display_embedder/software_output_device_proxy.h b/components/viz/service/display_embedder/software_output_device_proxy.h
new file mode 100644
index 0000000000000000000000000000000000000000..ff3c0217812a8370a20aa528f117e928fd1b95f4
index 0000000000000000000000000000000000000000..3865939d0445a23a468770f57207ba5ef23277ed
--- /dev/null
+++ b/components/viz/service/display_embedder/software_output_device_proxy.h
@@ -0,0 +1,88 @@
@@ -367,8 +367,8 @@ index 0000000000000000000000000000000000000000..ff3c0217812a8370a20aa528f117e928
+#include "components/viz/host/host_display_client.h"
+#include "components/viz/service/display/software_output_device.h"
+#include "components/viz/service/viz_service_export.h"
+#include "services/viz/privileged/interfaces/compositing/display_private.mojom.h"
+#include "services/viz/privileged/interfaces/compositing/layered_window_updater.mojom.h"
+#include "services/viz/privileged/mojom/compositing/display_private.mojom.h"
+#include "services/viz/privileged/mojom/compositing/layered_window_updater.mojom.h"
+
+namespace viz {
+
@@ -440,7 +440,7 @@ index 0000000000000000000000000000000000000000..ff3c0217812a8370a20aa528f117e928
+
+#endif // COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_SOFTWARE_OUTPUT_DEVICE_PROXY_H_
diff --git a/components/viz/service/display_embedder/software_output_device_win.cc b/components/viz/service/display_embedder/software_output_device_win.cc
index 73ea1986b2140a3ffb87c5e23c7ab2174bac0a10..3ba3657ba12ec47cc3db3fec218496ffe817d35b 100644
index 74316edc0e0bd28b1772e9d7cf34327d113462c4..9cbe5400458ce6e0b8ea9edfa3f0969fb936ee1e 100644
--- a/components/viz/service/display_embedder/software_output_device_win.cc
+++ b/components/viz/service/display_embedder/software_output_device_win.cc
@@ -11,6 +11,7 @@
@@ -449,7 +449,7 @@ index 73ea1986b2140a3ffb87c5e23c7ab2174bac0a10..3ba3657ba12ec47cc3db3fec218496ff
#include "components/viz/service/display_embedder/output_device_backing.h"
+#include "components/viz/service/display_embedder/software_output_device_proxy.h"
#include "mojo/public/cpp/system/platform_handle.h"
#include "services/viz/privileged/interfaces/compositing/layered_window_updater.mojom.h"
#include "services/viz/privileged/mojom/compositing/layered_window_updater.mojom.h"
#include "skia/ext/platform_canvas.h"
@@ -265,7 +266,7 @@ void SoftwareOutputDeviceWinProxy::EndPaintDelegated(
if (!canvas_)
@@ -476,10 +476,10 @@ index 73ea1986b2140a3ffb87c5e23c7ab2174bac0a10..3ba3657ba12ec47cc3db3fec218496ff
} else {
return std::make_unique<SoftwareOutputDeviceWinDirect>(hwnd, backing);
}
diff --git a/services/viz/privileged/interfaces/compositing/display_private.mojom b/services/viz/privileged/interfaces/compositing/display_private.mojom
index 8898b9162a65e043e8b95237b8874e48ea71744e..a455df870ece25fc6e5e46688a1c6b5b396b841a 100644
--- a/services/viz/privileged/interfaces/compositing/display_private.mojom
+++ b/services/viz/privileged/interfaces/compositing/display_private.mojom
diff --git a/services/viz/privileged/mojom/compositing/display_private.mojom b/services/viz/privileged/mojom/compositing/display_private.mojom
index 5c6292cfb3b8b46802c772d202d19c78e4782488..ed27af3ab0b383553b4d9492d29cec2b91bee807 100644
--- a/services/viz/privileged/mojom/compositing/display_private.mojom
+++ b/services/viz/privileged/mojom/compositing/display_private.mojom
@@ -79,12 +79,14 @@ interface DisplayPrivate {
};
@@ -496,10 +496,10 @@ index 8898b9162a65e043e8b95237b8874e48ea71744e..a455df870ece25fc6e5e46688a1c6b5b
CreateLayeredWindowUpdater(LayeredWindowUpdater& layered_window_updater);
// Notifies that a swap has occurred and provides information about the pixel
diff --git a/services/viz/privileged/interfaces/compositing/layered_window_updater.mojom b/services/viz/privileged/interfaces/compositing/layered_window_updater.mojom
index 58a7e221eaabd9e21196496d220c77babe07c56d..dd141b16eace2999380ed137b4adf1f3538a8a70 100644
--- a/services/viz/privileged/interfaces/compositing/layered_window_updater.mojom
+++ b/services/viz/privileged/interfaces/compositing/layered_window_updater.mojom
diff --git a/services/viz/privileged/mojom/compositing/layered_window_updater.mojom b/services/viz/privileged/mojom/compositing/layered_window_updater.mojom
index 6b7fbb6cf13dc8ee6ade0878a9a2c1efc5d4d3f1..e2af75168cb914a7b3b4a6c9b6a285498c3f8e72 100644
--- a/services/viz/privileged/mojom/compositing/layered_window_updater.mojom
+++ b/services/viz/privileged/mojom/compositing/layered_window_updater.mojom
@@ -26,5 +26,5 @@ interface LayeredWindowUpdater {
// Draws to the HWND by copying pixels from shared memory. Callback must be
// called after draw operation is complete to signal shared memory can be
@@ -508,7 +508,7 @@ index 58a7e221eaabd9e21196496d220c77babe07c56d..dd141b16eace2999380ed137b4adf1f3
+ Draw(gfx.mojom.Rect damage_rect) => ();
};
diff --git a/ui/compositor/compositor.h b/ui/compositor/compositor.h
index 5158731bd8512fcd2ee859b1e5eeff3a9a32ca9a..4d3592e939c45eec86cd4c7e328de247e9374419 100644
index 359e7d21a4a5e7acaed9bd7f42f40019e650a182..cd90aab9d3a7b5335c829d964d92e3fa62401408 100644
--- a/ui/compositor/compositor.h
+++ b/ui/compositor/compositor.h
@@ -23,6 +23,7 @@
@@ -517,7 +517,7 @@ index 5158731bd8512fcd2ee859b1e5eeff3a9a32ca9a..4d3592e939c45eec86cd4c7e328de247
#include "components/viz/common/surfaces/frame_sink_id.h"
+#include "components/viz/host/host_display_client.h"
#include "components/viz/host/host_frame_sink_client.h"
#include "services/viz/privileged/interfaces/compositing/vsync_parameter_observer.mojom-forward.h"
#include "services/viz/privileged/mojom/compositing/vsync_parameter_observer.mojom-forward.h"
#include "third_party/skia/include/core/SkColor.h"
@@ -194,6 +195,15 @@ class COMPOSITOR_EXPORT ContextFactory {
virtual bool SyncTokensRequiredForDisplayCompositor() = 0;
@@ -555,7 +555,7 @@ index 5158731bd8512fcd2ee859b1e5eeff3a9a32ca9a..4d3592e939c45eec86cd4c7e328de247
Layer* root_layer_ = nullptr;
diff --git a/ui/compositor/host/host_context_factory_private.cc b/ui/compositor/host/host_context_factory_private.cc
index 1c84de621781d0d7cf41866fc033b78881c5e972..112a1a6c2a0f24ee9ace05d7c38247b22fb4ed4c 100644
index 84b2623bd3dd8a7fdfa8e453eda3574e3b71ef99..974eb17c1d1f50c45b4d3a539a8d1a67b687642d 100644
--- a/ui/compositor/host/host_context_factory_private.cc
+++ b/ui/compositor/host/host_context_factory_private.cc
@@ -99,8 +99,12 @@ void HostContextFactoryPrivate::ConfigureCompositor(
@@ -594,10 +594,10 @@ index 4014e64a75da88cf66c02e8adb71171c2666cab7..25e57784e1a1ffc546b003daa4cd0059
// The geometry of the frame.
gfx::Size pixel_size;
float scale_factor = 1.f;
diff --git a/ui/gfx/mojo/ca_layer_params.mojom b/ui/gfx/mojo/ca_layer_params.mojom
index 7bf735643541b18bafffe645d3ff37e96caa4dea..f7eaf10ffd665789f10a587142fac0c0c79b9798 100644
--- a/ui/gfx/mojo/ca_layer_params.mojom
+++ b/ui/gfx/mojo/ca_layer_params.mojom
diff --git a/ui/gfx/mojom/ca_layer_params.mojom b/ui/gfx/mojom/ca_layer_params.mojom
index a73b2e678ffe0a682d0aa5409724fb441768bec5..6c36626d204c77ef51278b9e8f6fc6ee24a7a9ab 100644
--- a/ui/gfx/mojom/ca_layer_params.mojom
+++ b/ui/gfx/mojom/ca_layer_params.mojom
@@ -18,5 +18,6 @@ struct CALayerParams {
bool is_empty;
CALayerContent content;
@@ -605,10 +605,10 @@ index 7bf735643541b18bafffe645d3ff37e96caa4dea..f7eaf10ffd665789f10a587142fac0c0
+ gfx.mojom.Rect damage;
float scale_factor;
};
diff --git a/ui/gfx/mojo/ca_layer_params_struct_traits.cc b/ui/gfx/mojo/ca_layer_params_struct_traits.cc
index dd553996b5c6ff5ec0c210a020a18a6a843b8aae..26d1e0bda2640052d42ea4e691c3df73074dea08 100644
--- a/ui/gfx/mojo/ca_layer_params_struct_traits.cc
+++ b/ui/gfx/mojo/ca_layer_params_struct_traits.cc
diff --git a/ui/gfx/mojom/ca_layer_params_mojom_traits.cc b/ui/gfx/mojom/ca_layer_params_mojom_traits.cc
index 843d5c24ec33de07c12d4417eb111f91dbcd42fe..0ea594950fcd2686f1b07248dbc8ceb257d89dca 100644
--- a/ui/gfx/mojom/ca_layer_params_mojom_traits.cc
+++ b/ui/gfx/mojom/ca_layer_params_mojom_traits.cc
@@ -52,6 +52,9 @@ bool StructTraits<gfx::mojom::CALayerParamsDataView, gfx::CALayerParams>::Read(
if (!data.ReadPixelSize(&out->pixel_size))
return false;
@@ -619,10 +619,10 @@ index dd553996b5c6ff5ec0c210a020a18a6a843b8aae..26d1e0bda2640052d42ea4e691c3df73
out->scale_factor = data.scale_factor();
return true;
}
diff --git a/ui/gfx/mojo/ca_layer_params_struct_traits.h b/ui/gfx/mojo/ca_layer_params_struct_traits.h
index 94127a0d5b50b052318e9e5a360755fe771f87e9..348fa26c5c95a13d1ddd0ff2545aca3a35841a77 100644
--- a/ui/gfx/mojo/ca_layer_params_struct_traits.h
+++ b/ui/gfx/mojo/ca_layer_params_struct_traits.h
diff --git a/ui/gfx/mojom/ca_layer_params_mojom_traits.h b/ui/gfx/mojom/ca_layer_params_mojom_traits.h
index 4cac766eae3161baedac4202f694129cd90c80de..0821495ad22944d8856bb750cac8912a2f8328c3 100644
--- a/ui/gfx/mojom/ca_layer_params_mojom_traits.h
+++ b/ui/gfx/mojom/ca_layer_params_mojom_traits.h
@@ -20,6 +20,10 @@ struct StructTraits<gfx::mojom::CALayerParamsDataView, gfx::CALayerParams> {
return ca_layer_params.pixel_size;
}

View File

@@ -5,10 +5,10 @@ Subject: fix: disable usage of SetApplicationIsDaemon and
_LSSetApplicationLaunchServicesServerConnectionStatus in MAS builds
diff --git a/content/utility/utility_service_factory.cc b/content/utility/utility_service_factory.cc
index e4c8405fb17e37fd843eb9a962e0c5360524a693..1d5ee0a13a837efd0befe2ec02b38fbf4dcbc572 100644
index 9b0759ab820ddb0e2a9e609b88bbc1673607c4e3..2392fd01736550f404304df324da9d81dfb3d446 100644
--- a/content/utility/utility_service_factory.cc
+++ b/content/utility/utility_service_factory.cc
@@ -198,7 +198,7 @@ void UtilityServiceFactory::RunService(
@@ -196,7 +196,7 @@ void UtilityServiceFactory::RunService(
std::unique_ptr<service_manager::Service>
UtilityServiceFactory::CreateAudioService(
mojo::PendingReceiver<service_manager::mojom::Service> receiver) {

View File

@@ -0,0 +1,35 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shelley Vohr <shelley.vohr@gmail.com>
Date: Wed, 14 Aug 2019 15:36:05 -0700
Subject: fix: vc++ incompatible inline calls
Using const container elements like
const std::vector<const std::string> a = {"a"};
will fail when building without libc++ on: 'The C++ Standard
forbids containers of const elements because
allocator<const T> is ill-formed."
This fixes the issue by changing the container elements to non-const.
diff --git a/chrome/test/chromedriver/webauthn_commands.cc b/chrome/test/chromedriver/webauthn_commands.cc
index b0d4d62bc5003682523382600f8f6c815fdf089c..1f36721b50dc9a5e5fe85e044fc921bb1d0c6666 100644
--- a/chrome/test/chromedriver/webauthn_commands.cc
+++ b/chrome/test/chromedriver/webauthn_commands.cc
@@ -36,7 +36,7 @@ base::DictionaryValue MapParams(
// Converts the string |keys| in |params| from base64url to base64. Returns a
// status error if conversion of one of the keys failed.
Status ConvertBase64UrlToBase64(base::Value* params,
- const std::vector<const std::string> keys) {
+ const std::vector<std::string> keys) {
for (const std::string key : keys) {
base::Value* maybe_value = params->FindKey(key);
if (!maybe_value)
@@ -60,7 +60,7 @@ Status ConvertBase64UrlToBase64(base::Value* params,
// Converts the string |keys| in |params| from base64 to base64url.
void ConvertBase64ToBase64Url(base::Value* params,
- const std::vector<const std::string> keys) {
+ const std::vector<std::string> keys) {
for (const std::string key : keys) {
std::string* maybe_value = params->FindStringKey(key);
if (!maybe_value)

View File

@@ -42,10 +42,10 @@ index 906a1ee4ac58b0744a32153bbaafeac4322a60e4..c90f4aead36cbf3767dc5094728963c2
// another SiteInstance for the same site.
void RegisterSiteInstance(SiteInstanceImpl* site_instance);
diff --git a/content/browser/frame_host/render_frame_host_manager.cc b/content/browser/frame_host/render_frame_host_manager.cc
index 37593f39cecfe34fcbb7f0e9911175facdd87ea8..fab42c861fbc5f5344851b0bcb19e592678be8e6 100644
index b95ab6369324c29763d4320dcc4b16820a0e5e95..a0179277fe51d336cbcb19d76e28d2111926184a 100644
--- a/content/browser/frame_host/render_frame_host_manager.cc
+++ b/content/browser/frame_host/render_frame_host_manager.cc
@@ -2180,6 +2180,21 @@ bool RenderFrameHostManager::InitRenderView(
@@ -2228,6 +2228,21 @@ bool RenderFrameHostManager::InitRenderView(
scoped_refptr<SiteInstance>
RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
const NavigationRequest& request) {
@@ -67,12 +67,13 @@ index 37593f39cecfe34fcbb7f0e9911175facdd87ea8..fab42c861fbc5f5344851b0bcb19e592
SiteInstance* current_site_instance = render_frame_host_->GetSiteInstance();
// All children of MHTML documents must be MHTML documents. They all live in
@@ -2217,6 +2232,53 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
@@ -2265,6 +2280,59 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
request.common_params().url);
no_renderer_swap_allowed |=
request.from_begin_navigation() && !can_renderer_initiate_transfer;
+
+ if (!GetContentClient()->browser()->CanUseCustomSiteInstance()) {
+ bool has_navigation_started = request.state() != NavigationRequest::NOT_STARTED;
+ bool has_response_started =
+ (request.state() == NavigationRequest::RESPONSE_STARTED ||
+ request.state() == NavigationRequest::FAILED) &&
@@ -80,11 +81,12 @@ index 37593f39cecfe34fcbb7f0e9911175facdd87ea8..fab42c861fbc5f5344851b0bcb19e592
+ // Gives user a chance to choose a custom site instance.
+ SiteInstance* affinity_site_instance = nullptr;
+ scoped_refptr<SiteInstance> overriden_site_instance;
+ bool should_register_site_instance = false;
+ ContentBrowserClient::SiteInstanceForNavigationType siteInstanceType =
+ GetContentClient()->browser()->ShouldOverrideSiteInstanceForNavigation(
+ current_frame_host(), speculative_frame_host(), browser_context,
+ request.common_params().url, has_response_started,
+ &affinity_site_instance);
+ request.common_params().url, has_navigation_started,
+ has_response_started, &affinity_site_instance);
+ switch (siteInstanceType) {
+ case ContentBrowserClient::SiteInstanceForNavigationType::
+ FORCE_CANDIDATE_OR_NEW:
@@ -93,6 +95,12 @@ index 37593f39cecfe34fcbb7f0e9911175facdd87ea8..fab42c861fbc5f5344851b0bcb19e592
+ ? candidate_site_instance
+ : current_site_instance->CreateRelatedSiteInstance(
+ request.common_params().url);
+ should_register_site_instance = true;
+ break;
+ case ContentBrowserClient::SiteInstanceForNavigationType::FORCE_NEW:
+ overriden_site_instance = current_site_instance->CreateRelatedSiteInstance(
+ request.common_params().url);
+ should_register_site_instance = true;
+ break;
+ case ContentBrowserClient::SiteInstanceForNavigationType::FORCE_CURRENT:
+ overriden_site_instance = render_frame_host_->GetSiteInstance();
@@ -109,9 +117,7 @@ index 37593f39cecfe34fcbb7f0e9911175facdd87ea8..fab42c861fbc5f5344851b0bcb19e592
+ break;
+ }
+ if (overriden_site_instance) {
+ if (siteInstanceType ==
+ ContentBrowserClient::SiteInstanceForNavigationType::
+ FORCE_CANDIDATE_OR_NEW) {
+ if (should_register_site_instance) {
+ GetContentClient()->browser()->RegisterPendingSiteInstance(
+ render_frame_host_.get(), overriden_site_instance.get());
+ }
@@ -121,7 +127,7 @@ index 37593f39cecfe34fcbb7f0e9911175facdd87ea8..fab42c861fbc5f5344851b0bcb19e592
} else {
// Subframe navigations will use the current renderer, unless specifically
// allowed to swap processes.
@@ -2228,23 +2290,28 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
@@ -2276,23 +2344,28 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
if (no_renderer_swap_allowed && !should_swap_for_error_isolation)
return scoped_refptr<SiteInstance>(current_site_instance);
@@ -153,7 +159,7 @@ index 37593f39cecfe34fcbb7f0e9911175facdd87ea8..fab42c861fbc5f5344851b0bcb19e592
}
diff --git a/content/browser/site_instance_impl.cc b/content/browser/site_instance_impl.cc
index a805b110c378d0584a361f3a499be57c7826a63a..00c1f807033a76390c12335e5a647a6f951372c2 100644
index 47067d774c0490e3f0daf1f0d7ee60e4f51fc110..54aab183e80538173045c68d539c197af8b8d063 100644
--- a/content/browser/site_instance_impl.cc
+++ b/content/browser/site_instance_impl.cc
@@ -367,6 +367,10 @@ bool SiteInstanceImpl::HasRelatedSiteInstance(const GURL& url) {
@@ -180,12 +186,12 @@ index 1edb9fd6b0c383f291735dd1a952fcb7b17cc87f..23967f040eb346be265faa2a92562e1f
size_t GetRelatedActiveContentsCount() override;
bool RequiresDedicatedProcess() override;
diff --git a/content/public/browser/content_browser_client.cc b/content/public/browser/content_browser_client.cc
index 44a574d3c621695d7d1304c7b8db08db8cf753d1..39d3c28ca33fa1eeab14b67ec31a6ae09f25c354 100644
index 4d4710e8c5382ac9391bb693dc1fd42258efd181..45cf6657ea2055c45ff14669a0e09efc84efd133 100644
--- a/content/public/browser/content_browser_client.cc
+++ b/content/public/browser/content_browser_client.cc
@@ -52,6 +52,20 @@ void OverrideOnBindInterface(const service_manager::BindSourceInfo& remote_info,
handle);
}
@@ -44,6 +44,21 @@
namespace content {
+bool ContentBrowserClient::CanUseCustomSiteInstance() {
+ return false;
@@ -196,6 +202,7 @@ index 44a574d3c621695d7d1304c7b8db08db8cf753d1..39d3c28ca33fa1eeab14b67ec31a6ae0
+ content::RenderFrameHost* speculative_rfh,
+ content::BrowserContext* browser_context,
+ const GURL& url,
+ bool has_navigation_started,
+ bool has_request_started,
+ content::SiteInstance** affinity_site_instance) const {
+ return SiteInstanceForNavigationType::ASK_CHROMIUM;
@@ -205,10 +212,10 @@ index 44a574d3c621695d7d1304c7b8db08db8cf753d1..39d3c28ca33fa1eeab14b67ec31a6ae0
const MainFunctionParams& parameters) {
return nullptr;
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
index 7d83d9e0d0c57511955921d85f15a27a88c3ac37..3d518759a3bc190970a2d45ec178c97096fa250d 100644
index 897c2c1435a8c1a495aa84c928c360d74218bfa7..8b2b21f2ca7306751e123ed31198a2c5c38a4b5c 100644
--- a/content/public/browser/content_browser_client.h
+++ b/content/public/browser/content_browser_client.h
@@ -208,8 +208,41 @@ CONTENT_EXPORT void OverrideOnBindInterface(
@@ -204,8 +204,45 @@ struct WebPreferences;
// the observer interfaces.)
class CONTENT_EXPORT ContentBrowserClient {
public:
@@ -221,6 +228,9 @@ index 7d83d9e0d0c57511955921d85f15a27a88c3ac37..3d518759a3bc190970a2d45ec178c970
+ // Use the current site instance for the navigation.
+ FORCE_CURRENT,
+
+ // Use a new, unrelated site instance.
+ FORCE_NEW,
+
+ // Use the provided affinity site instance for the navigation.
+ FORCE_AFFINITY,
+
@@ -239,6 +249,7 @@ index 7d83d9e0d0c57511955921d85f15a27a88c3ac37..3d518759a3bc190970a2d45ec178c970
+ content::RenderFrameHost* speculative_rfh,
+ content::BrowserContext* browser_context,
+ const GURL& url,
+ bool has_navigation_started,
+ bool has_request_started,
+ content::SiteInstance** affinity_site_instance) const;
+

View File

@@ -6,10 +6,10 @@ Subject: gritsettings_resource_ids.patch
Add electron resources file to the list of resource ids generation.
diff --git a/tools/gritsettings/resource_ids b/tools/gritsettings/resource_ids
index 7ac3cf37b48153541278b3524d5c1610f6ae62e7..d284647347afca7beb1fea7415ae8f951026a03b 100644
index a4c39b1f6b141056b35ff8b7d9283863d057d0a2..b3a6bb5c948d7ebe6d9746e9210d97344c8a5c9e 100644
--- a/tools/gritsettings/resource_ids
+++ b/tools/gritsettings/resource_ids
@@ -459,6 +459,11 @@
@@ -465,6 +465,11 @@
"includes": [28880],
},

View File

@@ -7,10 +7,10 @@ Dont compare RC.exe and RC.py output.
FIXME: It has to be reverted once the script is fixed.
diff --git a/build/toolchain/win/tool_wrapper.py b/build/toolchain/win/tool_wrapper.py
index 926086670dac3ccf85f4085b513740aec1ebe9e5..cbb32f1143420d47af23f1ad92ee8656543a93e0 100644
index 1ad37129bb5663b547a1f1c32d09b9427d9d4434..6516ab892aa7032722fbe6af5991fc076314013c 100644
--- a/build/toolchain/win/tool_wrapper.py
+++ b/build/toolchain/win/tool_wrapper.py
@@ -224,7 +224,11 @@ class WinTool(object):
@@ -241,7 +241,11 @@ class WinTool(object):
if rc_exe_exit_code == 0:
import filecmp
# Strip "/fo" prefix.

View File

@@ -6,7 +6,7 @@ Subject: libgtkui_export.patch
Export libgtkui symbols for the GN component build.
diff --git a/chrome/browser/ui/libgtkui/gtk_util.h b/chrome/browser/ui/libgtkui/gtk_util.h
index adea4a859d96e219acc92c9178574f089a57944c..df615a91c00d22cabafffebe151728010fe9c1c4 100644
index d75427b5d5a0aca237cacc9654a8298e26285a81..8608d083a3eb6fe6b22e059cd68834ec4ded0458 100644
--- a/chrome/browser/ui/libgtkui/gtk_util.h
+++ b/chrome/browser/ui/libgtkui/gtk_util.h
@@ -11,6 +11,7 @@
@@ -28,9 +28,9 @@ index adea4a859d96e219acc92c9178574f089a57944c..df615a91c00d22cabafffebe15172801
-std::string GetDesktopName(base::Environment* env);
+LIBGTKUI_EXPORT std::string GetDesktopName(base::Environment* env);
guint GetGdkKeyCodeForAccelerator(const ui::Accelerator& accelerator);
@@ -51,7 +52,7 @@ void TurnButtonBlue(GtkWidget* button);
GdkModifierType GetGdkModifierForAccelerator(
const ui::Accelerator& accelerator);
@@ -49,7 +50,7 @@ void TurnButtonBlue(GtkWidget* button);
// Sets |dialog| as transient for |parent|, which will keep it on top and center
// it above |parent|. Do nothing if |parent| is nullptr.
@@ -39,7 +39,7 @@ index adea4a859d96e219acc92c9178574f089a57944c..df615a91c00d22cabafffebe15172801
// Gets the transient parent aura window for |dialog|.
aura::Window* GetAuraTransientParent(GtkWidget* dialog);
@@ -157,7 +158,7 @@ void ApplyCssToContext(GtkStyleContext* context, const std::string& css);
@@ -155,7 +156,7 @@ void ApplyCssToContext(GtkStyleContext* context, const std::string& css);
// Get the 'color' property from the style context created by
// GetStyleContextFromCss(|css_selector|).
@@ -48,7 +48,7 @@ index adea4a859d96e219acc92c9178574f089a57944c..df615a91c00d22cabafffebe15172801
ScopedCssProvider GetCssProvider(const std::string& css);
@@ -170,7 +171,7 @@ void RenderBackground(const gfx::Size& size,
@@ -168,7 +169,7 @@ void RenderBackground(const gfx::Size& size,
// Renders a background from the style context created by
// GetStyleContextFromCss(|css_selector|) into a 24x24 bitmap and
// returns the average color.

View File

@@ -7,12 +7,12 @@ Removes usage of the _LSSetApplicationLaunchServicesServerConnectionStatus
private API.
diff --git a/content/gpu/gpu_main.cc b/content/gpu/gpu_main.cc
index de80e1023c948a347440eeb960079f498e43fb87..69cb584e3b99a6989dbb2906bfa5bdf1c5cd3df5 100644
index 6779f6d70c1a69cd5668cf3a328cf56a492983e2..46d92835eadd6429ea0c6a53c5a39ff04f1c2634 100644
--- a/content/gpu/gpu_main.cc
+++ b/content/gpu/gpu_main.cc
@@ -285,8 +285,10 @@ int GpuMain(const MainFunctionParams& parameters) {
@@ -286,8 +286,10 @@ int GpuMain(const MainFunctionParams& parameters) {
std::make_unique<base::SingleThreadTaskExecutor>(
base::MessagePump::Type::NS_RUNLOOP);
base::MessagePumpType::NS_RUNLOOP);
+#ifndef MAS_BUILD
// Tell LaunchServices to continue without a connection to the daemon.

View File

@@ -73,7 +73,7 @@ index 94afefcee81b87c05bf9b1199d90d3d4b5ea84a6..2ec7f04c71824b47de1ddbf1f0e8625d
} // namespace blink
diff --git a/third_party/blink/renderer/core/paint/theme_painter_mac.mm b/third_party/blink/renderer/core/paint/theme_painter_mac.mm
index e965faf9fd8d5ec3572d769421f149907d66c67f..b2d0bbd80994fdf9607009d9e27bf4c3629fe402 100644
index e94235acb17335fbc78c606ff26036871117bd09..7c4bd19215c67f649636ae69b9a21b5c1ba21ecc 100644
--- a/third_party/blink/renderer/core/paint/theme_painter_mac.mm
+++ b/third_party/blink/renderer/core/paint/theme_painter_mac.mm
@@ -41,6 +41,7 @@

View File

@@ -38,10 +38,10 @@ index 743d1364bcd13e24ecbe5ced730161d15b8c3e93..a7e81072194c00baa0aa3159a6bfe374
// is concerned.
@property(nonatomic, readonly) NSString* subrole;
diff --git a/content/browser/accessibility/browser_accessibility_cocoa.mm b/content/browser/accessibility/browser_accessibility_cocoa.mm
index 6e97b6750cad46a8a8096c199c3a2f5386e0ae3b..3cfbb34bf6426d575c7affb9f4f9503948665d8d 100644
index 241f5a41afce70835e12b16fb64192663b0d8580..5e026cb0627970620f5994dc783e1fa989401ed3 100644
--- a/content/browser/accessibility/browser_accessibility_cocoa.mm
+++ b/content/browser/accessibility/browser_accessibility_cocoa.mm
@@ -141,6 +141,7 @@
@@ -219,6 +219,7 @@
// VoiceOver uses -1 to mean "no limit" for AXResultsLimit.
const int kAXResultsLimitNoLimit = -1;
@@ -49,7 +49,7 @@ index 6e97b6750cad46a8a8096c199c3a2f5386e0ae3b..3cfbb34bf6426d575c7affb9f4f95039
extern "C" {
// The following are private accessibility APIs required for cursor navigation
@@ -342,6 +343,7 @@ void AddMisspelledTextAttributes(const AXPlatformRange& ax_range,
@@ -420,6 +421,7 @@ void AddMisspelledTextAttributes(const AXPlatformRange& ax_range,
AddMisspelledTextAttributes(ax_range, attributed_text);
return attributed_text;
}
@@ -57,7 +57,7 @@ index 6e97b6750cad46a8a8096c199c3a2f5386e0ae3b..3cfbb34bf6426d575c7affb9f4f95039
// Returns an autoreleased copy of the AXNodeData's attribute.
NSString* NSStringForStringAttribute(BrowserAccessibility* browserAccessibility,
@@ -609,7 +611,9 @@ + (void)initialize {
@@ -687,7 +689,9 @@ + (void)initialize {
{NSAccessibilityEditableAncestorAttribute, @"editableAncestor"},
{NSAccessibilityElementBusyAttribute, @"elementBusy"},
{NSAccessibilityEnabledAttribute, @"enabled"},
@@ -67,7 +67,7 @@ index 6e97b6750cad46a8a8096c199c3a2f5386e0ae3b..3cfbb34bf6426d575c7affb9f4f95039
{NSAccessibilityExpandedAttribute, @"expanded"},
{NSAccessibilityFocusableAncestorAttribute, @"focusableAncestor"},
{NSAccessibilityFocusedAttribute, @"focused"},
@@ -644,13 +648,17 @@ + (void)initialize {
@@ -722,13 +726,17 @@ + (void)initialize {
{NSAccessibilityRowsAttribute, @"rows"},
// TODO(aboxhall): expose
// NSAccessibilityServesAsTitleForUIElementsAttribute
@@ -85,7 +85,7 @@ index 6e97b6750cad46a8a8096c199c3a2f5386e0ae3b..3cfbb34bf6426d575c7affb9f4f95039
{NSAccessibilitySizeAttribute, @"size"},
{NSAccessibilitySortDirectionAttribute, @"sortDirection"},
{NSAccessibilitySubroleAttribute, @"subrole"},
@@ -1148,6 +1156,7 @@ - (NSNumber*)enabled {
@@ -1226,6 +1234,7 @@ - (NSNumber*)enabled {
ax::mojom::Restriction::kDisabled];
}
@@ -93,7 +93,7 @@ index 6e97b6750cad46a8a8096c199c3a2f5386e0ae3b..3cfbb34bf6426d575c7affb9f4f95039
// Returns a text marker that points to the last character in the document that
// can be selected with VoiceOver.
- (id)endTextMarker {
@@ -1158,6 +1167,7 @@ - (id)endTextMarker {
@@ -1236,6 +1245,7 @@ - (id)endTextMarker {
BrowserAccessibilityPositionInstance position = root->CreatePositionAt(0);
return CreateTextMarker(position->CreatePositionAtEndOfAnchor());
}
@@ -101,7 +101,7 @@ index 6e97b6750cad46a8a8096c199c3a2f5386e0ae3b..3cfbb34bf6426d575c7affb9f4f95039
- (NSNumber*)expanded {
if (![self instanceActive])
@@ -2029,6 +2039,7 @@ - (NSValue*)selectedTextRange {
@@ -2107,6 +2117,7 @@ - (NSValue*)selectedTextRange {
return [NSValue valueWithRange:NSMakeRange(selStart, selLength)];
}
@@ -109,7 +109,7 @@ index 6e97b6750cad46a8a8096c199c3a2f5386e0ae3b..3cfbb34bf6426d575c7affb9f4f95039
- (id)selectedTextMarkerRange {
if (![self instanceActive])
return nil;
@@ -2064,6 +2075,7 @@ - (id)selectedTextMarkerRange {
@@ -2142,6 +2153,7 @@ - (id)selectedTextMarkerRange {
CreateAXPlatformRange(*anchorObject, anchorOffset, anchorAffinity,
*focusObject, focusOffset, focusAffinity));
}
@@ -117,7 +117,7 @@ index 6e97b6750cad46a8a8096c199c3a2f5386e0ae3b..3cfbb34bf6426d575c7affb9f4f95039
- (NSValue*)size {
if (![self instanceActive])
@@ -2096,6 +2108,7 @@ - (NSString*)sortDirection {
@@ -2174,6 +2186,7 @@ - (NSString*)sortDirection {
return nil;
}
@@ -125,7 +125,7 @@ index 6e97b6750cad46a8a8096c199c3a2f5386e0ae3b..3cfbb34bf6426d575c7affb9f4f95039
// Returns a text marker that points to the first character in the document that
// can be selected with VoiceOver.
- (id)startTextMarker {
@@ -2106,6 +2119,7 @@ - (id)startTextMarker {
@@ -2184,6 +2197,7 @@ - (id)startTextMarker {
BrowserAccessibilityPositionInstance position = root->CreatePositionAt(0);
return CreateTextMarker(position->CreatePositionAtStartOfAnchor());
}
@@ -133,7 +133,7 @@ index 6e97b6750cad46a8a8096c199c3a2f5386e0ae3b..3cfbb34bf6426d575c7affb9f4f95039
// Returns a subrole based upon the role.
- (NSString*)subrole {
@@ -2409,11 +2423,13 @@ - (NSAttributedString*)attributedValueForRange:(NSRange)range {
@@ -2475,11 +2489,13 @@ - (NSAttributedString*)attributedValueForRange:(NSRange)range {
NSMutableAttributedString* attributedValue =
[[[NSMutableAttributedString alloc] initWithString:value] autorelease];
@@ -147,23 +147,27 @@ index 6e97b6750cad46a8a8096c199c3a2f5386e0ae3b..3cfbb34bf6426d575c7affb9f4f95039
return [attributedValue attributedSubstringFromRange:range];
}
@@ -2496,6 +2512,7 @@ - (id)accessibilityAttributeValue:(NSString*)attribute
@@ -2562,9 +2578,8 @@ - (id)accessibilityAttributeValue:(NSString*)attribute
return ToBrowserAccessibilityCocoa(cell);
}
- if ([attribute
- isEqualToString:
- NSAccessibilityUIElementForTextMarkerParameterizedAttribute]) {
+#ifndef MAS_BUILD
if ([attribute isEqualToString:@"AXUIElementForTextMarker"]) {
+ if ([attribute isEqualToString:NSAccessibilityUIElementForTextMarkerParameterizedAttribute]) {
BrowserAccessibilityPositionInstance position =
CreatePositionFromTextMarker(parameter);
@@ -2673,6 +2690,7 @@ - (id)accessibilityAttributeValue:(NSString*)attribute
NSString* text = GetTextForTextMarkerRange(parameter);
return [NSNumber numberWithInt:[text length]];
if (!position->IsNullPosition())
@@ -2855,6 +2870,7 @@ - (id)accessibilityAttributeValue:(NSString*)attribute
return CreateTextMarker(root->CreatePositionAt(index));
}
+#endif
if ([attribute isEqualToString:
NSAccessibilityBoundsForRangeParameterizedAttribute]) {
@@ -2706,6 +2724,7 @@ - (id)accessibilityAttributeValue:(NSString*)attribute
@@ -2888,6 +2904,7 @@ - (id)accessibilityAttributeValue:(NSString*)attribute
return nil;
}
@@ -171,7 +175,7 @@ index 6e97b6750cad46a8a8096c199c3a2f5386e0ae3b..3cfbb34bf6426d575c7affb9f4f95039
if ([attribute
isEqualToString:
NSAccessibilityLineTextMarkerRangeForTextMarkerParameterizedAttribute]) {
@@ -2786,6 +2805,7 @@ AXPlatformRange range(position->CreatePreviousLineStartPosition(
@@ -2968,6 +2985,7 @@ AXPlatformRange range(position->CreatePreviousLineStartPosition(
return @(child->GetIndexInParent());
}
@@ -180,7 +184,7 @@ index 6e97b6750cad46a8a8096c199c3a2f5386e0ae3b..3cfbb34bf6426d575c7affb9f4f95039
return nil;
}
diff --git a/content/browser/accessibility/browser_accessibility_manager_mac.mm b/content/browser/accessibility/browser_accessibility_manager_mac.mm
index cd447453b5a8877a9b1da7eab28130a795e3015b..9ef9a7aa5733b8591ed96511e9cdbc8f51875d04 100644
index 790b79d9f67fae56ae1b30307f72a4022f35c854..ba99f5d222735cec8be17426e3ac3553ae656f77 100644
--- a/content/browser/accessibility/browser_accessibility_manager_mac.mm
+++ b/content/browser/accessibility/browser_accessibility_manager_mac.mm
@@ -493,6 +493,7 @@ void PostAnnouncementNotification(NSString* announcement) {
@@ -276,7 +280,7 @@ index b6bea74d9f9c2fcfba381477895e4c15741318fc..4a02e5659e85c507d480d7fb9b63ee10
void BluetoothAdapterMac::RemovePairingDelegateInternal(
diff --git a/media/audio/BUILD.gn b/media/audio/BUILD.gn
index d8ae83ce63aafdd0fcd1994a144465791e94ba4a..d19096f9afd606bb7bfd6c377f8a976417d3bff2 100644
index 35fd1d7da0adfb8c8bef3d2ff3aa9ac25285421a..b7eda4e11c464e733e4ddb1cbf009ba811fc332a 100644
--- a/media/audio/BUILD.gn
+++ b/media/audio/BUILD.gn
@@ -180,6 +180,12 @@ source_set("audio") {

View File

@@ -5,10 +5,10 @@ Subject: network service: allow remote certificate verification logic
diff --git a/services/network/network_context.cc b/services/network/network_context.cc
index dffa1299b1cfce8609313435769189495fd8ccb5..ddea6f6e60b6f5ec4c0fdaddf825870f6b4db419 100644
index 05f062d5d98195571aca579f4451f25ff6da15bf..9c8bd7affcf4e2017c0f661e22155825398b50c7 100644
--- a/services/network/network_context.cc
+++ b/services/network/network_context.cc
@@ -91,6 +91,11 @@
@@ -90,6 +90,11 @@
#include "services/network/url_loader.h"
#include "services/network/url_request_context_builder_mojo.h"
@@ -20,7 +20,7 @@ index dffa1299b1cfce8609313435769189495fd8ccb5..ddea6f6e60b6f5ec4c0fdaddf825870f
#if BUILDFLAG(IS_CT_SUPPORTED)
#include "components/certificate_transparency/chrome_ct_policy_enforcer.h"
#include "components/certificate_transparency/chrome_require_ct_delegate.h"
@@ -319,6 +324,75 @@ std::string HashesToBase64String(const net::HashValueVector& hashes) {
@@ -318,6 +323,75 @@ std::string HashesToBase64String(const net::HashValueVector& hashes) {
} // namespace
@@ -96,7 +96,7 @@ index dffa1299b1cfce8609313435769189495fd8ccb5..ddea6f6e60b6f5ec4c0fdaddf825870f
constexpr uint32_t NetworkContext::kMaxOutstandingRequestsPerProcess;
constexpr bool NetworkContext::enable_resource_scheduler_;
@@ -676,6 +750,12 @@ void NetworkContext::SetClient(mojom::NetworkContextClientPtr client) {
@@ -645,6 +719,12 @@ void NetworkContext::SetClient(mojom::NetworkContextClientPtr client) {
client_ = std::move(client);
}
@@ -109,7 +109,7 @@ index dffa1299b1cfce8609313435769189495fd8ccb5..ddea6f6e60b6f5ec4c0fdaddf825870f
void NetworkContext::CreateURLLoaderFactory(
mojom::URLLoaderFactoryRequest request,
mojom::URLLoaderFactoryParamsPtr params) {
@@ -2151,12 +2231,19 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext() {
@@ -1720,12 +1800,19 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext() {
cert_net_fetcher_, /*system_trust_store_provider=*/nullptr)));
}
#endif
@@ -134,7 +134,7 @@ index dffa1299b1cfce8609313435769189495fd8ccb5..ddea6f6e60b6f5ec4c0fdaddf825870f
std::unique_ptr<net::NetworkDelegate> network_delegate =
std::make_unique<NetworkServiceNetworkDelegate>(this);
diff --git a/services/network/network_context.h b/services/network/network_context.h
index 297289317efc82b61379c7800e1039eaaf49dc6b..40ba50148d10f16afd9f386917966a6f797b1d92 100644
index bae29f0850644a63668fb9a5a99b619239635af1..cffd9a9869beb6fa5ab258cc063ecb9233fc90f5 100644
--- a/services/network/network_context.h
+++ b/services/network/network_context.h
@@ -80,6 +80,7 @@ class DomainReliabilityMonitor;
@@ -145,7 +145,7 @@ index 297289317efc82b61379c7800e1039eaaf49dc6b..40ba50148d10f16afd9f386917966a6f
class CookieManager;
class ExpectCTReporter;
class HostResolver;
@@ -182,6 +183,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
@@ -165,6 +166,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
// mojom::NetworkContext implementation:
void SetClient(mojom::NetworkContextClientPtr client) override;
@@ -153,7 +153,7 @@ index 297289317efc82b61379c7800e1039eaaf49dc6b..40ba50148d10f16afd9f386917966a6f
void CreateURLLoaderFactory(mojom::URLLoaderFactoryRequest request,
mojom::URLLoaderFactoryParamsPtr params) override;
void ResetURLLoaderFactories() override;
@@ -576,6 +578,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
@@ -553,6 +555,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
std::unique_ptr<network::NSSTempCertsCacheChromeOS> nss_temp_certs_cache_;
#endif
@@ -163,7 +163,7 @@ index 297289317efc82b61379c7800e1039eaaf49dc6b..40ba50148d10f16afd9f386917966a6f
// CertNetFetcher is not used by the current platform.
scoped_refptr<net::CertNetFetcherImpl> cert_net_fetcher_;
diff --git a/services/network/public/mojom/network_context.mojom b/services/network/public/mojom/network_context.mojom
index 58b18e0c3c2beea5f22af3c0b2ad206798ad33a9..4dcb94d32a9928d70f061dbc12dc7b7e672025b8 100644
index 39e583e4481af613f0af97c7a06a0a43f1dd1cfc..bdf12bbbdd7ea7d9dd041f460f79d4ed20062e13 100644
--- a/services/network/public/mojom/network_context.mojom
+++ b/services/network/public/mojom/network_context.mojom
@@ -161,6 +161,17 @@ interface TrustedURLLoaderHeaderClient {

View File

@@ -7,7 +7,7 @@ Do not check for unique origin in CacheStorage, in Electron we may have
scripts running without an origin.
diff --git a/content/browser/cache_storage/legacy/legacy_cache_storage.cc b/content/browser/cache_storage/legacy/legacy_cache_storage.cc
index a064cef489d6dbb86c1fd1da2bd2e918316326ed..9408cf6ec682bc917555a328926d0f57e49c61a1 100644
index b1a4d62c9230fd11e74d4fa959b0d89f30a27e83..225c31ec025d73eb581dee9a05cb17cd70ee4be8 100644
--- a/content/browser/cache_storage/legacy/legacy_cache_storage.cc
+++ b/content/browser/cache_storage/legacy/legacy_cache_storage.cc
@@ -104,7 +104,7 @@ class LegacyCacheStorage::CacheLoader {

View File

@@ -6,7 +6,7 @@ Subject: pass RenderProcessHost through to PlatformNotificationService
this is so Electron can identify which renderer a notification came from
diff --git a/content/browser/notifications/blink_notification_service_impl.cc b/content/browser/notifications/blink_notification_service_impl.cc
index ceb4bc6248a961bd907e35e9f758cebdbd0ae62b..c85acbb33b7b467716b717159816a00e67d46119 100644
index a717d9f3539dc0fe86b743c6e29e4311b8b5cec3..1351217319c57be414e6c66f8a01f71fe46d2c04 100644
--- a/content/browser/notifications/blink_notification_service_impl.cc
+++ b/content/browser/notifications/blink_notification_service_impl.cc
@@ -88,9 +88,11 @@ BlinkNotificationServiceImpl::BlinkNotificationServiceImpl(
@@ -67,7 +67,7 @@ index f64eb733ede38501c34b2af89f42255189abd982..3c2dfad7ac9ba64b0b49ebef41a303ed
notification_service_remote_.BindNewPipeAndPassReceiver());
diff --git a/content/browser/notifications/platform_notification_context_impl.cc b/content/browser/notifications/platform_notification_context_impl.cc
index 564d4fdb4d414bdb49d74dc8066dd3de86339dda..32d0ab7f8049dc13e83deac925ef9d10fc1554c1 100644
index 93ae69a720d4d24b5fd11508a9f6ec3c17f559d5..93768924cf442ef4cb36addfe279852b9c0dd444 100644
--- a/content/browser/notifications/platform_notification_context_impl.cc
+++ b/content/browser/notifications/platform_notification_context_impl.cc
@@ -207,12 +207,13 @@ void PlatformNotificationContextImpl::Shutdown() {
@@ -87,7 +87,7 @@ index 564d4fdb4d414bdb49d74dc8066dd3de86339dda..32d0ab7f8049dc13e83deac925ef9d10
void PlatformNotificationContextImpl::RemoveService(
diff --git a/content/browser/notifications/platform_notification_context_impl.h b/content/browser/notifications/platform_notification_context_impl.h
index 83d7c93482bf68ca98ee58de537711dad5844699..edd488efa643e80659cceab476cf53e12f10a1fb 100644
index 4bf25bf1fa69f7d3869369172d375e2e489e62a1..f80ef2cecc8b111dc54e109646573a5978d8ea9c 100644
--- a/content/browser/notifications/platform_notification_context_impl.h
+++ b/content/browser/notifications/platform_notification_context_impl.h
@@ -24,6 +24,7 @@
@@ -107,10 +107,10 @@ index 83d7c93482bf68ca98ee58de537711dad5844699..edd488efa643e80659cceab476cf53e1
mojo::PendingReceiver<blink::mojom::NotificationService> receiver);
diff --git a/content/browser/renderer_interface_binders.cc b/content/browser/renderer_interface_binders.cc
index cfdfae7e861ca6d5025f9478363e063afae326ef..b5dacb158e01091228aa97bb85db1efb24ceb6f7 100644
index 95bed38ac589bd55550704d16fa817610aead6f9..664b7dca4e9c2a09680855e9bc3864c8bd8ac4d5 100644
--- a/content/browser/renderer_interface_binders.cc
+++ b/content/browser/renderer_interface_binders.cc
@@ -196,7 +196,7 @@ void RendererInterfaceBinders::InitializeParameterizedBinderRegistry() {
@@ -201,7 +201,7 @@ void RendererInterfaceBinders::InitializeParameterizedBinderRegistry() {
RenderProcessHost* host, const url::Origin& origin) {
static_cast<StoragePartitionImpl*>(host->GetStoragePartition())
->GetPlatformNotificationContext()
@@ -141,7 +141,7 @@ index ca61088079c4150fcf389504ddcf26bcf6bf69cd..d9c034c39890eef1fe3d95c6d7c0ae68
const GURL& origin,
const blink::PlatformNotificationData& notification_data,
diff --git a/content/test/mock_platform_notification_service.cc b/content/test/mock_platform_notification_service.cc
index faa8e541d9cb530f9212420a4dfd0318069320db..0a244000e60daf8e6bd8e783b41124528a117026 100644
index ba5982883a3821b42c47c80187af2e4d1b3f0ffb..720965aa1df6b415e12a85dd2b2e4475facab019 100644
--- a/content/test/mock_platform_notification_service.cc
+++ b/content/test/mock_platform_notification_service.cc
@@ -29,6 +29,7 @@ MockPlatformNotificationService::MockPlatformNotificationService(

View File

@@ -5,7 +5,7 @@ Subject: out_of_process_instance.patch
diff --git a/pdf/out_of_process_instance.cc b/pdf/out_of_process_instance.cc
index fa1ad2c48fac29d2f5ca93c83943878b3fc1a33f..1e97399067dcb8da735f70b1351ea1d08fb2e0e0 100644
index d4dc099ca7f49d9541b2891f0efdf069d3cebf19..dab9401485cca4f1d58ad4d511e5ce697890a625 100644
--- a/pdf/out_of_process_instance.cc
+++ b/pdf/out_of_process_instance.cc
@@ -466,7 +466,9 @@ bool OutOfProcessInstance::Init(uint32_t argc,

View File

@@ -28,7 +28,7 @@ index 735da93c3cabb8c6139971295740ba14a30d1b69..533f53fbc42397608e3762e370cc935c
// Non-owning pointer to the filter must outlive this class.
explicit ChromeBrowserPepperHostFactory(content::BrowserPpapiHost* host);
diff --git a/chrome/browser/renderer_host/pepper/pepper_broker_message_filter.cc b/chrome/browser/renderer_host/pepper/pepper_broker_message_filter.cc
index 83cedb4c9e1323259afd041e571240cd971e1241..3686ae2fab5f400cf119a54aea547a72655c2b0a 100644
index 37245c48cacbc5db164c61e4499f34ee83e0fce7..0fef12892e965e319e45f5dd1a9c5c9fc606aa9a 100644
--- a/chrome/browser/renderer_host/pepper/pepper_broker_message_filter.cc
+++ b/chrome/browser/renderer_host/pepper/pepper_broker_message_filter.cc
@@ -7,10 +7,12 @@
@@ -61,7 +61,7 @@ index 83cedb4c9e1323259afd041e571240cd971e1241..3686ae2fab5f400cf119a54aea547a72
+ return PP_OK;
}
diff --git a/chrome/browser/renderer_host/pepper/pepper_flash_browser_host.cc b/chrome/browser/renderer_host/pepper/pepper_flash_browser_host.cc
index 9d28e920676edd065f735b8939854468321e99ca..6c086a792e343cf537e46f2c97c21b6257d7268e 100644
index c6c2ac11fd5551fe03978b947d2dda4c016e59ae..2dc392a6eab17b048df730e294398a3a0fb2eb8d 100644
--- a/chrome/browser/renderer_host/pepper/pepper_flash_browser_host.cc
+++ b/chrome/browser/renderer_host/pepper/pepper_flash_browser_host.cc
@@ -8,9 +8,11 @@
@@ -179,7 +179,7 @@ index f2f40b636a41649199a38c663f03e6182df82520..41d11d1f1f9921d4b4deaaf4b2d8ab4b
DISALLOW_COPY_AND_ASSIGN(PepperFlashBrowserHost);
diff --git a/chrome/browser/renderer_host/pepper/pepper_flash_drm_host.cc b/chrome/browser/renderer_host/pepper/pepper_flash_drm_host.cc
index 0a727e8c438462a293db629da07d5aef2b25a9ee..b49303e2c19329715f72d8926cb765289224d000 100644
index 2e51425cb66f25f240ad7f4a052bcf6eb76f2062..240fa299b1160ebb2f9b20c7361405c9b84d5d2f 100644
--- a/chrome/browser/renderer_host/pepper/pepper_flash_drm_host.cc
+++ b/chrome/browser/renderer_host/pepper/pepper_flash_drm_host.cc
@@ -20,6 +20,7 @@
@@ -258,7 +258,7 @@ index b9d2ce7f7f6837ee7b304daac82d21a3147c6faf..4d4b023d62d12b4d119acbfdee64f415
base::WeakPtrFactory<PepperFlashDRMHost> weak_factory_{this};
diff --git a/chrome/browser/renderer_host/pepper/pepper_isolated_file_system_message_filter.cc b/chrome/browser/renderer_host/pepper/pepper_isolated_file_system_message_filter.cc
index 0d083bb09ff17a691c6399d2a5746b44e3196873..2023dc0240220362a1b503da07aa9fab4cb4b434 100644
index 00db4e2fa2ac89d89ecd31174e192dcb17f3e912..df5a53c162059270ad673fffebbd432f6df0d212 100644
--- a/chrome/browser/renderer_host/pepper/pepper_isolated_file_system_message_filter.cc
+++ b/chrome/browser/renderer_host/pepper/pepper_isolated_file_system_message_filter.cc
@@ -8,17 +8,21 @@
@@ -316,7 +316,7 @@ index 0d083bb09ff17a691c6399d2a5746b44e3196873..2023dc0240220362a1b503da07aa9fab
}
PepperIsolatedFileSystemMessageFilter::
@@ -96,6 +102,7 @@ int32_t PepperIsolatedFileSystemMessageFilter::OnResourceMessageReceived(
@@ -95,6 +101,7 @@ int32_t PepperIsolatedFileSystemMessageFilter::OnResourceMessageReceived(
return PP_ERROR_FAILED;
}
@@ -324,7 +324,7 @@ index 0d083bb09ff17a691c6399d2a5746b44e3196873..2023dc0240220362a1b503da07aa9fab
Profile* PepperIsolatedFileSystemMessageFilter::GetProfile() {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
ProfileManager* profile_manager = g_browser_process->profile_manager();
@@ -122,6 +129,7 @@ PepperIsolatedFileSystemMessageFilter::CreateCrxFileSystem(Profile* profile) {
@@ -121,6 +128,7 @@ PepperIsolatedFileSystemMessageFilter::CreateCrxFileSystem(Profile* profile) {
return storage::IsolatedContext::ScopedFSHandle();
#endif
}
@@ -332,7 +332,7 @@ index 0d083bb09ff17a691c6399d2a5746b44e3196873..2023dc0240220362a1b503da07aa9fab
int32_t PepperIsolatedFileSystemMessageFilter::OnOpenFileSystem(
ppapi::host::HostMessageContext* context,
@@ -130,7 +138,7 @@ int32_t PepperIsolatedFileSystemMessageFilter::OnOpenFileSystem(
@@ -129,7 +137,7 @@ int32_t PepperIsolatedFileSystemMessageFilter::OnOpenFileSystem(
case PP_ISOLATEDFILESYSTEMTYPE_PRIVATE_INVALID:
break;
case PP_ISOLATEDFILESYSTEMTYPE_PRIVATE_CRX:
@@ -341,7 +341,7 @@ index 0d083bb09ff17a691c6399d2a5746b44e3196873..2023dc0240220362a1b503da07aa9fab
case PP_ISOLATEDFILESYSTEMTYPE_PRIVATE_PLUGINPRIVATE:
return OpenPluginPrivateFileSystem(context);
}
@@ -140,6 +148,7 @@ int32_t PepperIsolatedFileSystemMessageFilter::OnOpenFileSystem(
@@ -139,6 +147,7 @@ int32_t PepperIsolatedFileSystemMessageFilter::OnOpenFileSystem(
return PP_ERROR_FAILED;
}
@@ -349,7 +349,7 @@ index 0d083bb09ff17a691c6399d2a5746b44e3196873..2023dc0240220362a1b503da07aa9fab
int32_t PepperIsolatedFileSystemMessageFilter::OpenCrxFileSystem(
ppapi::host::HostMessageContext* context) {
#if BUILDFLAG(ENABLE_EXTENSIONS)
@@ -180,6 +189,7 @@ int32_t PepperIsolatedFileSystemMessageFilter::OpenCrxFileSystem(
@@ -179,6 +188,7 @@ int32_t PepperIsolatedFileSystemMessageFilter::OpenCrxFileSystem(
return PP_ERROR_NOTSUPPORTED;
#endif
}

View File

@@ -11,7 +11,7 @@ majority of changes originally come from these PRs:
This patch also fixes callback for manual user cancellation and success.
diff --git a/chrome/browser/printing/print_job_worker.cc b/chrome/browser/printing/print_job_worker.cc
index 63f432b58371cfa0f8079fa78a51c8865a00c183..7b39523e0b8b840191ea517d5f5e8eda701995bc 100644
index 72a0c8cd0f1be0f7713c01ce28323619f09fcc20..b78da10cb607f0f7ce0e97a620908b55f0901c0c 100644
--- a/chrome/browser/printing/print_job_worker.cc
+++ b/chrome/browser/printing/print_job_worker.cc
@@ -21,12 +21,12 @@
@@ -28,25 +28,40 @@ index 63f432b58371cfa0f8079fa78a51c8865a00c183..7b39523e0b8b840191ea517d5f5e8eda
#include "printing/print_job_constants.h"
#include "printing/printed_document.h"
#include "printing/printing_utils.h"
@@ -224,7 +224,15 @@ void PrintJobWorker::UpdatePrintSettingsFromPOD(
@@ -203,9 +203,14 @@ void PrintJobWorker::SetSettingsFromPOD(
void PrintJobWorker::UpdatePrintSettings(base::Value new_settings,
SettingsCallback callback) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
- PrintingContext::Result result =
- printing_context_->UpdatePrintSettings(std::move(new_settings));
- GetSettingsDone(std::move(callback), result);
+ // Reset settings from previous print job
+ printing_context_->ResetSettings();
+ PrintingContext::Result get_default_result = printing_context_->UseDefaultSettings();
+ if (get_default_result == PrintingContext::Result::OK) {
+ PrintingContext::Result update_result =
+ printing_context_->UpdatePrintSettings(std::move(new_settings));
+ GetSettingsDone(std::move(callback), update_result);
+ }
}
#if defined(OS_CHROMEOS)
@@ -221,6 +226,13 @@ void PrintJobWorker::UpdatePrintSettingsFromPOD(
void PrintJobWorker::GetSettingsDone(SettingsCallback callback,
PrintingContext::Result result) {
- std::move(callback).Run(printing_context_->settings(), result);
+ if (result == PrintingContext::CANCEL) {
+ print_job_->PostTask(
+ FROM_HERE,
+ base::BindOnce(&NotificationCallback, base::RetainedRef(print_job_),
+ JobEventDetails::USER_INIT_CANCELED, 0,
+ base::RetainedRef(document_)));
+ } else {
+ std::move(callback).Run(printing_context_->settings(), result);
+ }
std::move(callback).Run(printing_context_->settings(), result);
}
void PrintJobWorker::GetSettingsWithUI(int document_page_count,
diff --git a/chrome/browser/printing/print_view_manager_base.cc b/chrome/browser/printing/print_view_manager_base.cc
index c4e0992f6265b34659514ef5f15eb8d78645161c..e95f62c0761d1a5829cc4403434fd643e45a0a69 100644
index 046cb140b10187e8c2850d990afc4c7a77283ae4..ada5a3d237cd64127412e4ec775a63e807d266e2 100644
--- a/chrome/browser/printing/print_view_manager_base.cc
+++ b/chrome/browser/printing/print_view_manager_base.cc
@@ -27,10 +27,7 @@
@@ -118,7 +133,7 @@ index c4e0992f6265b34659514ef5f15eb8d78645161c..e95f62c0761d1a5829cc4403434fd643
}
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
@@ -244,9 +249,9 @@ void PrintViewManagerBase::StartLocalPrintJob(
@@ -242,9 +247,9 @@ void PrintViewManagerBase::StartLocalPrintJob(
void PrintViewManagerBase::UpdatePrintingEnabled() {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
// The Unretained() is safe because ForEachFrame() is synchronous.
@@ -131,7 +146,7 @@ index c4e0992f6265b34659514ef5f15eb8d78645161c..e95f62c0761d1a5829cc4403434fd643
}
void PrintViewManagerBase::NavigationStopped() {
@@ -338,7 +343,7 @@ void PrintViewManagerBase::OnPrintingFailed(int cookie) {
@@ -342,7 +347,7 @@ void PrintViewManagerBase::OnPrintingFailed(int cookie) {
PrintManager::OnPrintingFailed(cookie);
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
@@ -140,7 +155,7 @@ index c4e0992f6265b34659514ef5f15eb8d78645161c..e95f62c0761d1a5829cc4403434fd643
#endif
ReleasePrinterQuery();
@@ -438,9 +443,13 @@ void PrintViewManagerBase::OnNotifyPrintJobEvent(
@@ -440,9 +445,13 @@ void PrintViewManagerBase::OnNotifyPrintJobEvent(
content::NotificationService::NoDetails());
break;
}
@@ -156,7 +171,7 @@ index c4e0992f6265b34659514ef5f15eb8d78645161c..e95f62c0761d1a5829cc4403434fd643
NOTREACHED();
break;
}
@@ -535,8 +544,6 @@ bool PrintViewManagerBase::CreateNewPrintJob(
@@ -537,8 +546,6 @@ bool PrintViewManagerBase::CreateNewPrintJob(
DCHECK(!quit_inner_loop_);
DCHECK(query);
@@ -165,7 +180,7 @@ index c4e0992f6265b34659514ef5f15eb8d78645161c..e95f62c0761d1a5829cc4403434fd643
// We can't print if there is no renderer.
if (!web_contents()->GetRenderViewHost() ||
@@ -547,8 +554,6 @@ bool PrintViewManagerBase::CreateNewPrintJob(
@@ -549,8 +556,6 @@ bool PrintViewManagerBase::CreateNewPrintJob(
DCHECK(!print_job_);
print_job_ = base::MakeRefCounted<PrintJob>();
print_job_->Initialize(std::move(query), RenderSourceName(), number_pages_);
@@ -174,7 +189,7 @@ index c4e0992f6265b34659514ef5f15eb8d78645161c..e95f62c0761d1a5829cc4403434fd643
printing_succeeded_ = false;
return true;
}
@@ -597,6 +602,13 @@ void PrintViewManagerBase::ReleasePrintJob() {
@@ -599,6 +604,13 @@ void PrintViewManagerBase::ReleasePrintJob() {
content::RenderFrameHost* rfh = printing_rfh_;
printing_rfh_ = nullptr;
@@ -188,16 +203,19 @@ index c4e0992f6265b34659514ef5f15eb8d78645161c..e95f62c0761d1a5829cc4403434fd643
if (!print_job_)
return;
@@ -607,7 +619,7 @@ void PrintViewManagerBase::ReleasePrintJob() {
@@ -608,8 +620,9 @@ void PrintViewManagerBase::ReleasePrintJob() {
rfh->Send(msg.release());
}
registrar_.Remove(this, chrome::NOTIFICATION_PRINT_JOB_EVENT,
- registrar_.Remove(this, chrome::NOTIFICATION_PRINT_JOB_EVENT,
- content::Source<PrintJob>(print_job_.get()));
+ content::NotificationService::AllSources());
+ if (!callback_.is_null())
+ registrar_.Remove(this, chrome::NOTIFICATION_PRINT_JOB_EVENT,
+ content::NotificationService::AllSources());
// Don't close the worker thread.
print_job_ = nullptr;
}
@@ -677,6 +689,9 @@ bool PrintViewManagerBase::PrintNowInternal(
@@ -679,6 +692,9 @@ bool PrintViewManagerBase::PrintNowInternal(
// Don't print / print preview interstitials or crashed tabs.
if (web_contents()->ShowingInterstitialPage() || web_contents()->IsCrashed())
return false;
@@ -208,10 +226,10 @@ index c4e0992f6265b34659514ef5f15eb8d78645161c..e95f62c0761d1a5829cc4403434fd643
}
diff --git a/chrome/browser/printing/print_view_manager_base.h b/chrome/browser/printing/print_view_manager_base.h
index 925736d379c34ac7ddc07032305d24e1ae65e4b3..a8b2b31ec8bcb04d83df368b12d124dcdbb8b55d 100644
index dd12f557535feea98991d6563e6c7e82b58d6498..5fa7cc4d82f55058f33ca05e687b062c45578f62 100644
--- a/chrome/browser/printing/print_view_manager_base.h
+++ b/chrome/browser/printing/print_view_manager_base.h
@@ -39,6 +39,8 @@ class PrintJob;
@@ -33,6 +33,8 @@ class PrintJob;
class PrintQueriesQueue;
class PrinterQuery;
@@ -220,7 +238,7 @@ index 925736d379c34ac7ddc07032305d24e1ae65e4b3..a8b2b31ec8bcb04d83df368b12d124dc
// Base class for managing the print commands for a WebContents.
class PrintViewManagerBase : public content::NotificationObserver,
public PrintManager {
@@ -48,7 +50,9 @@ class PrintViewManagerBase : public content::NotificationObserver,
@@ -42,7 +44,9 @@ class PrintViewManagerBase : public content::NotificationObserver,
// Prints the current document immediately. Since the rendering is
// asynchronous, the actual printing will not be completed on the return of
// this function. Returns false if printing is impossible at the moment.
@@ -231,7 +249,7 @@ index 925736d379c34ac7ddc07032305d24e1ae65e4b3..a8b2b31ec8bcb04d83df368b12d124dc
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
// Prints the document in |print_data| with settings specified in
@@ -195,9 +199,15 @@ class PrintViewManagerBase : public content::NotificationObserver,
@@ -196,9 +200,15 @@ class PrintViewManagerBase : public content::NotificationObserver,
// The current RFH that is printing with a system printing dialog.
content::RenderFrameHost* printing_rfh_;
@@ -248,7 +266,7 @@ index 925736d379c34ac7ddc07032305d24e1ae65e4b3..a8b2b31ec8bcb04d83df368b12d124dc
// This means we are _blocking_ until all the necessary pages have been
// rendered or the print settings are being loaded.
diff --git a/chrome/browser/printing/printing_message_filter.cc b/chrome/browser/printing/printing_message_filter.cc
index 706617b7924cfbf25e4f3a04a40d9ee977e6fd69..6e3c3743e5da782e227e1ec3dba83ed7b401f3de 100644
index 355324f069bcccead875cc591c20e456d20a6f5b..fe889df2a0acf271b667813ef430a3bae1c84c31 100644
--- a/chrome/browser/printing/printing_message_filter.cc
+++ b/chrome/browser/printing/printing_message_filter.cc
@@ -21,6 +21,7 @@
@@ -281,7 +299,7 @@ index 706617b7924cfbf25e4f3a04a40d9ee977e6fd69..6e3c3743e5da782e227e1ec3dba83ed7
+ #if 0
is_printing_enabled_.Init(prefs::kPrintingEnabled, profile->GetPrefs());
is_printing_enabled_.MoveToSequence(
base::CreateSingleThreadTaskRunnerWithTraits({BrowserThread::IO}));
base::CreateSingleThreadTaskRunner({BrowserThread::IO}));
+ #endif
}
@@ -314,7 +332,18 @@ index 706617b7924cfbf25e4f3a04a40d9ee977e6fd69..6e3c3743e5da782e227e1ec3dba83ed7
std::unique_ptr<PrinterQuery> printer_query =
queue_->PopPrinterQuery(document_cookie);
if (!printer_query) {
@@ -295,7 +303,7 @@ void PrintingMessageFilter::OnUpdatePrintSettingsReply(
@@ -257,7 +265,9 @@ void PrintingMessageFilter::OnUpdatePrintSettingsReply(
std::unique_ptr<PrinterQuery> printer_query,
IPC::Message* reply_msg) {
PrintMsg_PrintPages_Params params;
- if (!printer_query || printer_query->last_status() != PrintingContext::OK) {
+ // We call update without first printing from defaults,
+ // so the last printer status will still be defaulted to PrintingContext::FAILED
+ if (!printer_query) {
params.Reset();
} else {
RenderParamsFromPrintSettings(printer_query->settings(), &params.params);
@@ -295,7 +305,7 @@ void PrintingMessageFilter::OnUpdatePrintSettingsReply(
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
void PrintingMessageFilter::OnCheckForCancel(const PrintHostMsg_PreviewIds& ids,
bool* cancel) {
@@ -349,23 +378,22 @@ index 9fbea6d0a2dbe55b1d600fbc217dee5aa8ae8cd5..de9bd267e408c02fd4da7d903523c0e6
// content::BrowserMessageFilter:
bool OnMessageReceived(const IPC::Message& message) override;
diff --git a/components/printing/common/print_messages.h b/components/printing/common/print_messages.h
index 1802034a6e15a6ad8b0d9591cfb79ba5873dc982..a827091facdb4f6b1d74ce826c3492ced27c008e 100644
index 1802034a6e15a6ad8b0d9591cfb79ba5873dc982..331ac71d925c056d3b7577123251514c35f30fde 100644
--- a/components/printing/common/print_messages.h
+++ b/components/printing/common/print_messages.h
@@ -368,7 +368,10 @@ IPC_MESSAGE_ROUTED0(PrintMsg_PrintNodeUnderContextMenu)
@@ -368,7 +368,9 @@ IPC_MESSAGE_ROUTED0(PrintMsg_PrintNodeUnderContextMenu)
#if BUILDFLAG(ENABLE_PRINTING)
// Tells the RenderFrame to switch the CSS to print media type, renders every
// requested pages and switch back the CSS to display media type.
-IPC_MESSAGE_ROUTED0(PrintMsg_PrintPages)
+IPC_MESSAGE_ROUTED3(PrintMsg_PrintPages,
+IPC_MESSAGE_ROUTED2(PrintMsg_PrintPages,
+ bool /* silent print */,
+ bool /* print page's background */,
+ base::DictionaryValue /* settings */)
// Like PrintMsg_PrintPages, but using the print preview document's frame/node.
IPC_MESSAGE_ROUTED0(PrintMsg_PrintForSystemDialog)
diff --git a/components/printing/renderer/print_render_frame_helper.cc b/components/printing/renderer/print_render_frame_helper.cc
index ef580254bd8feba84ac02924b77b9b4feaf14d96..57a8264a7174b440ed1d6bfe9c2c3e21552d950b 100644
index 1a65567cb5c5f98b60d05679700c5eb91d49a229..612766fe63166b047e4f0385f219f6615023fcb6 100644
--- a/components/printing/renderer/print_render_frame_helper.cc
+++ b/components/printing/renderer/print_render_frame_helper.cc
@@ -37,6 +37,7 @@
@@ -376,49 +404,47 @@ index ef580254bd8feba84ac02924b77b9b4feaf14d96..57a8264a7174b440ed1d6bfe9c2c3e21
#include "printing/units.h"
#include "third_party/blink/public/common/frame/frame_owner_element_type.h"
#include "third_party/blink/public/common/frame/sandbox_flags.h"
@@ -1116,7 +1117,9 @@ void PrintRenderFrameHelper::ScriptedPrint(bool user_initiated) {
@@ -1117,7 +1118,8 @@ void PrintRenderFrameHelper::ScriptedPrint(bool user_initiated) {
web_frame->DispatchBeforePrintEvent();
if (!weak_this)
return;
- Print(web_frame, blink::WebNode(), PrintRequestType::kScripted);
+ Print(web_frame, blink::WebNode(), PrintRequestType::kScripted,
+ false /* silent */, false /* print_background */,
+ base::DictionaryValue() /* new_settings */);
+ false /* silent */, base::DictionaryValue() /* new_settings */);
if (weak_this)
web_frame->DispatchAfterPrintEvent();
}
@@ -1164,7 +1167,10 @@ void PrintRenderFrameHelper::OnDestruct() {
@@ -1165,7 +1167,9 @@ void PrintRenderFrameHelper::OnDestruct() {
delete this;
}
-void PrintRenderFrameHelper::OnPrintPages() {
+void PrintRenderFrameHelper::OnPrintPages(
+ bool silent,
+ bool print_background,
+ const base::DictionaryValue& settings) {
if (ipc_nesting_level_ > 1)
return;
@@ -1177,7 +1183,8 @@ void PrintRenderFrameHelper::OnPrintPages() {
@@ -1178,7 +1182,8 @@ void PrintRenderFrameHelper::OnPrintPages() {
// If we are printing a PDF extension frame, find the plugin node and print
// that instead.
auto plugin = delegate_->GetPdfElement(frame);
- Print(frame, plugin, PrintRequestType::kRegular);
+ Print(frame, plugin, PrintRequestType::kRegular,
+ silent, print_background, settings);
+ silent, settings);
if (weak_this)
frame->DispatchAfterPrintEvent();
// WARNING: |this| may be gone at this point. Do not do any more work here and
@@ -1194,7 +1201,7 @@ void PrintRenderFrameHelper::OnPrintForSystemDialog() {
@@ -1195,7 +1200,7 @@ void PrintRenderFrameHelper::OnPrintForSystemDialog() {
}
auto weak_this = weak_ptr_factory_.GetWeakPtr();
Print(frame, print_preview_context_.source_node(),
- PrintRequestType::kRegular);
+ PrintRequestType::kRegular, false, false, base::DictionaryValue());
+ PrintRequestType::kRegular, false, base::DictionaryValue());
if (weak_this)
frame->DispatchAfterPrintEvent();
// WARNING: |this| may be gone at this point. Do not do any more work here and
@@ -1230,6 +1237,8 @@ void PrintRenderFrameHelper::OnPrintPreview(
@@ -1231,6 +1236,8 @@ void PrintRenderFrameHelper::OnPrintPreview(
if (ipc_nesting_level_ > 1)
return;
@@ -427,31 +453,29 @@ index ef580254bd8feba84ac02924b77b9b4feaf14d96..57a8264a7174b440ed1d6bfe9c2c3e21
print_preview_context_.OnPrintPreview();
UMA_HISTOGRAM_ENUMERATION("PrintPreview.PreviewEvent",
@@ -1622,7 +1631,10 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
@@ -1623,7 +1630,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
auto self = weak_ptr_factory_.GetWeakPtr();
Print(duplicate_node.GetDocument().GetFrame(), duplicate_node,
- PrintRequestType::kRegular);
+ PrintRequestType::kRegular,
+ false /* silent */,
+ false /* print_background */,
+ base::DictionaryValue() /* new_settings */);
// Check if |this| is still valid.
if (!self)
return;
@@ -1633,7 +1645,10 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
@@ -1634,7 +1643,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
const blink::WebNode& node,
- PrintRequestType print_request_type) {
+ PrintRequestType print_request_type,
+ bool silent,
+ bool print_background,
+ const base::DictionaryValue& settings) {
// If still not finished with earlier print request simply ignore.
if (prep_frame_view_)
return;
@@ -1641,7 +1656,7 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
@@ -1642,7 +1653,7 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
FrameReference frame_ref(frame);
int expected_page_count = 0;
@@ -460,7 +484,7 @@ index ef580254bd8feba84ac02924b77b9b4feaf14d96..57a8264a7174b440ed1d6bfe9c2c3e21
DidFinishPrinting(FAIL_PRINT_INIT);
return; // Failed to init print page settings.
}
@@ -1661,8 +1676,11 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
@@ -1662,8 +1673,11 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
PrintMsg_PrintPages_Params print_settings;
auto self = weak_ptr_factory_.GetWeakPtr();
@@ -474,15 +498,7 @@ index ef580254bd8feba84ac02924b77b9b4feaf14d96..57a8264a7174b440ed1d6bfe9c2c3e21
// Check if |this| is still valid.
if (!self)
return;
@@ -1672,6 +1690,7 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
? blink::kWebPrintScalingOptionSourceSize
: scaling_option;
SetPrintPagesParams(print_settings);
+ print_settings.params.should_print_backgrounds = print_background;
if (print_settings.params.dpi.IsEmpty() ||
!print_settings.params.document_cookie) {
DidFinishPrinting(OK); // Release resources and fail silently on failure.
@@ -1867,10 +1886,24 @@ std::vector<int> PrintRenderFrameHelper::GetPrintedPages(
@@ -1868,10 +1882,23 @@ std::vector<int> PrintRenderFrameHelper::GetPrintedPages(
return printed_pages;
}
@@ -494,23 +510,22 @@ index ef580254bd8feba84ac02924b77b9b4feaf14d96..57a8264a7174b440ed1d6bfe9c2c3e21
- Send(new PrintHostMsg_GetDefaultPrintSettings(routing_id(),
- &settings.params));
+ if (new_settings.empty()) {
+ // Send the default IPC message if caller is window.print()
+ Send(new PrintHostMsg_GetDefaultPrintSettings(routing_id(),
+ &settings.params));
+ } else {
+ // Send the cookie so that UpdatePrintSettings can reuse PrinterQuery when
+ // possible.
+ int cookie =
+ print_pages_params_ ? print_pages_params_->params.document_cookie : 0;
+ // Send the update IPC message if caller is webContents.print()
+ bool canceled = false;
+ Send(new PrintHostMsg_UpdatePrintSettings(
+ routing_id(), cookie, new_settings, &settings, &canceled));
+ routing_id(), 0, new_settings, &settings, &canceled));
+ if (canceled)
+ return false;
+ }
+
// Check if the printer returned any settings, if the settings is empty, we
// can safely assume there are no printer drivers configured. So we safely
// terminate.
@@ -1890,12 +1923,14 @@ bool PrintRenderFrameHelper::InitPrintSettings(bool fit_to_paper_size) {
@@ -1891,12 +1918,14 @@ bool PrintRenderFrameHelper::InitPrintSettings(bool fit_to_paper_size) {
return result;
}
@@ -530,33 +545,31 @@ index ef580254bd8feba84ac02924b77b9b4feaf14d96..57a8264a7174b440ed1d6bfe9c2c3e21
Send(new PrintHostMsg_ShowInvalidPrinterSettingsError(routing_id()));
return false;
diff --git a/components/printing/renderer/print_render_frame_helper.h b/components/printing/renderer/print_render_frame_helper.h
index 71c0c15217b62cd7a6087c6d9ae50481f9041d5f..e2250a66517dbd909cd3b5407173ad91c11ec32f 100644
index 71c0c15217b62cd7a6087c6d9ae50481f9041d5f..18d853d7f808aaf816de86e8c5b8231738d16f55 100644
--- a/components/printing/renderer/print_render_frame_helper.h
+++ b/components/printing/renderer/print_render_frame_helper.h
@@ -193,7 +193,9 @@ class PrintRenderFrameHelper
@@ -193,7 +193,8 @@ class PrintRenderFrameHelper
bool OnMessageReceived(const IPC::Message& message) override;
// Message handlers ---------------------------------------------------------
- void OnPrintPages();
+ void OnPrintPages(bool silent,
+ bool print_background,
+ const base::DictionaryValue& settings);
void OnPrintForSystemDialog();
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
void OnInitiatePrintPreview(bool has_selection);
@@ -243,7 +245,10 @@ class PrintRenderFrameHelper
@@ -243,7 +244,9 @@ class PrintRenderFrameHelper
// WARNING: |this| may be gone after this method returns.
void Print(blink::WebLocalFrame* frame,
const blink::WebNode& node,
- PrintRequestType print_request_type);
+ PrintRequestType print_request_type,
+ bool silent,
+ bool print_background,
+ const base::DictionaryValue& settings);
// Notification when printing is done - signal tear-down/free resources.
void DidFinishPrinting(PrintingResult result);
@@ -252,12 +257,14 @@ class PrintRenderFrameHelper
@@ -252,12 +255,14 @@ class PrintRenderFrameHelper
// Initialize print page settings with default settings.
// Used only for native printing workflow.
@@ -573,3 +586,54 @@ index 71c0c15217b62cd7a6087c6d9ae50481f9041d5f..e2250a66517dbd909cd3b5407173ad91
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
// Set options for print preset from source PDF document.
diff --git a/printing/print_settings_conversion.cc b/printing/print_settings_conversion.cc
index 17c363ff9aa2e2262cacd0c9baea3820334bf67b..5b02461c2e9afe254405ddacd904e4bdbddd0b8b 100644
--- a/printing/print_settings_conversion.cc
+++ b/printing/print_settings_conversion.cc
@@ -184,11 +184,12 @@ bool PrintSettingsFromJobSettings(const base::Value& job_settings,
settings->set_dpi_xy(dpi_horizontal.value(), dpi_vertical.value());
#endif
+ if (!device_name->empty())
+ settings->set_device_name(base::UTF8ToUTF16(*device_name));
settings->set_collate(collate.value());
settings->set_copies(copies.value());
settings->SetOrientation(landscape.value());
- settings->set_device_name(base::UTF8ToUTF16(*device_name));
settings->set_duplex_mode(static_cast<DuplexMode>(duplex_mode.value()));
settings->set_color(static_cast<ColorModel>(color.value()));
settings->set_scale_factor(static_cast<double>(scale_factor.value()) / 100.0);
diff --git a/printing/printing_context.cc b/printing/printing_context.cc
index 78e3c3b2e1bea0f3626838eab14267847a556470..b1c16e6eb1d0d9c0a8b700d9faf408d602f962ea 100644
--- a/printing/printing_context.cc
+++ b/printing/printing_context.cc
@@ -77,8 +77,6 @@ PrintingContext::Result PrintingContext::UsePdfSettings() {
PrintingContext::Result PrintingContext::UpdatePrintSettings(
base::Value job_settings) {
- ResetSettings();
-
if (!PrintSettingsFromJobSettings(job_settings, &settings_)) {
NOTREACHED();
return OnError();
diff --git a/printing/printing_context.h b/printing/printing_context.h
index 9ccc1a6680bcedd452cade7f7531924ace7876cf..4e1c330c01a1d6d1ba702337f16d8f8a70cd76f5 100644
--- a/printing/printing_context.h
+++ b/printing/printing_context.h
@@ -129,12 +129,12 @@ class PRINTING_EXPORT PrintingContext {
int job_id() const { return job_id_; }
- protected:
- explicit PrintingContext(Delegate* delegate);
-
// Reinitializes the settings for object reuse.
void ResetSettings();
+ protected:
+ explicit PrintingContext(Delegate* delegate);
+
// Does bookkeeping when an error occurs.
PrintingContext::Result OnError();

View File

@@ -8,7 +8,7 @@ needed in chromium but our autofill implementation uses them. This patch can be
our autofill implementation to work like chromium.
diff --git a/chrome/browser/ui/libgtkui/native_theme_gtk.cc b/chrome/browser/ui/libgtkui/native_theme_gtk.cc
index 3044d7b1829397a97b9a1ef9f115587bab74339d..c578d16c995c11daf90484593b5f9649d37b7041 100644
index 4edc178d601f764721b8c13b639f6ed073417c43..15c1375b193d71a2ab195d09b22b0969b738395b 100644
--- a/chrome/browser/ui/libgtkui/native_theme_gtk.cc
+++ b/chrome/browser/ui/libgtkui/native_theme_gtk.cc
@@ -280,6 +280,27 @@ SkColor SkColorFromColorId(ui::NativeTheme::ColorId color_id) {
@@ -40,10 +40,10 @@ index 3044d7b1829397a97b9a1ef9f115587bab74339d..c578d16c995c11daf90484593b5f9649
// TODO(thomasanderson): Render GtkSpinner directly.
case ui::NativeTheme::kColorId_ThrobberSpinningColor:
diff --git a/ui/native_theme/common_theme.cc b/ui/native_theme/common_theme.cc
index 489369300d48dbfacb8c5489e06b77218f526bf4..340026b3dac4e833d3448d83db7b92c136134726 100644
index 8bd17ec4a9340881694c1aded2c19769d0867edb..bc02c137279dbb672984a59f0a3b546ce5e39012 100644
--- a/ui/native_theme/common_theme.cc
+++ b/ui/native_theme/common_theme.cc
@@ -51,6 +51,14 @@ SkColor GetAuraColor(NativeTheme::ColorId color_id,
@@ -56,6 +56,14 @@ SkColor GetAuraColor(NativeTheme::ColorId color_id,
case NativeTheme::kColorId_BubbleFooterBackground:
return SkColorSetRGB(0x32, 0x36, 0x39);
@@ -58,7 +58,7 @@ index 489369300d48dbfacb8c5489e06b77218f526bf4..340026b3dac4e833d3448d83db7b92c1
// FocusableBorder
case NativeTheme::kColorId_FocusedBorderColor:
return SkColorSetA(gfx::kGoogleBlue300, 0x66);
@@ -351,6 +359,18 @@ SkColor GetAuraColor(NativeTheme::ColorId color_id,
@@ -360,6 +368,18 @@ SkColor GetAuraColor(NativeTheme::ColorId color_id,
case NativeTheme::kColorId_UnfocusedBorderColor:
return SkColorSetA(SK_ColorBLACK, 0x66);
@@ -78,10 +78,10 @@ index 489369300d48dbfacb8c5489e06b77218f526bf4..340026b3dac4e833d3448d83db7b92c1
case NativeTheme::kColorId_ThrobberSpinningColor:
return gfx::kGoogleBlue600;
diff --git a/ui/native_theme/native_theme.h b/ui/native_theme/native_theme.h
index 97ced9d2495c33aad710d8ec5208b8107cd94ed9..62dc2fdad120e0cee44b15848d1ebb813ccb8559 100644
index d12315d778468333b41308e664d78f0b1ad0391e..8ecad2a7560c124f2a5b412a6d7ed9e60616aa34 100644
--- a/ui/native_theme/native_theme.h
+++ b/ui/native_theme/native_theme.h
@@ -367,6 +367,11 @@ class NATIVE_THEME_EXPORT NativeTheme {
@@ -387,6 +387,11 @@ class NATIVE_THEME_EXPORT NativeTheme {
kColorId_TableHeaderText,
kColorId_TableHeaderBackground,
kColorId_TableHeaderSeparator,
@@ -94,24 +94,24 @@ index 97ced9d2495c33aad710d8ec5208b8107cd94ed9..62dc2fdad120e0cee44b15848d1ebb81
kColorId_ThrobberSpinningColor,
kColorId_ThrobberWaitingColor,
diff --git a/ui/native_theme/native_theme_win.cc b/ui/native_theme/native_theme_win.cc
index c6a0c1b9775f9d7e7a9be15d6f15ce84acf68b68..3b3a909bd920a7bf8f54fac4c00f29ce9556c20c 100644
index 257206023976b889590bc225f6542881e8a5d463..3003643bfb78cec2f5e84fc9e1471e1ef54aae41 100644
--- a/ui/native_theme/native_theme_win.cc
+++ b/ui/native_theme/native_theme_win.cc
@@ -548,6 +548,17 @@ SkColor NativeThemeWin::GetSystemColor(ColorId color_id) const {
@@ -559,6 +559,17 @@ SkColor NativeThemeWin::GetSystemColor(ColorId color_id,
case kColorId_TableGroupingIndicatorColor:
return system_colors_[COLOR_GRAYTEXT];
return system_colors_[SystemThemeColor::kGrayText];
+ // Results Tables
+ case kColorId_ResultsTableNormalBackground:
+ return system_colors_[COLOR_WINDOW];
+ return system_colors_[SystemThemeColor::kWindow];
+ case kColorId_ResultsTableHoveredBackground:
+ return color_utils::AlphaBlend(system_colors_[COLOR_HIGHLIGHT],
+ system_colors_[COLOR_WINDOW], 0.25f);
+ return color_utils::AlphaBlend(system_colors_[SystemThemeColor::kWindowText],
+ system_colors_[SystemThemeColor::kWindow], 0.25f);
+ case kColorId_ResultsTableNormalText:
+ return system_colors_[COLOR_WINDOWTEXT];
+ return system_colors_[SystemThemeColor::kWindowText];
+ case kColorId_ResultsTableDimmedText:
+ return color_utils::AlphaBlend(system_colors_[COLOR_WINDOWTEXT],
+ system_colors_[COLOR_WINDOW], 0.5f);
+ return color_utils::AlphaBlend(system_colors_[SystemThemeColor::kWindowText],
+ system_colors_[SystemThemeColor::kWindow], 0.5f);
default:
break;
}

View File

@@ -25,7 +25,7 @@ index f41270e262784602c90b79b7aefbcd1a7af43dd8..a28ea7ee72fbf596b2b1d10cacaad406
const blink::WebMouseEvent& event,
const ui::LatencyInfo& latency) {
diff --git a/content/browser/renderer_host/render_widget_host_view_base.h b/content/browser/renderer_host/render_widget_host_view_base.h
index 8e523d78e7655262b18e1b52d8365120df387908..cf9e284267d767ed35013a7aa5f675cebb3c68bb 100644
index 1381c94013e5d9881f131fcab1926698f6b1fe9f..feeb351e2ba929abe82b9a4fe4b5b6982e925156 100644
--- a/content/browser/renderer_host/render_widget_host_view_base.h
+++ b/content/browser/renderer_host/render_widget_host_view_base.h
@@ -24,9 +24,11 @@

View File

@@ -52,10 +52,10 @@ Some alternatives to this patch:
None of these options seems like a substantial maintainability win over this patch to me (@nornagon).
diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn
index e107dd9f5d264b17601a67edafe9bd61c4d767c3..85e6af67276684202fadd7a4ca4e58252f222c70 100644
index cc6c2943fb92226341276071cbe15bfb9a6f13bc..8547a9208814eedb9cb94de3f16f233e2c8ed0bc 100644
--- a/chrome/BUILD.gn
+++ b/chrome/BUILD.gn
@@ -1716,7 +1716,7 @@ if (is_chrome_branded && !is_android) {
@@ -1626,7 +1626,7 @@ if (is_chrome_branded && !is_android) {
}
}
@@ -64,7 +64,7 @@ index e107dd9f5d264b17601a67edafe9bd61c4d767c3..85e6af67276684202fadd7a4ca4e5825
chrome_paks("packed_resources") {
if (is_mac) {
output_dir = "$root_gen_dir/repack"
@@ -1740,6 +1740,12 @@ if (!is_android) {
@@ -1650,6 +1650,12 @@ if (!is_android) {
}
}

Some files were not shown because too many files have changed in this diff Show More