mirror of
https://github.com/electron/electron.git
synced 2026-02-19 03:14:51 -05:00
Compare commits
141 Commits
v10.0.0-be
...
v10.1.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fbd99fbed1 | ||
|
|
d563c79521 | ||
|
|
2ccfb825df | ||
|
|
88d7bdc8c8 | ||
|
|
c6eeff8055 | ||
|
|
f99afa4d58 | ||
|
|
303b420200 | ||
|
|
fa3652a14f | ||
|
|
fdbd2439a6 | ||
|
|
ac3e10c88c | ||
|
|
5067b012d4 | ||
|
|
ae80f43675 | ||
|
|
9b6b09216b | ||
|
|
34a246e3ce | ||
|
|
0dea6fa7f0 | ||
|
|
61dc1c88fd | ||
|
|
c63327f9b2 | ||
|
|
615dce3275 | ||
|
|
4ea6af64a7 | ||
|
|
66b6789c50 | ||
|
|
749b134e09 | ||
|
|
1c3ebfdc30 | ||
|
|
2206330795 | ||
|
|
10de79126a | ||
|
|
a42fa5158f | ||
|
|
f2c6053111 | ||
|
|
34a321f46b | ||
|
|
deb78453c0 | ||
|
|
d73b67f386 | ||
|
|
0b834877fe | ||
|
|
4df5ecdf82 | ||
|
|
a980ad5645 | ||
|
|
7cc0cb4331 | ||
|
|
414aa3111b | ||
|
|
5753370c8d | ||
|
|
606919f701 | ||
|
|
1861392561 | ||
|
|
e492b88f9f | ||
|
|
da5eac885d | ||
|
|
44ecd34289 | ||
|
|
c5b5ca50a6 | ||
|
|
4b7b3dc4f2 | ||
|
|
4a43487b39 | ||
|
|
a799860d7e | ||
|
|
93727d6a11 | ||
|
|
207fbecddf | ||
|
|
588ae53970 | ||
|
|
8a8fe090ae | ||
|
|
711bab1950 | ||
|
|
50046f8df6 | ||
|
|
9193d35769 | ||
|
|
8191a8418f | ||
|
|
f4600bdfdf | ||
|
|
7fd8e6a14e | ||
|
|
a1abe6b64c | ||
|
|
a6f22059af | ||
|
|
3089bf939f | ||
|
|
180204887a | ||
|
|
af59f68281 | ||
|
|
e9c9a6f177 | ||
|
|
6582017231 | ||
|
|
4e82a50883 | ||
|
|
7079304a6c | ||
|
|
8fb28051a4 | ||
|
|
72901f9d91 | ||
|
|
838e00a523 | ||
|
|
596136ae99 | ||
|
|
8e1daa4449 | ||
|
|
5c19e983f9 | ||
|
|
cf5be544b6 | ||
|
|
28a9fb8ea2 | ||
|
|
cf935eb81b | ||
|
|
f47f8df7f9 | ||
|
|
d77f4f62fd | ||
|
|
276d17a063 | ||
|
|
f6ddfd70b3 | ||
|
|
04f652a53b | ||
|
|
04c5f4acac | ||
|
|
ca15aa70d6 | ||
|
|
96bc80ace7 | ||
|
|
e3cf1ab030 | ||
|
|
04e3a95b85 | ||
|
|
58045d85c8 | ||
|
|
08fc9dfc40 | ||
|
|
5fb3e0359d | ||
|
|
325444e1c8 | ||
|
|
bc4884788c | ||
|
|
0a766acc73 | ||
|
|
578aef4714 | ||
|
|
c9c89f9c8e | ||
|
|
9d90a994cf | ||
|
|
3cfdc086bb | ||
|
|
6c04533fca | ||
|
|
99f1d7e57a | ||
|
|
009105db4f | ||
|
|
b2f09a1469 | ||
|
|
74212577e5 | ||
|
|
8da4e299c6 | ||
|
|
b2ffded4a9 | ||
|
|
039a8ab49b | ||
|
|
1b4b4fddaa | ||
|
|
fdde45379e | ||
|
|
9462e9a3ed | ||
|
|
d08e31c6b4 | ||
|
|
b2449f3ce1 | ||
|
|
683c0c0491 | ||
|
|
91a6399c22 | ||
|
|
799a04a4c0 | ||
|
|
82092471e4 | ||
|
|
39a931968c | ||
|
|
bd7f6a9090 | ||
|
|
2d747acd67 | ||
|
|
8371e83a9d | ||
|
|
22c804a4ad | ||
|
|
5481ddf9df | ||
|
|
4c596ab969 | ||
|
|
328c5c7b46 | ||
|
|
5b8d4240d6 | ||
|
|
d52412dea7 | ||
|
|
39edbd6af4 | ||
|
|
30db185060 | ||
|
|
c804212426 | ||
|
|
7a5b18b0d6 | ||
|
|
d608a30015 | ||
|
|
74efe8d834 | ||
|
|
3283211a15 | ||
|
|
d4a6affa4b | ||
|
|
73e13ab6d6 | ||
|
|
c32c69604a | ||
|
|
2761be6467 | ||
|
|
30cb2b134b | ||
|
|
48cd3eeced | ||
|
|
831b6fa227 | ||
|
|
91ce51cfb3 | ||
|
|
bf1870facc | ||
|
|
39bc7c82a6 | ||
|
|
991d982622 | ||
|
|
195662ead0 | ||
|
|
d580cc1578 | ||
|
|
d8de43f534 | ||
|
|
c48a6b48c9 |
@@ -313,12 +313,15 @@ step-get-more-space-on-mac: &step-get-more-space-on-mac
|
||||
command: |
|
||||
if [ "`uname`" == "Darwin" ]; then
|
||||
sudo rm -rf /Library/Developer/CoreSimulator
|
||||
sudo rm -rf /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform
|
||||
sudo rm -rf /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform
|
||||
sudo rm -rf /Applications/Xcode.app/Contents/Developer/Platforms/WatchOS.platform
|
||||
sudo rm -rf /Applications/Xcode.app/Contents/Developer/Platforms/WatchSimulator.platform
|
||||
sudo rm -rf /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVSimulator.platform
|
||||
sudo rm -rf /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform
|
||||
sudo rm -rf $(xcode-select -p)/Platforms/AppleTVOS.platform
|
||||
sudo rm -rf $(xcode-select -p)/Platforms/iPhoneOS.platform
|
||||
sudo rm -rf $(xcode-select -p)/Platforms/WatchOS.platform
|
||||
sudo rm -rf $(xcode-select -p)/Platforms/WatchSimulator.platform
|
||||
sudo rm -rf $(xcode-select -p)/Platforms/AppleTVSimulator.platform
|
||||
sudo rm -rf $(xcode-select -p)/Platforms/iPhoneSimulator.platform
|
||||
sudo rm -rf ~/.rubies
|
||||
sudo rm -rf ~/Library/Caches/Homebrew
|
||||
sudo rm -rf /usr/local/Homebrew
|
||||
fi
|
||||
|
||||
# On macOS delete all .git directories under src/ expect for
|
||||
@@ -707,12 +710,11 @@ step-hunspell-store: &step-hunspell-store
|
||||
step-maybe-generate-breakpad-symbols: &step-maybe-generate-breakpad-symbols
|
||||
run:
|
||||
name: Generate breakpad symbols
|
||||
no_output_timeout: 30m
|
||||
command: |
|
||||
if [ "$GENERATE_SYMBOLS" == "true" ]; then
|
||||
cd src
|
||||
ninja -C out/Default electron:electron_symbols
|
||||
cd out/Default/breakpad_symbols
|
||||
find . -name \*.sym -print0 | xargs -0 npx @sentry/cli@1.51.1 difutil bundle-sources
|
||||
fi
|
||||
|
||||
step-maybe-zip-symbols: &step-maybe-zip-symbols
|
||||
@@ -1042,8 +1044,8 @@ steps-electron-ts-compile-for-doc-change: &steps-electron-ts-compile-for-doc-cha
|
||||
- *step-depot-tools-get
|
||||
- *step-depot-tools-add-to-path
|
||||
- *step-restore-brew-cache
|
||||
- *step-get-more-space-on-mac
|
||||
- *step-install-gnutar-on-mac
|
||||
- *step-get-more-space-on-mac
|
||||
- *step-generate-deps-hash
|
||||
- *step-touch-sync-done
|
||||
- maybe-restore-portaled-src-cache
|
||||
|
||||
@@ -31,7 +31,8 @@
|
||||
"BUILDFLAG": "readonly",
|
||||
"ENABLE_DESKTOP_CAPTURER": "readonly",
|
||||
"ENABLE_REMOTE_MODULE": "readonly",
|
||||
"ENABLE_VIEWS_API": "readonly"
|
||||
"ENABLE_VIEWS_API": "readonly",
|
||||
"BigInt": "readonly"
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
|
||||
10
.gitattributes
vendored
10
.gitattributes
vendored
@@ -2,3 +2,13 @@
|
||||
# files to be checked out with LF endings even if core.autocrlf is true.
|
||||
*.patch text eol=lf
|
||||
patches/**/.patches merge=union
|
||||
|
||||
# Source code and markdown files should always use LF as line ending.
|
||||
*.cc text eol=lf
|
||||
*.mm text eol=lf
|
||||
*.h text eol=lf
|
||||
*.js text eol=lf
|
||||
*.ts text eol=lf
|
||||
*.py text eol=lf
|
||||
*.ps1 text eol=lf
|
||||
*.md text eol=lf
|
||||
|
||||
14
BUILD.gn
14
BUILD.gn
@@ -362,6 +362,7 @@ source_set("electron_lib") {
|
||||
"//services/viz/privileged/mojom/compositing",
|
||||
"//skia",
|
||||
"//third_party/blink/public:blink",
|
||||
"//third_party/blink/public:blink_devtools_inspector_resources",
|
||||
"//third_party/boringssl",
|
||||
"//third_party/electron_node:node_lib",
|
||||
"//third_party/inspector_protocol:crdtp",
|
||||
@@ -1093,20 +1094,17 @@ if (is_mac) {
|
||||
"//components/crash/core/app:run_as_crashpad_handler",
|
||||
]
|
||||
|
||||
ldflags = []
|
||||
|
||||
libs = [
|
||||
"comctl32.lib",
|
||||
"uiautomationcore.lib",
|
||||
"wtsapi32.lib",
|
||||
]
|
||||
|
||||
configs += [ "//build/config/win:windowed" ]
|
||||
|
||||
ldflags = [
|
||||
# Windows 7 doesn't have these DLLs.
|
||||
# TODO: are there other DLLs we need to list here to be win7
|
||||
# compatible?
|
||||
"/DELAYLOAD:api-ms-win-core-winrt-l1-1-0.dll",
|
||||
"/DELAYLOAD:api-ms-win-core-winrt-string-l1-1-0.dll",
|
||||
configs += [
|
||||
"//build/config/win:windowed",
|
||||
"//build/config/win:delayloads",
|
||||
]
|
||||
|
||||
# This is to support renaming of electron.exe. node-gyp has hard-coded
|
||||
|
||||
7
DEPS
7
DEPS
@@ -8,12 +8,13 @@ gclient_gn_args = [
|
||||
'checkout_pgo_profiles',
|
||||
'checkout_oculus_sdk',
|
||||
'checkout_openxr',
|
||||
'checkout_google_benchmark'
|
||||
'checkout_google_benchmark',
|
||||
'mac_xcode_version',
|
||||
]
|
||||
|
||||
vars = {
|
||||
'chromium_version':
|
||||
'85.0.4181.1',
|
||||
'85.0.4183.98',
|
||||
'node_version':
|
||||
'v12.16.3',
|
||||
'nan_version':
|
||||
@@ -51,6 +52,8 @@ vars = {
|
||||
# Python "requests" module is used for releases only.
|
||||
'checkout_requests': False,
|
||||
|
||||
'mac_xcode_version': 'default',
|
||||
|
||||
# To allow running hooks without parsing the DEPS tree
|
||||
'process_deps': True,
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
10.0.0-beta.6
|
||||
10.1.2
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
version: 1.0.{build}
|
||||
build_cloud: electron-16-core
|
||||
image: vs2019bt-16.4.0
|
||||
image: vs2019bt-16.6.2
|
||||
environment:
|
||||
GIT_CACHE_PATH: C:\Users\electron\libcc_cache
|
||||
ELECTRON_OUT_DIR: Default
|
||||
|
||||
@@ -87,7 +87,11 @@ steps:
|
||||
|
||||
- powershell: |
|
||||
Get-Process | Where Name –Like "electron*" | Stop-Process
|
||||
Get-Process | Where Name –Like "MicrosoftEdge*" | Stop-Process
|
||||
Get-Process | Where Name –Like "msedge*" | Stop-Process
|
||||
displayName: 'Kill processes left running from last test run'
|
||||
condition: always()
|
||||
|
||||
- powershell: |
|
||||
Remove-Item -path $env:APPDATA/Electron* -Recurse
|
||||
displayName: 'Delete user app data directories'
|
||||
condition: always()
|
||||
|
||||
@@ -10,10 +10,9 @@ config.output = {
|
||||
filename: path.basename(outPath)
|
||||
}
|
||||
|
||||
const { wrapInitWithProfilingTimeout } = config;
|
||||
delete config.wrapInitWithProfilingTimeout;
|
||||
const { wrapInitWithProfilingTimeout, wrapInitWithTryCatch, ...webpackConfig } = config;
|
||||
|
||||
webpack(config, (err, stats) => {
|
||||
webpack(webpackConfig, (err, stats) => {
|
||||
if (err) {
|
||||
console.error(err)
|
||||
process.exit(1)
|
||||
@@ -21,9 +20,17 @@ webpack(config, (err, stats) => {
|
||||
console.error(stats.toString('normal'))
|
||||
process.exit(1)
|
||||
} else {
|
||||
let contents = fs.readFileSync(outPath, 'utf8');
|
||||
if (wrapInitWithTryCatch) {
|
||||
contents = `try {
|
||||
${contents}
|
||||
} catch (err) {
|
||||
console.error('Electron ${webpackConfig.output.filename} script failed to run');
|
||||
console.error(err);
|
||||
}`;
|
||||
}
|
||||
if (wrapInitWithProfilingTimeout) {
|
||||
const contents = fs.readFileSync(outPath, 'utf8');
|
||||
const newContents = `function ___electron_webpack_init__() {
|
||||
contents = `function ___electron_webpack_init__() {
|
||||
${contents}
|
||||
};
|
||||
if ((globalThis.process || binding.process).argv.includes("--profile-electron-init")) {
|
||||
@@ -31,8 +38,8 @@ if ((globalThis.process || binding.process).argv.includes("--profile-electron-in
|
||||
} else {
|
||||
___electron_webpack_init__();
|
||||
}`;
|
||||
fs.writeFileSync(outPath, newContents);
|
||||
}
|
||||
fs.writeFileSync(outPath, contents)
|
||||
process.exit(0)
|
||||
}
|
||||
})
|
||||
|
||||
@@ -69,7 +69,8 @@ module.exports = ({
|
||||
loadElectronFromAlternateTarget,
|
||||
targetDeletesNodeGlobals,
|
||||
target,
|
||||
wrapInitWithProfilingTimeout
|
||||
wrapInitWithProfilingTimeout,
|
||||
wrapInitWithTryCatch
|
||||
}) => {
|
||||
let entry = path.resolve(electronRoot, 'lib', target, 'init.ts')
|
||||
if (!fs.existsSync(entry)) {
|
||||
@@ -85,6 +86,7 @@ module.exports = ({
|
||||
filename: `${target}.bundle.js`
|
||||
},
|
||||
wrapInitWithProfilingTimeout,
|
||||
wrapInitWithTryCatch,
|
||||
resolve: {
|
||||
alias: {
|
||||
'@electron/internal': path.resolve(electronRoot, 'lib'),
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
module.exports = require('./webpack.config.base')({
|
||||
target: 'isolated_renderer',
|
||||
alwaysHasNode: false
|
||||
alwaysHasNode: false,
|
||||
wrapInitWithTryCatch: true
|
||||
})
|
||||
|
||||
@@ -2,5 +2,6 @@ module.exports = require('./webpack.config.base')({
|
||||
target: 'renderer',
|
||||
alwaysHasNode: true,
|
||||
targetDeletesNodeGlobals: true,
|
||||
wrapInitWithProfilingTimeout: true
|
||||
wrapInitWithProfilingTimeout: true,
|
||||
wrapInitWithTryCatch: true
|
||||
})
|
||||
|
||||
@@ -2,4 +2,5 @@ module.exports = require('./webpack.config.base')({
|
||||
target: 'sandboxed_renderer',
|
||||
alwaysHasNode: false,
|
||||
wrapInitWithProfilingTimeout: true,
|
||||
wrapInitWithTryCatch: true
|
||||
})
|
||||
|
||||
@@ -2,5 +2,6 @@ module.exports = require('./webpack.config.base')({
|
||||
target: 'worker',
|
||||
loadElectronFromAlternateTarget: 'renderer',
|
||||
alwaysHasNode: true,
|
||||
targetDeletesNodeGlobals: true
|
||||
targetDeletesNodeGlobals: true,
|
||||
wrapInitWithTryCatch: true
|
||||
})
|
||||
|
||||
@@ -161,13 +161,6 @@ static_library("chrome") {
|
||||
}
|
||||
}
|
||||
|
||||
if (enable_tts) {
|
||||
sources += [
|
||||
"//chrome/browser/speech/tts_controller_delegate_impl.cc",
|
||||
"//chrome/browser/speech/tts_controller_delegate_impl.h",
|
||||
]
|
||||
}
|
||||
|
||||
if (enable_widevine) {
|
||||
sources += [
|
||||
"//chrome/renderer/media/chrome_key_systems.cc",
|
||||
|
||||
@@ -359,7 +359,7 @@ Returns:
|
||||
|
||||
Emitted when the GPU process crashes or is killed.
|
||||
|
||||
### Event: 'renderer-process-crashed'
|
||||
### Event: 'renderer-process-crashed' _Deprecated_
|
||||
|
||||
Returns:
|
||||
|
||||
|
||||
@@ -207,11 +207,15 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
|
||||
* `opacity` Number (optional) - Set the initial opacity of the window, between 0.0 (fully
|
||||
transparent) and 1.0 (fully opaque). This is only implemented on Windows and macOS.
|
||||
* `darkTheme` Boolean (optional) - Forces using dark theme for the window, only works on
|
||||
some GTK desktop environments. Default is [`nativeTheme.shouldUseDarkColors`](native-theme.md).
|
||||
some GTK+3 desktop environments. Default is `false`.
|
||||
* `transparent` Boolean (optional) - Makes the window [transparent](frameless-window.md#transparent-window).
|
||||
Default is `false`. On Windows, does not work unless the window is frameless.
|
||||
* `type` String (optional) - The type of window, default is normal window. See more about
|
||||
this below.
|
||||
* `visualEffectState` String (optional) - Specify how the material appearance should reflect window activity state on macOS. Must be used with the `vibrancy` property. Possible values are:
|
||||
* `followWindow` - The backdrop should automatically appear active when the window is active, and inactive when it is not. This is the default.
|
||||
* `active` - The backdrop should always appear active.
|
||||
* `inactive` - The backdrop should always appear inactive.
|
||||
* `titleBarStyle` String (optional) - The style of window title bar.
|
||||
Default is `default`. Possible values are:
|
||||
* `default` - Results in the standard gray opaque Mac title
|
||||
@@ -271,7 +275,7 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
|
||||
the `nodeIntegration` option and the APIs available to the preload script
|
||||
are more limited. Read more about the option [here](sandbox-option.md).
|
||||
* `enableRemoteModule` Boolean (optional) - Whether to enable the [`remote`](remote.md) module.
|
||||
Default is `true`.
|
||||
Default is `false`.
|
||||
* `session` [Session](session.md#class-session) (optional) - Sets the session used by the
|
||||
page. Instead of passing the Session object directly, you can also choose to
|
||||
use the `partition` option instead, which accepts a partition string. When
|
||||
@@ -348,6 +352,9 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
|
||||
You can access this context in the dev tools by selecting the
|
||||
'Electron Isolated Context' entry in the combo box at the top of the
|
||||
Console tab.
|
||||
* `worldSafeExecuteJavaScript` Boolean (optional) - If true, values returned from `webFrame.executeJavaScript` will be sanitized to ensure JS values
|
||||
can't unsafely cross between worlds when using `contextIsolation`. The default
|
||||
is `false`. In Electron 12, the default will be changed to `true`. _Deprecated_
|
||||
* `nativeWindowOpen` Boolean (optional) - Whether to use native
|
||||
`window.open()`. Defaults to `false`. Child windows will always have node
|
||||
integration disabled unless `nodeIntegrationInSubFrames` is true. **Note:** This option is currently
|
||||
@@ -1123,7 +1130,7 @@ Disable or enable the window.
|
||||
|
||||
#### `win.isEnabled()`
|
||||
|
||||
Returns Boolean - whether the window is enabled.
|
||||
Returns `Boolean` - whether the window is enabled.
|
||||
|
||||
#### `win.setSize(width, height[, animate])`
|
||||
|
||||
@@ -1666,9 +1673,12 @@ Sets whether the menu bar should be visible. If the menu bar is auto-hide, users
|
||||
|
||||
Returns `Boolean` - Whether the menu bar is visible.
|
||||
|
||||
#### `win.setVisibleOnAllWorkspaces(visible)`
|
||||
#### `win.setVisibleOnAllWorkspaces(visible[, options])`
|
||||
|
||||
* `visible` Boolean
|
||||
* `options` Object (optional)
|
||||
* `visibleOnFullScreen` Boolean (optional) _macOS_ - Sets whether
|
||||
the window should be visible above fullscreen windows
|
||||
|
||||
Sets whether the window should be visible on all workspaces.
|
||||
|
||||
|
||||
@@ -156,10 +156,16 @@ parameters in a renderer process will not result in those parameters being sent
|
||||
with crashes that occur in other renderer processes or in the main process.
|
||||
|
||||
**Note:** Parameters have limits on the length of the keys and values. Key
|
||||
names must be no longer than 39 bytes, and values must be no longer than 127
|
||||
names must be no longer than 39 bytes, and values must be no longer than 20320
|
||||
bytes. Keys with names longer than the maximum will be silently ignored. Key
|
||||
values longer than the maximum length will be truncated.
|
||||
|
||||
**Note:** On linux values that are longer than 127 bytes will be chunked into
|
||||
multiple keys, each 127 bytes in length. E.g. `addExtraParameter('foo', 'a'.repeat(130))`
|
||||
will result in two chunked keys `foo__1` and `foo__2`, the first will contain
|
||||
the first 127 bytes and the second will contain the remaining 3 bytes. On
|
||||
your crash reporting backend you should stitch together keys in this format.
|
||||
|
||||
### `crashReporter.removeExtraParameter(key)`
|
||||
|
||||
* `key` String - Parameter key, must be no longer than 39 bytes.
|
||||
|
||||
@@ -52,6 +52,8 @@ Returns:
|
||||
* `method` String - Method name.
|
||||
* `params` any - Event parameters defined by the 'parameters'
|
||||
attribute in the remote debugging protocol.
|
||||
* `sessionId` String - Unique identifier of attached debugging session,
|
||||
will match the value sent from `debugger.sendCommand`.
|
||||
|
||||
Emitted whenever the debugging target issues an instrumentation event.
|
||||
|
||||
@@ -74,11 +76,16 @@ Returns `Boolean` - Whether a debugger is attached to the `webContents`.
|
||||
|
||||
Detaches the debugger from the `webContents`.
|
||||
|
||||
#### `debugger.sendCommand(method[, commandParams])`
|
||||
#### `debugger.sendCommand(method[, commandParams, sessionId])`
|
||||
|
||||
* `method` String - Method name, should be one of the methods defined by the
|
||||
[remote debugging protocol][rdp].
|
||||
* `commandParams` any (optional) - JSON object with request parameters.
|
||||
* `sessionId` String (optional) - send command to the target with associated
|
||||
debugging session id. The initial value can be obtained by sending
|
||||
[Target.attachToTarget][attachToTarget] message.
|
||||
|
||||
[attachToTarget]: https://chromedevtools.github.io/devtools-protocol/tot/Target/#method-attachToTarget
|
||||
|
||||
Returns `Promise<any>` - A promise that resolves with the response defined by
|
||||
the 'returns' attribute of the command description in the remote debugging protocol
|
||||
|
||||
@@ -102,3 +102,15 @@ The following methods of `chrome.tabs` are supported:
|
||||
> **Note:** In Chrome, passing `-1` as a tab ID signifies the "currently active
|
||||
> tab". Since Electron has no such concept, passing `-1` as a tab ID is not
|
||||
> supported and will raise an error.
|
||||
|
||||
### `chrome.management`
|
||||
|
||||
The following methods of `chrome.management` are supported:
|
||||
|
||||
- `chrome.management.getAll`
|
||||
- `chrome.management.get`
|
||||
- `chrome.management.getSelf`
|
||||
- `chrome.management.getPermissionWarningsById`
|
||||
- `chrome.management.getPermissionWarningsByManifest`
|
||||
- `chrome.management.onEnabled`
|
||||
- `chrome.management.onDisabled`
|
||||
|
||||
@@ -119,6 +119,13 @@ Returns `NativeImage`
|
||||
|
||||
Creates an empty `NativeImage` instance.
|
||||
|
||||
### `nativeImage.createThumbnailFromPath(path, maxSize)` _macOS_ _Windows_
|
||||
|
||||
* `path` String - path to a file that we intend to construct a thumbnail out of.
|
||||
* `maxSize` [Size](structures/size.md) - the maximum width and height (positive numbers) the thumbnail returned can be. The Windows implementation will ignore `maxSize.height` and scale the height according to `maxSize.width`.
|
||||
|
||||
Returns `Promise<NativeImage>` - fulfilled with the file's thumbnail preview image, which is a [NativeImage](native-image.md).
|
||||
|
||||
### `nativeImage.createFromPath(path)`
|
||||
|
||||
* `path` String
|
||||
|
||||
@@ -8,19 +8,19 @@ Process: [Main](../glossary.md#main-process)
|
||||
|
||||
The `powerMonitor` module emits the following events:
|
||||
|
||||
### Event: 'suspend'
|
||||
### Event: 'suspend' _macOS_ _Windows_
|
||||
|
||||
Emitted when the system is suspending.
|
||||
|
||||
### Event: 'resume'
|
||||
### Event: 'resume' _macOS_ _Windows_
|
||||
|
||||
Emitted when system is resuming.
|
||||
|
||||
### Event: 'on-ac' _Windows_
|
||||
### Event: 'on-ac' _macOS_ _Windows_
|
||||
|
||||
Emitted when the system changes to AC power.
|
||||
|
||||
### Event: 'on-battery' _Windows_
|
||||
### Event: 'on-battery' _macOS_ _Windows_
|
||||
|
||||
Emitted when system changes to battery power.
|
||||
|
||||
|
||||
@@ -7,4 +7,5 @@
|
||||
* `contentLengths` Number[] - The total size of the content, in bytes.
|
||||
* `price` Number - The cost of the product in the local currency.
|
||||
* `formattedPrice` String - The locale formatted price of the product.
|
||||
* `currencyCode` String - 3 character code presenting a product's currency based on the ISO 4217 standard.
|
||||
* `isDownloadable` Boolean - A Boolean value that indicates whether the App Store has downloadable content for this product. `true` if at least one file has been associated with the product.
|
||||
|
||||
@@ -416,7 +416,7 @@ This API itself will not protect your user data; rather, it is a mechanism to al
|
||||
|
||||
Returns `Boolean` - `true` if the current process is a trusted accessibility client and `false` if it is not.
|
||||
|
||||
### `systemPreferences.getMediaAccessStatus(mediaType)` _macOS_
|
||||
### `systemPreferences.getMediaAccessStatus(mediaType)` _Windows_ _macOS_
|
||||
|
||||
* `mediaType` String - Can be `microphone`, `camera` or `screen`.
|
||||
|
||||
@@ -426,6 +426,9 @@ This user consent was not required on macOS 10.13 High Sierra or lower so this m
|
||||
macOS 10.14 Mojave or higher requires consent for `microphone` and `camera` access.
|
||||
macOS 10.15 Catalina or higher requires consent for `screen` access.
|
||||
|
||||
Windows 10 has a global setting controlling `microphone` and `camera` access for all win32 applications.
|
||||
It will always return `granted` for `screen` and for all media types on older versions of Windows.
|
||||
|
||||
### `systemPreferences.askForMediaAccess(mediaType)` _macOS_
|
||||
|
||||
* `mediaType` String - the type of media being requested; can be `microphone`, `camera`.
|
||||
|
||||
@@ -1311,6 +1311,8 @@ Returns [`PrinterInfo[]`](structures/printer-info.md)
|
||||
* `success` Boolean - Indicates success of the print call.
|
||||
* `failureReason` String - Error description called back if the print fails.
|
||||
|
||||
When a custom `pageSize` is passed, Chromium attempts to validate platform specific minumum values for `width_microns` and `height_microns`. Width and height must both be minimum 353 microns but may be higher on some operating systems.
|
||||
|
||||
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.
|
||||
|
||||
@@ -1334,13 +1336,12 @@ win.webContents.print(options, (success, errorType) => {
|
||||
* `landscape` Boolean (optional) - `true` for landscape, `false` for portrait.
|
||||
* `marginsType` Integer (optional) - Specifies the type of margins to use. Uses 0 for
|
||||
default margin, 1 for no margin, and 2 for minimum margin.
|
||||
and `width` in microns.
|
||||
* `scaleFactor` Number (optional) - The scale factor of the web page. Can range from 0 to 100.
|
||||
* `pageRanges` Record<string, number> (optional) - The page range to print.
|
||||
* `from` Number - the first page to print.
|
||||
* `to` Number - the last page to print (inclusive).
|
||||
* `pageSize` String | Size (optional) - Specify page size of the generated PDF. Can be `A3`,
|
||||
`A4`, `A5`, `Legal`, `Letter`, `Tabloid` or an Object containing `height`
|
||||
`A4`, `A5`, `Legal`, `Letter`, `Tabloid` or an Object containing `height` and `width` in microns.
|
||||
* `printBackground` Boolean (optional) - Whether to print CSS backgrounds.
|
||||
* `printSelectionOnly` Boolean (optional) - Whether to print selection only.
|
||||
|
||||
@@ -1371,6 +1372,8 @@ An example of `webContents.printToPDF`:
|
||||
```javascript
|
||||
const { BrowserWindow } = require('electron')
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const os = require('os')
|
||||
|
||||
let win = new BrowserWindow({ width: 800, height: 600 })
|
||||
win.loadURL('http://github.com')
|
||||
@@ -1378,12 +1381,13 @@ win.loadURL('http://github.com')
|
||||
win.webContents.on('did-finish-load', () => {
|
||||
// Use default printing options
|
||||
win.webContents.printToPDF({}).then(data => {
|
||||
fs.writeFile('/tmp/print.pdf', data, (error) => {
|
||||
const pdfPath = path.join(os.homedir(), 'Desktop', 'temp.pdf')
|
||||
fs.writeFile(pdfPath, data, (error) => {
|
||||
if (error) throw error
|
||||
console.log('Write PDF successfully.')
|
||||
console.log(`Wrote PDF successfully to ${pdfPath}`)
|
||||
})
|
||||
}).catch(error => {
|
||||
console.log(error)
|
||||
console.log(`Failed to write PDF to ${pdfPath}: `, error)
|
||||
})
|
||||
})
|
||||
```
|
||||
|
||||
@@ -1,95 +1,95 @@
|
||||
// Modules to control application life and create native browser window
|
||||
const { app, BrowserWindow, ipcMain, dialog } = require('electron')
|
||||
|
||||
// Keep a global reference of the window object, if you don't, the window will
|
||||
// be closed automatically when the JavaScript object is garbage collected.
|
||||
let mainWindow
|
||||
|
||||
function createWindow () {
|
||||
// Create the browser window.
|
||||
mainWindow = new BrowserWindow({
|
||||
width: 800,
|
||||
height: 600,
|
||||
webPreferences: {
|
||||
nodeIntegration: true
|
||||
}
|
||||
})
|
||||
|
||||
// and load the index.html of the app.
|
||||
mainWindow.loadFile('index.html')
|
||||
|
||||
// Open the DevTools.
|
||||
// mainWindow.webContents.openDevTools()
|
||||
|
||||
// Emitted when the window is closed.
|
||||
mainWindow.on('closed', function () {
|
||||
// Dereference the window object, usually you would store windows
|
||||
// in an array if your app supports multi windows, this is the time
|
||||
// when you should delete the corresponding element.
|
||||
mainWindow = null
|
||||
})
|
||||
}
|
||||
|
||||
// This method will be called when Electron has finished
|
||||
// initialization and is ready to create browser windows.
|
||||
// Some APIs can only be used after this event occurs.
|
||||
app.whenReady().then(createWindow)
|
||||
|
||||
// Quit when all windows are closed.
|
||||
app.on('window-all-closed', function () {
|
||||
// On macOS it is common for applications and their menu bar
|
||||
// to stay active until the user quits explicitly with Cmd + Q
|
||||
if (process.platform !== 'darwin') {
|
||||
app.quit()
|
||||
}
|
||||
})
|
||||
|
||||
app.on('activate', function () {
|
||||
// On macOS it is common to re-create a window in the app when the
|
||||
// dock icon is clicked and there are no other windows open.
|
||||
if (mainWindow === null) {
|
||||
createWindow()
|
||||
}
|
||||
})
|
||||
|
||||
ipcMain.on('open-error-dialog', event => {
|
||||
dialog.showErrorBox('An Error Message', 'Demonstrating an error message.')
|
||||
})
|
||||
|
||||
ipcMain.on('open-information-dialog', event => {
|
||||
const options = {
|
||||
type: 'info',
|
||||
title: 'Information',
|
||||
message: "This is an information dialog. Isn't it nice?",
|
||||
buttons: ['Yes', 'No']
|
||||
}
|
||||
dialog.showMessageBox(options, index => {
|
||||
event.sender.send('information-dialog-selection', index)
|
||||
})
|
||||
})
|
||||
|
||||
ipcMain.on('open-file-dialog', event => {
|
||||
dialog.showOpenDialog(
|
||||
{
|
||||
properties: ['openFile', 'openDirectory']
|
||||
},
|
||||
files => {
|
||||
if (files) {
|
||||
event.sender.send('selected-directory', files)
|
||||
}
|
||||
}
|
||||
)
|
||||
})
|
||||
|
||||
ipcMain.on('save-dialog', event => {
|
||||
const options = {
|
||||
title: 'Save an Image',
|
||||
filters: [{ name: 'Images', extensions: ['jpg', 'png', 'gif'] }]
|
||||
}
|
||||
dialog.showSaveDialog(options, filename => {
|
||||
event.sender.send('saved-file', filename)
|
||||
})
|
||||
})
|
||||
|
||||
// In this file you can include the rest of your app's specific main process
|
||||
// code. You can also put them in separate files and require them here.
|
||||
// Modules to control application life and create native browser window
|
||||
const { app, BrowserWindow, ipcMain, dialog } = require('electron')
|
||||
|
||||
// Keep a global reference of the window object, if you don't, the window will
|
||||
// be closed automatically when the JavaScript object is garbage collected.
|
||||
let mainWindow
|
||||
|
||||
function createWindow () {
|
||||
// Create the browser window.
|
||||
mainWindow = new BrowserWindow({
|
||||
width: 800,
|
||||
height: 600,
|
||||
webPreferences: {
|
||||
nodeIntegration: true
|
||||
}
|
||||
})
|
||||
|
||||
// and load the index.html of the app.
|
||||
mainWindow.loadFile('index.html')
|
||||
|
||||
// Open the DevTools.
|
||||
// mainWindow.webContents.openDevTools()
|
||||
|
||||
// Emitted when the window is closed.
|
||||
mainWindow.on('closed', function () {
|
||||
// Dereference the window object, usually you would store windows
|
||||
// in an array if your app supports multi windows, this is the time
|
||||
// when you should delete the corresponding element.
|
||||
mainWindow = null
|
||||
})
|
||||
}
|
||||
|
||||
// This method will be called when Electron has finished
|
||||
// initialization and is ready to create browser windows.
|
||||
// Some APIs can only be used after this event occurs.
|
||||
app.whenReady().then(createWindow)
|
||||
|
||||
// Quit when all windows are closed.
|
||||
app.on('window-all-closed', function () {
|
||||
// On macOS it is common for applications and their menu bar
|
||||
// to stay active until the user quits explicitly with Cmd + Q
|
||||
if (process.platform !== 'darwin') {
|
||||
app.quit()
|
||||
}
|
||||
})
|
||||
|
||||
app.on('activate', function () {
|
||||
// On macOS it is common to re-create a window in the app when the
|
||||
// dock icon is clicked and there are no other windows open.
|
||||
if (mainWindow === null) {
|
||||
createWindow()
|
||||
}
|
||||
})
|
||||
|
||||
ipcMain.on('open-error-dialog', event => {
|
||||
dialog.showErrorBox('An Error Message', 'Demonstrating an error message.')
|
||||
})
|
||||
|
||||
ipcMain.on('open-information-dialog', event => {
|
||||
const options = {
|
||||
type: 'info',
|
||||
title: 'Information',
|
||||
message: "This is an information dialog. Isn't it nice?",
|
||||
buttons: ['Yes', 'No']
|
||||
}
|
||||
dialog.showMessageBox(options, index => {
|
||||
event.sender.send('information-dialog-selection', index)
|
||||
})
|
||||
})
|
||||
|
||||
ipcMain.on('open-file-dialog', event => {
|
||||
dialog.showOpenDialog(
|
||||
{
|
||||
properties: ['openFile', 'openDirectory']
|
||||
},
|
||||
files => {
|
||||
if (files) {
|
||||
event.sender.send('selected-directory', files)
|
||||
}
|
||||
}
|
||||
)
|
||||
})
|
||||
|
||||
ipcMain.on('save-dialog', event => {
|
||||
const options = {
|
||||
title: 'Save an Image',
|
||||
filters: [{ name: 'Images', extensions: ['jpg', 'png', 'gif'] }]
|
||||
}
|
||||
dialog.showSaveDialog(options, filename => {
|
||||
event.sender.send('saved-file', filename)
|
||||
})
|
||||
})
|
||||
|
||||
// In this file you can include the rest of your app's specific main process
|
||||
// code. You can also put them in separate files and require them here.
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
const { ipcRenderer, shell } = require('electron')
|
||||
|
||||
const links = document.querySelectorAll('a[href]')
|
||||
const errorBtn = document.getElementById('error-dialog')
|
||||
|
||||
errorBtn.addEventListener('click', event => {
|
||||
ipcRenderer.send('open-error-dialog')
|
||||
})
|
||||
|
||||
Array.prototype.forEach.call(links, (link) => {
|
||||
const url = link.getAttribute('href')
|
||||
if (url.indexOf('http') === 0) {
|
||||
link.addEventListener('click', (e) => {
|
||||
e.preventDefault()
|
||||
shell.openExternal(url)
|
||||
})
|
||||
}
|
||||
const { ipcRenderer, shell } = require('electron')
|
||||
|
||||
const links = document.querySelectorAll('a[href]')
|
||||
const errorBtn = document.getElementById('error-dialog')
|
||||
|
||||
errorBtn.addEventListener('click', event => {
|
||||
ipcRenderer.send('open-error-dialog')
|
||||
})
|
||||
|
||||
Array.prototype.forEach.call(links, (link) => {
|
||||
const url = link.getAttribute('href')
|
||||
if (url.indexOf('http') === 0) {
|
||||
link.addEventListener('click', (e) => {
|
||||
e.preventDefault()
|
||||
shell.openExternal(url)
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -1,70 +1,70 @@
|
||||
// Modules to control application life and create native browser window
|
||||
const { app, BrowserWindow, ipcMain, dialog } = require('electron')
|
||||
|
||||
// Keep a global reference of the window object, if you don't, the window will
|
||||
// be closed automatically when the JavaScript object is garbage collected.
|
||||
let mainWindow
|
||||
|
||||
function createWindow () {
|
||||
// Create the browser window.
|
||||
mainWindow = new BrowserWindow({
|
||||
width: 800,
|
||||
height: 600,
|
||||
webPreferences: {
|
||||
nodeIntegration: true
|
||||
}
|
||||
})
|
||||
|
||||
// and load the index.html of the app.
|
||||
mainWindow.loadFile('index.html')
|
||||
|
||||
// Open the DevTools.
|
||||
// mainWindow.webContents.openDevTools()
|
||||
|
||||
// Emitted when the window is closed.
|
||||
mainWindow.on('closed', function () {
|
||||
// Dereference the window object, usually you would store windows
|
||||
// in an array if your app supports multi windows, this is the time
|
||||
// when you should delete the corresponding element.
|
||||
mainWindow = null
|
||||
})
|
||||
}
|
||||
|
||||
// This method will be called when Electron has finished
|
||||
// initialization and is ready to create browser windows.
|
||||
// Some APIs can only be used after this event occurs.
|
||||
app.whenReady().then(createWindow)
|
||||
|
||||
// Quit when all windows are closed.
|
||||
app.on('window-all-closed', function () {
|
||||
// On macOS it is common for applications and their menu bar
|
||||
// to stay active until the user quits explicitly with Cmd + Q
|
||||
if (process.platform !== 'darwin') {
|
||||
app.quit()
|
||||
}
|
||||
})
|
||||
|
||||
app.on('activate', function () {
|
||||
// On macOS it is common to re-create a window in the app when the
|
||||
// dock icon is clicked and there are no other windows open.
|
||||
if (mainWindow === null) {
|
||||
createWindow()
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
ipcMain.on('open-information-dialog', event => {
|
||||
const options = {
|
||||
type: 'info',
|
||||
title: 'Information',
|
||||
message: "This is an information dialog. Isn't it nice?",
|
||||
buttons: ['Yes', 'No']
|
||||
}
|
||||
dialog.showMessageBox(options, index => {
|
||||
event.sender.send('information-dialog-selection', index)
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
// In this file you can include the rest of your app's specific main process
|
||||
// code. You can also put them in separate files and require them here.
|
||||
// Modules to control application life and create native browser window
|
||||
const { app, BrowserWindow, ipcMain, dialog } = require('electron')
|
||||
|
||||
// Keep a global reference of the window object, if you don't, the window will
|
||||
// be closed automatically when the JavaScript object is garbage collected.
|
||||
let mainWindow
|
||||
|
||||
function createWindow () {
|
||||
// Create the browser window.
|
||||
mainWindow = new BrowserWindow({
|
||||
width: 800,
|
||||
height: 600,
|
||||
webPreferences: {
|
||||
nodeIntegration: true
|
||||
}
|
||||
})
|
||||
|
||||
// and load the index.html of the app.
|
||||
mainWindow.loadFile('index.html')
|
||||
|
||||
// Open the DevTools.
|
||||
// mainWindow.webContents.openDevTools()
|
||||
|
||||
// Emitted when the window is closed.
|
||||
mainWindow.on('closed', function () {
|
||||
// Dereference the window object, usually you would store windows
|
||||
// in an array if your app supports multi windows, this is the time
|
||||
// when you should delete the corresponding element.
|
||||
mainWindow = null
|
||||
})
|
||||
}
|
||||
|
||||
// This method will be called when Electron has finished
|
||||
// initialization and is ready to create browser windows.
|
||||
// Some APIs can only be used after this event occurs.
|
||||
app.whenReady().then(createWindow)
|
||||
|
||||
// Quit when all windows are closed.
|
||||
app.on('window-all-closed', function () {
|
||||
// On macOS it is common for applications and their menu bar
|
||||
// to stay active until the user quits explicitly with Cmd + Q
|
||||
if (process.platform !== 'darwin') {
|
||||
app.quit()
|
||||
}
|
||||
})
|
||||
|
||||
app.on('activate', function () {
|
||||
// On macOS it is common to re-create a window in the app when the
|
||||
// dock icon is clicked and there are no other windows open.
|
||||
if (mainWindow === null) {
|
||||
createWindow()
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
ipcMain.on('open-information-dialog', event => {
|
||||
const options = {
|
||||
type: 'info',
|
||||
title: 'Information',
|
||||
message: "This is an information dialog. Isn't it nice?",
|
||||
buttons: ['Yes', 'No']
|
||||
}
|
||||
dialog.showMessageBox(options, index => {
|
||||
event.sender.send('information-dialog-selection', index)
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
// In this file you can include the rest of your app's specific main process
|
||||
// code. You can also put them in separate files and require them here.
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
const { ipcRenderer, shell } = require('electron')
|
||||
|
||||
const informationBtn = document.getElementById('information-dialog')
|
||||
const links = document.querySelectorAll('a[href]')
|
||||
|
||||
informationBtn.addEventListener('click', event => {
|
||||
ipcRenderer.send('open-information-dialog')
|
||||
})
|
||||
|
||||
ipcRenderer.on('information-dialog-selection', (event, index) => {
|
||||
let message = 'You selected '
|
||||
if (index === 0) message += 'yes.'
|
||||
else message += 'no.'
|
||||
document.getElementById('info-selection').innerHTML = message
|
||||
})
|
||||
|
||||
Array.prototype.forEach.call(links, (link) => {
|
||||
const url = link.getAttribute('href')
|
||||
if (url.indexOf('http') === 0) {
|
||||
link.addEventListener('click', (e) => {
|
||||
e.preventDefault()
|
||||
shell.openExternal(url)
|
||||
})
|
||||
}
|
||||
const { ipcRenderer, shell } = require('electron')
|
||||
|
||||
const informationBtn = document.getElementById('information-dialog')
|
||||
const links = document.querySelectorAll('a[href]')
|
||||
|
||||
informationBtn.addEventListener('click', event => {
|
||||
ipcRenderer.send('open-information-dialog')
|
||||
})
|
||||
|
||||
ipcRenderer.on('information-dialog-selection', (event, index) => {
|
||||
let message = 'You selected '
|
||||
if (index === 0) message += 'yes.'
|
||||
else message += 'no.'
|
||||
document.getElementById('info-selection').innerHTML = message
|
||||
})
|
||||
|
||||
Array.prototype.forEach.call(links, (link) => {
|
||||
const url = link.getAttribute('href')
|
||||
if (url.indexOf('http') === 0) {
|
||||
link.addEventListener('click', (e) => {
|
||||
e.preventDefault()
|
||||
shell.openExternal(url)
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -1,70 +1,70 @@
|
||||
// Modules to control application life and create native browser window
|
||||
const { app, BrowserWindow, ipcMain, dialog } = require('electron')
|
||||
|
||||
// Keep a global reference of the window object, if you don't, the window will
|
||||
// be closed automatically when the JavaScript object is garbage collected.
|
||||
let mainWindow
|
||||
|
||||
function createWindow () {
|
||||
// Create the browser window.
|
||||
mainWindow = new BrowserWindow({
|
||||
width: 800,
|
||||
height: 600,
|
||||
webPreferences: {
|
||||
nodeIntegration: true
|
||||
}
|
||||
})
|
||||
|
||||
// and load the index.html of the app.
|
||||
mainWindow.loadFile('index.html')
|
||||
|
||||
// Open the DevTools.
|
||||
// mainWindow.webContents.openDevTools()
|
||||
|
||||
// Emitted when the window is closed.
|
||||
mainWindow.on('closed', function () {
|
||||
// Dereference the window object, usually you would store windows
|
||||
// in an array if your app supports multi windows, this is the time
|
||||
// when you should delete the corresponding element.
|
||||
mainWindow = null
|
||||
})
|
||||
}
|
||||
|
||||
// This method will be called when Electron has finished
|
||||
// initialization and is ready to create browser windows.
|
||||
// Some APIs can only be used after this event occurs.
|
||||
app.whenReady().then(createWindow)
|
||||
|
||||
// Quit when all windows are closed.
|
||||
app.on('window-all-closed', function () {
|
||||
// On macOS it is common for applications and their menu bar
|
||||
// to stay active until the user quits explicitly with Cmd + Q
|
||||
if (process.platform !== 'darwin') {
|
||||
app.quit()
|
||||
}
|
||||
})
|
||||
|
||||
app.on('activate', function () {
|
||||
// On macOS it is common to re-create a window in the app when the
|
||||
// dock icon is clicked and there are no other windows open.
|
||||
if (mainWindow === null) {
|
||||
createWindow()
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
ipcMain.on('open-file-dialog', event => {
|
||||
dialog.showOpenDialog(
|
||||
{
|
||||
properties: ['openFile', 'openDirectory']
|
||||
},
|
||||
files => {
|
||||
if (files) {
|
||||
event.sender.send('selected-directory', files)
|
||||
}
|
||||
}
|
||||
)
|
||||
})
|
||||
|
||||
// In this file you can include the rest of your app's specific main process
|
||||
// code. You can also put them in separate files and require them here.
|
||||
// Modules to control application life and create native browser window
|
||||
const { app, BrowserWindow, ipcMain, dialog } = require('electron')
|
||||
|
||||
// Keep a global reference of the window object, if you don't, the window will
|
||||
// be closed automatically when the JavaScript object is garbage collected.
|
||||
let mainWindow
|
||||
|
||||
function createWindow () {
|
||||
// Create the browser window.
|
||||
mainWindow = new BrowserWindow({
|
||||
width: 800,
|
||||
height: 600,
|
||||
webPreferences: {
|
||||
nodeIntegration: true
|
||||
}
|
||||
})
|
||||
|
||||
// and load the index.html of the app.
|
||||
mainWindow.loadFile('index.html')
|
||||
|
||||
// Open the DevTools.
|
||||
// mainWindow.webContents.openDevTools()
|
||||
|
||||
// Emitted when the window is closed.
|
||||
mainWindow.on('closed', function () {
|
||||
// Dereference the window object, usually you would store windows
|
||||
// in an array if your app supports multi windows, this is the time
|
||||
// when you should delete the corresponding element.
|
||||
mainWindow = null
|
||||
})
|
||||
}
|
||||
|
||||
// This method will be called when Electron has finished
|
||||
// initialization and is ready to create browser windows.
|
||||
// Some APIs can only be used after this event occurs.
|
||||
app.whenReady().then(createWindow)
|
||||
|
||||
// Quit when all windows are closed.
|
||||
app.on('window-all-closed', function () {
|
||||
// On macOS it is common for applications and their menu bar
|
||||
// to stay active until the user quits explicitly with Cmd + Q
|
||||
if (process.platform !== 'darwin') {
|
||||
app.quit()
|
||||
}
|
||||
})
|
||||
|
||||
app.on('activate', function () {
|
||||
// On macOS it is common to re-create a window in the app when the
|
||||
// dock icon is clicked and there are no other windows open.
|
||||
if (mainWindow === null) {
|
||||
createWindow()
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
ipcMain.on('open-file-dialog', event => {
|
||||
dialog.showOpenDialog(
|
||||
{
|
||||
properties: ['openFile', 'openDirectory']
|
||||
},
|
||||
files => {
|
||||
if (files) {
|
||||
event.sender.send('selected-directory', files)
|
||||
}
|
||||
}
|
||||
)
|
||||
})
|
||||
|
||||
// In this file you can include the rest of your app's specific main process
|
||||
// code. You can also put them in separate files and require them here.
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
const { ipcRenderer, shell } = require('electron')
|
||||
|
||||
const selectDirBtn = document.getElementById('select-directory')
|
||||
const links = document.querySelectorAll('a[href]')
|
||||
|
||||
selectDirBtn.addEventListener('click', event => {
|
||||
ipcRenderer.send('open-file-dialog')
|
||||
})
|
||||
|
||||
ipcRenderer.on('selected-directory', (event, path) => {
|
||||
document.getElementById('selected-file').innerHTML = `You selected: ${path}`
|
||||
})
|
||||
|
||||
Array.prototype.forEach.call(links, (link) => {
|
||||
const url = link.getAttribute('href')
|
||||
if (url.indexOf('http') === 0) {
|
||||
link.addEventListener('click', (e) => {
|
||||
e.preventDefault()
|
||||
shell.openExternal(url)
|
||||
})
|
||||
}
|
||||
})
|
||||
const { ipcRenderer, shell } = require('electron')
|
||||
|
||||
const selectDirBtn = document.getElementById('select-directory')
|
||||
const links = document.querySelectorAll('a[href]')
|
||||
|
||||
selectDirBtn.addEventListener('click', event => {
|
||||
ipcRenderer.send('open-file-dialog')
|
||||
})
|
||||
|
||||
ipcRenderer.on('selected-directory', (event, path) => {
|
||||
document.getElementById('selected-file').innerHTML = `You selected: ${path}`
|
||||
})
|
||||
|
||||
Array.prototype.forEach.call(links, (link) => {
|
||||
const url = link.getAttribute('href')
|
||||
if (url.indexOf('http') === 0) {
|
||||
link.addEventListener('click', (e) => {
|
||||
e.preventDefault()
|
||||
shell.openExternal(url)
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
@@ -1,66 +1,66 @@
|
||||
// Modules to control application life and create native browser window
|
||||
const { app, BrowserWindow, ipcMain, dialog } = require('electron')
|
||||
|
||||
// Keep a global reference of the window object, if you don't, the window will
|
||||
// be closed automatically when the JavaScript object is garbage collected.
|
||||
let mainWindow
|
||||
|
||||
function createWindow () {
|
||||
// Create the browser window.
|
||||
mainWindow = new BrowserWindow({
|
||||
width: 800,
|
||||
height: 600,
|
||||
webPreferences: {
|
||||
nodeIntegration: true
|
||||
}
|
||||
})
|
||||
|
||||
// and load the index.html of the app.
|
||||
mainWindow.loadFile('index.html')
|
||||
|
||||
// Open the DevTools.
|
||||
// mainWindow.webContents.openDevTools()
|
||||
|
||||
// Emitted when the window is closed.
|
||||
mainWindow.on('closed', function () {
|
||||
// Dereference the window object, usually you would store windows
|
||||
// in an array if your app supports multi windows, this is the time
|
||||
// when you should delete the corresponding element.
|
||||
mainWindow = null
|
||||
})
|
||||
}
|
||||
|
||||
// This method will be called when Electron has finished
|
||||
// initialization and is ready to create browser windows.
|
||||
// Some APIs can only be used after this event occurs.
|
||||
app.whenReady().then(createWindow)
|
||||
|
||||
// Quit when all windows are closed.
|
||||
app.on('window-all-closed', function () {
|
||||
// On macOS it is common for applications and their menu bar
|
||||
// to stay active until the user quits explicitly with Cmd + Q
|
||||
if (process.platform !== 'darwin') {
|
||||
app.quit()
|
||||
}
|
||||
})
|
||||
|
||||
app.on('activate', function () {
|
||||
// On macOS it is common to re-create a window in the app when the
|
||||
// dock icon is clicked and there are no other windows open.
|
||||
if (mainWindow === null) {
|
||||
createWindow()
|
||||
}
|
||||
})
|
||||
|
||||
ipcMain.on('save-dialog', event => {
|
||||
const options = {
|
||||
title: 'Save an Image',
|
||||
filters: [{ name: 'Images', extensions: ['jpg', 'png', 'gif'] }]
|
||||
}
|
||||
dialog.showSaveDialog(options, filename => {
|
||||
event.sender.send('saved-file', filename)
|
||||
})
|
||||
})
|
||||
|
||||
// In this file you can include the rest of your app's specific main process
|
||||
// code. You can also put them in separate files and require them here.
|
||||
// Modules to control application life and create native browser window
|
||||
const { app, BrowserWindow, ipcMain, dialog } = require('electron')
|
||||
|
||||
// Keep a global reference of the window object, if you don't, the window will
|
||||
// be closed automatically when the JavaScript object is garbage collected.
|
||||
let mainWindow
|
||||
|
||||
function createWindow () {
|
||||
// Create the browser window.
|
||||
mainWindow = new BrowserWindow({
|
||||
width: 800,
|
||||
height: 600,
|
||||
webPreferences: {
|
||||
nodeIntegration: true
|
||||
}
|
||||
})
|
||||
|
||||
// and load the index.html of the app.
|
||||
mainWindow.loadFile('index.html')
|
||||
|
||||
// Open the DevTools.
|
||||
// mainWindow.webContents.openDevTools()
|
||||
|
||||
// Emitted when the window is closed.
|
||||
mainWindow.on('closed', function () {
|
||||
// Dereference the window object, usually you would store windows
|
||||
// in an array if your app supports multi windows, this is the time
|
||||
// when you should delete the corresponding element.
|
||||
mainWindow = null
|
||||
})
|
||||
}
|
||||
|
||||
// This method will be called when Electron has finished
|
||||
// initialization and is ready to create browser windows.
|
||||
// Some APIs can only be used after this event occurs.
|
||||
app.whenReady().then(createWindow)
|
||||
|
||||
// Quit when all windows are closed.
|
||||
app.on('window-all-closed', function () {
|
||||
// On macOS it is common for applications and their menu bar
|
||||
// to stay active until the user quits explicitly with Cmd + Q
|
||||
if (process.platform !== 'darwin') {
|
||||
app.quit()
|
||||
}
|
||||
})
|
||||
|
||||
app.on('activate', function () {
|
||||
// On macOS it is common to re-create a window in the app when the
|
||||
// dock icon is clicked and there are no other windows open.
|
||||
if (mainWindow === null) {
|
||||
createWindow()
|
||||
}
|
||||
})
|
||||
|
||||
ipcMain.on('save-dialog', event => {
|
||||
const options = {
|
||||
title: 'Save an Image',
|
||||
filters: [{ name: 'Images', extensions: ['jpg', 'png', 'gif'] }]
|
||||
}
|
||||
dialog.showSaveDialog(options, filename => {
|
||||
event.sender.send('saved-file', filename)
|
||||
})
|
||||
})
|
||||
|
||||
// In this file you can include the rest of your app's specific main process
|
||||
// code. You can also put them in separate files and require them here.
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
const { ipcRenderer, shell } = require('electron')
|
||||
|
||||
const saveBtn = document.getElementById('save-dialog')
|
||||
const links = document.querySelectorAll('a[href]')
|
||||
|
||||
saveBtn.addEventListener('click', event => {
|
||||
ipcRenderer.send('save-dialog')
|
||||
})
|
||||
|
||||
ipcRenderer.on('saved-file', (event, path) => {
|
||||
if (!path) path = 'No path'
|
||||
document.getElementById('file-saved').innerHTML = `Path selected: ${path}`
|
||||
})
|
||||
|
||||
Array.prototype.forEach.call(links, (link) => {
|
||||
const url = link.getAttribute('href')
|
||||
if (url.indexOf('http') === 0) {
|
||||
link.addEventListener('click', (e) => {
|
||||
e.preventDefault()
|
||||
shell.openExternal(url)
|
||||
})
|
||||
}
|
||||
const { ipcRenderer, shell } = require('electron')
|
||||
|
||||
const saveBtn = document.getElementById('save-dialog')
|
||||
const links = document.querySelectorAll('a[href]')
|
||||
|
||||
saveBtn.addEventListener('click', event => {
|
||||
ipcRenderer.send('save-dialog')
|
||||
})
|
||||
|
||||
ipcRenderer.on('saved-file', (event, path) => {
|
||||
if (!path) path = 'No path'
|
||||
document.getElementById('file-saved').innerHTML = `Path selected: ${path}`
|
||||
})
|
||||
|
||||
Array.prototype.forEach.call(links, (link) => {
|
||||
const url = link.getAttribute('href')
|
||||
if (url.indexOf('http') === 0) {
|
||||
link.addEventListener('click', (e) => {
|
||||
e.preventDefault()
|
||||
shell.openExternal(url)
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -1,56 +1,56 @@
|
||||
// Modules to control application life and create native browser window
|
||||
const { app, BrowserWindow } = require('electron')
|
||||
|
||||
// Keep a global reference of the window object, if you don't, the window will
|
||||
// be closed automatically when the JavaScript object is garbage collected.
|
||||
let mainWindow
|
||||
|
||||
function createWindow () {
|
||||
// Create the browser window.
|
||||
mainWindow = new BrowserWindow({
|
||||
width: 800,
|
||||
height: 600,
|
||||
webPreferences: {
|
||||
nodeIntegration: true
|
||||
}
|
||||
})
|
||||
|
||||
// and load the index.html of the app.
|
||||
mainWindow.loadFile('index.html')
|
||||
|
||||
// Open the DevTools.
|
||||
// mainWindow.webContents.openDevTools()
|
||||
|
||||
// Emitted when the window is closed.
|
||||
mainWindow.on('closed', function () {
|
||||
// Dereference the window object, usually you would store windows
|
||||
// in an array if your app supports multi windows, this is the time
|
||||
// when you should delete the corresponding element.
|
||||
mainWindow = null
|
||||
})
|
||||
}
|
||||
|
||||
// This method will be called when Electron has finished
|
||||
// initialization and is ready to create browser windows.
|
||||
// Some APIs can only be used after this event occurs.
|
||||
app.whenReady().then(createWindow)
|
||||
|
||||
// Quit when all windows are closed.
|
||||
app.on('window-all-closed', function () {
|
||||
// On macOS it is common for applications and their menu bar
|
||||
// to stay active until the user quits explicitly with Cmd + Q
|
||||
if (process.platform !== 'darwin') {
|
||||
app.quit()
|
||||
}
|
||||
})
|
||||
|
||||
app.on('activate', function () {
|
||||
// On macOS it is common to re-create a window in the app when the
|
||||
// dock icon is clicked and there are no other windows open.
|
||||
if (mainWindow === null) {
|
||||
createWindow()
|
||||
}
|
||||
})
|
||||
|
||||
// In this file you can include the rest of your app's specific main process
|
||||
// Modules to control application life and create native browser window
|
||||
const { app, BrowserWindow } = require('electron')
|
||||
|
||||
// Keep a global reference of the window object, if you don't, the window will
|
||||
// be closed automatically when the JavaScript object is garbage collected.
|
||||
let mainWindow
|
||||
|
||||
function createWindow () {
|
||||
// Create the browser window.
|
||||
mainWindow = new BrowserWindow({
|
||||
width: 800,
|
||||
height: 600,
|
||||
webPreferences: {
|
||||
nodeIntegration: true
|
||||
}
|
||||
})
|
||||
|
||||
// and load the index.html of the app.
|
||||
mainWindow.loadFile('index.html')
|
||||
|
||||
// Open the DevTools.
|
||||
// mainWindow.webContents.openDevTools()
|
||||
|
||||
// Emitted when the window is closed.
|
||||
mainWindow.on('closed', function () {
|
||||
// Dereference the window object, usually you would store windows
|
||||
// in an array if your app supports multi windows, this is the time
|
||||
// when you should delete the corresponding element.
|
||||
mainWindow = null
|
||||
})
|
||||
}
|
||||
|
||||
// This method will be called when Electron has finished
|
||||
// initialization and is ready to create browser windows.
|
||||
// Some APIs can only be used after this event occurs.
|
||||
app.whenReady().then(createWindow)
|
||||
|
||||
// Quit when all windows are closed.
|
||||
app.on('window-all-closed', function () {
|
||||
// On macOS it is common for applications and their menu bar
|
||||
// to stay active until the user quits explicitly with Cmd + Q
|
||||
if (process.platform !== 'darwin') {
|
||||
app.quit()
|
||||
}
|
||||
})
|
||||
|
||||
app.on('activate', function () {
|
||||
// On macOS it is common to re-create a window in the app when the
|
||||
// dock icon is clicked and there are no other windows open.
|
||||
if (mainWindow === null) {
|
||||
createWindow()
|
||||
}
|
||||
})
|
||||
|
||||
// In this file you can include the rest of your app's specific main process
|
||||
// code. You can also put them in separate files and require them here.
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
const { shell } = require('electron')
|
||||
const os = require('os')
|
||||
|
||||
const exLinksBtn = document.getElementById('open-ex-links')
|
||||
const fileManagerBtn = document.getElementById('open-file-manager')
|
||||
|
||||
fileManagerBtn.addEventListener('click', (event) => {
|
||||
shell.showItemInFolder(os.homedir())
|
||||
})
|
||||
|
||||
exLinksBtn.addEventListener('click', (event) => {
|
||||
shell.openExternal('https://electronjs.org')
|
||||
const { shell } = require('electron')
|
||||
const os = require('os')
|
||||
|
||||
const exLinksBtn = document.getElementById('open-ex-links')
|
||||
const fileManagerBtn = document.getElementById('open-file-manager')
|
||||
|
||||
fileManagerBtn.addEventListener('click', (event) => {
|
||||
shell.showItemInFolder(os.homedir())
|
||||
})
|
||||
|
||||
exLinksBtn.addEventListener('click', (event) => {
|
||||
shell.openExternal('https://electronjs.org')
|
||||
})
|
||||
|
||||
@@ -1,56 +1,56 @@
|
||||
// Modules to control application life and create native browser window
|
||||
const { app, BrowserWindow } = require('electron')
|
||||
|
||||
// Keep a global reference of the window object, if you don't, the window will
|
||||
// be closed automatically when the JavaScript object is garbage collected.
|
||||
let mainWindow
|
||||
|
||||
function createWindow () {
|
||||
// Create the browser window.
|
||||
mainWindow = new BrowserWindow({
|
||||
width: 800,
|
||||
height: 600,
|
||||
webPreferences: {
|
||||
nodeIntegration: true
|
||||
}
|
||||
})
|
||||
|
||||
// and load the index.html of the app.
|
||||
mainWindow.loadFile('index.html')
|
||||
|
||||
// Open the DevTools.
|
||||
// mainWindow.webContents.openDevTools()
|
||||
|
||||
// Emitted when the window is closed.
|
||||
mainWindow.on('closed', function () {
|
||||
// Dereference the window object, usually you would store windows
|
||||
// in an array if your app supports multi windows, this is the time
|
||||
// when you should delete the corresponding element.
|
||||
mainWindow = null
|
||||
})
|
||||
}
|
||||
|
||||
// This method will be called when Electron has finished
|
||||
// initialization and is ready to create browser windows.
|
||||
// Some APIs can only be used after this event occurs.
|
||||
app.whenReady().then(createWindow)
|
||||
|
||||
// Quit when all windows are closed.
|
||||
app.on('window-all-closed', function () {
|
||||
// On macOS it is common for applications and their menu bar
|
||||
// to stay active until the user quits explicitly with Cmd + Q
|
||||
if (process.platform !== 'darwin') {
|
||||
app.quit()
|
||||
}
|
||||
})
|
||||
|
||||
app.on('activate', function () {
|
||||
// On macOS it is common to re-create a window in the app when the
|
||||
// dock icon is clicked and there are no other windows open.
|
||||
if (mainWindow === null) {
|
||||
createWindow()
|
||||
}
|
||||
})
|
||||
|
||||
// In this file you can include the rest of your app's specific main process
|
||||
// Modules to control application life and create native browser window
|
||||
const { app, BrowserWindow } = require('electron')
|
||||
|
||||
// Keep a global reference of the window object, if you don't, the window will
|
||||
// be closed automatically when the JavaScript object is garbage collected.
|
||||
let mainWindow
|
||||
|
||||
function createWindow () {
|
||||
// Create the browser window.
|
||||
mainWindow = new BrowserWindow({
|
||||
width: 800,
|
||||
height: 600,
|
||||
webPreferences: {
|
||||
nodeIntegration: true
|
||||
}
|
||||
})
|
||||
|
||||
// and load the index.html of the app.
|
||||
mainWindow.loadFile('index.html')
|
||||
|
||||
// Open the DevTools.
|
||||
// mainWindow.webContents.openDevTools()
|
||||
|
||||
// Emitted when the window is closed.
|
||||
mainWindow.on('closed', function () {
|
||||
// Dereference the window object, usually you would store windows
|
||||
// in an array if your app supports multi windows, this is the time
|
||||
// when you should delete the corresponding element.
|
||||
mainWindow = null
|
||||
})
|
||||
}
|
||||
|
||||
// This method will be called when Electron has finished
|
||||
// initialization and is ready to create browser windows.
|
||||
// Some APIs can only be used after this event occurs.
|
||||
app.whenReady().then(createWindow)
|
||||
|
||||
// Quit when all windows are closed.
|
||||
app.on('window-all-closed', function () {
|
||||
// On macOS it is common for applications and their menu bar
|
||||
// to stay active until the user quits explicitly with Cmd + Q
|
||||
if (process.platform !== 'darwin') {
|
||||
app.quit()
|
||||
}
|
||||
})
|
||||
|
||||
app.on('activate', function () {
|
||||
// On macOS it is common to re-create a window in the app when the
|
||||
// dock icon is clicked and there are no other windows open.
|
||||
if (mainWindow === null) {
|
||||
createWindow()
|
||||
}
|
||||
})
|
||||
|
||||
// In this file you can include the rest of your app's specific main process
|
||||
// code. You can also put them in separate files and require them here.
|
||||
|
||||
@@ -1,29 +1,29 @@
|
||||
const basicNotification = {
|
||||
title: 'Basic Notification',
|
||||
body: 'Short message part'
|
||||
}
|
||||
|
||||
const notification = {
|
||||
title: 'Notification with image',
|
||||
body: 'Short message plus a custom image',
|
||||
icon: 'https://via.placeholder.com/150'
|
||||
}
|
||||
|
||||
const basicNotificationButton = document.getElementById('basic-noti')
|
||||
const notificationButton = document.getElementById('advanced-noti')
|
||||
|
||||
notificationButton.addEventListener('click', () => {
|
||||
const myNotification = new window.Notification(notification.title, notification)
|
||||
|
||||
myNotification.onclick = () => {
|
||||
console.log('Notification clicked')
|
||||
}
|
||||
})
|
||||
|
||||
basicNotificationButton.addEventListener('click', () => {
|
||||
const myNotification = new window.Notification(basicNotification.title, basicNotification)
|
||||
|
||||
myNotification.onclick = () => {
|
||||
console.log('Notification clicked')
|
||||
}
|
||||
})
|
||||
const basicNotification = {
|
||||
title: 'Basic Notification',
|
||||
body: 'Short message part'
|
||||
}
|
||||
|
||||
const notification = {
|
||||
title: 'Notification with image',
|
||||
body: 'Short message plus a custom image',
|
||||
icon: 'https://via.placeholder.com/150'
|
||||
}
|
||||
|
||||
const basicNotificationButton = document.getElementById('basic-noti')
|
||||
const notificationButton = document.getElementById('advanced-noti')
|
||||
|
||||
notificationButton.addEventListener('click', () => {
|
||||
const myNotification = new window.Notification(notification.title, notification)
|
||||
|
||||
myNotification.onclick = () => {
|
||||
console.log('Notification clicked')
|
||||
}
|
||||
})
|
||||
|
||||
basicNotificationButton.addEventListener('click', () => {
|
||||
const myNotification = new window.Notification(basicNotification.title, basicNotification)
|
||||
|
||||
myNotification.onclick = () => {
|
||||
console.log('Notification clicked')
|
||||
}
|
||||
})
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,35 +1,35 @@
|
||||
const { ipcRenderer, shell } = require('electron')
|
||||
|
||||
const trayBtn = document.getElementById('put-in-tray')
|
||||
const links = document.querySelectorAll('a[href]')
|
||||
|
||||
let trayOn = false
|
||||
|
||||
trayBtn.addEventListener('click', function (event) {
|
||||
if (trayOn) {
|
||||
trayOn = false
|
||||
document.getElementById('tray-countdown').innerHTML = ''
|
||||
ipcRenderer.send('remove-tray')
|
||||
} else {
|
||||
trayOn = true
|
||||
const message = 'Click demo again to remove.'
|
||||
document.getElementById('tray-countdown').innerHTML = message
|
||||
ipcRenderer.send('put-in-tray')
|
||||
}
|
||||
})
|
||||
// Tray removed from context menu on icon
|
||||
ipcRenderer.on('tray-removed', function () {
|
||||
ipcRenderer.send('remove-tray')
|
||||
trayOn = false
|
||||
document.getElementById('tray-countdown').innerHTML = ''
|
||||
})
|
||||
|
||||
Array.prototype.forEach.call(links, (link) => {
|
||||
const url = link.getAttribute('href')
|
||||
if (url.indexOf('http') === 0) {
|
||||
link.addEventListener('click', (e) => {
|
||||
e.preventDefault()
|
||||
shell.openExternal(url)
|
||||
})
|
||||
}
|
||||
const { ipcRenderer, shell } = require('electron')
|
||||
|
||||
const trayBtn = document.getElementById('put-in-tray')
|
||||
const links = document.querySelectorAll('a[href]')
|
||||
|
||||
let trayOn = false
|
||||
|
||||
trayBtn.addEventListener('click', function (event) {
|
||||
if (trayOn) {
|
||||
trayOn = false
|
||||
document.getElementById('tray-countdown').innerHTML = ''
|
||||
ipcRenderer.send('remove-tray')
|
||||
} else {
|
||||
trayOn = true
|
||||
const message = 'Click demo again to remove.'
|
||||
document.getElementById('tray-countdown').innerHTML = message
|
||||
ipcRenderer.send('put-in-tray')
|
||||
}
|
||||
})
|
||||
// Tray removed from context menu on icon
|
||||
ipcRenderer.on('tray-removed', function () {
|
||||
ipcRenderer.send('remove-tray')
|
||||
trayOn = false
|
||||
document.getElementById('tray-countdown').innerHTML = ''
|
||||
})
|
||||
|
||||
Array.prototype.forEach.call(links, (link) => {
|
||||
const url = link.getAttribute('href')
|
||||
if (url.indexOf('http') === 0) {
|
||||
link.addEventListener('click', (e) => {
|
||||
e.preventDefault()
|
||||
shell.openExternal(url)
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -1,56 +1,56 @@
|
||||
// Modules to control application life and create native browser window
|
||||
const { app, BrowserWindow } = require('electron')
|
||||
|
||||
// Keep a global reference of the window object, if you don't, the window will
|
||||
// be closed automatically when the JavaScript object is garbage collected.
|
||||
let mainWindow
|
||||
|
||||
function createWindow () {
|
||||
// Create the browser window.
|
||||
mainWindow = new BrowserWindow({
|
||||
width: 800,
|
||||
height: 600,
|
||||
webPreferences: {
|
||||
nodeIntegration: true
|
||||
}
|
||||
})
|
||||
|
||||
// and load the index.html of the app.
|
||||
mainWindow.loadFile('index.html')
|
||||
|
||||
// Open the DevTools.
|
||||
// mainWindow.webContents.openDevTools()
|
||||
|
||||
// Emitted when the window is closed.
|
||||
mainWindow.on('closed', function () {
|
||||
// Dereference the window object, usually you would store windows
|
||||
// in an array if your app supports multi windows, this is the time
|
||||
// when you should delete the corresponding element.
|
||||
mainWindow = null
|
||||
})
|
||||
}
|
||||
|
||||
// This method will be called when Electron has finished
|
||||
// initialization and is ready to create browser windows.
|
||||
// Some APIs can only be used after this event occurs.
|
||||
app.whenReady().then(createWindow)
|
||||
|
||||
// Quit when all windows are closed.
|
||||
app.on('window-all-closed', function () {
|
||||
// On macOS it is common for applications and their menu bar
|
||||
// to stay active until the user quits explicitly with Cmd + Q
|
||||
if (process.platform !== 'darwin') {
|
||||
app.quit()
|
||||
}
|
||||
})
|
||||
|
||||
app.on('activate', function () {
|
||||
// On macOS it is common to re-create a window in the app when the
|
||||
// dock icon is clicked and there are no other windows open.
|
||||
if (mainWindow === null) {
|
||||
createWindow()
|
||||
}
|
||||
})
|
||||
|
||||
// In this file you can include the rest of your app's specific main process
|
||||
// Modules to control application life and create native browser window
|
||||
const { app, BrowserWindow } = require('electron')
|
||||
|
||||
// Keep a global reference of the window object, if you don't, the window will
|
||||
// be closed automatically when the JavaScript object is garbage collected.
|
||||
let mainWindow
|
||||
|
||||
function createWindow () {
|
||||
// Create the browser window.
|
||||
mainWindow = new BrowserWindow({
|
||||
width: 800,
|
||||
height: 600,
|
||||
webPreferences: {
|
||||
nodeIntegration: true
|
||||
}
|
||||
})
|
||||
|
||||
// and load the index.html of the app.
|
||||
mainWindow.loadFile('index.html')
|
||||
|
||||
// Open the DevTools.
|
||||
// mainWindow.webContents.openDevTools()
|
||||
|
||||
// Emitted when the window is closed.
|
||||
mainWindow.on('closed', function () {
|
||||
// Dereference the window object, usually you would store windows
|
||||
// in an array if your app supports multi windows, this is the time
|
||||
// when you should delete the corresponding element.
|
||||
mainWindow = null
|
||||
})
|
||||
}
|
||||
|
||||
// This method will be called when Electron has finished
|
||||
// initialization and is ready to create browser windows.
|
||||
// Some APIs can only be used after this event occurs.
|
||||
app.whenReady().then(createWindow)
|
||||
|
||||
// Quit when all windows are closed.
|
||||
app.on('window-all-closed', function () {
|
||||
// On macOS it is common for applications and their menu bar
|
||||
// to stay active until the user quits explicitly with Cmd + Q
|
||||
if (process.platform !== 'darwin') {
|
||||
app.quit()
|
||||
}
|
||||
})
|
||||
|
||||
app.on('activate', function () {
|
||||
// On macOS it is common to re-create a window in the app when the
|
||||
// dock icon is clicked and there are no other windows open.
|
||||
if (mainWindow === null) {
|
||||
createWindow()
|
||||
}
|
||||
})
|
||||
|
||||
// In this file you can include the rest of your app's specific main process
|
||||
// code. You can also put them in separate files and require them here.
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
const { BrowserWindow } = require('electron').remote
|
||||
const shell = require('electron').shell
|
||||
|
||||
const framelessWindowBtn = document.getElementById('frameless-window')
|
||||
|
||||
const links = document.querySelectorAll('a[href]')
|
||||
|
||||
framelessWindowBtn.addEventListener('click', (event) => {
|
||||
const modalPath = 'https://electronjs.org'
|
||||
let win = new BrowserWindow({ frame: false })
|
||||
|
||||
win.on('close', () => { win = null })
|
||||
win.loadURL(modalPath)
|
||||
win.show()
|
||||
})
|
||||
|
||||
Array.prototype.forEach.call(links, (link) => {
|
||||
const url = link.getAttribute('href')
|
||||
if (url.indexOf('http') === 0) {
|
||||
link.addEventListener('click', (e) => {
|
||||
e.preventDefault()
|
||||
shell.openExternal(url)
|
||||
})
|
||||
}
|
||||
})
|
||||
const { BrowserWindow } = require('electron').remote
|
||||
const shell = require('electron').shell
|
||||
|
||||
const framelessWindowBtn = document.getElementById('frameless-window')
|
||||
|
||||
const links = document.querySelectorAll('a[href]')
|
||||
|
||||
framelessWindowBtn.addEventListener('click', (event) => {
|
||||
const modalPath = 'https://electronjs.org'
|
||||
let win = new BrowserWindow({ frame: false })
|
||||
|
||||
win.on('close', () => { win = null })
|
||||
win.loadURL(modalPath)
|
||||
win.show()
|
||||
})
|
||||
|
||||
Array.prototype.forEach.call(links, (link) => {
|
||||
const url = link.getAttribute('href')
|
||||
if (url.indexOf('http') === 0) {
|
||||
link.addEventListener('click', (e) => {
|
||||
e.preventDefault()
|
||||
shell.openExternal(url)
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
@@ -1,56 +1,56 @@
|
||||
// Modules to control application life and create native browser window
|
||||
const { app, BrowserWindow } = require('electron')
|
||||
|
||||
// Keep a global reference of the window object, if you don't, the window will
|
||||
// be closed automatically when the JavaScript object is garbage collected.
|
||||
let mainWindow
|
||||
|
||||
function createWindow () {
|
||||
// Create the browser window.
|
||||
mainWindow = new BrowserWindow({
|
||||
width: 800,
|
||||
height: 600,
|
||||
webPreferences: {
|
||||
nodeIntegration: true
|
||||
}
|
||||
})
|
||||
|
||||
// and load the index.html of the app.
|
||||
mainWindow.loadFile('index.html')
|
||||
|
||||
// Open the DevTools.
|
||||
// mainWindow.webContents.openDevTools()
|
||||
|
||||
// Emitted when the window is closed.
|
||||
mainWindow.on('closed', function () {
|
||||
// Dereference the window object, usually you would store windows
|
||||
// in an array if your app supports multi windows, this is the time
|
||||
// when you should delete the corresponding element.
|
||||
mainWindow = null
|
||||
})
|
||||
}
|
||||
|
||||
// This method will be called when Electron has finished
|
||||
// initialization and is ready to create browser windows.
|
||||
// Some APIs can only be used after this event occurs.
|
||||
app.whenReady().then(createWindow)
|
||||
|
||||
// Quit when all windows are closed.
|
||||
app.on('window-all-closed', function () {
|
||||
// On macOS it is common for applications and their menu bar
|
||||
// to stay active until the user quits explicitly with Cmd + Q
|
||||
if (process.platform !== 'darwin') {
|
||||
app.quit()
|
||||
}
|
||||
})
|
||||
|
||||
app.on('activate', function () {
|
||||
// On macOS it is common to re-create a window in the app when the
|
||||
// dock icon is clicked and there are no other windows open.
|
||||
if (mainWindow === null) {
|
||||
createWindow()
|
||||
}
|
||||
})
|
||||
|
||||
// In this file you can include the rest of your app's specific main process
|
||||
// Modules to control application life and create native browser window
|
||||
const { app, BrowserWindow } = require('electron')
|
||||
|
||||
// Keep a global reference of the window object, if you don't, the window will
|
||||
// be closed automatically when the JavaScript object is garbage collected.
|
||||
let mainWindow
|
||||
|
||||
function createWindow () {
|
||||
// Create the browser window.
|
||||
mainWindow = new BrowserWindow({
|
||||
width: 800,
|
||||
height: 600,
|
||||
webPreferences: {
|
||||
nodeIntegration: true
|
||||
}
|
||||
})
|
||||
|
||||
// and load the index.html of the app.
|
||||
mainWindow.loadFile('index.html')
|
||||
|
||||
// Open the DevTools.
|
||||
// mainWindow.webContents.openDevTools()
|
||||
|
||||
// Emitted when the window is closed.
|
||||
mainWindow.on('closed', function () {
|
||||
// Dereference the window object, usually you would store windows
|
||||
// in an array if your app supports multi windows, this is the time
|
||||
// when you should delete the corresponding element.
|
||||
mainWindow = null
|
||||
})
|
||||
}
|
||||
|
||||
// This method will be called when Electron has finished
|
||||
// initialization and is ready to create browser windows.
|
||||
// Some APIs can only be used after this event occurs.
|
||||
app.whenReady().then(createWindow)
|
||||
|
||||
// Quit when all windows are closed.
|
||||
app.on('window-all-closed', function () {
|
||||
// On macOS it is common for applications and their menu bar
|
||||
// to stay active until the user quits explicitly with Cmd + Q
|
||||
if (process.platform !== 'darwin') {
|
||||
app.quit()
|
||||
}
|
||||
})
|
||||
|
||||
app.on('activate', function () {
|
||||
// On macOS it is common to re-create a window in the app when the
|
||||
// dock icon is clicked and there are no other windows open.
|
||||
if (mainWindow === null) {
|
||||
createWindow()
|
||||
}
|
||||
})
|
||||
|
||||
// In this file you can include the rest of your app's specific main process
|
||||
// code. You can also put them in separate files and require them here.
|
||||
|
||||
@@ -1,35 +1,35 @@
|
||||
const { BrowserWindow } = require('electron').remote
|
||||
const shell = require('electron').shell
|
||||
|
||||
const manageWindowBtn = document.getElementById('manage-window')
|
||||
|
||||
const links = document.querySelectorAll('a[href]')
|
||||
|
||||
let win
|
||||
|
||||
manageWindowBtn.addEventListener('click', (event) => {
|
||||
const modalPath = 'https://electronjs.org'
|
||||
win = new BrowserWindow({ width: 400, height: 275 })
|
||||
|
||||
win.on('resize', updateReply)
|
||||
win.on('move', updateReply)
|
||||
win.on('close', () => { win = null })
|
||||
win.loadURL(modalPath)
|
||||
win.show()
|
||||
|
||||
function updateReply () {
|
||||
const manageWindowReply = document.getElementById('manage-window-reply')
|
||||
const message = `Size: ${win.getSize()} Position: ${win.getPosition()}`
|
||||
manageWindowReply.innerText = message
|
||||
}
|
||||
})
|
||||
|
||||
Array.prototype.forEach.call(links, (link) => {
|
||||
const url = link.getAttribute('href')
|
||||
if (url.indexOf('http') === 0) {
|
||||
link.addEventListener('click', (e) => {
|
||||
e.preventDefault()
|
||||
shell.openExternal(url)
|
||||
})
|
||||
}
|
||||
})
|
||||
const { BrowserWindow } = require('electron').remote
|
||||
const shell = require('electron').shell
|
||||
|
||||
const manageWindowBtn = document.getElementById('manage-window')
|
||||
|
||||
const links = document.querySelectorAll('a[href]')
|
||||
|
||||
let win
|
||||
|
||||
manageWindowBtn.addEventListener('click', (event) => {
|
||||
const modalPath = 'https://electronjs.org'
|
||||
win = new BrowserWindow({ width: 400, height: 275 })
|
||||
|
||||
win.on('resize', updateReply)
|
||||
win.on('move', updateReply)
|
||||
win.on('close', () => { win = null })
|
||||
win.loadURL(modalPath)
|
||||
win.show()
|
||||
|
||||
function updateReply () {
|
||||
const manageWindowReply = document.getElementById('manage-window-reply')
|
||||
const message = `Size: ${win.getSize()} Position: ${win.getPosition()}`
|
||||
manageWindowReply.innerText = message
|
||||
}
|
||||
})
|
||||
|
||||
Array.prototype.forEach.call(links, (link) => {
|
||||
const url = link.getAttribute('href')
|
||||
if (url.indexOf('http') === 0) {
|
||||
link.addEventListener('click', (e) => {
|
||||
e.preventDefault()
|
||||
shell.openExternal(url)
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
@@ -1,56 +1,56 @@
|
||||
// Modules to control application life and create native browser window
|
||||
const { app, BrowserWindow } = require('electron')
|
||||
|
||||
// Keep a global reference of the window object, if you don't, the window will
|
||||
// be closed automatically when the JavaScript object is garbage collected.
|
||||
let mainWindow
|
||||
|
||||
function createWindow () {
|
||||
// Create the browser window.
|
||||
mainWindow = new BrowserWindow({
|
||||
width: 800,
|
||||
height: 600,
|
||||
webPreferences: {
|
||||
nodeIntegration: true
|
||||
}
|
||||
})
|
||||
|
||||
// and load the index.html of the app.
|
||||
mainWindow.loadFile('index.html')
|
||||
|
||||
// Open the DevTools.
|
||||
// mainWindow.webContents.openDevTools()
|
||||
|
||||
// Emitted when the window is closed.
|
||||
mainWindow.on('closed', function () {
|
||||
// Dereference the window object, usually you would store windows
|
||||
// in an array if your app supports multi windows, this is the time
|
||||
// when you should delete the corresponding element.
|
||||
mainWindow = null
|
||||
})
|
||||
}
|
||||
|
||||
// This method will be called when Electron has finished
|
||||
// initialization and is ready to create browser windows.
|
||||
// Some APIs can only be used after this event occurs.
|
||||
app.whenReady().then(createWindow)
|
||||
|
||||
// Quit when all windows are closed.
|
||||
app.on('window-all-closed', function () {
|
||||
// On macOS it is common for applications and their menu bar
|
||||
// to stay active until the user quits explicitly with Cmd + Q
|
||||
if (process.platform !== 'darwin') {
|
||||
app.quit()
|
||||
}
|
||||
})
|
||||
|
||||
app.on('activate', function () {
|
||||
// On macOS it is common to re-create a window in the app when the
|
||||
// dock icon is clicked and there are no other windows open.
|
||||
if (mainWindow === null) {
|
||||
createWindow()
|
||||
}
|
||||
})
|
||||
|
||||
// In this file you can include the rest of your app's specific main process
|
||||
// Modules to control application life and create native browser window
|
||||
const { app, BrowserWindow } = require('electron')
|
||||
|
||||
// Keep a global reference of the window object, if you don't, the window will
|
||||
// be closed automatically when the JavaScript object is garbage collected.
|
||||
let mainWindow
|
||||
|
||||
function createWindow () {
|
||||
// Create the browser window.
|
||||
mainWindow = new BrowserWindow({
|
||||
width: 800,
|
||||
height: 600,
|
||||
webPreferences: {
|
||||
nodeIntegration: true
|
||||
}
|
||||
})
|
||||
|
||||
// and load the index.html of the app.
|
||||
mainWindow.loadFile('index.html')
|
||||
|
||||
// Open the DevTools.
|
||||
// mainWindow.webContents.openDevTools()
|
||||
|
||||
// Emitted when the window is closed.
|
||||
mainWindow.on('closed', function () {
|
||||
// Dereference the window object, usually you would store windows
|
||||
// in an array if your app supports multi windows, this is the time
|
||||
// when you should delete the corresponding element.
|
||||
mainWindow = null
|
||||
})
|
||||
}
|
||||
|
||||
// This method will be called when Electron has finished
|
||||
// initialization and is ready to create browser windows.
|
||||
// Some APIs can only be used after this event occurs.
|
||||
app.whenReady().then(createWindow)
|
||||
|
||||
// Quit when all windows are closed.
|
||||
app.on('window-all-closed', function () {
|
||||
// On macOS it is common for applications and their menu bar
|
||||
// to stay active until the user quits explicitly with Cmd + Q
|
||||
if (process.platform !== 'darwin') {
|
||||
app.quit()
|
||||
}
|
||||
})
|
||||
|
||||
app.on('activate', function () {
|
||||
// On macOS it is common to re-create a window in the app when the
|
||||
// dock icon is clicked and there are no other windows open.
|
||||
if (mainWindow === null) {
|
||||
createWindow()
|
||||
}
|
||||
})
|
||||
|
||||
// In this file you can include the rest of your app's specific main process
|
||||
// code. You can also put them in separate files and require them here.
|
||||
|
||||
@@ -1,48 +1,48 @@
|
||||
const { BrowserWindow } = require('electron').remote
|
||||
const shell = require('electron').shell
|
||||
|
||||
const listenToWindowBtn = document.getElementById('listen-to-window')
|
||||
const focusModalBtn = document.getElementById('focus-on-modal-window')
|
||||
|
||||
const links = document.querySelectorAll('a[href]')
|
||||
|
||||
let win
|
||||
|
||||
listenToWindowBtn.addEventListener('click', () => {
|
||||
const modalPath = 'https://electronjs.org'
|
||||
win = new BrowserWindow({ width: 600, height: 400 })
|
||||
|
||||
const hideFocusBtn = () => {
|
||||
focusModalBtn.classList.add('disappear')
|
||||
focusModalBtn.classList.remove('smooth-appear')
|
||||
focusModalBtn.removeEventListener('click', clickHandler)
|
||||
}
|
||||
|
||||
const showFocusBtn = (btn) => {
|
||||
if (!win) return
|
||||
focusModalBtn.classList.add('smooth-appear')
|
||||
focusModalBtn.classList.remove('disappear')
|
||||
focusModalBtn.addEventListener('click', clickHandler)
|
||||
}
|
||||
|
||||
win.on('focus', hideFocusBtn)
|
||||
win.on('blur', showFocusBtn)
|
||||
win.on('close', () => {
|
||||
hideFocusBtn()
|
||||
win = null
|
||||
})
|
||||
win.loadURL(modalPath)
|
||||
win.show()
|
||||
|
||||
const clickHandler = () => { win.focus() }
|
||||
})
|
||||
|
||||
Array.prototype.forEach.call(links, (link) => {
|
||||
const url = link.getAttribute('href')
|
||||
if (url.indexOf('http') === 0) {
|
||||
link.addEventListener('click', (e) => {
|
||||
e.preventDefault()
|
||||
shell.openExternal(url)
|
||||
})
|
||||
}
|
||||
})
|
||||
const { BrowserWindow } = require('electron').remote
|
||||
const shell = require('electron').shell
|
||||
|
||||
const listenToWindowBtn = document.getElementById('listen-to-window')
|
||||
const focusModalBtn = document.getElementById('focus-on-modal-window')
|
||||
|
||||
const links = document.querySelectorAll('a[href]')
|
||||
|
||||
let win
|
||||
|
||||
listenToWindowBtn.addEventListener('click', () => {
|
||||
const modalPath = 'https://electronjs.org'
|
||||
win = new BrowserWindow({ width: 600, height: 400 })
|
||||
|
||||
const hideFocusBtn = () => {
|
||||
focusModalBtn.classList.add('disappear')
|
||||
focusModalBtn.classList.remove('smooth-appear')
|
||||
focusModalBtn.removeEventListener('click', clickHandler)
|
||||
}
|
||||
|
||||
const showFocusBtn = (btn) => {
|
||||
if (!win) return
|
||||
focusModalBtn.classList.add('smooth-appear')
|
||||
focusModalBtn.classList.remove('disappear')
|
||||
focusModalBtn.addEventListener('click', clickHandler)
|
||||
}
|
||||
|
||||
win.on('focus', hideFocusBtn)
|
||||
win.on('blur', showFocusBtn)
|
||||
win.on('close', () => {
|
||||
hideFocusBtn()
|
||||
win = null
|
||||
})
|
||||
win.loadURL(modalPath)
|
||||
win.show()
|
||||
|
||||
const clickHandler = () => { win.focus() }
|
||||
})
|
||||
|
||||
Array.prototype.forEach.call(links, (link) => {
|
||||
const url = link.getAttribute('href')
|
||||
if (url.indexOf('http') === 0) {
|
||||
link.addEventListener('click', (e) => {
|
||||
e.preventDefault()
|
||||
shell.openExternal(url)
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
@@ -54,6 +54,7 @@ template("electron_extra_paks") {
|
||||
])
|
||||
output = "${invoker.output_dir}/resources.pak"
|
||||
sources = [
|
||||
"$root_gen_dir/chrome/print_preview_pdf_resources.pak",
|
||||
"$root_gen_dir/components/components_resources.pak",
|
||||
"$root_gen_dir/content/browser/resources/media/media_internals_resources.pak",
|
||||
"$root_gen_dir/content/browser/tracing/tracing_resources.pak",
|
||||
@@ -63,10 +64,12 @@ template("electron_extra_paks") {
|
||||
"$root_gen_dir/mojo/public/js/mojo_bindings_resources.pak",
|
||||
"$root_gen_dir/net/net_resources.pak",
|
||||
"$root_gen_dir/third_party/blink/public/resources/blink_resources.pak",
|
||||
"$root_gen_dir/third_party/blink/public/resources/inspector_overlay_resources.pak",
|
||||
"$root_gen_dir/ui/resources/webui_resources.pak",
|
||||
"$target_gen_dir/electron_resources.pak",
|
||||
]
|
||||
deps = [
|
||||
"//chrome/browser/resources:print_preview_pdf_resources",
|
||||
"//components/resources",
|
||||
"//content:content_resources",
|
||||
"//content:dev_ui_content_resources",
|
||||
@@ -76,6 +79,7 @@ template("electron_extra_paks") {
|
||||
"//electron:resources",
|
||||
"//mojo/public/js:resources",
|
||||
"//net:net_resources",
|
||||
"//third_party/blink/public:devtools_inspector_resources",
|
||||
"//third_party/blink/public:resources",
|
||||
"//ui/resources",
|
||||
]
|
||||
|
||||
@@ -138,7 +138,6 @@ auto_filenames = {
|
||||
"lib/common/api/clipboard.js",
|
||||
"lib/common/api/deprecate.ts",
|
||||
"lib/common/api/module-list.ts",
|
||||
"lib/common/api/native-image.js",
|
||||
"lib/common/api/shell.js",
|
||||
"lib/common/define-properties.ts",
|
||||
"lib/common/electron-binding-setup.ts",
|
||||
@@ -149,6 +148,7 @@ auto_filenames = {
|
||||
"lib/renderer/api/crash-reporter.ts",
|
||||
"lib/renderer/api/desktop-capturer.ts",
|
||||
"lib/renderer/api/ipc-renderer.ts",
|
||||
"lib/renderer/api/native-image.ts",
|
||||
"lib/renderer/api/remote.js",
|
||||
"lib/renderer/api/web-frame.ts",
|
||||
"lib/renderer/inspector.ts",
|
||||
@@ -204,6 +204,7 @@ auto_filenames = {
|
||||
"lib/browser/api/menu.js",
|
||||
"lib/browser/api/message-channel.ts",
|
||||
"lib/browser/api/module-list.ts",
|
||||
"lib/browser/api/native-image.ts",
|
||||
"lib/browser/api/native-theme.ts",
|
||||
"lib/browser/api/net-log.js",
|
||||
"lib/browser/api/net.ts",
|
||||
@@ -240,7 +241,6 @@ auto_filenames = {
|
||||
"lib/common/api/clipboard.js",
|
||||
"lib/common/api/deprecate.ts",
|
||||
"lib/common/api/module-list.ts",
|
||||
"lib/common/api/native-image.js",
|
||||
"lib/common/api/shell.js",
|
||||
"lib/common/define-properties.ts",
|
||||
"lib/common/electron-binding-setup.ts",
|
||||
@@ -262,7 +262,6 @@ auto_filenames = {
|
||||
"lib/common/api/clipboard.js",
|
||||
"lib/common/api/deprecate.ts",
|
||||
"lib/common/api/module-list.ts",
|
||||
"lib/common/api/native-image.js",
|
||||
"lib/common/api/shell.js",
|
||||
"lib/common/define-properties.ts",
|
||||
"lib/common/electron-binding-setup.ts",
|
||||
@@ -277,6 +276,7 @@ auto_filenames = {
|
||||
"lib/renderer/api/exports/electron.ts",
|
||||
"lib/renderer/api/ipc-renderer.ts",
|
||||
"lib/renderer/api/module-list.ts",
|
||||
"lib/renderer/api/native-image.ts",
|
||||
"lib/renderer/api/remote.js",
|
||||
"lib/renderer/api/web-frame.ts",
|
||||
"lib/renderer/init.ts",
|
||||
@@ -304,7 +304,6 @@ auto_filenames = {
|
||||
"lib/common/api/clipboard.js",
|
||||
"lib/common/api/deprecate.ts",
|
||||
"lib/common/api/module-list.ts",
|
||||
"lib/common/api/native-image.js",
|
||||
"lib/common/api/shell.js",
|
||||
"lib/common/define-properties.ts",
|
||||
"lib/common/electron-binding-setup.ts",
|
||||
@@ -318,6 +317,7 @@ auto_filenames = {
|
||||
"lib/renderer/api/exports/electron.ts",
|
||||
"lib/renderer/api/ipc-renderer.ts",
|
||||
"lib/renderer/api/module-list.ts",
|
||||
"lib/renderer/api/native-image.ts",
|
||||
"lib/renderer/api/remote.js",
|
||||
"lib/renderer/api/web-frame.ts",
|
||||
"lib/renderer/ipc-renderer-internal-utils.ts",
|
||||
|
||||
@@ -451,6 +451,7 @@ filenames = {
|
||||
"shell/common/api/electron_api_native_image.cc",
|
||||
"shell/common/api/electron_api_native_image.h",
|
||||
"shell/common/api/electron_api_native_image_mac.mm",
|
||||
"shell/common/api/electron_api_native_image_win.cc",
|
||||
"shell/common/api/electron_api_shell.cc",
|
||||
"shell/common/api/electron_api_v8_util.cc",
|
||||
"shell/common/api/electron_bindings.cc",
|
||||
@@ -625,6 +626,8 @@ filenames = {
|
||||
"shell/browser/extensions/api/resources_private/resources_private_api.h",
|
||||
"shell/browser/extensions/api/runtime/electron_runtime_api_delegate.cc",
|
||||
"shell/browser/extensions/api/runtime/electron_runtime_api_delegate.h",
|
||||
"shell/browser/extensions/api/management/electron_management_api_delegate.cc",
|
||||
"shell/browser/extensions/api/management/electron_management_api_delegate.h",
|
||||
"shell/browser/extensions/api/tabs/tabs_api.cc",
|
||||
"shell/browser/extensions/api/tabs/tabs_api.h",
|
||||
"shell/browser/extensions/api/streams_private/streams_private_api.cc",
|
||||
|
||||
@@ -30,9 +30,11 @@ BrowserWindow.prototype._init = function () {
|
||||
// Though this hack is only needed on macOS when the app is launched from
|
||||
// Finder, we still do it on all platforms in case of other bugs we don't
|
||||
// know.
|
||||
this.webContents.once('load-url', function () {
|
||||
this.focus();
|
||||
});
|
||||
if (this.webContents._initiallyShown) {
|
||||
this.webContents.once('load-url', function () {
|
||||
this.focus();
|
||||
});
|
||||
}
|
||||
|
||||
// Redirect focus/blur event to app instance too.
|
||||
this.on('blur', (event) => {
|
||||
|
||||
@@ -15,6 +15,7 @@ export const browserModuleList: ElectronInternal.ModuleEntry[] = [
|
||||
{ name: 'Menu', loader: () => require('./menu') },
|
||||
{ name: 'MenuItem', loader: () => require('./menu-item') },
|
||||
{ name: 'MessageChannelMain', loader: () => require('./message-channel') },
|
||||
{ name: 'nativeImage', loader: () => require('./native-image') },
|
||||
{ name: 'nativeTheme', loader: () => require('./native-theme') },
|
||||
{ name: 'net', loader: () => require('./net') },
|
||||
{ name: 'netLog', loader: () => require('./net-log') },
|
||||
|
||||
@@ -17,6 +17,7 @@ export const browserModuleNames = [
|
||||
'inAppPurchase',
|
||||
'Menu',
|
||||
'MenuItem',
|
||||
'nativeImage',
|
||||
'nativeTheme',
|
||||
'net',
|
||||
'netLog',
|
||||
|
||||
3
lib/browser/api/native-image.ts
Normal file
3
lib/browser/api/native-image.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
const { nativeImage } = process._linkedBinding('electron_common_native_image');
|
||||
|
||||
export default nativeImage;
|
||||
@@ -64,6 +64,19 @@ const PDFPageSizes = {
|
||||
}
|
||||
};
|
||||
|
||||
// The minimum micron size Chromium accepts is that where:
|
||||
// Per printing/units.h:
|
||||
// * kMicronsPerInch - Length of an inch in 0.001mm unit.
|
||||
// * kPointsPerInch - Length of an inch in CSS's 1pt unit.
|
||||
//
|
||||
// Formula: (kPointsPerInch / kMicronsPerInch) * size >= 1
|
||||
//
|
||||
// Practically, this means microns need to be > 352 microns.
|
||||
// We therefore need to verify this or it will silently fail.
|
||||
const isValidCustomPageSize = (width, height) => {
|
||||
return [width, height].every(x => x > 352);
|
||||
};
|
||||
|
||||
// Default printing setting
|
||||
const defaultPrintingSetting = {
|
||||
// Customizable.
|
||||
@@ -215,7 +228,9 @@ WebContents.prototype.executeJavaScriptInIsolatedWorld = async function (code, h
|
||||
};
|
||||
|
||||
// Translate the options of printToPDF.
|
||||
WebContents.prototype.printToPDF = function (options) {
|
||||
|
||||
let pendingPromise;
|
||||
WebContents.prototype.printToPDF = async function (options) {
|
||||
const printSettings = {
|
||||
...defaultPrintingSetting,
|
||||
requestID: getNextId()
|
||||
@@ -318,13 +333,20 @@ WebContents.prototype.printToPDF = function (options) {
|
||||
const error = new Error('height and width properties are required for pageSize');
|
||||
return Promise.reject(error);
|
||||
}
|
||||
// Dimensions in Microns
|
||||
// 1 meter = 10^6 microns
|
||||
|
||||
// Dimensions in Microns - 1 meter = 10^6 microns
|
||||
const height = Math.ceil(pageSize.height);
|
||||
const width = Math.ceil(pageSize.width);
|
||||
if (!isValidCustomPageSize(width, height)) {
|
||||
const error = new Error('height and width properties must be minimum 352 microns.');
|
||||
return Promise.reject(error);
|
||||
}
|
||||
|
||||
printSettings.mediaSize = {
|
||||
name: 'CUSTOM',
|
||||
custom_display_name: 'Custom',
|
||||
height_microns: Math.ceil(pageSize.height),
|
||||
width_microns: Math.ceil(pageSize.width)
|
||||
height_microns: height,
|
||||
width_microns: width
|
||||
};
|
||||
} else if (PDFPageSizes[pageSize]) {
|
||||
printSettings.mediaSize = PDFPageSizes[pageSize];
|
||||
@@ -341,7 +363,12 @@ WebContents.prototype.printToPDF = function (options) {
|
||||
// PrinterType enum from //printing/print_job_constants.h
|
||||
printSettings.printerType = 2;
|
||||
if (this._printToPDF) {
|
||||
return this._printToPDF(printSettings);
|
||||
if (pendingPromise) {
|
||||
pendingPromise = pendingPromise.then(() => this._printToPDF(printSettings));
|
||||
} else {
|
||||
pendingPromise = this._printToPDF(printSettings);
|
||||
}
|
||||
return pendingPromise;
|
||||
} else {
|
||||
const error = new Error('Printing feature is disabled');
|
||||
return Promise.reject(error);
|
||||
@@ -359,12 +386,19 @@ WebContents.prototype.print = function (options = {}, callback) {
|
||||
if (!pageSize.height || !pageSize.width) {
|
||||
throw new Error('height and width properties are required for pageSize');
|
||||
}
|
||||
|
||||
// Dimensions in Microns - 1 meter = 10^6 microns
|
||||
const height = Math.ceil(pageSize.height);
|
||||
const width = Math.ceil(pageSize.width);
|
||||
if (!isValidCustomPageSize(width, height)) {
|
||||
throw new Error('height and width properties must be minimum 352 microns.');
|
||||
}
|
||||
|
||||
options.mediaSize = {
|
||||
name: 'CUSTOM',
|
||||
custom_display_name: 'Custom',
|
||||
height_microns: Math.ceil(pageSize.height),
|
||||
width_microns: Math.ceil(pageSize.width)
|
||||
height_microns: height,
|
||||
width_microns: width
|
||||
};
|
||||
} else if (PDFPageSizes[pageSize]) {
|
||||
options.mediaSize = PDFPageSizes[pageSize];
|
||||
|
||||
@@ -4,7 +4,6 @@ import * as fs from 'fs';
|
||||
import { Socket } from 'net';
|
||||
import * as path from 'path';
|
||||
import * as util from 'util';
|
||||
|
||||
const Module = require('module');
|
||||
|
||||
// We modified the original process.argv to let node.js load the init.js,
|
||||
|
||||
@@ -134,3 +134,7 @@ ipcMainUtils.handleSync('ELECTRON_CRASH_REPORTER_SET_UPLOAD_TO_SERVER', (event,
|
||||
ipcMainUtils.handleSync('ELECTRON_CRASH_REPORTER_GET_CRASHES_DIRECTORY', () => {
|
||||
return electron.crashReporter.getCrashesDirectory();
|
||||
});
|
||||
|
||||
ipcMainInternal.handle('ELECTRON_NATIVE_IMAGE_CREATE_THUMBNAIL_FROM_PATH', async (_, path, size) => {
|
||||
return typeUtils.serialize(await electron.nativeImage.createThumbnailFromPath(path, size));
|
||||
});
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
// Common modules, please sort alphabetically
|
||||
export const commonModuleList: ElectronInternal.ModuleEntry[] = [
|
||||
{ name: 'clipboard', loader: () => require('./clipboard') },
|
||||
{ name: 'nativeImage', loader: () => require('./native-image') },
|
||||
{ name: 'shell', loader: () => require('./shell') },
|
||||
// The internal modules, invisible unless you know their names.
|
||||
{ name: 'deprecate', loader: () => require('./deprecate'), private: true }
|
||||
|
||||
@@ -7,6 +7,7 @@ export const rendererModuleList: ElectronInternal.ModuleEntry[] = [
|
||||
{ name: 'contextBridge', loader: () => require('./context-bridge') },
|
||||
{ name: 'crashReporter', loader: () => require('./crash-reporter') },
|
||||
{ name: 'ipcRenderer', loader: () => require('./ipc-renderer') },
|
||||
{ name: 'nativeImage', loader: () => require('./native-image') },
|
||||
{ name: 'webFrame', loader: () => require('./web-frame') }
|
||||
];
|
||||
|
||||
|
||||
10
lib/renderer/api/native-image.ts
Normal file
10
lib/renderer/api/native-image.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { ipcRendererInternal } from '@electron/internal/renderer/ipc-renderer-internal';
|
||||
import { deserialize } from '@electron/internal/common/type-utils';
|
||||
|
||||
const { nativeImage } = process._linkedBinding('electron_common_native_image');
|
||||
|
||||
nativeImage.createThumbnailFromPath = async (path: string, size: Electron.Size) => {
|
||||
return deserialize(await ipcRendererInternal.invoke('ELECTRON_NATIVE_IMAGE_CREATE_THUMBNAIL_FROM_PATH', path, size));
|
||||
};
|
||||
|
||||
export default nativeImage;
|
||||
@@ -1,4 +1,5 @@
|
||||
import { EventEmitter } from 'events';
|
||||
import deprecate from '@electron/internal/common/api/deprecate';
|
||||
|
||||
const binding = process.electronBinding('web_frame');
|
||||
|
||||
@@ -47,14 +48,26 @@ class WebFrame extends EventEmitter {
|
||||
}
|
||||
}
|
||||
|
||||
const { hasSwitch } = process.electronBinding('command_line');
|
||||
const worldSafeJS = hasSwitch('world-safe-execute-javascript') && hasSwitch('context-isolation');
|
||||
|
||||
// Populate the methods.
|
||||
for (const name in binding) {
|
||||
if (!name.startsWith('_')) { // some methods are manually populated above
|
||||
// TODO(felixrieseberg): Once we can type web_frame natives, we could
|
||||
// use a neat `keyof` here
|
||||
(WebFrame as any).prototype[name] = function (...args: Array<any>) {
|
||||
if (!worldSafeJS && name.startsWith('executeJavaScript')) {
|
||||
deprecate.log(`Security Warning: webFrame.${name} was called without worldSafeExecuteJavaScript enabled. This is considered unsafe. worldSafeExecuteJavaScript will be enabled by default in Electron 12.`);
|
||||
}
|
||||
return binding[name](this.context, ...args);
|
||||
};
|
||||
// TODO(MarshallOfSound): Remove once the above deprecation is removed
|
||||
if (name.startsWith('executeJavaScript')) {
|
||||
(WebFrame as any).prototype[`_${name}`] = function (...args: Array<any>) {
|
||||
return binding[name](this.context, ...args);
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,11 @@ export const webFrameInit = () => {
|
||||
ipcRendererUtils.handle('ELECTRON_INTERNAL_RENDERER_WEB_FRAME_METHOD', (
|
||||
event, method: keyof WebFrameMethod, ...args: any[]
|
||||
) => {
|
||||
// TODO(MarshallOfSound): Remove once the world-safe-execute-javascript deprecation warning is removed
|
||||
if (method.startsWith('executeJavaScript')) {
|
||||
return (webFrame as any)[`_${method}`](...args);
|
||||
}
|
||||
|
||||
// The TypeScript compiler cannot handle the sheer number of
|
||||
// call signatures here and simply gives up. Incorrect invocations
|
||||
// will be caught by "keyof WebFrameMethod" though.
|
||||
|
||||
@@ -13,7 +13,7 @@ export const moduleList: ElectronInternal.ModuleEntry[] = [
|
||||
},
|
||||
{
|
||||
name: 'nativeImage',
|
||||
loader: () => require('@electron/internal/common/api/native-image')
|
||||
loader: () => require('@electron/internal/renderer/api/native-image')
|
||||
},
|
||||
{
|
||||
name: 'webFrame',
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "electron",
|
||||
"version": "10.0.0-beta.6",
|
||||
"version": "10.1.2",
|
||||
"repository": "https://github.com/electron/electron",
|
||||
"description": "Build cross platform desktop apps with JavaScript, HTML, and CSS",
|
||||
"devDependencies": {
|
||||
|
||||
@@ -44,7 +44,6 @@ notification_provenance.patch
|
||||
content_browser_main_loop.patch
|
||||
dump_syms.patch
|
||||
command-ismediakey.patch
|
||||
tts.patch
|
||||
printing.patch
|
||||
support_mixed_sandbox_with_zygote.patch
|
||||
fix_disable_usage_of_abort_report_np_in_mas_builds.patch
|
||||
@@ -84,7 +83,6 @@ delay_lock_the_protocol_scheme_registry.patch
|
||||
gpu_notify_when_dxdiag_request_fails.patch
|
||||
feat_allow_embedders_to_add_observers_on_created_hunspell.patch
|
||||
feat_add_onclose_to_messageport.patch
|
||||
fix_account_for_print_preview_disabled_when_printing_to_pdf.patch
|
||||
web_contents.patch
|
||||
ui_gtk_public_header.patch
|
||||
crash_allow_setting_more_options.patch
|
||||
@@ -96,7 +94,10 @@ fix_swap_global_proxies_before_initializing_the_windows_proxies.patch
|
||||
allow_setting_secondary_label_via_simplemenumodel.patch
|
||||
refactor_expose_cursor_changes_to_the_webcontentsobserver.patch
|
||||
disable_unnecessary_ischromefirstrun_check.patch
|
||||
disable_dcheck_that_fails_with_software_compositing.patch
|
||||
fix_handling_non_client_pointer_events_from_pen_on_windows_10.patch
|
||||
remove_menu_window_task_item.patch
|
||||
use_electron_resources_in_icon_reader_service.patch
|
||||
fix_include_missing_header_file.patch
|
||||
cherrypick_future_chrome_commit_to_remove_superfluous_dcheck.patch
|
||||
worker_feat_add_hook_to_notify_script_ready.patch
|
||||
provide_axtextchangevaluestartmarker_for_macos_a11y_value_change.patch
|
||||
allow_focus_to_move_into_an_editable_combobox_s_listbox.patch
|
||||
reconnect_p2p_socket_dispatcher_if_network_service_dies.patch
|
||||
|
||||
@@ -10,7 +10,7 @@ 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 b502af8bb93dd45b5de046850f69ef34f9d04732..a6c84cd7909c6a1c70f3f4b5bd65531bf26f1a94 100644
|
||||
index 82f55455fe365f54bdc3eefac8bd538af13f642d..5da552f02472299e09bc33c5ab0aa184b62953a4 100644
|
||||
--- a/content/gpu/gpu_main.cc
|
||||
+++ b/content/gpu/gpu_main.cc
|
||||
@@ -255,6 +255,10 @@ int GpuMain(const MainFunctionParams& parameters) {
|
||||
@@ -24,7 +24,7 @@ index b502af8bb93dd45b5de046850f69ef34f9d04732..a6c84cd7909c6a1c70f3f4b5bd65531b
|
||||
// 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
|
||||
@@ -373,7 +377,6 @@ int GpuMain(const MainFunctionParams& parameters) {
|
||||
@@ -389,7 +393,6 @@ int GpuMain(const MainFunctionParams& parameters) {
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -23,10 +23,10 @@ index 4e195f960d7b9bf50f6784ce380a84a10867914f..dbf85ffe8504bdbab1c4c29f085e5307
|
||||
int32_t world_id) {}
|
||||
virtual void DidClearWindowObject() {}
|
||||
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
|
||||
index 5586d724ef30e8183787c1cbba21fe9741d587c5..a5a95523e16fd35018f9646ae4a4d51e5ca626c0 100644
|
||||
index 74e98485b4646b5e91ff2c15e85d85205df2851c..55af1205b90a1fce035a6b7abf1797fe20ea1f7b 100644
|
||||
--- a/content/renderer/render_frame_impl.cc
|
||||
+++ b/content/renderer/render_frame_impl.cc
|
||||
@@ -4735,6 +4735,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
|
||||
@@ -4741,6 +4741,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
|
||||
observer.DidCreateScriptContext(context, world_id);
|
||||
}
|
||||
|
||||
@@ -40,10 +40,10 @@ index 5586d724ef30e8183787c1cbba21fe9741d587c5..a5a95523e16fd35018f9646ae4a4d51e
|
||||
int world_id) {
|
||||
for (auto& observer : observers_)
|
||||
diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h
|
||||
index 745610204f08a39912b92f8b8ba9028465c9c57f..ddc571fbec08a38ada5c84acdadd618f1b349bed 100644
|
||||
index c6d8de45561cbcb6beeb6a28ce0517587b72a030..aef52b00d00392490d43cf7b7ef96ebad7b227e4 100644
|
||||
--- a/content/renderer/render_frame_impl.h
|
||||
+++ b/content/renderer/render_frame_impl.h
|
||||
@@ -721,6 +721,8 @@ class CONTENT_EXPORT RenderFrameImpl
|
||||
@@ -719,6 +719,8 @@ class CONTENT_EXPORT RenderFrameImpl
|
||||
bool ShouldTrackUseCounter(const blink::WebURL& url) override;
|
||||
void DidCreateScriptContext(v8::Local<v8::Context> context,
|
||||
int world_id) override;
|
||||
@@ -53,10 +53,10 @@ index 745610204f08a39912b92f8b8ba9028465c9c57f..ddc571fbec08a38ada5c84acdadd618f
|
||||
int world_id) override;
|
||||
void DidChangeScrollOffset() override;
|
||||
diff --git a/third_party/blink/public/web/web_local_frame_client.h b/third_party/blink/public/web/web_local_frame_client.h
|
||||
index 902504b8399c53fee972fe5549a4dbd39274a3c8..ddf6b6b696f7d990b7455ac6c9b8156a733b6c07 100644
|
||||
index f0a05ead42b7a5eb70fc4e5cae13710391f14b5c..b1bbdcf6f69128b9943001a2b64e8a92e5148ab1 100644
|
||||
--- a/third_party/blink/public/web/web_local_frame_client.h
|
||||
+++ b/third_party/blink/public/web/web_local_frame_client.h
|
||||
@@ -542,6 +542,9 @@ class BLINK_EXPORT WebLocalFrameClient {
|
||||
@@ -550,6 +550,9 @@ class BLINK_EXPORT WebLocalFrameClient {
|
||||
virtual void DidCreateScriptContext(v8::Local<v8::Context>,
|
||||
int32_t world_id) {}
|
||||
|
||||
@@ -79,7 +79,7 @@ index 5ac9a7ed3d0f91764452579992471c83104de64f..15ac214bc9177f2fc228cf93c459a7b3
|
||||
if (World().IsMainWorld()) {
|
||||
GetFrame()->Loader().DispatchDidClearWindowObjectInMainWorld();
|
||||
diff --git a/third_party/blink/renderer/core/exported/local_frame_client_impl.cc b/third_party/blink/renderer/core/exported/local_frame_client_impl.cc
|
||||
index f9d867fb84e544a2705d22c9fef1f04e639c052b..9b26988f4c7dd96269fd44c57dc9632f47ec409f 100644
|
||||
index adc00866f436b59bd50881949379014222d71a50..71631b77c13ea1e6e8a4f558ef5ac5a09886218d 100644
|
||||
--- a/third_party/blink/renderer/core/exported/local_frame_client_impl.cc
|
||||
+++ b/third_party/blink/renderer/core/exported/local_frame_client_impl.cc
|
||||
@@ -363,6 +363,13 @@ void LocalFrameClientImpl::DidCreateScriptContext(
|
||||
@@ -97,7 +97,7 @@ index f9d867fb84e544a2705d22c9fef1f04e639c052b..9b26988f4c7dd96269fd44c57dc9632f
|
||||
v8::Local<v8::Context> context,
|
||||
int32_t world_id) {
|
||||
diff --git a/third_party/blink/renderer/core/exported/local_frame_client_impl.h b/third_party/blink/renderer/core/exported/local_frame_client_impl.h
|
||||
index 183a009cf58399966c9002786ede3d540aa068cb..dbe445cf40ec53e4b36e4a323334662c70359a38 100644
|
||||
index 23a196c72164b41bfff97d105957889cce3a7fbe..c702d1dc09b5026ab77a0ba8ec03c4d0cc7c2d67 100644
|
||||
--- a/third_party/blink/renderer/core/exported/local_frame_client_impl.h
|
||||
+++ b/third_party/blink/renderer/core/exported/local_frame_client_impl.h
|
||||
@@ -78,6 +78,8 @@ class CORE_EXPORT LocalFrameClientImpl final : public LocalFrameClient {
|
||||
@@ -110,7 +110,7 @@ index 183a009cf58399966c9002786ede3d540aa068cb..dbe445cf40ec53e4b36e4a323334662c
|
||||
int32_t world_id) override;
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/frame/local_frame_client.h b/third_party/blink/renderer/core/frame/local_frame_client.h
|
||||
index a8443a8bfc2542ffad472206214279c1223d493f..8c7a4dec19d6fbca615b7bc282b0388189eef886 100644
|
||||
index 27ab3b3056c81ca367f45e0a1f7bd74a153353c4..790f7fac77677aad8c1d69c287273a9bf9436ac2 100644
|
||||
--- a/third_party/blink/renderer/core/frame/local_frame_client.h
|
||||
+++ b/third_party/blink/renderer/core/frame/local_frame_client.h
|
||||
@@ -297,6 +297,8 @@ class CORE_EXPORT LocalFrameClient : public FrameClient {
|
||||
|
||||
@@ -49,10 +49,10 @@ index 6d15b6b5ff7b36b85f6b8200b76a32b285f0e675..c21234572976a6de7db5b0f2f7f44ec7
|
||||
// the per-context allow patterns that is managed via NetworkContext
|
||||
// interface. This still respects the per-context block lists.
|
||||
diff --git a/services/network/url_loader.cc b/services/network/url_loader.cc
|
||||
index 80dc1f91fd4051dc054f1c9e9a5ab0087c4d66fd..4eec90182ae4944f219e12ff2673d0fbd24e112d 100644
|
||||
index 9d2d455613fa7fa46d156876fa80a1be8a18a992..0cc2e561667dd1454409365a13d1daaced997c62 100644
|
||||
--- a/services/network/url_loader.cc
|
||||
+++ b/services/network/url_loader.cc
|
||||
@@ -437,6 +437,7 @@ URLLoader::URLLoader(
|
||||
@@ -470,6 +470,7 @@ URLLoader::URLLoader(
|
||||
base::WeakPtr<KeepaliveStatisticsRecorder> keepalive_statistics_recorder,
|
||||
base::WeakPtr<NetworkUsageAccumulator> network_usage_accumulator,
|
||||
mojom::TrustedURLLoaderHeaderClient* url_loader_header_client,
|
||||
@@ -60,7 +60,7 @@ index 80dc1f91fd4051dc054f1c9e9a5ab0087c4d66fd..4eec90182ae4944f219e12ff2673d0fb
|
||||
mojom::OriginPolicyManager* origin_policy_manager,
|
||||
std::unique_ptr<TrustTokenRequestHelperFactory> trust_token_helper_factory,
|
||||
mojo::PendingRemote<mojom::CookieAccessObserver> cookie_observer)
|
||||
@@ -497,6 +498,11 @@ URLLoader::URLLoader(
|
||||
@@ -533,6 +534,11 @@ URLLoader::URLLoader(
|
||||
header_client_.set_disconnect_handler(
|
||||
base::BindOnce(&URLLoader::OnMojoDisconnect, base::Unretained(this)));
|
||||
}
|
||||
@@ -72,7 +72,7 @@ index 80dc1f91fd4051dc054f1c9e9a5ab0087c4d66fd..4eec90182ae4944f219e12ff2673d0fb
|
||||
if (want_raw_headers_) {
|
||||
options_ |= mojom::kURLLoadOptionSendSSLInfoWithResponse |
|
||||
mojom::kURLLoadOptionSendSSLInfoForCertificateError;
|
||||
@@ -1016,7 +1022,7 @@ void URLLoader::OnAuthRequired(net::URLRequest* url_request,
|
||||
@@ -1060,7 +1066,7 @@ void URLLoader::OnAuthRequired(net::URLRequest* url_request,
|
||||
// |this| may have been deleted.
|
||||
return;
|
||||
}
|
||||
@@ -81,7 +81,7 @@ index 80dc1f91fd4051dc054f1c9e9a5ab0087c4d66fd..4eec90182ae4944f219e12ff2673d0fb
|
||||
OnAuthCredentials(base::nullopt);
|
||||
return;
|
||||
}
|
||||
@@ -1032,11 +1038,20 @@ void URLLoader::OnAuthRequired(net::URLRequest* url_request,
|
||||
@@ -1076,11 +1082,20 @@ void URLLoader::OnAuthRequired(net::URLRequest* url_request,
|
||||
if (url_request->response_headers())
|
||||
head->headers = url_request->response_headers();
|
||||
head->auth_challenge_info = auth_info;
|
||||
@@ -108,7 +108,7 @@ index 80dc1f91fd4051dc054f1c9e9a5ab0087c4d66fd..4eec90182ae4944f219e12ff2673d0fb
|
||||
auth_challenge_responder_receiver_.set_disconnect_handler(
|
||||
base::BindOnce(&URLLoader::DeleteSelf, base::Unretained(this)));
|
||||
diff --git a/services/network/url_loader.h b/services/network/url_loader.h
|
||||
index f5436f10a312c713e95fac4670eab3edf048a742..02212de14459ee6cd15492e7b35cd2791f48205c 100644
|
||||
index 33e6b100ef3ebfea62a9445bb8aa4b45034f7f25..b70780428d056e5306e215ba7d86a2e729ffaeda 100644
|
||||
--- a/services/network/url_loader.h
|
||||
+++ b/services/network/url_loader.h
|
||||
@@ -115,6 +115,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) URLLoader
|
||||
|
||||
@@ -0,0 +1,117 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Aaron Leventhal <aleventhal@chromium.org>
|
||||
Date: Tue, 21 Jul 2020 19:41:11 +0000
|
||||
Subject: Allow focus to move into an editable combobox's listbox
|
||||
|
||||
In bug 593646 (https://codereview.chromium.org/2024053003/) a rule was
|
||||
added, apparently similar to a rule in WebKit, that prevents
|
||||
aria-activedescendant on an editable combobox field from moving focus
|
||||
into its listbox. However, removing this condition fixes an issue where
|
||||
the first item is not read. It also improves the verbalization,
|
||||
providing the user with the positional info, e.g. "2 of 5".
|
||||
Removing this line also does not seem to break the example attached to
|
||||
bug 593646.
|
||||
|
||||
Bug: 1082865
|
||||
Change-Id: I4250fb152f4b06f3c57b300ebe7ef5549c58d624
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2303789
|
||||
Reviewed-by: Dominic Mazzoni <dmazzoni@chromium.org>
|
||||
Commit-Queue: Aaron Leventhal <aleventhal@chromium.org>
|
||||
Cr-Commit-Position: refs/heads/master@{#790502}
|
||||
|
||||
diff --git a/content/browser/accessibility/browser_accessibility_manager_mac.mm b/content/browser/accessibility/browser_accessibility_manager_mac.mm
|
||||
index 90bdee0cf769e872f2e9585eb5055429f12a9eda..614ea21f46190b14832ddba1e621464558630eb0 100644
|
||||
--- a/content/browser/accessibility/browser_accessibility_manager_mac.mm
|
||||
+++ b/content/browser/accessibility/browser_accessibility_manager_mac.mm
|
||||
@@ -142,11 +142,6 @@ BrowserAccessibility* BrowserAccessibilityManagerMac::GetFocus() const {
|
||||
if (!focus)
|
||||
return nullptr;
|
||||
|
||||
- // For editable combo boxes, focus should stay on the combo box so the user
|
||||
- // will not be taken out of the combo box while typing.
|
||||
- if (focus->GetRole() == ax::mojom::Role::kTextFieldWithComboBox)
|
||||
- return focus;
|
||||
-
|
||||
// Otherwise, follow the active descendant.
|
||||
return GetActiveDescendant(focus);
|
||||
}
|
||||
diff --git a/content/test/data/accessibility/aria/aria-combobox-expected-mac.txt b/content/test/data/accessibility/aria/aria-combobox-expected-mac.txt
|
||||
index 05121ca639d0e891de51fb65a96659bcc97493c9..802bf5319941ec872dc21bd634979ca91ff33740 100644
|
||||
--- a/content/test/data/accessibility/aria/aria-combobox-expected-mac.txt
|
||||
+++ b/content/test/data/accessibility/aria/aria-combobox-expected-mac.txt
|
||||
@@ -1,7 +1,7 @@
|
||||
AXWebArea
|
||||
++AXGroup
|
||||
++++AXStaticText AXValue='State'
|
||||
-++AXComboBox AXAutocompleteValue='list' AXFocused=1 AXTitle='State'
|
||||
+++AXComboBox AXAutocompleteValue='list' AXTitle='State'
|
||||
++AXList
|
||||
++++AXStaticText AXValue='Alabama'
|
||||
-++++AXStaticText AXValue='Alaska'
|
||||
+++++AXStaticText AXFocused=1 AXValue='Alaska'
|
||||
\ No newline at end of file
|
||||
diff --git a/content/test/data/accessibility/event/aria-combo-box-collapse-expected-mac.txt b/content/test/data/accessibility/event/aria-combo-box-collapse-expected-mac.txt
|
||||
index 97c3c417f30812abecdde273f130088df86bd4ae..93ef79e311977bb4277842fa5332f6097faba837 100644
|
||||
--- a/content/test/data/accessibility/event/aria-combo-box-collapse-expected-mac.txt
|
||||
+++ b/content/test/data/accessibility/event/aria-combo-box-collapse-expected-mac.txt
|
||||
@@ -1,2 +1,3 @@
|
||||
AXExpandedChanged on AXComboBox
|
||||
-AXSelectedChildrenChanged on AXComboBox
|
||||
+AXFocusedUIElementChanged on AXComboBox
|
||||
+AXSelectedChildrenChanged on AXComboBox
|
||||
\ No newline at end of file
|
||||
diff --git a/content/test/data/accessibility/event/aria-combo-box-delay-add-list-expected-mac.txt b/content/test/data/accessibility/event/aria-combo-box-delay-add-list-expected-mac.txt
|
||||
index 47ff72a2689baa23600ededfe38d79fd6b5bedcf..f7d4c30f49fe3f3f62132cddf59942181b8127b8 100644
|
||||
--- a/content/test/data/accessibility/event/aria-combo-box-delay-add-list-expected-mac.txt
|
||||
+++ b/content/test/data/accessibility/event/aria-combo-box-delay-add-list-expected-mac.txt
|
||||
@@ -1 +1,2 @@
|
||||
-AXSelectedChildrenChanged on AXComboBox
|
||||
+AXFocusedUIElementChanged on AXStaticText AXValue="Apple"
|
||||
+AXSelectedChildrenChanged on AXComboBox
|
||||
\ No newline at end of file
|
||||
diff --git a/content/test/data/accessibility/event/aria-combo-box-delay-show-list-expected-mac.txt b/content/test/data/accessibility/event/aria-combo-box-delay-show-list-expected-mac.txt
|
||||
index ec6b5552605fcb7fc4fdada1265d5f25ee637dce..4de438fffab3c86b81961e1d989cd71de237eaa4 100644
|
||||
--- a/content/test/data/accessibility/event/aria-combo-box-delay-show-list-expected-mac.txt
|
||||
+++ b/content/test/data/accessibility/event/aria-combo-box-delay-show-list-expected-mac.txt
|
||||
@@ -1,2 +1,3 @@
|
||||
+AXFocusedUIElementChanged on AXStaticText AXValue="Apple"
|
||||
AXSelectedChildrenChanged on AXComboBox
|
||||
AXSelectedChildrenChanged on AXList
|
||||
\ No newline at end of file
|
||||
diff --git a/content/test/data/accessibility/event/aria-combo-box-expand-expected-mac.txt b/content/test/data/accessibility/event/aria-combo-box-expand-expected-mac.txt
|
||||
index 97cdb8b8b67d46e0a952d22765c823bd346aef3a..343feae3d79a48981cc1e27015ba2a93423eedc0 100644
|
||||
--- a/content/test/data/accessibility/event/aria-combo-box-expand-expected-mac.txt
|
||||
+++ b/content/test/data/accessibility/event/aria-combo-box-expand-expected-mac.txt
|
||||
@@ -1,3 +1,4 @@
|
||||
AXExpandedChanged on AXComboBox
|
||||
+AXFocusedUIElementChanged on AXStaticText AXValue="Apple"
|
||||
AXSelectedChildrenChanged on AXComboBox
|
||||
-AXSelectedChildrenChanged on AXList
|
||||
+AXSelectedChildrenChanged on AXList
|
||||
\ No newline at end of file
|
||||
diff --git a/content/test/data/accessibility/event/aria-combo-box-focus-expected-mac.txt b/content/test/data/accessibility/event/aria-combo-box-focus-expected-mac.txt
|
||||
index 2bfc70f5fecea2c2a5e7268cef641d6d0e7d4a47..ad5e2bf2c8029185c51eecc94cac1dbe7608c99e 100644
|
||||
--- a/content/test/data/accessibility/event/aria-combo-box-focus-expected-mac.txt
|
||||
+++ b/content/test/data/accessibility/event/aria-combo-box-focus-expected-mac.txt
|
||||
@@ -1,3 +1,3 @@
|
||||
-AXFocusedUIElementChanged on AXComboBox
|
||||
-AXSelectedTextChanged on AXComboBox
|
||||
-AXSelectedTextChanged on AXWebArea
|
||||
+AXFocusedUIElementChanged on AXStaticText AXValue="Apple not selected"
|
||||
+AXSelectedTextChanged on AXStaticText AXValue="Apple not selected"
|
||||
+AXSelectedTextChanged on AXWebArea
|
||||
\ No newline at end of file
|
||||
diff --git a/content/test/data/accessibility/event/aria-combo-box-next-expected-mac.txt b/content/test/data/accessibility/event/aria-combo-box-next-expected-mac.txt
|
||||
index d5f21183c3d0a1c24cb6665194a93c3299dbfd56..9e7d0c0aaeb1c52dc1f1b3afed36f287851b89ff 100644
|
||||
--- a/content/test/data/accessibility/event/aria-combo-box-next-expected-mac.txt
|
||||
+++ b/content/test/data/accessibility/event/aria-combo-box-next-expected-mac.txt
|
||||
@@ -1,5 +1,7 @@
|
||||
+AXFocusedUIElementChanged on AXStaticText AXValue="Orange"
|
||||
AXSelectedChildrenChanged on AXComboBox
|
||||
AXSelectedChildrenChanged on AXList
|
||||
=== Start Continuation ===
|
||||
+AXFocusedUIElementChanged on AXStaticText AXValue="Banana"
|
||||
AXSelectedChildrenChanged on AXComboBox
|
||||
-AXSelectedChildrenChanged on AXList
|
||||
+AXSelectedChildrenChanged on AXList
|
||||
\ No newline at end of file
|
||||
@@ -6,19 +6,19 @@ Subject: allow new privileges in unsandboxed child processes
|
||||
This allows unsandboxed renderers to launch setuid processes on Linux.
|
||||
|
||||
diff --git a/content/browser/child_process_launcher_helper_linux.cc b/content/browser/child_process_launcher_helper_linux.cc
|
||||
index e53e60ef146f8024e503f9ffad663a4d2dbc4f80..cee204cf6447c4b2a8cfd9c4ca257fe46af3e2e9 100644
|
||||
index e63dfcf43147c7174942277b2c129675014c9e59..7121ec638809c5964d22af496559cb7f46c794ef 100644
|
||||
--- a/content/browser/child_process_launcher_helper_linux.cc
|
||||
+++ b/content/browser/child_process_launcher_helper_linux.cc
|
||||
@@ -54,6 +54,18 @@ bool ChildProcessLauncherHelper::BeforeLaunchOnLauncherThread(
|
||||
@@ -53,6 +53,18 @@ bool ChildProcessLauncherHelper::BeforeLaunchOnLauncherThread(
|
||||
if (GetProcessType() == switches::kRendererProcess) {
|
||||
const int sandbox_fd = SandboxHostLinux::GetInstance()->GetChildSocket();
|
||||
options->fds_to_remap.push_back(
|
||||
std::make_pair(sandbox_fd, service_manager::GetSandboxFD()));
|
||||
options->fds_to_remap.push_back(std::make_pair(sandbox_fd, GetSandboxFD()));
|
||||
+
|
||||
+ // (For Electron), if we're launching without zygote, that means we're
|
||||
+ // launching an unsandboxed process (since all sandboxed processes are
|
||||
+ // forked from the zygote). Relax the allow_new_privs option to permit
|
||||
+ // launching suid processes from unsandboxed renderers.
|
||||
+ service_manager::ZygoteHandle zygote_handle =
|
||||
+ ZygoteHandle zygote_handle =
|
||||
+ base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kNoZygote)
|
||||
+ ? nullptr
|
||||
+ : delegate_->GetZygote();
|
||||
|
||||
@@ -6,10 +6,10 @@ Subject: Allow setting secondary label via SimpleMenuModel
|
||||
Builds on https://chromium-review.googlesource.com/c/chromium/src/+/2208976
|
||||
|
||||
diff --git a/ui/base/models/simple_menu_model.cc b/ui/base/models/simple_menu_model.cc
|
||||
index 88053e9d501413d18b6a6ae36b76668431db7ee9..481a04c4835d246cfa20edfc4f1dd10ce93fcdb8 100644
|
||||
index 0c37f6e2caead2f3004f1fbdd2abe7921ef4bea7..6f46775d96153d0c6a0795a1d6085f532daf985c 100644
|
||||
--- a/ui/base/models/simple_menu_model.cc
|
||||
+++ b/ui/base/models/simple_menu_model.cc
|
||||
@@ -49,6 +49,11 @@ base::string16 SimpleMenuModel::Delegate::GetLabelForCommandId(
|
||||
@@ -53,6 +53,11 @@ base::string16 SimpleMenuModel::Delegate::GetLabelForCommandId(
|
||||
return base::string16();
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ index 88053e9d501413d18b6a6ae36b76668431db7ee9..481a04c4835d246cfa20edfc4f1dd10c
|
||||
ImageModel SimpleMenuModel::Delegate::GetIconForCommandId(
|
||||
int command_id) const {
|
||||
return ImageModel();
|
||||
@@ -291,6 +296,11 @@ void SimpleMenuModel::SetLabel(int index, const base::string16& label) {
|
||||
@@ -295,6 +300,11 @@ void SimpleMenuModel::SetLabel(int index, const base::string16& label) {
|
||||
MenuItemsChanged();
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ index 88053e9d501413d18b6a6ae36b76668431db7ee9..481a04c4835d246cfa20edfc4f1dd10c
|
||||
void SimpleMenuModel::SetMinorText(int index,
|
||||
const base::string16& minor_text) {
|
||||
items_[ValidateItemIndex(index)].minor_text = minor_text;
|
||||
@@ -364,6 +374,12 @@ base::string16 SimpleMenuModel::GetLabelAt(int index) const {
|
||||
@@ -372,6 +382,12 @@ base::string16 SimpleMenuModel::GetLabelAt(int index) const {
|
||||
return items_[ValidateItemIndex(index)].label;
|
||||
}
|
||||
|
||||
@@ -47,10 +47,10 @@ index 88053e9d501413d18b6a6ae36b76668431db7ee9..481a04c4835d246cfa20edfc4f1dd10c
|
||||
return items_[ValidateItemIndex(index)].minor_text;
|
||||
}
|
||||
diff --git a/ui/base/models/simple_menu_model.h b/ui/base/models/simple_menu_model.h
|
||||
index 92975ff7dc5c5ca217717da6faa0042467076005..84cf58456cd8a879dbf5940737713027057546cd 100644
|
||||
index 5f1116ba19b8160a2fee008415b8841f056aad98..9c07e44c484a9a15b7d16d592311eb07d9b3734a 100644
|
||||
--- a/ui/base/models/simple_menu_model.h
|
||||
+++ b/ui/base/models/simple_menu_model.h
|
||||
@@ -44,6 +44,7 @@ class COMPONENT_EXPORT(UI_BASE) SimpleMenuModel : public MenuModel {
|
||||
@@ -48,6 +48,7 @@ class COMPONENT_EXPORT(UI_BASE) SimpleMenuModel : public MenuModel {
|
||||
// Some command ids have labels and icons that change over time.
|
||||
virtual bool IsItemForCommandIdDynamic(int command_id) const;
|
||||
virtual base::string16 GetLabelForCommandId(int command_id) const;
|
||||
@@ -58,7 +58,7 @@ index 92975ff7dc5c5ca217717da6faa0042467076005..84cf58456cd8a879dbf5940737713027
|
||||
// Gets the icon for the item with the specified id.
|
||||
virtual ImageModel GetIconForCommandId(int command_id) const;
|
||||
|
||||
@@ -147,6 +148,9 @@ class COMPONENT_EXPORT(UI_BASE) SimpleMenuModel : public MenuModel {
|
||||
@@ -151,6 +152,9 @@ class COMPONENT_EXPORT(UI_BASE) SimpleMenuModel : public MenuModel {
|
||||
// Sets the label for the item at |index|.
|
||||
void SetLabel(int index, const base::string16& label);
|
||||
|
||||
@@ -68,7 +68,7 @@ index 92975ff7dc5c5ca217717da6faa0042467076005..84cf58456cd8a879dbf5940737713027
|
||||
// Sets the minor text for the item at |index|.
|
||||
void SetMinorText(int index, const base::string16& minor_text);
|
||||
|
||||
@@ -173,6 +177,7 @@ class COMPONENT_EXPORT(UI_BASE) SimpleMenuModel : public MenuModel {
|
||||
@@ -180,6 +184,7 @@ class COMPONENT_EXPORT(UI_BASE) SimpleMenuModel : public MenuModel {
|
||||
ui::MenuSeparatorType GetSeparatorTypeAt(int index) const override;
|
||||
int GetCommandIdAt(int index) const override;
|
||||
base::string16 GetLabelAt(int index) const override;
|
||||
@@ -76,7 +76,7 @@ index 92975ff7dc5c5ca217717da6faa0042467076005..84cf58456cd8a879dbf5940737713027
|
||||
base::string16 GetMinorTextAt(int index) const override;
|
||||
ImageModel GetMinorIconAt(int index) const override;
|
||||
bool IsItemDynamicAt(int index) const override;
|
||||
@@ -207,6 +212,7 @@ class COMPONENT_EXPORT(UI_BASE) SimpleMenuModel : public MenuModel {
|
||||
@@ -216,6 +221,7 @@ class COMPONENT_EXPORT(UI_BASE) SimpleMenuModel : public MenuModel {
|
||||
int command_id = 0;
|
||||
ItemType type = TYPE_COMMAND;
|
||||
base::string16 label;
|
||||
|
||||
@@ -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 657034319731c660e5c513be7d92bab280c9dee0..1c51cab672063a2b9ac8a63d6c42a7c4451e5879 100644
|
||||
index 6032e38bfd641f96db44ac75beb07c5b035da840..a693d3936c493296072796c1c557790139af3d34 100644
|
||||
--- a/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
+++ b/third_party/blink/renderer/core/frame/local_frame.cc
|
||||
@@ -538,10 +538,6 @@ void LocalFrame::DetachImpl(FrameDetachType type) {
|
||||
@@ -539,10 +539,6 @@ void LocalFrame::DetachImpl(FrameDetachType type) {
|
||||
}
|
||||
CHECK(!view_ || !view_->IsAttached());
|
||||
|
||||
@@ -28,7 +28,7 @@ index 657034319731c660e5c513be7d92bab280c9dee0..1c51cab672063a2b9ac8a63d6c42a7c4
|
||||
if (!Client())
|
||||
return;
|
||||
|
||||
@@ -559,6 +555,10 @@ void LocalFrame::DetachImpl(FrameDetachType type) {
|
||||
@@ -560,6 +556,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();
|
||||
|
||||
@@ -7,10 +7,10 @@ This exposes a method for obtaining a reference to an isolated world, which is
|
||||
otherwise not available in the Blink API.
|
||||
|
||||
diff --git a/third_party/blink/public/web/web_local_frame.h b/third_party/blink/public/web/web_local_frame.h
|
||||
index be5efdc896fd9318b50c9e5ad02ec404ba7be23d..79234d0def2d4e97e05a03ecb1dbd7b077bc44b2 100644
|
||||
index 2b6ac1ab4377695246f09de772c17db1a0fa0fe4..1d8dd050662db2197d571b677e4c2bc255d56255 100644
|
||||
--- a/third_party/blink/public/web/web_local_frame.h
|
||||
+++ b/third_party/blink/public/web/web_local_frame.h
|
||||
@@ -354,6 +354,8 @@ class WebLocalFrame : public WebFrame {
|
||||
@@ -355,6 +355,8 @@ class WebLocalFrame : public WebFrame {
|
||||
// Returns the world ID associated with |script_context|.
|
||||
virtual int32_t GetScriptContextWorldId(
|
||||
v8::Local<v8::Context> script_context) const = 0;
|
||||
@@ -20,10 +20,10 @@ index be5efdc896fd9318b50c9e5ad02ec404ba7be23d..79234d0def2d4e97e05a03ecb1dbd7b0
|
||||
// Executes script in the context of the current page and returns the value
|
||||
// that the script evaluated to with callback. Script execution can be
|
||||
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 857f31b2d7af86138b8b5cfd8b7131f2524bc94e..4891f5aa60469b224c933adaa334eef8ac8a19ec 100644
|
||||
index 74cc39af0a7c528ebf78954927dd022e44711981..f92da67a14ee2799c405ea038936d3d0d30e71a7 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
|
||||
@@ -967,6 +967,13 @@ v8::Local<v8::Object> WebLocalFrameImpl::GlobalProxy() const {
|
||||
@@ -971,6 +971,13 @@ v8::Local<v8::Object> WebLocalFrameImpl::GlobalProxy() const {
|
||||
return MainWorldScriptContext()->Global();
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ index 857f31b2d7af86138b8b5cfd8b7131f2524bc94e..4891f5aa60469b224c933adaa334eef8
|
||||
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 d3dbe21b34cafa395706320bde5b7b11c1b84b4e..bc00e411e3ea6e08909d004de1a01cc548ec700d 100644
|
||||
index 4555bd981a201899158711e54f943f67b951266c..43aeda11b6c7c51220b7cd32be5a6e6c266218be 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
|
||||
@@ -166,6 +166,8 @@ class CORE_EXPORT WebLocalFrameImpl final
|
||||
|
||||
@@ -14,7 +14,7 @@ tradeoff is that switching from MAS_BUILD to !MAS_BUILD or vice-versa will
|
||||
rebuild the entire tree.
|
||||
|
||||
diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn
|
||||
index 33416d571f2d2a672daf62be21bfb97dfc998b51..a1f21871c1806857723d3a421e5ef3917d7f1ef0 100644
|
||||
index 4cc6bfc45e647e656934b331793faef1ba0f4b14..b585c11f9b43bfd9f0d79dc5103fd844224e3586 100644
|
||||
--- a/build/config/BUILDCONFIG.gn
|
||||
+++ b/build/config/BUILDCONFIG.gn
|
||||
@@ -123,6 +123,9 @@ if (current_os == "") {
|
||||
|
||||
@@ -9,10 +9,10 @@ potentially prevent a window from being created.
|
||||
TODO(loc): this patch is currently broken.
|
||||
|
||||
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc
|
||||
index 33869e7bf3aa6dd404f8413b817e544fb404bb43..98cfc99a3c917f9b6e7bc3b5c19479b81c114489 100644
|
||||
index 0e54861c260ecfa1635ee56c1c9e931914afe901..948e3e5cf64f74ae560c64d0490c22a810d0d96f 100644
|
||||
--- a/content/browser/frame_host/render_frame_host_impl.cc
|
||||
+++ b/content/browser/frame_host/render_frame_host_impl.cc
|
||||
@@ -4809,6 +4809,7 @@ void RenderFrameHostImpl::CreateNewWindow(
|
||||
@@ -4823,6 +4823,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,
|
||||
@@ -21,10 +21,10 @@ index 33869e7bf3aa6dd404f8413b817e544fb404bb43..98cfc99a3c917f9b6e7bc3b5c19479b8
|
||||
&no_javascript_access);
|
||||
|
||||
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
||||
index 33072ecef6bcfb751ce81cf46e2609bddcca065b..1f5f7f217a7cb4013f6bfbb380b2b81214cc92b0 100644
|
||||
index 1db46cd9bee49617a045753340d35e0e74ebf1ed..b62a639e51886ddc500d7aa78aa2f9c2efc75514 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -3087,9 +3087,9 @@ RenderFrameHostDelegate* WebContentsImpl::CreateNewWindow(
|
||||
@@ -3091,9 +3091,9 @@ RenderFrameHostDelegate* WebContentsImpl::CreateNewWindow(
|
||||
}
|
||||
|
||||
if (delegate_) {
|
||||
@@ -38,10 +38,10 @@ index 33072ecef6bcfb751ce81cf46e2609bddcca065b..1f5f7f217a7cb4013f6bfbb380b2b812
|
||||
|
||||
for (auto& observer : observers_) {
|
||||
diff --git a/content/common/frame.mojom b/content/common/frame.mojom
|
||||
index 322e2f0f4f023cd2e34163f623c5b52eaad51c1d..46ae29207c804ae3474ae3a3dd8f76de93a1deb0 100644
|
||||
index 40821a2c3d7cf13136944e5bc6852047045a6be2..90c3ab998a8707eb91fc016ce56e9248194deeeb 100644
|
||||
--- a/content/common/frame.mojom
|
||||
+++ b/content/common/frame.mojom
|
||||
@@ -277,6 +277,10 @@ struct CreateNewWindowParams {
|
||||
@@ -278,6 +278,10 @@ struct CreateNewWindowParams {
|
||||
|
||||
// The window features to use for the new window.
|
||||
blink.mojom.WindowFeatures features;
|
||||
@@ -53,7 +53,7 @@ index 322e2f0f4f023cd2e34163f623c5b52eaad51c1d..46ae29207c804ae3474ae3a3dd8f76de
|
||||
|
||||
// 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 20df2e7f81543d666c8c9136bd3bd0a3fcd318ea..a0ea7c6100eb437bf1c409ddad3bb5bbe1f3acb8 100644
|
||||
index 87375b2ef10c24b5d8d0f604f6a9ee601a706a0c..84ca4325a72a5c4267d43e5be9bfd7b73efa0b86 100644
|
||||
--- a/content/public/browser/content_browser_client.cc
|
||||
+++ b/content/public/browser/content_browser_client.cc
|
||||
@@ -529,6 +529,8 @@ bool ContentBrowserClient::CanCreateWindow(
|
||||
@@ -66,10 +66,10 @@ index 20df2e7f81543d666c8c9136bd3bd0a3fcd318ea..a0ea7c6100eb437bf1c409ddad3bb5bb
|
||||
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 28be6be2dd20b7beb6e0ef7830396b6d11ac4985..31a0a2b60dd96ede0beba95e8d1df65ed744cf83 100644
|
||||
index edf60410ba571866b03968804543188f7f00c088..00f3f557ccf69760c4e0ac7c9fcc7d048e21e8d8 100644
|
||||
--- a/content/public/browser/content_browser_client.h
|
||||
+++ b/content/public/browser/content_browser_client.h
|
||||
@@ -146,6 +146,7 @@ class NetworkService;
|
||||
@@ -147,6 +147,7 @@ class NetworkService;
|
||||
class TrustedURLLoaderHeaderClient;
|
||||
} // namespace mojom
|
||||
struct ResourceRequest;
|
||||
@@ -77,7 +77,7 @@ index 28be6be2dd20b7beb6e0ef7830396b6d11ac4985..31a0a2b60dd96ede0beba95e8d1df65e
|
||||
} // namespace network
|
||||
|
||||
namespace sandbox {
|
||||
@@ -845,6 +846,8 @@ class CONTENT_EXPORT ContentBrowserClient {
|
||||
@@ -849,6 +850,8 @@ class CONTENT_EXPORT ContentBrowserClient {
|
||||
const std::string& frame_name,
|
||||
WindowOpenDisposition disposition,
|
||||
const blink::mojom::WindowFeatures& features,
|
||||
@@ -135,7 +135,7 @@ index e545ff70c612e98cdd79230303273a3ec7bfcaac..405152e0e90bc76b7de9c3e6946944f3
|
||||
// typically happens when popups are created.
|
||||
virtual void WebContentsCreated(WebContents* source_contents,
|
||||
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
|
||||
index 29220e08371ad0f7a400c81bd024c55130430767..57447f4529917692155d1861c7658156978fa0be 100644
|
||||
index efab61352658f6d1dc9370c8826af25e22b97b38..c1b0d1f5f7acb82f559ba90f24b6f9e5e7c44dad 100644
|
||||
--- a/content/renderer/render_view_impl.cc
|
||||
+++ b/content/renderer/render_view_impl.cc
|
||||
@@ -67,6 +67,7 @@
|
||||
@@ -146,7 +146,7 @@ index 29220e08371ad0f7a400c81bd024c55130430767..57447f4529917692155d1861c7658156
|
||||
#include "content/renderer/media/audio/audio_device_factory.h"
|
||||
#include "content/renderer/render_frame_impl.h"
|
||||
#include "content/renderer/render_frame_proxy.h"
|
||||
@@ -1238,6 +1239,10 @@ WebView* RenderViewImpl::CreateView(
|
||||
@@ -1235,6 +1236,10 @@ WebView* RenderViewImpl::CreateView(
|
||||
}
|
||||
params->features = ConvertWebWindowFeaturesToMojoWindowFeatures(features);
|
||||
|
||||
@@ -158,10 +158,10 @@ index 29220e08371ad0f7a400c81bd024c55130430767..57447f4529917692155d1861c7658156
|
||||
// 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 021b06878da520d5e5576cb01c60a4a2e017b9ad..71d9fc7215180a47b45c924ed95fb8619db598f6 100644
|
||||
index 1d17a41e553bf4d7181a1dcfac9f9e379b6dffcb..384d7150daaeda547e0085e3031b706784ceb7dd 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
|
||||
@@ -400,6 +400,8 @@ bool WebTestContentBrowserClient::CanCreateWindow(
|
||||
@@ -399,6 +399,8 @@ bool WebTestContentBrowserClient::CanCreateWindow(
|
||||
const std::string& frame_name,
|
||||
WindowOpenDisposition disposition,
|
||||
const blink::mojom::WindowFeatures& features,
|
||||
@@ -171,7 +171,7 @@ index 021b06878da520d5e5576cb01c60a4a2e017b9ad..71d9fc7215180a47b45c924ed95fb861
|
||||
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 45b6bbbd41bbe19a39edb83b6ced844cb4c97244..90b5c696f4cc6b77d1377a628c9d8166c773bb60 100644
|
||||
index 21f7e0d85006bc35872c237b98a14d9644bb1488..d3fef30d9731e4cc6cfe404003b9b1fa8cea53e1 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
|
||||
@@ -79,6 +79,8 @@ class WebTestContentBrowserClient : public ShellContentBrowserClient {
|
||||
@@ -206,14 +206,14 @@ index 4f735ad0d97eaac9a57dad137e479f8a7ec33a36..0a3c5821962c85609b64b3625fa6b8d6
|
||||
|
||||
} // namespace blink
|
||||
diff --git a/third_party/blink/renderer/core/frame/local_dom_window.cc b/third_party/blink/renderer/core/frame/local_dom_window.cc
|
||||
index 5aa89ed53435a5a417adfa05ae503c0cb0520ccf..0a82d2afa8d7896ddb7ea206617c59959a9dd40c 100644
|
||||
index 3ac97b71b1b97c5bd105af2ea7df467ab0649544..0c17598fe4e6633ea84749e0fbf7f01d3dd9cd1f 100644
|
||||
--- a/third_party/blink/renderer/core/frame/local_dom_window.cc
|
||||
+++ b/third_party/blink/renderer/core/frame/local_dom_window.cc
|
||||
@@ -1968,6 +1968,7 @@ DOMWindow* LocalDOMWindow::open(v8::Isolate* isolate,
|
||||
@@ -2021,6 +2021,7 @@ DOMWindow* LocalDOMWindow::open(v8::Isolate* isolate,
|
||||
}
|
||||
|
||||
WebWindowFeatures window_features = GetWindowFeaturesFromString(features);
|
||||
+ window_features.raw_features = features;
|
||||
|
||||
FrameLoadRequest frame_request(active_document,
|
||||
FrameLoadRequest frame_request(incumbent_window->document(),
|
||||
ResourceRequest(completed_url));
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Andy Locascio <andy@slack-corp.com>
|
||||
Date: Wed, 22 Jul 2020 11:33:03 -0400
|
||||
Subject: cherrypick future chrome commit to remove superfluous DCHECK
|
||||
|
||||
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2273957
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/html/canvas/text_metrics.cc b/third_party/blink/renderer/core/html/canvas/text_metrics.cc
|
||||
index d3fadad089cce5ce653264d1e219c979d2038688..f1ad599a020dd207651a9d9eb809f39f956a8911 100644
|
||||
--- a/third_party/blink/renderer/core/html/canvas/text_metrics.cc
|
||||
+++ b/third_party/blink/renderer/core/html/canvas/text_metrics.cc
|
||||
@@ -100,19 +100,6 @@ void TextMetrics::Update(const Font& font,
|
||||
xpos += run_width;
|
||||
}
|
||||
double real_width = xpos;
|
||||
-#if DCHECK_IS_ON()
|
||||
- // This DCHECK is for limited time only; to use |glyph_bounds| instead of
|
||||
- // |BoundingBox| and make sure they are compatible.
|
||||
- if (runs.size() == 1 && direction == runs[0].Direction()) {
|
||||
- FloatRect bbox = font.BoundingBox(text_run);
|
||||
- // |GetCharacterRange|, the underlying function of |BoundingBox|, clamps
|
||||
- // negative |MaxY| to 0. This is unintentional, and that we are not copying
|
||||
- // the behavior.
|
||||
- DCHECK_EQ(bbox.Y(), std::min(glyph_bounds.Y(), .0f));
|
||||
- DCHECK_EQ(bbox.MaxY(), std::max(glyph_bounds.MaxY(), .0f));
|
||||
- DCHECK_EQ(bbox.Width(), real_width);
|
||||
- }
|
||||
-#endif
|
||||
width_ = real_width;
|
||||
|
||||
float dx = 0.0f;
|
||||
diff --git a/third_party/blink/renderer/platform/fonts/font.cc b/third_party/blink/renderer/platform/fonts/font.cc
|
||||
index 2cb10421dcc44d17add0e813cf6847d8efe1905d..7d9f98145237c94e6136eddbd60ad6804eb3ad45 100644
|
||||
--- a/third_party/blink/renderer/platform/fonts/font.cc
|
||||
+++ b/third_party/blink/renderer/platform/fonts/font.cc
|
||||
@@ -484,14 +484,6 @@ FloatRect Font::SelectionRectForText(const TextRun& run,
|
||||
FloatRect(point.X() + range.start, point.Y(), range.Width(), height));
|
||||
}
|
||||
|
||||
-FloatRect Font::BoundingBox(const TextRun& run, int from, int to) const {
|
||||
- to = (to == -1 ? run.length() : to);
|
||||
- FontCachePurgePreventer purge_preventer;
|
||||
- CachingWordShaper shaper(*this);
|
||||
- CharacterRange range = shaper.GetCharacterRange(run, from, to);
|
||||
- return FloatRect(range.start, -range.ascent, range.Width(), range.Height());
|
||||
-}
|
||||
-
|
||||
int Font::OffsetForPosition(const TextRun& run,
|
||||
float x_float,
|
||||
IncludePartialGlyphsOption partial_glyphs,
|
||||
diff --git a/third_party/blink/renderer/platform/fonts/font.h b/third_party/blink/renderer/platform/fonts/font.h
|
||||
index b6dbb6f31e6f48ac1f7e0ceb386a63e0cbaf67f1..8864a71c4c3441e0cb639d86b3ebda2e66014586 100644
|
||||
--- a/third_party/blink/renderer/platform/fonts/font.h
|
||||
+++ b/third_party/blink/renderer/platform/fonts/font.h
|
||||
@@ -162,7 +162,6 @@ class PLATFORM_EXPORT Font {
|
||||
float height,
|
||||
int from = 0,
|
||||
int to = -1) const;
|
||||
- FloatRect BoundingBox(const TextRun&, int from = 0, int to = -1) const;
|
||||
CharacterRange GetCharacterRange(const TextRun&,
|
||||
unsigned from,
|
||||
unsigned to) const;
|
||||
@@ -7,10 +7,10 @@ spellchecker uses a few IDS_ resources. We need to load these from
|
||||
Electrons grit header instead of Chromes
|
||||
|
||||
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
|
||||
index 5d7ff1a26faf83c8f82a58787e17d8923f7b9ea1..137d924523ade90bdf4e788f49f7b1c5b3e2e382 100644
|
||||
index 995b99c5ba9d388de83d6a4dc30bf0ae74fbeb4a..879703baee2017a272e4b8d2f4ce976ed712e155 100644
|
||||
--- a/chrome/browser/BUILD.gn
|
||||
+++ b/chrome/browser/BUILD.gn
|
||||
@@ -5500,6 +5500,7 @@ static_library("browser") {
|
||||
@@ -5538,6 +5538,7 @@ static_library("browser") {
|
||||
deps += [
|
||||
"//components/spellcheck/browser",
|
||||
"//components/spellcheck/common",
|
||||
|
||||
@@ -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 706532cbccd96863d270a35ff87d555b7d648f41..cfee983c0a8c12620a17d1ad7a9a77784c9dfc3c 100644
|
||||
index 4ada8596176e8581f8e5db15f91c1cd70f41d7e9..4d600e5d34a0a7514c17c7d02bdabdc796660c9a 100644
|
||||
--- a/content/browser/browser_main_loop.cc
|
||||
+++ b/content/browser/browser_main_loop.cc
|
||||
@@ -1432,7 +1432,7 @@ void BrowserMainLoop::MainMessageLoopRun() {
|
||||
@@ -1436,7 +1436,7 @@ void BrowserMainLoop::MainMessageLoopRun() {
|
||||
NOTREACHED();
|
||||
#else
|
||||
base::RunLoop run_loop;
|
||||
|
||||
@@ -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 25e5a2c20452da3db4c648dfa678d8bd1f7d01cc..5947254f096c78d0ac4b97e4700a77cd2461ba96 100644
|
||||
index d6c77f00ee6fb5f0a21d2d3df2bc00aea3f7e5dc..f8aade234eab49e3600e5d78d9ce71af66646ba3 100644
|
||||
--- a/content/browser/frame_host/navigation_controller_impl.cc
|
||||
+++ b/content/browser/frame_host/navigation_controller_impl.cc
|
||||
@@ -1264,8 +1264,10 @@ NavigationType NavigationControllerImpl::ClassifyNavigation(
|
||||
@@ -1267,8 +1267,10 @@ NavigationType NavigationControllerImpl::ClassifyNavigation(
|
||||
return NAVIGATION_TYPE_NEW_SUBFRAME;
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ index 25e5a2c20452da3db4c648dfa678d8bd1f7d01cc..5947254f096c78d0ac4b97e4700a77cd
|
||||
|
||||
if (rfh->GetParent()) {
|
||||
// All manual subframes would be did_create_new_entry and handled above, so
|
||||
@@ -1521,7 +1523,10 @@ void NavigationControllerImpl::RendererDidNavigateToNewPage(
|
||||
@@ -1524,7 +1526,10 @@ void NavigationControllerImpl::RendererDidNavigateToNewPage(
|
||||
new_entry->GetFavicon() = GetLastCommittedEntry()->GetFavicon();
|
||||
}
|
||||
|
||||
@@ -46,10 +46,10 @@ index 25e5a2c20452da3db4c648dfa678d8bd1f7d01cc..5947254f096c78d0ac4b97e4700a77cd
|
||||
// navigation. Now we know that the renderer has updated its state accordingly
|
||||
// and it is safe to also clear the browser side history.
|
||||
diff --git a/ui/base/clipboard/clipboard_win.cc b/ui/base/clipboard/clipboard_win.cc
|
||||
index 9bfabd34eabcaf893b674e74e540f9258f1730bb..ea6e9f7b7161f9e3afa463fb8114479d3d10eb6b 100644
|
||||
index 421f22eaaf6dbb90c8e3a4bb78d9d017bac8db94..959666ba60c97e0c2f082867c8ebd77de45d8788 100644
|
||||
--- a/ui/base/clipboard/clipboard_win.cc
|
||||
+++ b/ui/base/clipboard/clipboard_win.cc
|
||||
@@ -773,10 +773,10 @@ SkBitmap ClipboardWin::ReadImageInternal(ClipboardBuffer buffer) const {
|
||||
@@ -782,10 +782,10 @@ SkBitmap ClipboardWin::ReadImageInternal(ClipboardBuffer buffer) const {
|
||||
|
||||
void ClipboardWin::WriteToClipboard(ClipboardFormatType format, HANDLE handle) {
|
||||
UINT cf_format = format.ToFormatEtc().cfFormat;
|
||||
|
||||
@@ -19,10 +19,10 @@ https://chromium-review.googlesource.com/c/chromium/src/+/1901591, we should try
|
||||
re-submitting the patch.
|
||||
|
||||
diff --git a/content/app/content_main_runner_impl.cc b/content/app/content_main_runner_impl.cc
|
||||
index 12055944205a9d8de54e6d3ff66e99b723fa5752..b46a9f4ad5f07c2a8e649edbfb52b52f9f6e9946 100644
|
||||
index f5e5576fd7455336481111c24b436457e235e43c..4af47c892ce5485ff18de67e1af8962cd7315406 100644
|
||||
--- a/content/app/content_main_runner_impl.cc
|
||||
+++ b/content/app/content_main_runner_impl.cc
|
||||
@@ -663,7 +663,7 @@ int ContentMainRunnerImpl::Initialize(const ContentMainParams& params) {
|
||||
@@ -662,7 +662,7 @@ int ContentMainRunnerImpl::Initialize(const ContentMainParams& params) {
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -68,10 +68,10 @@ index 3038f9d25798f36811b6398f8cc0e7d83ecc41b0..68189c36c47ef85b345b0ccc40c456f8
|
||||
// Re-initializes schemes for tests.
|
||||
CONTENT_EXPORT void ReRegisterContentSchemesForTests();
|
||||
diff --git a/content/public/app/content_main_delegate.cc b/content/public/app/content_main_delegate.cc
|
||||
index ed5b0e2c0b4d453560ee9e2e4a55780b409eeea9..46e29dca5d13691bcf9494c0f90b68d6219a75ef 100644
|
||||
index 02985a525c98999f469906c8ff3647b740d9f962..e52e8d69c2d05b31d1f28b19752be362941e52be 100644
|
||||
--- a/content/public/app/content_main_delegate.cc
|
||||
+++ b/content/public/app/content_main_delegate.cc
|
||||
@@ -37,6 +37,10 @@ int ContentMainDelegate::TerminateForFatalInitializationError() {
|
||||
@@ -36,6 +36,10 @@ int ContentMainDelegate::TerminateForFatalInitializationError() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -83,10 +83,10 @@ index ed5b0e2c0b4d453560ee9e2e4a55780b409eeea9..46e29dca5d13691bcf9494c0f90b68d6
|
||||
return service_manager::ProcessType::kDefault;
|
||||
}
|
||||
diff --git a/content/public/app/content_main_delegate.h b/content/public/app/content_main_delegate.h
|
||||
index 2d9ee9fa20a9aba1de168cc86bfeea5eab71e6d3..4b163c3fa2ddd258b5527e0ccaf9fc9d2621ef75 100644
|
||||
index 0ca924769b98009264b53121dfe6a892b81e8530..606a5cb8d89216a95e9187fba2ea9b6d4121a394 100644
|
||||
--- a/content/public/app/content_main_delegate.h
|
||||
+++ b/content/public/app/content_main_delegate.h
|
||||
@@ -77,6 +77,20 @@ class CONTENT_EXPORT ContentMainDelegate {
|
||||
@@ -76,6 +76,20 @@ class CONTENT_EXPORT ContentMainDelegate {
|
||||
// returning initialization error code. Default behavior is CHECK(false).
|
||||
virtual int TerminateForFatalInitializationError();
|
||||
|
||||
|
||||
@@ -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 a47389ee5387b4d08eb293355eca9ecae41d6522..db101407da7678b61af311791dcc6689a51e35b5 100644
|
||||
index db4fe784c7e119111917757b2d1de4d7cc1e5f2b..f6e9f97e47b44fa47e8e6c237be371754a5204bd 100644
|
||||
--- a/ui/views/win/hwnd_message_handler.cc
|
||||
+++ b/ui/views/win/hwnd_message_handler.cc
|
||||
@@ -306,6 +306,10 @@ constexpr int kSynthesizedMouseMessagesTimeDifference = 500;
|
||||
@@ -49,7 +49,7 @@ index a47389ee5387b4d08eb293355eca9ecae41d6522..db101407da7678b61af311791dcc6689
|
||||
// HWNDMessageHandler, gfx::WindowImpl overrides:
|
||||
|
||||
diff --git a/ui/views/win/hwnd_message_handler.h b/ui/views/win/hwnd_message_handler.h
|
||||
index 90aab6ae2d180431912c979dc253791f92f17595..88ee06c3b52c506076f71edbb9cc8e55660a1fba 100644
|
||||
index 7118ff56f0dd1c6291e4095ce7f3d8fc723f0398..5dbaab15ee1667ed1caf0b746b8e31d1b12a7b52 100644
|
||||
--- a/ui/views/win/hwnd_message_handler.h
|
||||
+++ b/ui/views/win/hwnd_message_handler.h
|
||||
@@ -203,6 +203,8 @@ class VIEWS_EXPORT HWNDMessageHandler : public gfx::WindowImpl,
|
||||
|
||||
@@ -20,10 +20,10 @@ to deal with color spaces. That is being tracked at
|
||||
https://crbug.com/634542 and https://crbug.com/711107.
|
||||
|
||||
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
|
||||
index 82c14397633c55c4ffc5f09d5bd4fc434afa2759..86c5da137497fc01f141be076efa955188a79790 100644
|
||||
index 2c8bb4fe9c8cf592cc83fce164f21209e5dd1465..a6fde7b42fd854a56226acb4766274621aa7b3e6 100644
|
||||
--- a/cc/trees/layer_tree_host_impl.cc
|
||||
+++ b/cc/trees/layer_tree_host_impl.cc
|
||||
@@ -1862,6 +1862,10 @@ void LayerTreeHostImpl::SetIsLikelyToRequireADraw(
|
||||
@@ -1861,6 +1861,10 @@ void LayerTreeHostImpl::SetIsLikelyToRequireADraw(
|
||||
|
||||
gfx::ColorSpace LayerTreeHostImpl::GetRasterColorSpace(
|
||||
gfx::ContentColorUsage content_color_usage) const {
|
||||
@@ -60,7 +60,7 @@ index 8bde4796ebcf40f7f10c62f4005eabb84af9de04..913ab005e582b3d1ab0df8f88ac1df62
|
||||
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 0fc4813b2f76fe6154ebdc60ffabd278bed75653..7423c91d661adcf9e761b93ddbfa4ea8ce1c02da 100644
|
||||
index f28c3218baa08e7ae885567e0ede1d8108f8a373..a5f4a4a10a776fc92a5e9fbc9593563d548ccbc8 100644
|
||||
--- a/components/viz/host/renderer_settings_creation.cc
|
||||
+++ b/components/viz/host/renderer_settings_creation.cc
|
||||
@@ -14,6 +14,7 @@
|
||||
@@ -71,7 +71,7 @@ index 0fc4813b2f76fe6154ebdc60ffabd278bed75653..7423c91d661adcf9e761b93ddbfa4ea8
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
#include "ui/base/cocoa/remote_layer_api.h"
|
||||
@@ -50,6 +51,8 @@ bool GetSwitchValueAsInt(const base::CommandLine* command_line,
|
||||
@@ -51,6 +52,8 @@ bool GetSwitchValueAsInt(const base::CommandLine* command_line,
|
||||
RendererSettings CreateRendererSettings() {
|
||||
RendererSettings renderer_settings;
|
||||
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
|
||||
@@ -81,10 +81,10 @@ index 0fc4813b2f76fe6154ebdc60ffabd278bed75653..7423c91d661adcf9e761b93ddbfa4ea8
|
||||
!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 9c3432fd618ec5d0fc8aa0d28c73c3e004d25438..c35e322f159ea77b63b8711ad7a7bf248e2ada8d 100644
|
||||
index 591e5c4e6f7291412a5f05c244d6256a4b4fd57d..2af556050b7fe4ce7404d0c5ce6f2328a1e863fd 100644
|
||||
--- a/components/viz/service/display/gl_renderer.cc
|
||||
+++ b/components/viz/service/display/gl_renderer.cc
|
||||
@@ -85,6 +85,9 @@
|
||||
@@ -89,6 +89,9 @@
|
||||
|
||||
using gpu::gles2::GLES2Interface;
|
||||
|
||||
@@ -94,7 +94,7 @@ index 9c3432fd618ec5d0fc8aa0d28c73c3e004d25438..c35e322f159ea77b63b8711ad7a7bf24
|
||||
namespace viz {
|
||||
namespace {
|
||||
|
||||
@@ -583,8 +586,9 @@ void GLRenderer::DoDrawQuad(const DrawQuad* quad,
|
||||
@@ -587,8 +590,9 @@ void GLRenderer::DoDrawQuad(const DrawQuad* quad,
|
||||
void GLRenderer::DrawDebugBorderQuad(const DebugBorderDrawQuad* quad) {
|
||||
SetBlendEnabled(quad->ShouldDrawWithBlending());
|
||||
|
||||
@@ -106,7 +106,7 @@ index 9c3432fd618ec5d0fc8aa0d28c73c3e004d25438..c35e322f159ea77b63b8711ad7a7bf24
|
||||
|
||||
// Use the full quad_rect for debug quads to not move the edges based on
|
||||
// partial swaps.
|
||||
@@ -1554,7 +1558,8 @@ void GLRenderer::ChooseRPDQProgram(DrawRenderPassDrawQuadParams* params,
|
||||
@@ -1558,7 +1562,8 @@ void GLRenderer::ChooseRPDQProgram(DrawRenderPassDrawQuadParams* params,
|
||||
params->use_color_matrix, tint_gl_composited_content_,
|
||||
params->apply_shader_based_rounded_corner &&
|
||||
ShouldApplyRoundedCorner(params->quad)),
|
||||
@@ -116,7 +116,7 @@ index 9c3432fd618ec5d0fc8aa0d28c73c3e004d25438..c35e322f159ea77b63b8711ad7a7bf24
|
||||
}
|
||||
|
||||
void GLRenderer::UpdateRPDQUniforms(DrawRenderPassDrawQuadParams* params) {
|
||||
@@ -2025,7 +2030,8 @@ void GLRenderer::DrawSolidColorQuad(const SolidColorDrawQuad* quad,
|
||||
@@ -2029,7 +2034,8 @@ void GLRenderer::DrawSolidColorQuad(const SolidColorDrawQuad* quad,
|
||||
SetUseProgram(ProgramKey::SolidColor(use_aa ? USE_AA : NO_AA,
|
||||
tint_gl_composited_content_,
|
||||
ShouldApplyRoundedCorner(quad)),
|
||||
@@ -126,7 +126,7 @@ index 9c3432fd618ec5d0fc8aa0d28c73c3e004d25438..c35e322f159ea77b63b8711ad7a7bf24
|
||||
SetShaderColor(color, opacity);
|
||||
if (current_program_->rounded_corner_rect_location() != -1) {
|
||||
SetShaderRoundedCorner(
|
||||
@@ -2180,7 +2186,8 @@ void GLRenderer::DrawContentQuadAA(const ContentDrawQuadBase* quad,
|
||||
@@ -2184,7 +2190,8 @@ void GLRenderer::DrawContentQuadAA(const ContentDrawQuadBase* quad,
|
||||
: NON_PREMULTIPLIED_ALPHA,
|
||||
false, false, tint_gl_composited_content_,
|
||||
ShouldApplyRoundedCorner(quad)),
|
||||
@@ -136,7 +136,7 @@ index 9c3432fd618ec5d0fc8aa0d28c73c3e004d25438..c35e322f159ea77b63b8711ad7a7bf24
|
||||
|
||||
if (current_program_->tint_color_matrix_location() != -1) {
|
||||
auto matrix = cc::DebugColors::TintCompositedContentColorTransformMatrix();
|
||||
@@ -2276,7 +2283,8 @@ void GLRenderer::DrawContentQuadNoAA(const ContentDrawQuadBase* quad,
|
||||
@@ -2280,7 +2287,8 @@ void GLRenderer::DrawContentQuadNoAA(const ContentDrawQuadBase* quad,
|
||||
!quad->ShouldDrawWithBlending(), has_tex_clamp_rect,
|
||||
tint_gl_composited_content_,
|
||||
ShouldApplyRoundedCorner(quad)),
|
||||
@@ -146,7 +146,7 @@ index 9c3432fd618ec5d0fc8aa0d28c73c3e004d25438..c35e322f159ea77b63b8711ad7a7bf24
|
||||
|
||||
if (current_program_->tint_color_matrix_location() != -1) {
|
||||
auto matrix = cc::DebugColors::TintCompositedContentColorTransformMatrix();
|
||||
@@ -2378,7 +2386,8 @@ void GLRenderer::DrawYUVVideoQuad(const YUVVideoDrawQuad* quad,
|
||||
@@ -2382,7 +2390,8 @@ void GLRenderer::DrawYUVVideoQuad(const YUVVideoDrawQuad* quad,
|
||||
// The source color space should never be RGB.
|
||||
DCHECK_NE(src_color_space, src_color_space.GetAsFullRangeRGB());
|
||||
|
||||
@@ -156,7 +156,7 @@ index 9c3432fd618ec5d0fc8aa0d28c73c3e004d25438..c35e322f159ea77b63b8711ad7a7bf24
|
||||
|
||||
#if defined(OS_WIN)
|
||||
// Force sRGB output on Windows for overlay candidate video quads to match
|
||||
@@ -2542,7 +2551,8 @@ void GLRenderer::DrawStreamVideoQuad(const StreamVideoDrawQuad* quad,
|
||||
@@ -2546,7 +2555,8 @@ void GLRenderer::DrawStreamVideoQuad(const StreamVideoDrawQuad* quad,
|
||||
|
||||
SetUseProgram(ProgramKey::VideoStream(tex_coord_precision,
|
||||
ShouldApplyRoundedCorner(quad)),
|
||||
@@ -166,7 +166,7 @@ index 9c3432fd618ec5d0fc8aa0d28c73c3e004d25438..c35e322f159ea77b63b8711ad7a7bf24
|
||||
|
||||
DCHECK_EQ(GL_TEXTURE0, GetActiveTextureUnit(gl_));
|
||||
gl_->BindTexture(GL_TEXTURE_EXTERNAL_OES, lock.texture_id());
|
||||
@@ -2607,8 +2617,8 @@ void GLRenderer::FlushTextureQuadCache(BoundGeometry flush_binding) {
|
||||
@@ -2611,8 +2621,8 @@ void GLRenderer::FlushTextureQuadCache(BoundGeometry flush_binding) {
|
||||
draw_cache_.nearest_neighbor ? GL_NEAREST : GL_LINEAR);
|
||||
|
||||
// Bind the program to the GL state.
|
||||
@@ -177,7 +177,7 @@ index 9c3432fd618ec5d0fc8aa0d28c73c3e004d25438..c35e322f159ea77b63b8711ad7a7bf24
|
||||
|
||||
if (current_program_->rounded_corner_rect_location() != -1) {
|
||||
SetShaderRoundedCorner(
|
||||
@@ -3347,7 +3357,9 @@ void GLRenderer::PrepareGeometry(BoundGeometry binding) {
|
||||
@@ -3357,7 +3367,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) {
|
||||
@@ -188,7 +188,7 @@ index 9c3432fd618ec5d0fc8aa0d28c73c3e004d25438..c35e322f159ea77b63b8711ad7a7bf24
|
||||
|
||||
// If the input color space is PQ, and it did not specify a white level,
|
||||
// override it with the frame's white level.
|
||||
@@ -3729,9 +3741,9 @@ void GLRenderer::CopyRenderPassDrawQuadToOverlayResource(
|
||||
@@ -3739,9 +3751,9 @@ void GLRenderer::CopyRenderPassDrawQuadToOverlayResource(
|
||||
cc::MathUtil::CheckedRoundUp(iosurface_height, iosurface_multiple);
|
||||
}
|
||||
|
||||
@@ -201,7 +201,7 @@ index 9c3432fd618ec5d0fc8aa0d28c73c3e004d25438..c35e322f159ea77b63b8711ad7a7bf24
|
||||
*new_bounds = gfx::RectF(updated_dst_rect.origin(),
|
||||
gfx::SizeF((*overlay_texture)->texture.size()));
|
||||
|
||||
@@ -3950,8 +3962,8 @@ void GLRenderer::FlushOverdrawFeedback(const gfx::Rect& output_rect) {
|
||||
@@ -3960,8 +3972,8 @@ void GLRenderer::FlushOverdrawFeedback(const gfx::Rect& output_rect) {
|
||||
|
||||
PrepareGeometry(SHARED_BINDING);
|
||||
|
||||
@@ -212,17 +212,17 @@ index 9c3432fd618ec5d0fc8aa0d28c73c3e004d25438..c35e322f159ea77b63b8711ad7a7bf24
|
||||
|
||||
gfx::Transform render_matrix;
|
||||
render_matrix.Translate(0.5 * output_rect.width() + output_rect.x(),
|
||||
@@ -4068,3 +4080,5 @@ gfx::Size GLRenderer::GetRenderPassBackingPixelSize(
|
||||
@@ -4079,3 +4091,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 6ec6024a9447817926acf551e23e6ae84a45eded..395633bb6f00d5363a1540ab67c730e507712f2e 100644
|
||||
index 9f9d3422ad128fe3bfc305baa57971bd03e1b676..02747c0d4d7f0bb7ba034f35bcce86a91774bb36 100644
|
||||
--- a/content/browser/gpu/gpu_process_host.cc
|
||||
+++ b/content/browser/gpu/gpu_process_host.cc
|
||||
@@ -210,6 +210,7 @@ GpuTerminationStatus ConvertToGpuTerminationStatus(
|
||||
@@ -215,6 +215,7 @@ GpuTerminationStatus ConvertToGpuTerminationStatus(
|
||||
|
||||
// Command-line switches to propagate to the GPU process.
|
||||
static const char* const kSwitchNames[] = {
|
||||
@@ -231,7 +231,7 @@ index 6ec6024a9447817926acf551e23e6ae84a45eded..395633bb6f00d5363a1540ab67c730e5
|
||||
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 03c5e4cc58ae9321dc2a89cef43d615ac2023916..1800a97025d03d7fbf8cf5ab7a632277dd32202e 100644
|
||||
index e5a82f46cd58b0da9959930ee85303e4a1530425..753b926fbe0c6a3ef2b2e244d7f80f4f4574bc5c 100644
|
||||
--- a/content/browser/renderer_host/render_process_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_process_host_impl.cc
|
||||
@@ -227,6 +227,7 @@
|
||||
@@ -242,7 +242,7 @@ index 03c5e4cc58ae9321dc2a89cef43d615ac2023916..1800a97025d03d7fbf8cf5ab7a632277
|
||||
#include "ui/gl/gl_switches.h"
|
||||
#include "ui/native_theme/native_theme_features.h"
|
||||
#include "url/origin.h"
|
||||
@@ -3282,6 +3283,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
|
||||
@@ -3283,6 +3284,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[] = {
|
||||
@@ -251,7 +251,7 @@ index 03c5e4cc58ae9321dc2a89cef43d615ac2023916..1800a97025d03d7fbf8cf5ab7a632277
|
||||
service_manager::switches::kDisableInProcessStackTraces,
|
||||
service_manager::switches::kDisableSeccompFilterSandbox,
|
||||
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
|
||||
index d56b2a18c3e1edc5c02ceb99d695dde3023f94dc..9e44fd8e77d5fcf651ab1bd9399317bd58881423 100644
|
||||
index 30e6638b9c5bf4b04e73156ee4b0f70a91134010..6a05f399a8a70f5d7f4f04ec9b02968bf2c0ef6d 100644
|
||||
--- a/content/renderer/render_widget.cc
|
||||
+++ b/content/renderer/render_widget.cc
|
||||
@@ -2216,6 +2216,9 @@ cc::LayerTreeSettings RenderWidget::GenerateLayerTreeSettings(
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Deepak Mohan <hop2deep@gmail.com>
|
||||
Date: Fri, 22 May 2020 17:58:16 -0700
|
||||
Subject: Disable DCHECK that fails with software compositing
|
||||
|
||||
Should be removed once https://bugs.chromium.org/p/chromium/issues/detail?id=1084625
|
||||
is addressed.
|
||||
|
||||
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
|
||||
index db101407da7678b61af311791dcc6689a51e35b5..6191775ea0566862722741a3c6102867082f33d6 100644
|
||||
--- a/ui/views/win/hwnd_message_handler.cc
|
||||
+++ b/ui/views/win/hwnd_message_handler.cc
|
||||
@@ -2421,13 +2421,13 @@ void HWNDMessageHandler::OnPaint(HDC dc) {
|
||||
RECT cr;
|
||||
if (GetClientRect(hwnd(), &cr)) {
|
||||
if (exposed_pixels_.height() > 0) {
|
||||
- DCHECK_GE(cr.bottom, exposed_pixels_.height());
|
||||
+ //DCHECK_GE(cr.bottom, exposed_pixels_.height());
|
||||
RECT rect = {cr.left, cr.bottom - exposed_pixels_.height(), cr.right,
|
||||
cr.bottom};
|
||||
FillRect(ps.hdc, &rect, brush);
|
||||
}
|
||||
if (exposed_pixels_.width() > 0) {
|
||||
- DCHECK_GE(cr.right, exposed_pixels_.width());
|
||||
+ //DCHECK_GE(cr.right, exposed_pixels_.width());
|
||||
RECT rect = {cr.right - exposed_pixels_.width(), cr.top, cr.right,
|
||||
cr.bottom - exposed_pixels_.height()};
|
||||
FillRect(ps.hdc, &rect, brush);
|
||||
@@ -34,7 +34,7 @@ index 5f3f2feec8c787ff1e086bf256ef9353732037af..a127ec54042ef869f0e19ba6b86b86d4
|
||||
const base::TimeDelta& delay) {
|
||||
new_content_rendering_delay_ = delay;
|
||||
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
|
||||
index 0edc16351ec6856bb1b3010905ebff4cf7f1b2a3..a73d370bf2475a112790ba7c02d8d8d3ba9febff 100644
|
||||
index 338fd87a55cbf4688079daa5ec86d81d8258339e..5477ee5ca3974aa043939c79bef2f8e12925148d 100644
|
||||
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
|
||||
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
|
||||
@@ -623,7 +623,7 @@ void RenderWidgetHostViewAura::HideImpl() {
|
||||
|
||||
@@ -33,10 +33,10 @@ index 0ccfe130f00ec3b6c75cd8ee04d5a2777e1fd00c..653829457d58bf92057cc36aa8a28970
|
||||
DISALLOW_COPY_AND_ASSIGN(StaticHttpUserAgentSettings);
|
||||
};
|
||||
diff --git a/services/network/network_context.cc b/services/network/network_context.cc
|
||||
index a07176cf0fd3c7160922e7f9919e775cb3b6fe71..5d59a8cc4fec91de95ddbb90dab1df9334081fac 100644
|
||||
index 170ba3cf6176e8423b6009a0ac0299bf1e411158..14f8cb99631232cc225026c345e95df2b548bcff 100644
|
||||
--- a/services/network/network_context.cc
|
||||
+++ b/services/network/network_context.cc
|
||||
@@ -1036,6 +1036,13 @@ void NetworkContext::SetNetworkConditions(
|
||||
@@ -1035,6 +1035,13 @@ void NetworkContext::SetNetworkConditions(
|
||||
std::move(network_conditions));
|
||||
}
|
||||
|
||||
@@ -51,10 +51,10 @@ index a07176cf0fd3c7160922e7f9919e775cb3b6fe71..5d59a8cc4fec91de95ddbb90dab1df93
|
||||
// This may only be called on NetworkContexts created with the constructor
|
||||
// that calls MakeURLRequestContext().
|
||||
diff --git a/services/network/network_context.h b/services/network/network_context.h
|
||||
index dd65d1560daa8fde7d76e0dec8e1cdcb6c76b318..042f62dafcb027f0a65318d09dfadf751c792329 100644
|
||||
index 391a02c108debdd5e5572b4a666d30dc68ece76b..0d9c4cce09db485b5e750921eed703c75ffdf15a 100644
|
||||
--- a/services/network/network_context.h
|
||||
+++ b/services/network/network_context.h
|
||||
@@ -243,6 +243,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
|
||||
@@ -242,6 +242,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
|
||||
void CloseIdleConnections(CloseIdleConnectionsCallback callback) override;
|
||||
void SetNetworkConditions(const base::UnguessableToken& throttling_profile_id,
|
||||
mojom::NetworkConditionsPtr conditions) override;
|
||||
|
||||
@@ -13,7 +13,7 @@ uses internally for things like menus and devtools.
|
||||
We can remove this patch once it has in some shape been upstreamed.
|
||||
|
||||
diff --git a/ui/native_theme/native_theme.cc b/ui/native_theme/native_theme.cc
|
||||
index 119c6ba8f0318c398a1020cab5f0c55d387d4ed6..74b47875a042f9a5189dc4a7ade36c0cb3d1b5a6 100644
|
||||
index 150f4455d497c6e1ac84948eac088c9dc3a4d729..84a4d6dfc33ae7ba7e21efc5f38405e24749edd6 100644
|
||||
--- a/ui/native_theme/native_theme.cc
|
||||
+++ b/ui/native_theme/native_theme.cc
|
||||
@@ -247,6 +247,8 @@ NativeTheme::NativeTheme(bool should_use_dark_colors)
|
||||
@@ -26,7 +26,7 @@ index 119c6ba8f0318c398a1020cab5f0c55d387d4ed6..74b47875a042f9a5189dc4a7ade36c0c
|
||||
}
|
||||
|
||||
diff --git a/ui/native_theme/native_theme.h b/ui/native_theme/native_theme.h
|
||||
index 9ecc4540915100ff61e310d4c60bf91d75d0c588..8dfd9699f569e7fa0426492f881228ae8df9d376 100644
|
||||
index f4e9cc14b0b8406d255bbed56d98dcf61f24a405..e1b9298532b2676aa4d9cdacb15e9398be3ccc3f 100644
|
||||
--- a/ui/native_theme/native_theme.h
|
||||
+++ b/ui/native_theme/native_theme.h
|
||||
@@ -392,6 +392,22 @@ class NATIVE_THEME_EXPORT NativeTheme {
|
||||
@@ -52,7 +52,7 @@ index 9ecc4540915100ff61e310d4c60bf91d75d0c588..8dfd9699f569e7fa0426492f881228ae
|
||||
// Returns a shared instance of the native theme that should be used for web
|
||||
// rendering. Do not use it in a normal application context (i.e. browser).
|
||||
// The returned object should not be deleted by the caller. This function is
|
||||
@@ -526,6 +542,8 @@ class NATIVE_THEME_EXPORT NativeTheme {
|
||||
@@ -527,6 +543,8 @@ class NATIVE_THEME_EXPORT NativeTheme {
|
||||
bool is_high_contrast_ = false;
|
||||
PreferredColorScheme preferred_color_scheme_ = PreferredColorScheme::kLight;
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ Subject: feat: allow disabling blink scheduler throttling per RenderView
|
||||
This allows us to disable throttling for hidden windows.
|
||||
|
||||
diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc
|
||||
index 9a2cc0f076406d68910eeb5351e3869287515fcb..bde2f593f55edc677d44f4ae037042fe10661679 100644
|
||||
index c5140471ec2ade58948972f433d79c11932e2f17..12db0a89ac0f37ecab137841264ddd108d622dc8 100644
|
||||
--- a/content/browser/renderer_host/render_view_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_view_host_impl.cc
|
||||
@@ -512,6 +512,10 @@ void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) {
|
||||
@@ -21,7 +21,7 @@ index 9a2cc0f076406d68910eeb5351e3869287515fcb..bde2f593f55edc677d44f4ae037042fe
|
||||
return is_active();
|
||||
}
|
||||
diff --git a/content/browser/renderer_host/render_view_host_impl.h b/content/browser/renderer_host/render_view_host_impl.h
|
||||
index af15805b34d2cc038e73654017d4c0921e3fc321..3489f03bac1283efb6a27f5b959a72a8e5d0cb14 100644
|
||||
index e1f95d702844a687342f484e3c572686064dc498..0233242c0d2b4bde4e32931f30777ee26dc02619 100644
|
||||
--- a/content/browser/renderer_host/render_view_host_impl.h
|
||||
+++ b/content/browser/renderer_host/render_view_host_impl.h
|
||||
@@ -110,6 +110,7 @@ class CONTENT_EXPORT RenderViewHostImpl
|
||||
@@ -61,10 +61,10 @@ index dfd856eb481114fea9da3e26b4080c9a8473acf6..604a95a0427705eca523e91b08a136f8
|
||||
//
|
||||
// Returns the current WebKit preferences. Note: WebPreferences is cached, so
|
||||
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
|
||||
index 57447f4529917692155d1861c7658156978fa0be..2eaf980889ef9053e728dc09e76f1fcd889153b8 100644
|
||||
index c1b0d1f5f7acb82f559ba90f24b6f9e5e7c44dad..dacde7b382a698309e3b5644003d359e273d5bd1 100644
|
||||
--- a/content/renderer/render_view_impl.cc
|
||||
+++ b/content/renderer/render_view_impl.cc
|
||||
@@ -1173,6 +1173,8 @@ bool RenderViewImpl::OnMessageReceived(const IPC::Message& message) {
|
||||
@@ -1170,6 +1170,8 @@ bool RenderViewImpl::OnMessageReceived(const IPC::Message& message) {
|
||||
|
||||
bool handled = true;
|
||||
IPC_BEGIN_MESSAGE_MAP(RenderViewImpl, message)
|
||||
@@ -73,7 +73,7 @@ index 57447f4529917692155d1861c7658156978fa0be..2eaf980889ef9053e728dc09e76f1fcd
|
||||
IPC_MESSAGE_HANDLER(ViewMsg_UpdateTargetURL_ACK, OnUpdateTargetURLAck)
|
||||
IPC_MESSAGE_HANDLER(ViewMsg_UpdateWebPreferences, OnUpdateWebPreferences)
|
||||
IPC_MESSAGE_HANDLER(ViewMsg_MoveOrResizeStarted, OnMoveOrResizeStarted)
|
||||
@@ -1669,6 +1671,12 @@ bool RenderViewImpl::GetContentStateImmediately() {
|
||||
@@ -1667,6 +1669,12 @@ bool RenderViewImpl::GetContentStateImmediately() {
|
||||
return send_content_state_immediately_;
|
||||
}
|
||||
|
||||
@@ -111,10 +111,10 @@ index baa1cec07522a23221b146165a638d3f679f9817..50f0c46c8fcbb4ee8ebb316f859f84d0
|
||||
// Visibility -----------------------------------------------------------
|
||||
|
||||
diff --git a/third_party/blink/renderer/core/exported/web_view_impl.cc b/third_party/blink/renderer/core/exported/web_view_impl.cc
|
||||
index 94fb9863a6da4c049e45ec5966ef79d9c8e42b75..063d88779ad2ca7c4c723e2872c28d93401fcec3 100644
|
||||
index 27adaed62fe204202b4716cd573165b7456dbd29..2ba1cb1605ba5a10d5db78f4d3b440d431baceb1 100644
|
||||
--- a/third_party/blink/renderer/core/exported/web_view_impl.cc
|
||||
+++ b/third_party/blink/renderer/core/exported/web_view_impl.cc
|
||||
@@ -3366,6 +3366,13 @@ PageScheduler* WebViewImpl::Scheduler() const {
|
||||
@@ -3368,6 +3368,13 @@ PageScheduler* WebViewImpl::Scheduler() const {
|
||||
return GetPage()->GetPageScheduler();
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ index 94fb9863a6da4c049e45ec5966ef79d9c8e42b75..063d88779ad2ca7c4c723e2872c28d93
|
||||
void WebViewImpl::SetVisibilityState(
|
||||
mojom::blink::PageVisibilityState visibility_state,
|
||||
bool is_initial_state) {
|
||||
@@ -3376,7 +3383,8 @@ void WebViewImpl::SetVisibilityState(
|
||||
@@ -3378,7 +3385,8 @@ void WebViewImpl::SetVisibilityState(
|
||||
}
|
||||
GetPage()->SetVisibilityState(visibility_state, is_initial_state);
|
||||
GetPage()->GetPageScheduler()->SetPageVisible(
|
||||
|
||||
@@ -94,7 +94,7 @@ index 1026b739d283f0fc252fa2af83a6d4cf51bc8553..fe562ab60ce98b8bb0c5080a6428deb3
|
||||
private:
|
||||
const HWND hwnd_;
|
||||
diff --git a/components/viz/service/BUILD.gn b/components/viz/service/BUILD.gn
|
||||
index 8c4f933b32420d2cfc40d5bc5883fda61636b52a..6f2322736e570b1e994a4f0c39396261cb8a6f58 100644
|
||||
index 0979770409131aed4bea76d33b2748c01dde9541..d256ec42bb2154628de7d8d08cc8cf4b6d928911 100644
|
||||
--- a/components/viz/service/BUILD.gn
|
||||
+++ b/components/viz/service/BUILD.gn
|
||||
@@ -111,6 +111,8 @@ viz_component("service") {
|
||||
@@ -107,7 +107,7 @@ index 8c4f933b32420d2cfc40d5bc5883fda61636b52a..6f2322736e570b1e994a4f0c39396261
|
||||
"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 b58099c6c1ad5727a806b81d674f4dac187da927..6d38e89500b6f3dd2b76fe3c7e67c568862aa4af 100644
|
||||
index da8936a87cfe156a90952c1ca79d9faf6ef2cd1f..6fd321aaf610ee985868af62b0e856f19e8be264 100644
|
||||
--- a/components/viz/service/display_embedder/output_surface_provider_impl.cc
|
||||
+++ b/components/viz/service/display_embedder/output_surface_provider_impl.cc
|
||||
@@ -21,6 +21,7 @@
|
||||
@@ -126,7 +126,7 @@ index b58099c6c1ad5727a806b81d674f4dac187da927..6d38e89500b6f3dd2b76fe3c7e67c568
|
||||
#include "ui/base/ui_base_switches.h"
|
||||
#include "ui/gl/gl_context.h"
|
||||
#include "ui/gl/init/gl_factory.h"
|
||||
@@ -218,6 +220,22 @@ OutputSurfaceProviderImpl::CreateSoftwareOutputDeviceForPlatform(
|
||||
@@ -223,6 +225,22 @@ OutputSurfaceProviderImpl::CreateSoftwareOutputDeviceForPlatform(
|
||||
if (headless_)
|
||||
return std::make_unique<SoftwareOutputDevice>();
|
||||
|
||||
@@ -527,7 +527,7 @@ index 6b7fbb6cf13dc8ee6ade0878a9a2c1efc5d4d3f1..e2af75168cb914a7b3b4a6c9b6a28549
|
||||
+ Draw(gfx.mojom.Rect damage_rect) => ();
|
||||
};
|
||||
diff --git a/ui/compositor/compositor.h b/ui/compositor/compositor.h
|
||||
index 0f99c9d78626ccc211236832e5df2008ce0df5f2..f1dfa72d21e93f5223cde8e2b34d5ed2a6c04209 100644
|
||||
index 438dd212d881abf70362f12391b6a85f697785d0..34bd0cbf18714ac24355e603806cc36986f24e30 100644
|
||||
--- a/ui/compositor/compositor.h
|
||||
+++ b/ui/compositor/compositor.h
|
||||
@@ -74,6 +74,7 @@ class DisplayPrivate;
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Andy Locascio <andy@slack-corp.com>
|
||||
Date: Thu, 2 Apr 2020 15:05:00 -0700
|
||||
Subject: fix: account for print preview disabled when printing to pdf
|
||||
|
||||
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2068936
|
||||
|
||||
Avoid an optimization introduced in the above CL. In my limited
|
||||
understanding, it seems like we slightly misuse the print preview API
|
||||
and this is fallout from using it in a way the code doesn't expect.
|
||||
|
||||
diff --git a/components/printing/renderer/print_render_frame_helper.cc b/components/printing/renderer/print_render_frame_helper.cc
|
||||
index 7406760e1c0247899232fc96614cfb2359ade432..2bf4ea5817c80bef2f057c10195ca846e3d44d0b 100644
|
||||
--- a/components/printing/renderer/print_render_frame_helper.cc
|
||||
+++ b/components/printing/renderer/print_render_frame_helper.cc
|
||||
@@ -1499,6 +1499,7 @@ PrintRenderFrameHelper::CreatePreviewDocument() {
|
||||
const std::vector<int>& pages = print_pages_params_->pages;
|
||||
|
||||
bool require_document_metafile =
|
||||
+ !g_is_preview_enabled ||
|
||||
print_renderer_ ||
|
||||
print_params.printed_doc_type != mojom::SkiaDocumentType::kMSKP;
|
||||
if (!print_preview_context_.CreatePreviewDocument(
|
||||
@@ -1,28 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Cheng Zhao <zcbenz@gmail.com>
|
||||
Date: Thu, 4 Oct 2018 14:57:02 -0700
|
||||
Subject: fix: handle non client pointer events from pen on Windows 10
|
||||
|
||||
Refs: https://github.com/electron/electron/issues/21440
|
||||
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2237535
|
||||
|
||||
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
|
||||
index 6191775ea0566862722741a3c6102867082f33d6..48f32cc9b820156ee7bca9381611b8aff7953fdf 100644
|
||||
--- a/ui/views/win/hwnd_message_handler.cc
|
||||
+++ b/ui/views/win/hwnd_message_handler.cc
|
||||
@@ -2002,6 +2002,15 @@ LRESULT HWNDMessageHandler::OnPointerEvent(UINT message,
|
||||
return -1;
|
||||
}
|
||||
|
||||
+ // Pen may also send non client pointer messages, treat them as normal
|
||||
+ // touch events so they can be properly handled.
|
||||
+ if (pointer_type == PT_PEN &&
|
||||
+ (message == WM_NCPOINTERDOWN ||
|
||||
+ message == WM_NCPOINTERUP ||
|
||||
+ message == WM_NCPOINTERUPDATE)) {
|
||||
+ pointer_type = PT_TOUCH;
|
||||
+ }
|
||||
+
|
||||
switch (pointer_type) {
|
||||
case PT_PEN:
|
||||
return HandlePointerEventTypePen(message, w_param, l_param);
|
||||
30
patches/chromium/fix_include_missing_header_file.patch
Normal file
30
patches/chromium/fix_include_missing_header_file.patch
Normal file
@@ -0,0 +1,30 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Adam Kallai <kadam@inf.u-szeged.hu>
|
||||
Date: Thu, 2 Jul 2020 17:09:16 +0200
|
||||
Subject: fix: include missing header file
|
||||
|
||||
Include the header from base/ where NOTREACHED is defined.
|
||||
This fixes a build failure on Windows on Arm.
|
||||
|
||||
The patch was originally created by Richard Townsend <richard.townsend@arm.com>.
|
||||
|
||||
Bug: 1100363
|
||||
Change-Id: Ic97f7c217f22e51f1d4c9bd87ae434e263975c6d
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2279091
|
||||
Commit-Queue: Mark Mentovai <mark@chromium.org>
|
||||
Reviewed-by: Mark Mentovai <mark@chromium.org>
|
||||
|
||||
diff --git a/third_party/crashpad/crashpad/snapshot/win/system_snapshot_win.cc b/third_party/crashpad/crashpad/snapshot/win/system_snapshot_win.cc
|
||||
index 88cbc800de81de88d08c41e893ad4f64dc65ef47..778892c50be5e2acaaed3d47e45fb8a8261e695e 100644
|
||||
--- a/third_party/crashpad/crashpad/snapshot/win/system_snapshot_win.cc
|
||||
+++ b/third_party/crashpad/crashpad/snapshot/win/system_snapshot_win.cc
|
||||
@@ -23,7 +23,9 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
+#include "base/check_op.h"
|
||||
#include "base/logging.h"
|
||||
+#include "base/notreached.h"
|
||||
#include "base/numerics/safe_conversions.h"
|
||||
#include "base/strings/stringprintf.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
@@ -13,10 +13,10 @@ This patch can be removed once app.allowRendererProcessReuse is forced
|
||||
to true as then Chromiums assumptions around processes become correct.
|
||||
|
||||
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
||||
index 1f5f7f217a7cb4013f6bfbb380b2b81214cc92b0..9ac8c8ea965a33e64a656f4478b217d3e6288597 100644
|
||||
index b62a639e51886ddc500d7aa78aa2f9c2efc75514..fbbfba66e5cbd242484fd95897ad08209b390d1f 100644
|
||||
--- a/content/browser/web_contents/web_contents_impl.cc
|
||||
+++ b/content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -2492,11 +2492,13 @@ bool WebContentsImpl::HandleMouseEvent(const blink::WebMouseEvent& event) {
|
||||
@@ -2496,11 +2496,13 @@ bool WebContentsImpl::HandleMouseEvent(const blink::WebMouseEvent& event) {
|
||||
WebContentsImpl* outermost = GetOutermostWebContents();
|
||||
if (event.button == blink::WebPointerProperties::Button::kBack &&
|
||||
outermost->controller_.CanGoBack()) {
|
||||
|
||||
@@ -42,10 +42,10 @@ index 6b03c07316eaab83a50afc123fc9f17b1c1dfa3b..e821571731e4e1a93f873477c7410de7
|
||||
// another SiteInstance for the same site.
|
||||
void RegisterSiteInstance(SiteInstanceImpl* site_instance);
|
||||
diff --git a/content/browser/frame_host/navigation_request.cc b/content/browser/frame_host/navigation_request.cc
|
||||
index 6c3252af5e5f6dac3045f6315704ba9d494add4c..a8853ff856aa923e3820eb68d7b8081332d2a004 100644
|
||||
index 5757ad84edbb71ebfca143b84fa83d018da8fb84..764e1f007b44bda5191e9021be59ab21446f6e55 100644
|
||||
--- a/content/browser/frame_host/navigation_request.cc
|
||||
+++ b/content/browser/frame_host/navigation_request.cc
|
||||
@@ -1406,6 +1406,21 @@ void NavigationRequest::BeginNavigation() {
|
||||
@@ -1410,6 +1410,21 @@ void NavigationRequest::BeginNavigation() {
|
||||
// it immediately.
|
||||
EnterChildTraceEvent("ResponseStarted", this);
|
||||
|
||||
@@ -67,7 +67,7 @@ index 6c3252af5e5f6dac3045f6315704ba9d494add4c..a8853ff856aa923e3820eb68d7b80813
|
||||
// Select an appropriate RenderFrameHost.
|
||||
render_frame_host_ =
|
||||
frame_tree_node_->render_manager()->GetFrameHostForNavigation(this);
|
||||
@@ -4783,6 +4798,7 @@ void NavigationRequest::CheckStateTransition(NavigationState state) const {
|
||||
@@ -4801,6 +4816,7 @@ void NavigationRequest::CheckStateTransition(NavigationState state) const {
|
||||
{WILL_START_REQUEST, {
|
||||
WILL_REDIRECT_REQUEST,
|
||||
WILL_PROCESS_RESPONSE,
|
||||
@@ -75,7 +75,7 @@ index 6c3252af5e5f6dac3045f6315704ba9d494add4c..a8853ff856aa923e3820eb68d7b80813
|
||||
READY_TO_COMMIT,
|
||||
DID_COMMIT,
|
||||
CANCELING,
|
||||
@@ -4796,10 +4812,14 @@ void NavigationRequest::CheckStateTransition(NavigationState state) const {
|
||||
@@ -4814,10 +4830,14 @@ void NavigationRequest::CheckStateTransition(NavigationState state) const {
|
||||
WILL_FAIL_REQUEST,
|
||||
}},
|
||||
{WILL_PROCESS_RESPONSE, {
|
||||
@@ -91,7 +91,7 @@ index 6c3252af5e5f6dac3045f6315704ba9d494add4c..a8853ff856aa923e3820eb68d7b80813
|
||||
NOT_STARTED,
|
||||
DID_COMMIT,
|
||||
diff --git a/content/browser/frame_host/navigation_request.h b/content/browser/frame_host/navigation_request.h
|
||||
index 6941326796bb7e7b056ae0f83345edb2e4cb0479..8e8e1e6d994809159cf0433a4feeec85e68814f2 100644
|
||||
index 15e241680e7435c7cfd62a3eddcaab1be4638e1c..9db96ba9e042507b465821dbb0632317f1f0de70 100644
|
||||
--- a/content/browser/frame_host/navigation_request.h
|
||||
+++ b/content/browser/frame_host/navigation_request.h
|
||||
@@ -142,6 +142,10 @@ class CONTENT_EXPORT NavigationRequest
|
||||
@@ -106,10 +106,10 @@ index 6941326796bb7e7b056ae0f83345edb2e4cb0479..8e8e1e6d994809159cf0433a4feeec85
|
||||
READY_TO_COMMIT,
|
||||
|
||||
diff --git a/content/browser/frame_host/render_frame_host_manager.cc b/content/browser/frame_host/render_frame_host_manager.cc
|
||||
index b6f81430796a820992abc7dd81202853b9f6ed7f..c646423abc241e23252f5857abafcf44397c2c42 100644
|
||||
index 72ecbed1a296d34bffabe0d0fbe9d0c3af442938..af735438fa4848e661cc9fd1937e2577a5c747cf 100644
|
||||
--- a/content/browser/frame_host/render_frame_host_manager.cc
|
||||
+++ b/content/browser/frame_host/render_frame_host_manager.cc
|
||||
@@ -2305,6 +2305,16 @@ bool RenderFrameHostManager::InitRenderView(
|
||||
@@ -2331,6 +2331,16 @@ bool RenderFrameHostManager::InitRenderView(
|
||||
scoped_refptr<SiteInstance>
|
||||
RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
|
||||
NavigationRequest* request) {
|
||||
@@ -126,7 +126,7 @@ index b6f81430796a820992abc7dd81202853b9f6ed7f..c646423abc241e23252f5857abafcf44
|
||||
SiteInstance* current_site_instance = render_frame_host_->GetSiteInstance();
|
||||
|
||||
// All children of MHTML documents must be MHTML documents. They all live in
|
||||
@@ -2324,10 +2334,60 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
|
||||
@@ -2350,10 +2360,60 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
|
||||
//
|
||||
// TODO(clamy): We should also consider as a candidate SiteInstance the
|
||||
// speculative SiteInstance that was computed on redirects.
|
||||
@@ -191,7 +191,7 @@ index b6f81430796a820992abc7dd81202853b9f6ed7f..c646423abc241e23252f5857abafcf44
|
||||
|
||||
// Account for renderer-initiated reload as well.
|
||||
// Needed as a workaround for https://crbug.com/1045524, remove it when it is
|
||||
@@ -2357,6 +2417,9 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
|
||||
@@ -2383,6 +2443,9 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
|
||||
request->ResetStateForSiteInstanceChange();
|
||||
}
|
||||
|
||||
@@ -229,7 +229,7 @@ index 571e6381f2456450a07b64c3a84d1f15f4cbbefa..cb342a6c4915c4b2cc7fe0c1b3c7219f
|
||||
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 a0ea7c6100eb437bf1c409ddad3bb5bbe1f3acb8..756cf1465e27820e1061ce251b03f77b3d8546aa 100644
|
||||
index 84ca4325a72a5c4267d43e5be9bfd7b73efa0b86..4af654e2a2dbb5450b3f8ca1d85b0e6c94825c42 100644
|
||||
--- a/content/public/browser/content_browser_client.cc
|
||||
+++ b/content/public/browser/content_browser_client.cc
|
||||
@@ -59,6 +59,21 @@
|
||||
@@ -255,10 +255,10 @@ index a0ea7c6100eb437bf1c409ddad3bb5bbe1f3acb8..756cf1465e27820e1061ce251b03f77b
|
||||
const MainFunctionParams& parameters) {
|
||||
return nullptr;
|
||||
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
|
||||
index 31a0a2b60dd96ede0beba95e8d1df65ed744cf83..e56dee7ea987b6b0b3f729f4c8ffa483e3e8c96f 100644
|
||||
index 00f3f557ccf69760c4e0ac7c9fcc7d048e21e8d8..d968ab756f8628a3e52b57c9cacb50dea7819157 100644
|
||||
--- a/content/public/browser/content_browser_client.h
|
||||
+++ b/content/public/browser/content_browser_client.h
|
||||
@@ -236,8 +236,45 @@ class CONTENT_EXPORT ContentBrowserClient {
|
||||
@@ -240,8 +240,45 @@ class CONTENT_EXPORT ContentBrowserClient {
|
||||
using IsClipboardPasteAllowedCallback =
|
||||
base::OnceCallback<void(ClipboardPasteAllowed)>;
|
||||
|
||||
|
||||
@@ -40,10 +40,10 @@ index 2e069f00bb0f2c263b60662988548b246b74e5d9..82e9a19b6502aeab8f5d14098f2e5c5f
|
||||
// Update the GPU feature info. This updates the blacklist and enabled status
|
||||
// of GPU rasterization. In the future this will be used for more features.
|
||||
diff --git a/content/browser/gpu/gpu_data_manager_impl_private.cc b/content/browser/gpu/gpu_data_manager_impl_private.cc
|
||||
index 8ceb4ed3c6bc4759bacdf6a5922dd9a4c5e65322..a0a18214c3a4722c920ad4204a4975625130bb3c 100644
|
||||
index 54a2d002794e3cf3c40799e437456dd37df51503..4faf21eab883aa7095d712678ceea95975bdd18f 100644
|
||||
--- a/content/browser/gpu/gpu_data_manager_impl_private.cc
|
||||
+++ b/content/browser/gpu/gpu_data_manager_impl_private.cc
|
||||
@@ -1059,6 +1059,11 @@ void GpuDataManagerImplPrivate::TerminateInfoCollectionGpuProcess() {
|
||||
@@ -1063,6 +1063,11 @@ void GpuDataManagerImplPrivate::TerminateInfoCollectionGpuProcess() {
|
||||
host->ForceShutdown();
|
||||
}
|
||||
|
||||
|
||||
@@ -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.spec b/tools/gritsettings/resource_ids.spec
|
||||
index 732d954a33a69d8aee0849b96b0e0d5eacebca91..7b0419d6a75009e7a0052a09641ab60197010275 100644
|
||||
index fa2306ead7d2b70e41be750408e386bd452b99cc..9985c129afd87ed546baddae598881418ee502bf 100644
|
||||
--- a/tools/gritsettings/resource_ids.spec
|
||||
+++ b/tools/gritsettings/resource_ids.spec
|
||||
@@ -630,6 +630,11 @@
|
||||
@@ -649,6 +649,11 @@
|
||||
"includes": [3880],
|
||||
},
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ Disable private window frame APIs (NSNextStepFrame and NSThemeFrame) for MAS
|
||||
build.
|
||||
|
||||
diff --git a/components/remote_cocoa/app_shim/browser_native_widget_window_mac.mm b/components/remote_cocoa/app_shim/browser_native_widget_window_mac.mm
|
||||
index b52df712266ca390593d304936f0b979503af3ad..62ded794bd83963f681eb6a0b698228bf4e89ce5 100644
|
||||
index 69580888047c4ac6abb68873315bcafb78dda706..aa347913a75084f669bf7d89fbcc919b5222c2d5 100644
|
||||
--- a/components/remote_cocoa/app_shim/browser_native_widget_window_mac.mm
|
||||
+++ b/components/remote_cocoa/app_shim/browser_native_widget_window_mac.mm
|
||||
@@ -9,6 +9,7 @@
|
||||
@@ -27,7 +27,7 @@ index b52df712266ca390593d304936f0b979503af3ad..62ded794bd83963f681eb6a0b698228b
|
||||
@implementation BrowserNativeWidgetWindow
|
||||
|
||||
// Prevent detached tabs from glitching when the window is partially offscreen.
|
||||
@@ -82,6 +85,7 @@
|
||||
@@ -84,6 +87,7 @@
|
||||
|
||||
// NSWindow (PrivateAPI) overrides.
|
||||
|
||||
@@ -35,7 +35,7 @@ index b52df712266ca390593d304936f0b979503af3ad..62ded794bd83963f681eb6a0b698228b
|
||||
+ (Class)frameViewClassForStyleMask:(NSUInteger)windowStyle {
|
||||
// - NSThemeFrame and its subclasses will be nil if it's missing at runtime.
|
||||
if ([BrowserWindowFrame class])
|
||||
@@ -96,6 +100,8 @@
|
||||
@@ -98,6 +102,8 @@
|
||||
return NO;
|
||||
}
|
||||
|
||||
@@ -98,10 +98,10 @@ index e03bbc724cfd01967e71998394361556df1c4915..783745b11365c04c1e1052197d20d494
|
||||
// The NSWindow used by BridgedNativeWidget. Provides hooks into AppKit that
|
||||
// can only be accomplished by overriding methods.
|
||||
diff --git a/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm b/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm
|
||||
index 757c72d98de11f611309f4f5af8d0d9aab639181..a6319a0760308df6bac6b39ad3500ad77c1b6525 100644
|
||||
index 5e5a39c2920b748823d21f15bc054733d7aa6441..980c4cef13bacb46e92264bf38f3934626515190 100644
|
||||
--- a/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm
|
||||
+++ b/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm
|
||||
@@ -16,7 +16,9 @@
|
||||
@@ -15,7 +15,9 @@
|
||||
#import "ui/base/cocoa/window_size_constants.h"
|
||||
|
||||
@interface NSWindow (Private)
|
||||
@@ -111,7 +111,7 @@ index 757c72d98de11f611309f4f5af8d0d9aab639181..a6319a0760308df6bac6b39ad3500ad7
|
||||
- (BOOL)hasKeyAppearance;
|
||||
- (long long)_resizeDirectionForMouseLocation:(CGPoint)location;
|
||||
- (BOOL)_isConsideredOpenForPersistentState;
|
||||
@@ -58,6 +60,8 @@
|
||||
@@ -57,6 +59,8 @@
|
||||
}
|
||||
@end
|
||||
|
||||
@@ -119,8 +119,8 @@ index 757c72d98de11f611309f4f5af8d0d9aab639181..a6319a0760308df6bac6b39ad3500ad7
|
||||
+
|
||||
@implementation NativeWidgetMacNSWindowTitledFrame
|
||||
- (void)mouseDown:(NSEvent*)event {
|
||||
if (base::mac::IsAtMostOS10_11() && self.window.isMovable)
|
||||
@@ -84,6 +88,8 @@
|
||||
if (self.window.isMovable)
|
||||
@@ -83,6 +87,8 @@
|
||||
}
|
||||
@end
|
||||
|
||||
@@ -129,7 +129,7 @@ index 757c72d98de11f611309f4f5af8d0d9aab639181..a6319a0760308df6bac6b39ad3500ad7
|
||||
@implementation NativeWidgetMacNSWindow {
|
||||
@private
|
||||
base::scoped_nsobject<CommandDispatcher> _commandDispatcher;
|
||||
@@ -165,6 +171,8 @@
|
||||
@@ -164,6 +170,8 @@
|
||||
|
||||
// NSWindow overrides.
|
||||
|
||||
@@ -138,7 +138,7 @@ index 757c72d98de11f611309f4f5af8d0d9aab639181..a6319a0760308df6bac6b39ad3500ad7
|
||||
+ (Class)frameViewClassForStyleMask:(NSWindowStyleMask)windowStyle {
|
||||
if (windowStyle & NSWindowStyleMaskTitled) {
|
||||
if (Class customFrame = [NativeWidgetMacNSWindowTitledFrame class])
|
||||
@@ -176,6 +184,8 @@
|
||||
@@ -175,6 +183,8 @@
|
||||
return [super frameViewClassForStyleMask:windowStyle];
|
||||
}
|
||||
|
||||
|
||||
@@ -170,7 +170,7 @@ index 026bb184e3ecf21185900d3102fbbdb4bc9e1100..aef2f3625465d5de36d0ce496f713386
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
diff --git a/ui/base/BUILD.gn b/ui/base/BUILD.gn
|
||||
index 3241093ca37134435507b6cfb7d9663317563860..aace5b11a419cdbb0e257dd3ba2329e9ea013c6a 100644
|
||||
index 1179753aeffe325bc35ee6a730b0a6fde269e909..097ed19949105ad80edc0750c7241697ba87dfe6 100644
|
||||
--- a/ui/base/BUILD.gn
|
||||
+++ b/ui/base/BUILD.gn
|
||||
@@ -311,6 +311,13 @@ jumbo_component("base") {
|
||||
|
||||
@@ -17,7 +17,7 @@ cases where performance improves when disabling remote CoreAnimation (remote
|
||||
CoreAnimation is really only about battery usage).
|
||||
|
||||
diff --git a/gpu/ipc/service/image_transport_surface_overlay_mac.h b/gpu/ipc/service/image_transport_surface_overlay_mac.h
|
||||
index 3307998ec566e24a9050434af4e6e3bb09557d43..456603c97bfc2214b0d08fecd592ff1e2c26ceb6 100644
|
||||
index d565d2ab23d7a42e6787b58103fd40a8675b8e28..4cb9681c1f810a0cbd7f7ef04c4a7c73ca10c2b0 100644
|
||||
--- a/gpu/ipc/service/image_transport_surface_overlay_mac.h
|
||||
+++ b/gpu/ipc/service/image_transport_surface_overlay_mac.h
|
||||
@@ -20,7 +20,9 @@
|
||||
@@ -30,7 +30,7 @@ index 3307998ec566e24a9050434af4e6e3bb09557d43..456603c97bfc2214b0d08fecd592ff1e
|
||||
@class CALayer;
|
||||
|
||||
namespace ui {
|
||||
@@ -111,7 +113,9 @@ class ImageTransportSurfaceOverlayMacBase : public BaseClass,
|
||||
@@ -116,7 +118,9 @@ class ImageTransportSurfaceOverlayMacBase : public BaseClass,
|
||||
base::WeakPtr<ImageTransportSurfaceDelegate> delegate_;
|
||||
|
||||
bool use_remote_layer_api_;
|
||||
@@ -41,7 +41,7 @@ index 3307998ec566e24a9050434af4e6e3bb09557d43..456603c97bfc2214b0d08fecd592ff1e
|
||||
|
||||
gfx::Size pixel_size_;
|
||||
diff --git a/gpu/ipc/service/image_transport_surface_overlay_mac.mm b/gpu/ipc/service/image_transport_surface_overlay_mac.mm
|
||||
index 0823c8a728f62679f076a6237ba4dcc207c5d9bb..5ce94e2e2d696664e75c1aeb30d0177458a27df1 100644
|
||||
index f0dd2928aefcfef71e148e4e5c1e88dd7f9b0724..3461a7839a13f5c34c78b9b13997d5d3e42977a4 100644
|
||||
--- a/gpu/ipc/service/image_transport_surface_overlay_mac.mm
|
||||
+++ b/gpu/ipc/service/image_transport_surface_overlay_mac.mm
|
||||
@@ -51,7 +51,7 @@ ImageTransportSurfaceOverlayMacBase<BaseClass>::
|
||||
@@ -61,7 +61,7 @@ index 0823c8a728f62679f076a6237ba4dcc207c5d9bb..5ce94e2e2d696664e75c1aeb30d01774
|
||||
}
|
||||
|
||||
template <typename BaseClass>
|
||||
@@ -141,7 +142,9 @@ ImageTransportSurfaceOverlayMacBase<BaseClass>::SwapBuffersInternal(
|
||||
@@ -140,7 +141,9 @@ ImageTransportSurfaceOverlayMacBase<BaseClass>::SwapBuffersInternal(
|
||||
"GLImpl", static_cast<int>(gl::GetGLImplementation()),
|
||||
"width", pixel_size_.width());
|
||||
if (use_remote_layer_api_) {
|
||||
|
||||
@@ -7,10 +7,47 @@ Guard usages in blink of private Mac APIs by MAS_BUILD, so they can be
|
||||
excluded for people who want to submit their apps to the Mac App store.
|
||||
|
||||
diff --git a/content/browser/accessibility/accessibility_tree_formatter_mac.mm b/content/browser/accessibility/accessibility_tree_formatter_mac.mm
|
||||
index 177a7321153f68008f7c122b4f73e200feed72e9..f03c4fbad79ea829c440f13885a9005a46bc0640 100644
|
||||
index bc23c9cea294a363c650f234f3b697cd7139b082..7467840b77ee2e3a75b34d1981cdfeef62a4f9fc 100644
|
||||
--- a/content/browser/accessibility/accessibility_tree_formatter_mac.mm
|
||||
+++ b/content/browser/accessibility/accessibility_tree_formatter_mac.mm
|
||||
@@ -449,7 +449,7 @@ base::Value AccessibilityTreeFormatterMac::PopulateObject(
|
||||
@@ -145,7 +145,9 @@ class AccessibilityTreeFormatterMac : public AccessibilityTreeFormatterBase {
|
||||
gfx::NativeViewAccessible PropertyNodeToUIElement(
|
||||
const PropertyNode&,
|
||||
const LineIndexesMap&) const;
|
||||
+ #ifndef MAS_BUILD
|
||||
id PropertyNodeToTextMarker(const PropertyNode&, const LineIndexesMap&) const;
|
||||
+ #endif
|
||||
|
||||
base::Value PopulateSize(const BrowserAccessibilityCocoa*) const;
|
||||
base::Value PopulatePosition(const BrowserAccessibilityCocoa*) const;
|
||||
@@ -337,8 +339,10 @@ AccessibilityTreeFormatterMac::ParamByPropertyNode(
|
||||
param = PropertyNodeToRange(property_node);
|
||||
} else if (property_name == "AXIndexForChildUIElement") { // UIElement
|
||||
param = PropertyNodeToUIElement(property_node, line_indexes_map);
|
||||
+ #ifndef MAS_BUILD
|
||||
} else if (property_name == "AXIndexForTextMarker") { // TextMarker
|
||||
param = PropertyNodeToTextMarker(property_node, line_indexes_map);
|
||||
+ #endif
|
||||
}
|
||||
|
||||
return param;
|
||||
@@ -426,6 +430,7 @@ AccessibilityTreeFormatterMac::PropertyNodeToUIElement(
|
||||
return uielement;
|
||||
}
|
||||
|
||||
+#ifndef MAS_BUILD
|
||||
id AccessibilityTreeFormatterMac::PropertyNodeToTextMarker(
|
||||
const PropertyNode& propnode,
|
||||
const LineIndexesMap& line_indexes_map) const {
|
||||
@@ -466,6 +471,7 @@ id AccessibilityTreeFormatterMac::PropertyNodeToTextMarker(
|
||||
|
||||
return content::AXTextMarkerFrom(anchor_cocoa, *offset, affinity);
|
||||
}
|
||||
+#endif
|
||||
|
||||
base::Value AccessibilityTreeFormatterMac::PopulateSize(
|
||||
const BrowserAccessibilityCocoa* cocoa_node) const {
|
||||
@@ -527,7 +533,7 @@ base::Value AccessibilityTreeFormatterMac::PopulateObject(
|
||||
0 == strcmp([value objCType], @encode(NSRange))) {
|
||||
return PopulateRange([value rangeValue]);
|
||||
}
|
||||
@@ -19,7 +56,7 @@ index 177a7321153f68008f7c122b4f73e200feed72e9..f03c4fbad79ea829c440f13885a9005a
|
||||
// AXTextMarker
|
||||
if (content::IsAXTextMarker(value)) {
|
||||
return PopulateTextPosition(content::AXTextMarkerToPosition(value).get(),
|
||||
@@ -460,7 +460,7 @@ base::Value AccessibilityTreeFormatterMac::PopulateObject(
|
||||
@@ -538,7 +544,7 @@ base::Value AccessibilityTreeFormatterMac::PopulateObject(
|
||||
if (content::IsAXTextMarkerRange(value)) {
|
||||
return PopulateTextMarkerRange(value, line_indexes_map);
|
||||
}
|
||||
@@ -28,7 +65,7 @@ index 177a7321153f68008f7c122b4f73e200feed72e9..f03c4fbad79ea829c440f13885a9005a
|
||||
// Accessible object
|
||||
if ([value isKindOfClass:[BrowserAccessibilityCocoa class]]) {
|
||||
return base::Value(NodeToLineIndex(value, line_indexes_map));
|
||||
@@ -511,7 +511,7 @@ base::Value AccessibilityTreeFormatterMac::PopulateTextPosition(
|
||||
@@ -589,7 +595,7 @@ base::Value AccessibilityTreeFormatterMac::PopulateTextPosition(
|
||||
kConstValuePrefix + affinity);
|
||||
return set;
|
||||
}
|
||||
@@ -37,7 +74,7 @@ index 177a7321153f68008f7c122b4f73e200feed72e9..f03c4fbad79ea829c440f13885a9005a
|
||||
base::Value AccessibilityTreeFormatterMac::PopulateTextMarkerRange(
|
||||
id object,
|
||||
const LineIndexesMap& line_indexes_map) const {
|
||||
@@ -526,7 +526,7 @@ base::Value AccessibilityTreeFormatterMac::PopulateTextMarkerRange(
|
||||
@@ -604,7 +610,7 @@ base::Value AccessibilityTreeFormatterMac::PopulateTextMarkerRange(
|
||||
dict.SetPath("focus", PopulateTextPosition(range.focus(), line_indexes_map));
|
||||
return dict;
|
||||
}
|
||||
@@ -47,10 +84,23 @@ index 177a7321153f68008f7c122b4f73e200feed72e9..f03c4fbad79ea829c440f13885a9005a
|
||||
NSArray* node_array,
|
||||
const LineIndexesMap& line_indexes_map) const {
|
||||
diff --git a/content/browser/accessibility/browser_accessibility_cocoa.h b/content/browser/accessibility/browser_accessibility_cocoa.h
|
||||
index 8e7b652d2eb51ca20672d25465c2f2a42092086d..1bb0d2b7c9ab7a073da8454e328636b0a00277e3 100644
|
||||
index 947a548278067323aabe099986057ed68a8f50ae..7b721327bbe784314f4523bc7164182af3f53299 100644
|
||||
--- a/content/browser/accessibility/browser_accessibility_cocoa.h
|
||||
+++ b/content/browser/accessibility/browser_accessibility_cocoa.h
|
||||
@@ -124,7 +124,9 @@ BrowserAccessibilityPosition::AXRangeType AXTextMarkerRangeToRange(id);
|
||||
@@ -40,10 +40,12 @@ BrowserAccessibilityPosition::AXPositionInstance AXTextMarkerToPosition(id);
|
||||
// Returns browser accessibility range for the given AXTextMarkerRange.
|
||||
BrowserAccessibilityPosition::AXRangeType AXTextMarkerRangeToRange(id);
|
||||
|
||||
+#ifndef MAS_BUILD
|
||||
// Returns AXTextMarker for the given browser accessibility position.
|
||||
id AXTextMarkerFrom(const BrowserAccessibilityCocoa* anchor,
|
||||
int offset,
|
||||
ax::mojom::TextAffinity affinity);
|
||||
+#endif
|
||||
|
||||
} // namespace content
|
||||
|
||||
@@ -129,7 +131,9 @@ id AXTextMarkerFrom(const BrowserAccessibilityCocoa* anchor,
|
||||
@property(nonatomic, readonly) NSNumber* enabled;
|
||||
// Returns a text marker that points to the last character in the document that
|
||||
// can be selected with Voiceover.
|
||||
@@ -60,7 +110,7 @@ index 8e7b652d2eb51ca20672d25465c2f2a42092086d..1bb0d2b7c9ab7a073da8454e328636b0
|
||||
@property(nonatomic, readonly) NSNumber* expanded;
|
||||
@property(nonatomic, readonly) NSNumber* focused;
|
||||
@property(nonatomic, readonly) NSNumber* grabbed;
|
||||
@@ -135,7 +137,9 @@ BrowserAccessibilityPosition::AXRangeType AXTextMarkerRangeToRange(id);
|
||||
@@ -140,7 +144,9 @@ id AXTextMarkerFrom(const BrowserAccessibilityCocoa* anchor,
|
||||
@property(nonatomic, readonly, getter=isIgnored) BOOL ignored;
|
||||
// Index of a row, column, or tree item.
|
||||
@property(nonatomic, readonly) NSNumber* index;
|
||||
@@ -70,7 +120,7 @@ index 8e7b652d2eb51ca20672d25465c2f2a42092086d..1bb0d2b7c9ab7a073da8454e328636b0
|
||||
@property(nonatomic, readonly) NSString* invalid;
|
||||
@property(nonatomic, readonly) NSNumber* isMultiSelectable;
|
||||
@property(nonatomic, readonly) NSString* placeholderValue;
|
||||
@@ -158,14 +162,18 @@ BrowserAccessibilityPosition::AXRangeType AXTextMarkerRangeToRange(id);
|
||||
@@ -163,14 +169,18 @@ id AXTextMarkerFrom(const BrowserAccessibilityCocoa* anchor,
|
||||
// The object is selected as a whole.
|
||||
@property(nonatomic, readonly) NSNumber* selected;
|
||||
@property(nonatomic, readonly) NSArray* selectedChildren;
|
||||
@@ -90,7 +140,7 @@ index 8e7b652d2eb51ca20672d25465c2f2a42092086d..1bb0d2b7c9ab7a073da8454e328636b0
|
||||
// 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 ce1d034e40fbf907c18684711c36d8f428d174ff..5fd67af11106ef1e0bb093078d78d6451651d418 100644
|
||||
index 8e2592948d64afc2d1b3944085e769f5d2a9d337..eae637ff66da54ec2cba43107504ee3133d5fb2c 100644
|
||||
--- a/content/browser/accessibility/browser_accessibility_cocoa.mm
|
||||
+++ b/content/browser/accessibility/browser_accessibility_cocoa.mm
|
||||
@@ -208,6 +208,7 @@ NSString* const
|
||||
@@ -133,16 +183,15 @@ index ce1d034e40fbf907c18684711c36d8f428d174ff..5fd67af11106ef1e0bb093078d78d645
|
||||
bool content::IsAXTextMarker(id object) {
|
||||
if (object == nil)
|
||||
return false;
|
||||
@@ -755,7 +760,7 @@ BrowserAccessibilityPosition::AXRangeType
|
||||
content::AXTextMarkerRangeToRange(id text_marker_range) {
|
||||
return CreateRangeFromTextMarkerRange(text_marker_range);
|
||||
@@ -765,6 +770,7 @@ id content::AXTextMarkerFrom(const BrowserAccessibilityCocoa* anchor,
|
||||
return CreateTextMarker(std::move(position));
|
||||
}
|
||||
-
|
||||
|
||||
+#endif
|
||||
@implementation BrowserAccessibilityCocoa
|
||||
|
||||
+ (void)initialize {
|
||||
@@ -792,7 +797,9 @@ content::AXTextMarkerRangeToRange(id text_marker_range) {
|
||||
@@ -801,7 +807,9 @@ id content::AXTextMarkerFrom(const BrowserAccessibilityCocoa* anchor,
|
||||
{NSAccessibilityEditableAncestorAttribute, @"editableAncestor"},
|
||||
{NSAccessibilityElementBusyAttribute, @"elementBusy"},
|
||||
{NSAccessibilityEnabledAttribute, @"enabled"},
|
||||
@@ -152,7 +201,7 @@ index ce1d034e40fbf907c18684711c36d8f428d174ff..5fd67af11106ef1e0bb093078d78d645
|
||||
{NSAccessibilityExpandedAttribute, @"expanded"},
|
||||
{NSAccessibilityFocusableAncestorAttribute, @"focusableAncestor"},
|
||||
{NSAccessibilityFocusedAttribute, @"focused"},
|
||||
@@ -804,8 +811,10 @@ content::AXTextMarkerRangeToRange(id text_marker_range) {
|
||||
@@ -813,8 +821,10 @@ id content::AXTextMarkerFrom(const BrowserAccessibilityCocoa* anchor,
|
||||
{NSAccessibilityHighestEditableAncestorAttribute,
|
||||
@"highestEditableAncestor"},
|
||||
{NSAccessibilityIndexAttribute, @"index"},
|
||||
@@ -163,7 +212,7 @@ index ce1d034e40fbf907c18684711c36d8f428d174ff..5fd67af11106ef1e0bb093078d78d645
|
||||
{NSAccessibilityInvalidAttribute, @"invalid"},
|
||||
{NSAccessibilityIsMultiSelectableAttribute, @"isMultiSelectable"},
|
||||
{NSAccessibilityLanguageAttribute, @"language"},
|
||||
@@ -827,13 +836,17 @@ content::AXTextMarkerRangeToRange(id text_marker_range) {
|
||||
@@ -836,13 +846,17 @@ id content::AXTextMarkerFrom(const BrowserAccessibilityCocoa* anchor,
|
||||
{NSAccessibilityRowsAttribute, @"rows"},
|
||||
// TODO(aboxhall): expose
|
||||
// NSAccessibilityServesAsTitleForUIElementsAttribute
|
||||
@@ -181,7 +230,7 @@ index ce1d034e40fbf907c18684711c36d8f428d174ff..5fd67af11106ef1e0bb093078d78d645
|
||||
{NSAccessibilitySizeAttribute, @"size"},
|
||||
{NSAccessibilitySortDirectionAttribute, @"sortDirection"},
|
||||
{NSAccessibilitySubroleAttribute, @"subrole"},
|
||||
@@ -1321,6 +1334,7 @@ content::AXTextMarkerRangeToRange(id text_marker_range) {
|
||||
@@ -1330,6 +1344,7 @@ id content::AXTextMarkerFrom(const BrowserAccessibilityCocoa* anchor,
|
||||
ax::mojom::Restriction::kDisabled];
|
||||
}
|
||||
|
||||
@@ -189,7 +238,7 @@ index ce1d034e40fbf907c18684711c36d8f428d174ff..5fd67af11106ef1e0bb093078d78d645
|
||||
// Returns a text marker that points to the last character in the document that
|
||||
// can be selected with VoiceOver.
|
||||
- (id)endTextMarker {
|
||||
@@ -1331,6 +1345,7 @@ content::AXTextMarkerRangeToRange(id text_marker_range) {
|
||||
@@ -1340,6 +1355,7 @@ id content::AXTextMarkerFrom(const BrowserAccessibilityCocoa* anchor,
|
||||
BrowserAccessibilityPositionInstance position = root->CreatePositionAt(0);
|
||||
return CreateTextMarker(position->CreatePositionAtEndOfAnchor());
|
||||
}
|
||||
@@ -197,7 +246,7 @@ index ce1d034e40fbf907c18684711c36d8f428d174ff..5fd67af11106ef1e0bb093078d78d645
|
||||
|
||||
- (NSNumber*)expanded {
|
||||
if (![self instanceActive])
|
||||
@@ -1480,6 +1495,8 @@ content::AXTextMarkerRangeToRange(id text_marker_range) {
|
||||
@@ -1489,6 +1505,8 @@ id content::AXTextMarkerFrom(const BrowserAccessibilityCocoa* anchor,
|
||||
return nil;
|
||||
}
|
||||
|
||||
@@ -206,7 +255,7 @@ index ce1d034e40fbf907c18684711c36d8f428d174ff..5fd67af11106ef1e0bb093078d78d645
|
||||
- (NSNumber*)insertionPointLineNumber {
|
||||
if (![self instanceActive])
|
||||
return nil;
|
||||
@@ -1502,6 +1519,7 @@ content::AXTextMarkerRangeToRange(id text_marker_range) {
|
||||
@@ -1511,6 +1529,7 @@ id content::AXTextMarkerFrom(const BrowserAccessibilityCocoa* anchor,
|
||||
caretPosition->AsTextPosition()->text_offset());
|
||||
return @(std::distance(lineBreaks.begin(), iterator));
|
||||
}
|
||||
@@ -214,7 +263,7 @@ index ce1d034e40fbf907c18684711c36d8f428d174ff..5fd67af11106ef1e0bb093078d78d645
|
||||
|
||||
// Returns whether or not this node should be ignored in the
|
||||
// accessibility tree.
|
||||
@@ -2178,6 +2196,7 @@ content::AXTextMarkerRangeToRange(id text_marker_range) {
|
||||
@@ -2204,6 +2223,7 @@ id content::AXTextMarkerFrom(const BrowserAccessibilityCocoa* anchor,
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -222,7 +271,7 @@ index ce1d034e40fbf907c18684711c36d8f428d174ff..5fd67af11106ef1e0bb093078d78d645
|
||||
- (NSString*)selectedText {
|
||||
if (![self instanceActive])
|
||||
return nil;
|
||||
@@ -2189,11 +2208,13 @@ content::AXTextMarkerRangeToRange(id text_marker_range) {
|
||||
@@ -2215,11 +2235,13 @@ id content::AXTextMarkerFrom(const BrowserAccessibilityCocoa* anchor,
|
||||
return nil;
|
||||
return base::SysUTF16ToNSString(range.GetText());
|
||||
}
|
||||
@@ -236,7 +285,7 @@ index ce1d034e40fbf907c18684711c36d8f428d174ff..5fd67af11106ef1e0bb093078d78d645
|
||||
- (NSValue*)selectedTextRange {
|
||||
if (![self instanceActive])
|
||||
return nil;
|
||||
@@ -2214,12 +2235,15 @@ content::AXTextMarkerRangeToRange(id text_marker_range) {
|
||||
@@ -2240,12 +2262,15 @@ id content::AXTextMarkerFrom(const BrowserAccessibilityCocoa* anchor,
|
||||
int selLength = range.GetText().length();
|
||||
return [NSValue valueWithRange:NSMakeRange(selStart, selLength)];
|
||||
}
|
||||
@@ -252,7 +301,7 @@ index ce1d034e40fbf907c18684711c36d8f428d174ff..5fd67af11106ef1e0bb093078d78d645
|
||||
|
||||
- (NSValue*)size {
|
||||
if (![self instanceActive])
|
||||
@@ -2252,6 +2276,7 @@ content::AXTextMarkerRangeToRange(id text_marker_range) {
|
||||
@@ -2278,6 +2303,7 @@ id content::AXTextMarkerFrom(const BrowserAccessibilityCocoa* anchor,
|
||||
return nil;
|
||||
}
|
||||
|
||||
@@ -260,7 +309,7 @@ index ce1d034e40fbf907c18684711c36d8f428d174ff..5fd67af11106ef1e0bb093078d78d645
|
||||
// Returns a text marker that points to the first character in the document that
|
||||
// can be selected with VoiceOver.
|
||||
- (id)startTextMarker {
|
||||
@@ -2262,6 +2287,7 @@ content::AXTextMarkerRangeToRange(id text_marker_range) {
|
||||
@@ -2288,6 +2314,7 @@ id content::AXTextMarkerFrom(const BrowserAccessibilityCocoa* anchor,
|
||||
BrowserAccessibilityPositionInstance position = root->CreatePositionAt(0);
|
||||
return CreateTextMarker(position->CreatePositionAtStartOfAnchor());
|
||||
}
|
||||
@@ -268,7 +317,7 @@ index ce1d034e40fbf907c18684711c36d8f428d174ff..5fd67af11106ef1e0bb093078d78d645
|
||||
|
||||
// Returns a subrole based upon the role.
|
||||
- (NSString*)subrole {
|
||||
@@ -2584,11 +2610,13 @@ content::AXTextMarkerRangeToRange(id text_marker_range) {
|
||||
@@ -2607,11 +2634,13 @@ id content::AXTextMarkerFrom(const BrowserAccessibilityCocoa* anchor,
|
||||
NSMutableAttributedString* attributedInnerText =
|
||||
[[[NSMutableAttributedString alloc]
|
||||
initWithString:base::SysUTF16ToNSString(innerText)] autorelease];
|
||||
@@ -282,7 +331,7 @@ index ce1d034e40fbf907c18684711c36d8f428d174ff..5fd67af11106ef1e0bb093078d78d645
|
||||
|
||||
return [attributedInnerText attributedSubstringFromRange:range];
|
||||
}
|
||||
@@ -2692,9 +2720,8 @@ content::AXTextMarkerRangeToRange(id text_marker_range) {
|
||||
@@ -2715,9 +2744,8 @@ id content::AXTextMarkerFrom(const BrowserAccessibilityCocoa* anchor,
|
||||
return ToBrowserAccessibilityCocoa(cell);
|
||||
}
|
||||
|
||||
@@ -294,7 +343,7 @@ index ce1d034e40fbf907c18684711c36d8f428d174ff..5fd67af11106ef1e0bb093078d78d645
|
||||
BrowserAccessibilityPositionInstance position =
|
||||
CreatePositionFromTextMarker(parameter);
|
||||
if (!position->IsNullPosition())
|
||||
@@ -3007,6 +3034,7 @@ content::AXTextMarkerRangeToRange(id text_marker_range) {
|
||||
@@ -3030,6 +3058,7 @@ id content::AXTextMarkerFrom(const BrowserAccessibilityCocoa* anchor,
|
||||
|
||||
return CreateTextMarker(root->CreatePositionAt(index));
|
||||
}
|
||||
@@ -302,7 +351,7 @@ index ce1d034e40fbf907c18684711c36d8f428d174ff..5fd67af11106ef1e0bb093078d78d645
|
||||
|
||||
if ([attribute isEqualToString:
|
||||
NSAccessibilityBoundsForRangeParameterizedAttribute]) {
|
||||
@@ -3042,6 +3070,7 @@ content::AXTextMarkerRangeToRange(id text_marker_range) {
|
||||
@@ -3065,6 +3094,7 @@ id content::AXTextMarkerFrom(const BrowserAccessibilityCocoa* anchor,
|
||||
return nil;
|
||||
}
|
||||
|
||||
@@ -310,7 +359,7 @@ index ce1d034e40fbf907c18684711c36d8f428d174ff..5fd67af11106ef1e0bb093078d78d645
|
||||
if ([attribute
|
||||
isEqualToString:
|
||||
NSAccessibilityLineTextMarkerRangeForTextMarkerParameterizedAttribute]) {
|
||||
@@ -3156,6 +3185,7 @@ content::AXTextMarkerRangeToRange(id text_marker_range) {
|
||||
@@ -3179,6 +3209,7 @@ id content::AXTextMarkerFrom(const BrowserAccessibilityCocoa* anchor,
|
||||
|
||||
return @(child->GetIndexInParent());
|
||||
}
|
||||
@@ -319,7 +368,7 @@ index ce1d034e40fbf907c18684711c36d8f428d174ff..5fd67af11106ef1e0bb093078d78d645
|
||||
return nil;
|
||||
}
|
||||
diff --git a/content/browser/accessibility/browser_accessibility_manager_mac.mm b/content/browser/accessibility/browser_accessibility_manager_mac.mm
|
||||
index 83d0106f0f237dea75dfafe011bf527d97240d0d..462577a0dbd0fcc1baf17acd9678317cb27503fa 100644
|
||||
index 9795a4ce38995a56fac0bad20bfb453cc1de096b..9163ae35ba4dc81cbe9b8d8d4a456e8d36c3eede 100644
|
||||
--- a/content/browser/accessibility/browser_accessibility_manager_mac.mm
|
||||
+++ b/content/browser/accessibility/browser_accessibility_manager_mac.mm
|
||||
@@ -525,6 +525,7 @@ NSDictionary* BrowserAccessibilityManagerMac::
|
||||
@@ -370,6 +419,44 @@ index 28ca1646af0b0cce40d27baec71cbe65adc334fa..bae65c1f485bc02eb9ef2ebf7018af4a
|
||||
}
|
||||
|
||||
} // namespace
|
||||
diff --git a/content/renderer/theme_helper_mac.mm b/content/renderer/theme_helper_mac.mm
|
||||
index 1db129740992672a4e8be8100da18b6813f1a4f8..5b1e456020ac859c826dbef2826cacf3bb60108b 100644
|
||||
--- a/content/renderer/theme_helper_mac.mm
|
||||
+++ b/content/renderer/theme_helper_mac.mm
|
||||
@@ -7,11 +7,11 @@
|
||||
#include <Cocoa/Cocoa.h>
|
||||
|
||||
#include "base/strings/sys_string_conversions.h"
|
||||
-
|
||||
+#if !defined(MAS_BUILD)
|
||||
extern "C" {
|
||||
bool CGFontRenderingGetFontSmoothingDisabled(void) API_AVAILABLE(macos(10.14));
|
||||
}
|
||||
-
|
||||
+#endif
|
||||
namespace content {
|
||||
|
||||
void SystemColorsDidChange(int aqua_color_variant,
|
||||
@@ -59,8 +59,19 @@ void SystemColorsDidChange(int aqua_color_variant,
|
||||
bool IsSubpixelAntialiasingAvailable() {
|
||||
if (__builtin_available(macOS 10.14, *)) {
|
||||
// See https://trac.webkit.org/changeset/239306/webkit for more info.
|
||||
+#if !defined(MAS_BUILD)
|
||||
return !CGFontRenderingGetFontSmoothingDisabled();
|
||||
+#else
|
||||
+ NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
|
||||
+ NSString *default_key = @"CGFontRenderingGetFontSmoothingDisabled";
|
||||
+ // Check that key exists since boolForKey defaults to NO when the
|
||||
+ // key is missing and this key in fact defaults to YES;
|
||||
+ if ([defaults objectForKey:default_key] == nil)
|
||||
+ return false;
|
||||
+ return ![defaults boolForKey:default_key];
|
||||
+#endif
|
||||
}
|
||||
+
|
||||
return true;
|
||||
}
|
||||
|
||||
diff --git a/device/bluetooth/bluetooth_adapter_mac.mm b/device/bluetooth/bluetooth_adapter_mac.mm
|
||||
index b29b68be6fa6b0329ed03c2d9011690c5e6f83c5..3a8aca70701534d19cdf1655da18811473e42ea4 100644
|
||||
--- a/device/bluetooth/bluetooth_adapter_mac.mm
|
||||
|
||||
@@ -7,7 +7,7 @@ This adds a callback from the network service that's used to implement
|
||||
session.setCertificateVerifyCallback.
|
||||
|
||||
diff --git a/services/network/network_context.cc b/services/network/network_context.cc
|
||||
index f29891cb543999a5ed83ceb8130661ddbde5f1a6..a07176cf0fd3c7160922e7f9919e775cb3b6fe71 100644
|
||||
index 3bb208bad23cd3247f95305104a856e9d0bbc396..170ba3cf6176e8423b6009a0ac0299bf1e411158 100644
|
||||
--- a/services/network/network_context.cc
|
||||
+++ b/services/network/network_context.cc
|
||||
@@ -114,6 +114,11 @@
|
||||
@@ -22,7 +22,7 @@ index f29891cb543999a5ed83ceb8130661ddbde5f1a6..a07176cf0fd3c7160922e7f9919e775c
|
||||
#if BUILDFLAG(IS_CT_SUPPORTED)
|
||||
#include "components/certificate_transparency/chrome_ct_policy_enforcer.h"
|
||||
#include "components/certificate_transparency/chrome_require_ct_delegate.h"
|
||||
@@ -325,6 +330,79 @@ std::string HashesToBase64String(const net::HashValueVector& hashes) {
|
||||
@@ -324,6 +329,79 @@ std::string HashesToBase64String(const net::HashValueVector& hashes) {
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -102,7 +102,7 @@ index f29891cb543999a5ed83ceb8130661ddbde5f1a6..a07176cf0fd3c7160922e7f9919e775c
|
||||
constexpr uint32_t NetworkContext::kMaxOutstandingRequestsPerProcess;
|
||||
|
||||
NetworkContext::PendingCertVerify::PendingCertVerify() = default;
|
||||
@@ -519,6 +597,13 @@ void NetworkContext::SetClient(
|
||||
@@ -518,6 +596,13 @@ void NetworkContext::SetClient(
|
||||
client_.Bind(std::move(client));
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ index f29891cb543999a5ed83ceb8130661ddbde5f1a6..a07176cf0fd3c7160922e7f9919e775c
|
||||
void NetworkContext::CreateURLLoaderFactory(
|
||||
mojo::PendingReceiver<mojom::URLLoaderFactory> receiver,
|
||||
mojom::URLLoaderFactoryParamsPtr params) {
|
||||
@@ -1729,8 +1814,9 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext(
|
||||
@@ -1723,8 +1808,9 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext(
|
||||
"NetworkContext should pass CertVerifierServiceRemoteParams.";
|
||||
|
||||
std::unique_ptr<net::CertVerifier> cert_verifier;
|
||||
@@ -127,7 +127,7 @@ index f29891cb543999a5ed83ceb8130661ddbde5f1a6..a07176cf0fd3c7160922e7f9919e775c
|
||||
} else {
|
||||
if (params_->cert_verifier_params &&
|
||||
params_->cert_verifier_params->is_remote_params()) {
|
||||
@@ -1763,14 +1849,14 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext(
|
||||
@@ -1752,14 +1838,14 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext(
|
||||
cert_net_fetcher_ =
|
||||
base::MakeRefCounted<net::CertNetFetcherURLRequest>();
|
||||
|
||||
@@ -145,7 +145,7 @@ index f29891cb543999a5ed83ceb8130661ddbde5f1a6..a07176cf0fd3c7160922e7f9919e775c
|
||||
|
||||
#if defined(OS_CHROMEOS)
|
||||
cert_verifier_with_trust_anchors_ =
|
||||
@@ -1779,13 +1865,27 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext(
|
||||
@@ -1768,13 +1854,27 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext(
|
||||
UpdateAdditionalCertificates(
|
||||
std::move(params_->initial_additional_certificates));
|
||||
cert_verifier_with_trust_anchors_->InitializeOnIOThread(
|
||||
@@ -178,7 +178,7 @@ index f29891cb543999a5ed83ceb8130661ddbde5f1a6..a07176cf0fd3c7160922e7f9919e775c
|
||||
std::unique_ptr<NetworkServiceNetworkDelegate> network_delegate =
|
||||
std::make_unique<NetworkServiceNetworkDelegate>(
|
||||
diff --git a/services/network/network_context.h b/services/network/network_context.h
|
||||
index 6989b0367ea1abcd46a110b738adc18227ab6846..dd65d1560daa8fde7d76e0dec8e1cdcb6c76b318 100644
|
||||
index eced38ff04f8d7f3a91079b65f5ad29348bf8813..391a02c108debdd5e5572b4a666d30dc68ece76b 100644
|
||||
--- a/services/network/network_context.h
|
||||
+++ b/services/network/network_context.h
|
||||
@@ -86,6 +86,7 @@ class DomainReliabilityMonitor;
|
||||
@@ -189,7 +189,7 @@ index 6989b0367ea1abcd46a110b738adc18227ab6846..dd65d1560daa8fde7d76e0dec8e1cdcb
|
||||
class CookieManager;
|
||||
class ExpectCTReporter;
|
||||
class HostResolver;
|
||||
@@ -190,6 +191,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
|
||||
@@ -189,6 +190,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
|
||||
void CreateURLLoaderFactory(
|
||||
mojo::PendingReceiver<mojom::URLLoaderFactory> receiver,
|
||||
mojom::URLLoaderFactoryParamsPtr params) override;
|
||||
@@ -198,8 +198,8 @@ index 6989b0367ea1abcd46a110b738adc18227ab6846..dd65d1560daa8fde7d76e0dec8e1cdcb
|
||||
void ResetURLLoaderFactories() override;
|
||||
void GetCookieManager(
|
||||
mojo::PendingReceiver<mojom::CookieManager> receiver) override;
|
||||
@@ -657,6 +660,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
|
||||
std::unique_ptr<network::NSSTempCertsCacheChromeOS> nss_temp_certs_cache_;
|
||||
@@ -653,6 +656,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
|
||||
CertVerifierWithTrustAnchors* cert_verifier_with_trust_anchors_ = nullptr;
|
||||
#endif
|
||||
|
||||
+ RemoteCertVerifier* remote_cert_verifier_ = nullptr;
|
||||
|
||||
@@ -108,7 +108,7 @@ index 4bf25bf1fa69f7d3869369172d375e2e489e62a1..f80ef2cecc8b111dc54e109646573a59
|
||||
mojo::PendingReceiver<blink::mojom::NotificationService> receiver);
|
||||
|
||||
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
|
||||
index 792e359038592c6cb5bc9da319cbd5b383d5ca12..5f73faa60d4e8d8688af6513134a7696fd464026 100644
|
||||
index b3cee953abdb4f8d6991dedaa43b4f8267f44f9d..a2fc5326f7ecc3d0bd57587f78d0e3231c5a49ac 100644
|
||||
--- a/content/browser/renderer_host/render_process_host_impl.cc
|
||||
+++ b/content/browser/renderer_host/render_process_host_impl.cc
|
||||
@@ -2148,7 +2148,7 @@ void RenderProcessHostImpl::CreateNotificationService(
|
||||
|
||||
@@ -31,7 +31,7 @@ index 668a14bff461e83b2c6d9d7f23d9674ff081ef12..674f141e80c0316fd47558c4d428a970
|
||||
using RenderMode = PdfRenderSettings::Mode;
|
||||
RenderMode mode;
|
||||
diff --git a/chrome/browser/printing/print_job_worker.cc b/chrome/browser/printing/print_job_worker.cc
|
||||
index adb208ba3589e32536527219aaf4e89e3ee3311a..301f6416898445eed814d67901254ef8e5915e2a 100644
|
||||
index 52efa2037a31f84a261502107bfebc69ae5a419e..4834e92ae99f12043e5ce476370f64345ad29001 100644
|
||||
--- a/chrome/browser/printing/print_job_worker.cc
|
||||
+++ b/chrome/browser/printing/print_job_worker.cc
|
||||
@@ -20,7 +20,6 @@
|
||||
@@ -50,8 +50,8 @@ index adb208ba3589e32536527219aaf4e89e3ee3311a..301f6416898445eed814d67901254ef8
|
||||
#include "printing/print_job_constants.h"
|
||||
#include "printing/printed_document.h"
|
||||
#include "printing/printing_utils.h"
|
||||
@@ -223,16 +223,21 @@ void PrintJobWorker::UpdatePrintSettings(base::Value new_settings,
|
||||
print_backend->GetPrinterDriverInfo(printer_name));
|
||||
@@ -235,16 +235,21 @@ void PrintJobWorker::UpdatePrintSettings(base::Value new_settings,
|
||||
#endif // defined(OS_LINUX) && defined(USE_CUPS) && !defined(OS_CHROMEOS)
|
||||
}
|
||||
|
||||
- PrintingContext::Result result;
|
||||
@@ -75,7 +75,7 @@ index adb208ba3589e32536527219aaf4e89e3ee3311a..301f6416898445eed814d67901254ef8
|
||||
}
|
||||
|
||||
#if defined(OS_CHROMEOS)
|
||||
@@ -248,6 +253,13 @@ void PrintJobWorker::UpdatePrintSettingsFromPOD(
|
||||
@@ -260,6 +265,13 @@ void PrintJobWorker::UpdatePrintSettingsFromPOD(
|
||||
|
||||
void PrintJobWorker::GetSettingsDone(SettingsCallback callback,
|
||||
PrintingContext::Result result) {
|
||||
@@ -90,7 +90,7 @@ index adb208ba3589e32536527219aaf4e89e3ee3311a..301f6416898445eed814d67901254ef8
|
||||
}
|
||||
|
||||
diff --git a/chrome/browser/printing/print_view_manager_base.cc b/chrome/browser/printing/print_view_manager_base.cc
|
||||
index 8a743d0dd74b087059ff812019ae568a22c5fa01..20c43be03706617a276d210190897dc473bbd0da 100644
|
||||
index 8a743d0dd74b087059ff812019ae568a22c5fa01..617b246ab41a42990e191c6ab548679a240416bd 100644
|
||||
--- a/chrome/browser/printing/print_view_manager_base.cc
|
||||
+++ b/chrome/browser/printing/print_view_manager_base.cc
|
||||
@@ -27,10 +27,7 @@
|
||||
@@ -194,7 +194,19 @@ index 8a743d0dd74b087059ff812019ae568a22c5fa01..20c43be03706617a276d210190897dc4
|
||||
#endif
|
||||
|
||||
ReleasePrinterQuery();
|
||||
@@ -463,9 +476,13 @@ void PrintViewManagerBase::OnNotifyPrintJobEvent(
|
||||
@@ -382,6 +395,11 @@ void PrintViewManagerBase::OnScriptedPrint(
|
||||
}
|
||||
|
||||
void PrintViewManagerBase::OnShowInvalidPrinterSettingsError() {
|
||||
+ if (!callback_.is_null()) {
|
||||
+ std::string cb_str = "Invalid printer settings";
|
||||
+ std::move(callback_).Run(printing_succeeded_, cb_str);
|
||||
+ }
|
||||
+
|
||||
base::ThreadTaskRunnerHandle::Get()->PostTask(
|
||||
FROM_HERE, base::BindOnce(&ShowWarningMessageBox,
|
||||
l10n_util::GetStringUTF16(
|
||||
@@ -463,9 +481,13 @@ void PrintViewManagerBase::OnNotifyPrintJobEvent(
|
||||
content::NotificationService::NoDetails());
|
||||
break;
|
||||
}
|
||||
@@ -210,7 +222,7 @@ index 8a743d0dd74b087059ff812019ae568a22c5fa01..20c43be03706617a276d210190897dc4
|
||||
NOTREACHED();
|
||||
break;
|
||||
}
|
||||
@@ -560,8 +577,10 @@ bool PrintViewManagerBase::CreateNewPrintJob(
|
||||
@@ -560,8 +582,10 @@ bool PrintViewManagerBase::CreateNewPrintJob(
|
||||
DCHECK(!quit_inner_loop_);
|
||||
DCHECK(query);
|
||||
|
||||
@@ -223,7 +235,7 @@ index 8a743d0dd74b087059ff812019ae568a22c5fa01..20c43be03706617a276d210190897dc4
|
||||
|
||||
// We can't print if there is no renderer.
|
||||
if (!web_contents()->GetRenderViewHost() ||
|
||||
@@ -582,8 +601,6 @@ bool PrintViewManagerBase::CreateNewPrintJob(
|
||||
@@ -582,8 +606,6 @@ bool PrintViewManagerBase::CreateNewPrintJob(
|
||||
print_job_->SetSource(source, /*source_id=*/"");
|
||||
#endif
|
||||
|
||||
@@ -232,11 +244,13 @@ index 8a743d0dd74b087059ff812019ae568a22c5fa01..20c43be03706617a276d210190897dc4
|
||||
printing_succeeded_ = false;
|
||||
return true;
|
||||
}
|
||||
@@ -632,14 +649,22 @@ void PrintViewManagerBase::ReleasePrintJob() {
|
||||
@@ -632,6 +654,15 @@ void PrintViewManagerBase::ReleasePrintJob() {
|
||||
content::RenderFrameHost* rfh = printing_rfh_;
|
||||
printing_rfh_ = nullptr;
|
||||
|
||||
+ if (!callback_.is_null()) {
|
||||
+ registrar_.Remove(this, chrome::NOTIFICATION_PRINT_JOB_EVENT,
|
||||
+ content::NotificationService::AllSources());
|
||||
+ std::string cb_str = "";
|
||||
+ if (!printing_succeeded_)
|
||||
+ cb_str = printing_cancelled_ ? "cancelled" : "failed";
|
||||
@@ -246,18 +260,7 @@ index 8a743d0dd74b087059ff812019ae568a22c5fa01..20c43be03706617a276d210190897dc4
|
||||
if (!print_job_)
|
||||
return;
|
||||
|
||||
if (rfh)
|
||||
GetPrintRenderFrame(rfh)->PrintingDone(printing_succeeded_);
|
||||
|
||||
- registrar_.Remove(this, chrome::NOTIFICATION_PRINT_JOB_EVENT,
|
||||
- content::Source<PrintJob>(print_job_.get()));
|
||||
+ if (!callback_.is_null())
|
||||
+ registrar_.Remove(this, chrome::NOTIFICATION_PRINT_JOB_EVENT,
|
||||
+ content::NotificationService::AllSources());
|
||||
// Don't close the worker thread.
|
||||
print_job_ = nullptr;
|
||||
}
|
||||
@@ -675,7 +700,7 @@ bool PrintViewManagerBase::RunInnerMessageLoop() {
|
||||
@@ -675,7 +706,7 @@ bool PrintViewManagerBase::RunInnerMessageLoop() {
|
||||
}
|
||||
|
||||
bool PrintViewManagerBase::OpportunisticallyCreatePrintJob(int cookie) {
|
||||
@@ -433,7 +436,7 @@ index faccd2a6881b74f1fa6538fc1011071ac54b03e0..342fba6eb86ee803aae6f11826ee5ccc
|
||||
// Tells the RenderFrame to switch the CSS to print media type, render every
|
||||
// requested page using the print preview document's frame/node, and then
|
||||
diff --git a/components/printing/renderer/print_render_frame_helper.cc b/components/printing/renderer/print_render_frame_helper.cc
|
||||
index bb02f228d604976a668eb8ffa39f49e659975272..7406760e1c0247899232fc96614cfb2359ade432 100644
|
||||
index 3797c58b29136c22f9545cfb64a5ce50d7f3b07a..c0107f561f444d537735d4725c6dbecbcaf45226 100644
|
||||
--- a/components/printing/renderer/print_render_frame_helper.cc
|
||||
+++ b/components/printing/renderer/print_render_frame_helper.cc
|
||||
@@ -44,6 +44,7 @@
|
||||
@@ -444,7 +447,7 @@ index bb02f228d604976a668eb8ffa39f49e659975272..7406760e1c0247899232fc96614cfb23
|
||||
#include "printing/units.h"
|
||||
#include "third_party/blink/public/common/associated_interfaces/associated_interface_registry.h"
|
||||
#include "third_party/blink/public/common/css/page_orientation.h"
|
||||
@@ -1173,7 +1174,8 @@ void PrintRenderFrameHelper::ScriptedPrint(bool user_initiated) {
|
||||
@@ -1157,7 +1158,8 @@ void PrintRenderFrameHelper::ScriptedPrint(bool user_initiated) {
|
||||
web_frame->DispatchBeforePrintEvent();
|
||||
if (!weak_this)
|
||||
return;
|
||||
@@ -454,7 +457,7 @@ index bb02f228d604976a668eb8ffa39f49e659975272..7406760e1c0247899232fc96614cfb23
|
||||
if (weak_this)
|
||||
web_frame->DispatchAfterPrintEvent();
|
||||
}
|
||||
@@ -1194,7 +1196,7 @@ void PrintRenderFrameHelper::BindPrintRenderFrameReceiver(
|
||||
@@ -1178,7 +1180,7 @@ void PrintRenderFrameHelper::BindPrintRenderFrameReceiver(
|
||||
receivers_.Add(this, std::move(receiver));
|
||||
}
|
||||
|
||||
@@ -463,7 +466,7 @@ index bb02f228d604976a668eb8ffa39f49e659975272..7406760e1c0247899232fc96614cfb23
|
||||
ScopedIPC scoped_ipc(weak_ptr_factory_.GetWeakPtr());
|
||||
if (ipc_nesting_level_ > 1)
|
||||
return;
|
||||
@@ -1208,7 +1210,7 @@ void PrintRenderFrameHelper::PrintRequestedPages() {
|
||||
@@ -1192,7 +1194,7 @@ void PrintRenderFrameHelper::PrintRequestedPages() {
|
||||
// If we are printing a PDF extension frame, find the plugin node and print
|
||||
// that instead.
|
||||
auto plugin = delegate_->GetPdfElement(frame);
|
||||
@@ -472,7 +475,7 @@ index bb02f228d604976a668eb8ffa39f49e659975272..7406760e1c0247899232fc96614cfb23
|
||||
if (!render_frame_gone_)
|
||||
frame->DispatchAfterPrintEvent();
|
||||
// WARNING: |this| may be gone at this point. Do not do any more work here and
|
||||
@@ -1225,7 +1227,7 @@ void PrintRenderFrameHelper::PrintForSystemDialog() {
|
||||
@@ -1209,7 +1211,7 @@ void PrintRenderFrameHelper::PrintForSystemDialog() {
|
||||
return;
|
||||
}
|
||||
Print(frame, print_preview_context_.source_node(),
|
||||
@@ -481,7 +484,7 @@ index bb02f228d604976a668eb8ffa39f49e659975272..7406760e1c0247899232fc96614cfb23
|
||||
if (!render_frame_gone_)
|
||||
frame->DispatchAfterPrintEvent();
|
||||
// WARNING: |this| may be gone at this point. Do not do any more work here and
|
||||
@@ -1273,6 +1275,8 @@ void PrintRenderFrameHelper::PrintPreview(base::Value settings) {
|
||||
@@ -1257,6 +1259,8 @@ void PrintRenderFrameHelper::PrintPreview(base::Value settings) {
|
||||
if (ipc_nesting_level_ > 1)
|
||||
return;
|
||||
|
||||
@@ -490,7 +493,7 @@ index bb02f228d604976a668eb8ffa39f49e659975272..7406760e1c0247899232fc96614cfb23
|
||||
print_preview_context_.OnPrintPreview();
|
||||
|
||||
if (print_preview_context_.IsForArc()) {
|
||||
@@ -1790,7 +1794,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
|
||||
@@ -1774,7 +1778,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
|
||||
|
||||
auto self = weak_ptr_factory_.GetWeakPtr();
|
||||
Print(duplicate_node.GetDocument().GetFrame(), duplicate_node,
|
||||
@@ -501,7 +504,7 @@ index bb02f228d604976a668eb8ffa39f49e659975272..7406760e1c0247899232fc96614cfb23
|
||||
// Check if |this| is still valid.
|
||||
if (!self)
|
||||
return;
|
||||
@@ -1801,7 +1807,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
|
||||
@@ -1785,7 +1791,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
|
||||
|
||||
void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
|
||||
const blink::WebNode& node,
|
||||
@@ -512,7 +515,7 @@ index bb02f228d604976a668eb8ffa39f49e659975272..7406760e1c0247899232fc96614cfb23
|
||||
// If still not finished with earlier print request simply ignore.
|
||||
if (prep_frame_view_)
|
||||
return;
|
||||
@@ -1809,7 +1817,7 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
|
||||
@@ -1793,7 +1801,7 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
|
||||
FrameReference frame_ref(frame);
|
||||
|
||||
int expected_page_count = 0;
|
||||
@@ -521,7 +524,7 @@ index bb02f228d604976a668eb8ffa39f49e659975272..7406760e1c0247899232fc96614cfb23
|
||||
DidFinishPrinting(FAIL_PRINT_INIT);
|
||||
return; // Failed to init print page settings.
|
||||
}
|
||||
@@ -1829,8 +1837,11 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
|
||||
@@ -1813,8 +1821,11 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
|
||||
|
||||
PrintMsg_PrintPages_Params print_settings;
|
||||
auto self = weak_ptr_factory_.GetWeakPtr();
|
||||
@@ -535,7 +538,7 @@ index bb02f228d604976a668eb8ffa39f49e659975272..7406760e1c0247899232fc96614cfb23
|
||||
// Check if |this| is still valid.
|
||||
if (!self)
|
||||
return;
|
||||
@@ -2065,10 +2076,23 @@ void PrintRenderFrameHelper::IPCProcessed() {
|
||||
@@ -2049,10 +2060,23 @@ void PrintRenderFrameHelper::IPCProcessed() {
|
||||
base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, this);
|
||||
}
|
||||
|
||||
@@ -562,7 +565,7 @@ index bb02f228d604976a668eb8ffa39f49e659975272..7406760e1c0247899232fc96614cfb23
|
||||
// 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.
|
||||
@@ -2088,12 +2112,14 @@ bool PrintRenderFrameHelper::InitPrintSettings(bool fit_to_paper_size) {
|
||||
@@ -2072,12 +2096,14 @@ bool PrintRenderFrameHelper::InitPrintSettings(bool fit_to_paper_size) {
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -582,7 +585,7 @@ index bb02f228d604976a668eb8ffa39f49e659975272..7406760e1c0247899232fc96614cfb23
|
||||
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 674e43487837d858c4f90a111ab1e3f17fa71536..3dbe53f290779ed116744853857a3eae59b8751e 100644
|
||||
index e6d759d06c0b8f39c7f02b680d70c5eb6faf2888..be412a35088e8463b39647c9d814f8b00867f71d 100644
|
||||
--- a/components/printing/renderer/print_render_frame_helper.h
|
||||
+++ b/components/printing/renderer/print_render_frame_helper.h
|
||||
@@ -225,7 +225,7 @@ class PrintRenderFrameHelper
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user