Skip to content

Commit

Permalink
Merge branch 'master' into miniak/disable-plugin-sandbox
Browse files Browse the repository at this point in the history
  • Loading branch information
miniak committed Jul 5, 2019
2 parents f0a64c5 + 87b1dab commit 2efa235
Show file tree
Hide file tree
Showing 220 changed files with 3,597 additions and 1,642 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Expand Up @@ -10,7 +10,7 @@
# Build machines configs.
docker-image: &docker-image
docker:
- image: electronbuilds/electron:0.0.9
- image: electronbuilds/electron:0.0.10

machine-linux-medium: &machine-linux-medium
<<: *docker-image
Expand Down
70 changes: 45 additions & 25 deletions BUILD.gn
@@ -1,6 +1,7 @@
import("//build/config/locales.gni")
import("//build/config/ui.gni")
import("//build/config/win/manifest.gni")
import("//content/public/app/mac_helpers.gni")
import("//pdf/features.gni")
import("//printing/buildflags/buildflags.gni")
import("//third_party/ffmpeg/ffmpeg_options.gni")
Expand Down Expand Up @@ -474,6 +475,7 @@ static_library("electron_lib") {
if (is_mac) {
deps += [
"//components/remote_cocoa/app_shim",
"//content/common:mac_helpers",
"//ui/accelerated_widget_mac",
]
sources += [
Expand Down Expand Up @@ -518,6 +520,7 @@ static_library("electron_lib") {
]
configs += [ ":gio_unix" ]
include_dirs += [ "//third_party/breakpad" ]
configs += [ "//build/config/linux:x11" ]
defines += [
# Disable warnings for g_settings_list_schemas.
"GLIB_DISABLE_DEPRECATION_WARNINGS",
Expand Down Expand Up @@ -800,37 +803,49 @@ if (is_mac) {
}
}

mac_app_bundle("electron_helper_app") {
output_name = electron_helper_name
deps = [
":electron_framework+link",
]
if (!is_mas_build) {
deps += [ "//sandbox/mac:seatbelt" ]
}
defines = [ "HELPER_EXECUTABLE" ]
sources = filenames.app_sources
sources += [ "shell/common/atom_constants.cc" ]
include_dirs = [ "." ]
info_plist = "shell/renderer/resources/mac/Info.plist"
extra_substitutions =
[ "ELECTRON_BUNDLE_ID=$electron_mac_bundle_id.helper" ]
ldflags = [
"-rpath",
"@executable_path/../../..",
]
if (is_component_build) {
ldflags += [
template("electron_helper_app") {
mac_app_bundle(target_name) {
assert(defined(invoker.helper_name_suffix))

output_name = electron_helper_name + invoker.helper_name_suffix
deps = [
":electron_framework+link",
]
if (!is_mas_build) {
deps += [ "//sandbox/mac:seatbelt" ]
}
defines = [ "HELPER_EXECUTABLE" ]
sources = filenames.app_sources
sources += [ "shell/common/atom_constants.cc" ]
include_dirs = [ "." ]
info_plist = "shell/renderer/resources/mac/Info.plist"
extra_substitutions =
[ "ELECTRON_BUNDLE_ID=$electron_mac_bundle_id.helper" ]
ldflags = [
"-rpath",
"@executable_path/../../../../../..",
"@executable_path/../../..",
]
if (is_component_build) {
ldflags += [
"-rpath",
"@executable_path/../../../../../..",
]
}
}
}

foreach(helper_params, content_mac_helpers) {
_helper_target = helper_params[0]
_helper_bundle_id = helper_params[1]
_helper_suffix = helper_params[2]
electron_helper_app("electron_helper_app_${_helper_target}") {
helper_name_suffix = _helper_suffix
}
}

bundle_data("electron_app_framework_bundle_data") {
sources = [
"$root_out_dir/$electron_framework_name.framework",
"$root_out_dir/$electron_helper_name.app",
]
if (!is_mas_build) {
sources += [
Expand All @@ -844,8 +859,13 @@ if (is_mac) {
]
public_deps = [
":electron_framework+link",
":electron_helper_app",
]

foreach(helper_params, content_mac_helpers) {
sources +=
[ "$root_out_dir/${electron_helper_name}${helper_params[2]}.app" ]
public_deps += [ ":electron_helper_app_${helper_params[0]}" ]
}
}

mac_app_bundle("electron_login_helper") {
Expand Down Expand Up @@ -984,7 +1004,6 @@ if (is_mac) {
if (is_win) {
sources += [
# TODO: we should be generating our .rc files more like how chrome does
"shell/browser/resources/win/atom.ico",
"shell/browser/resources/win/atom.rc",
"shell/browser/resources/win/resource.h",
]
Expand Down Expand Up @@ -1012,6 +1031,7 @@ if (is_mac) {
# See https://github.com/nodejs/node-gyp/commit/52ceec3a6d15de3a8f385f43dbe5ecf5456ad07a
ldflags += [ "/DEF:" + rebase_path("build/electron.def", root_build_dir) ]
inputs = [
"shell/browser/resources/win/atom.ico",
"build/electron.def",
]
}
Expand Down
9 changes: 4 additions & 5 deletions DEPS
Expand Up @@ -10,11 +10,11 @@ gclient_gn_args = [

vars = {
'chromium_version':
'f200986dfaabd6aad6a4b37dad7aae42fec349e9',
'37cd06a295cf156cb7658ec5382f5623a05841c6',
'node_version':
'0a300f60bce0c8f0cb3d846fcb0e1f55f26013ee',
'780436005ffc7f317abfba48b236428858284e99',
'nan_version':
'960dd6c70fc9eb136efdf37b4bef18fadbc3436f',
'2ee313aaca52e2b478965ac50eb5082520380d1b',

'boto_version': 'f7574aa6cc2c819430c1f05e9a1a1a666ef8169b',
'pyyaml_version': '3.12',
Expand All @@ -23,8 +23,7 @@ vars = {
'boto_git': 'https://github.com/boto',
'chromium_git': 'https://chromium.googlesource.com',
'electron_git': 'https://github.com/electron',
# FIXME: Once https://github.com/nodejs/nan/pull/857 lands this should point at nodejs/nan
'nodejs_git': 'https://github.com/marshallofsound',
'nodejs_git': 'https://github.com/nodejs',
'requests_git': 'https://github.com/kennethreitz',
'yaml_git': 'https://github.com/yaml',

Expand Down
3 changes: 3 additions & 0 deletions Dockerfile
Expand Up @@ -10,6 +10,7 @@ RUN chmod a+rwx /tmp
# Install Linux packages
ADD build/install-build-deps.sh /setup/install-build-deps.sh
RUN echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | debconf-set-selections
RUN dpkg --add-architecture i386
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
curl \
libnotify-bin \
Expand All @@ -22,6 +23,8 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
sudo \
vim-nox \
wget \
g++-multilib \
libgl1:i386 \
&& /setup/install-build-deps.sh --syms --no-prompt --no-chromeos-fonts --lib32 --arm \
&& rm -rf /var/lib/apt/lists/*

Expand Down
2 changes: 1 addition & 1 deletion ELECTRON_VERSION
@@ -1 +1 @@
7.0.0-nightly.20190626
7.0.0-nightly.20190704
4 changes: 2 additions & 2 deletions appveyor.yml
Expand Up @@ -29,7 +29,7 @@

version: 1.0.{build}
build_cloud: libcc-20
image: libcc-20-vs2017-15.9
image: vs2017-15.9-10.0.18362
environment:
GIT_CACHE_PATH: C:\Users\electron\libcc_cache
ELECTRON_OUT_DIR: Default
Expand All @@ -52,7 +52,7 @@ build_script:
- echo "Building $env:GN_CONFIG build"
- git config --global core.longpaths true
- cd ..
- ps: if (Test-Path src\electron) { Remove-Item src\electron -Recurse }
- mkdir src
- ps: Move-Item $env:APPVEYOR_BUILD_FOLDER -Destination src\electron
- ps: $env:CHROMIUM_BUILDTOOLS_PATH="$pwd\src\buildtools"
- ps: $env:SCCACHE_PATH="$pwd\src\electron\external_binaries\sccache.exe"
Expand Down
4 changes: 4 additions & 0 deletions chromium_src/BUILD.gn
Expand Up @@ -102,6 +102,10 @@ static_library("chrome") {
"//chrome/browser/ui/cocoa/color_chooser_mac.h",
"//chrome/browser/ui/cocoa/color_chooser_mac.mm",
]
deps += [
"//components/remote_cocoa/app_shim",
"//components/remote_cocoa/browser",
]
}

if (is_win) {
Expand Down
8 changes: 4 additions & 4 deletions docs/api/app.md
Expand Up @@ -1179,10 +1179,10 @@ Show the app's about panel options. These options can be overridden with `app.se
* `applicationVersion` String (optional) - The app's version.
* `copyright` String (optional) - Copyright information.
* `version` String (optional) - The app's build version number.
* `credits` String (optional) - Credit information. _macOS_
* `authors` String[] (optional) - List of app authors. _Linux_
* `website` String (optional) - The app's website. _Linux_
* `iconPath` String (optional) - Path to the app's icon. Will be shown as 64x64 pixels while retaining aspect ratio. _Linux_
* `credits` String (optional) _macOS_ - Credit information.
* `authors` String[] (optional) _Linux_ - List of app authors.
* `website` String (optional) _Linux_ - The app's website.
* `iconPath` String (optional) _Linux_ - Path to the app's icon. Will be shown as 64x64 pixels while retaining aspect ratio.

Set the about panel options. This will override the values defined in the app's
`.plist` file on MacOS. See the [Apple docs][about-panel-options] for more details. On Linux, values must be set in order to be shown; there are no defaults.
Expand Down
61 changes: 61 additions & 0 deletions docs/api/breaking-changes-ns.md
@@ -0,0 +1,61 @@
# Breaking changes (NetworkService) (Draft)

This document describes changes to Electron APIs after migrating network code
to NetworkService API.

We don't currently have an estimate of when we will enable `NetworkService` by
default in Electron, but as Chromium is already removing non-`NetworkService`
code, we might switch before Electron 10.

The content of this document should be moved to `breaking-changes.md` once we have
determined when to enable `NetworkService` in Electron.

## Planned Breaking API Changes

### `protocol.unregisterProtocol`
### `protocol.uninterceptProtocol`

The APIs are now synchronous and the optional callback is no longer needed.

```javascript
// Deprecated
protocol.unregisterProtocol(scheme, () => { /* ... */ })
// Replace with
protocol.unregisterProtocol(scheme)
```

### `protocol.registerFileProtocol`
### `protocol.registerBufferProtocol`
### `protocol.registerStringProtocol`
### `protocol.registerHttpProtocol`
### `protocol.registerStreamProtocol`
### `protocol.interceptFileProtocol`
### `protocol.interceptStringProtocol`
### `protocol.interceptBufferProtocol`
### `protocol.interceptHttpProtocol`
### `protocol.interceptStreamProtocol`

The APIs are now synchronous and the optional callback is no longer needed.

```javascript
// Deprecated
protocol.registerFileProtocol(scheme, handler, () => { /* ... */ })
// Replace with
protocol.registerFileProtocol(scheme, handler)
```

The registered or intercepted protocol does not have effect on current page
until navigation happens.

### `protocol.isProtocolHandled`

This API is deprecated and users should use `protocol.isProtocolRegistered`
and `protocol.isProtocolIntercepted` instead.

```javascript
// Deprecated
protocol.isProtocolHandled(scheme).then(() => { /* ... */ })
// Replace with
const isRegistered = protocol.isProtocolRegistered(scheme)
const isIntercepted = protocol.isProtocolIntercepted(scheme)
```
4 changes: 4 additions & 0 deletions docs/api/breaking-changes.md
Expand Up @@ -64,6 +64,10 @@ webFrame.setIsolatedWorldInfo(
})
```

### Removal of deprecated `marked` property on getBlinkMemoryInfo

This property was removed in Chromium 77, and as such is no longer available.

## Planned Breaking API Changes (6.0)

### `win.setMenu(null)`
Expand Down
12 changes: 7 additions & 5 deletions docs/api/browser-window.md
Expand Up @@ -233,10 +233,9 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
Windows, which adds standard window frame. Setting it to `false` will remove
window shadow and window animations. Default is `true`.
* `vibrancy` String (optional) - Add a type of vibrancy effect to the window, only on
macOS. Can be `appearance-based`, `light`, `dark`, `titlebar`, `selection`,
`menu`, `popover`, `sidebar`, `medium-light` or `ultra-dark`. Please note that
using `frame: false` in combination with a vibrancy value requires that you use a
non-default `titleBarStyle` as well.
macOS. Can be `appearance-based`, `light`, `dark`, `titlebar`, `selection`, `menu`,
`popover`, `sidebar`, `medium-light` or `ultra-dark`. Please note that using `frame: false` in combination with a vibrancy value requires that you use a non-default `titleBarStyle` as well.
Also note that `appearance-based`, `light`, `dark`, `medium-light`, and `ultra-dark` have been deprecated and will be removed in an upcoming version of macOS.
* `zoomToPageWidth` Boolean (optional) - Controls the behavior on macOS when
option-clicking the green stoplight button on the toolbar or by clicking the
Window > Zoom menu item. If `true`, the window will grow to the preferred
Expand Down Expand Up @@ -1613,12 +1612,15 @@ Adds a window as a tab on this window, after the tab for the window instance.
#### `win.setVibrancy(type)` _macOS_

* `type` String - Can be `appearance-based`, `light`, `dark`, `titlebar`,
`selection`, `menu`, `popover`, `sidebar`, `medium-light` or `ultra-dark`. See
`selection`, `menu`, `popover`, `sidebar`, `medium-light` or `ultra-dark`. See
the [macOS documentation][vibrancy-docs] for more details.

Adds a vibrancy effect to the browser window. Passing `null` or an empty string
will remove the vibrancy effect on the window.

Note that `appearance-based`, `light`, `dark`, `medium-light`, and `ultra-dark` have been
deprecated and will be removed in an upcoming version of macOS.

#### `win.setTouchBar(touchBar)` _macOS_ _Experimental_

* `touchBar` TouchBar
Expand Down
4 changes: 2 additions & 2 deletions docs/api/dialog.md
Expand Up @@ -4,11 +4,11 @@
Process: [Main](../glossary.md#main-process)

An example of showing a dialog to select multiple files and directories:
An example of showing a dialog to select multiple files:

```javascript
const { dialog } = require('electron')
console.log(dialog.showOpenDialog({ properties: ['openFile', 'openDirectory', 'multiSelections'] }))
console.log(dialog.showOpenDialog({ properties: ['openFile', 'multiSelections'] }))
```

The Dialog is opened from Electron's main thread. If you want to use the dialog
Expand Down
2 changes: 1 addition & 1 deletion docs/api/menu-item.md
Expand Up @@ -24,7 +24,7 @@ See [`Menu`](menu.md) for examples.
* `icon` ([NativeImage](native-image.md) | String) (optional)
* `enabled` Boolean (optional) - If false, the menu item will be greyed out and
unclickable.
* `acceleratorWorksWhenHidden` Boolean (optional) - default is `true`, and when `false` will prevent the accelerator from triggering the item if the item is not visible`. _macOS_
* `acceleratorWorksWhenHidden` Boolean (optional) _macOS_ - default is `true`, and when `false` will prevent the accelerator from triggering the item if the item is not visible`.
* `visible` Boolean (optional) - If false, the menu item will be entirely hidden.
* `checked` Boolean (optional) - Should only be specified for `checkbox` or `radio` type
menu items.
Expand Down
4 changes: 3 additions & 1 deletion docs/api/menu.md
Expand Up @@ -152,9 +152,11 @@ simple template API:
```javascript
const { app, Menu } = require('electron')

const isMac = process.platform === 'darwin'

const template = [
// { role: 'appMenu' }
...(process.platform === 'darwin' ? [{
...(isMac ? [{
label: app.name,
submenu: [
{ role: 'about' },
Expand Down

0 comments on commit 2efa235

Please sign in to comment.