Compare commits

...

2204 Commits

Author SHA1 Message Date
John Kleinschmidt
52f6945f20 build: move macos release builds to CircleCI (#17342) 2019-03-11 17:11:27 -04:00
Electron Bot
7a5cb9f47b Bump v2.0.18 2019-03-07 14:57:01 -08:00
Electron Bot
cfc32ca2bc Revert "Bump v2.0.18"
This reverts commit 4681dcb854.
2019-03-07 14:53:11 -08:00
Electron Bot
4681dcb854 Bump v2.0.18 2019-03-07 14:41:33 -08:00
Roller Bot
d70279fc65 chore: bump libcc submodule to 1f6a271a1a6cb167f08686f7ddc6bc858fea4879 (#17266) 2019-03-07 14:38:13 -08:00
trop[bot]
d173f31328 chore: disable get/setLoginItemSettings specs (#16842) 2019-02-08 13:38:50 -08:00
trop[bot]
a9d4b27469 build: ensure index.json is actually valid JSON before uploading (backport: 2-0-x) (#16748)
* build: ensure index.json is actually valid JSON before uploading

* chore: fix py linting for validation of index.json
2019-02-05 15:00:39 -08:00
Electron Bot
888216f10d Bump v2.0.17 2019-01-31 08:05:58 -08:00
Charles Kerr
0309654cc1 fix: move open handling to web-contents.js (#16630)
* fix: move open handling to web-contents.js

* fix: fix lint error
2019-01-30 19:49:42 -08:00
Shelley Vohr
295011994f chore: update release scripts for cleanup (#16136) 2018-12-20 10:08:01 -07:00
Electron Bot
b9aed81df3 Bump v2.0.16 2018-12-18 14:15:34 -08:00
Michelle Tilley
5615913f4f chore: add additional logging for release upload failures (#16127) 2018-12-18 11:49:40 -08:00
Michelle Tilley
dd0ae203b7 Revert "Bump v2.0.16"
This reverts commit ed7534097c.
2018-12-18 11:17:58 -08:00
Electron Bot
ed7534097c Bump v2.0.16 2018-12-18 10:34:47 -08:00
Michelle Tilley
e292d6f94a Revert "Bump v2.0.16"
This reverts commit aea4751aa3.
2018-12-18 10:27:10 -08:00
Electron Bot
aea4751aa3 Bump v2.0.16 2018-12-18 09:56:07 -08:00
Roller Bot
d643b3557b chore: bump libcc submodule to daf9bdcdfdfd6bad258b5e1e48b2e17d06c1a987 (#16112) 2018-12-17 22:28:55 -06:00
Electron Bot
4495f66310 Bump v2.0.15 2018-12-13 10:24:07 -08:00
Roller Bot
5de7f2abdb chore: bump libcc submodule (#16035) 2018-12-13 03:31:26 +05:30
Roller Bot
01c892dfc3 chore: bump libcc submodule to ebe1313308aa95c71f23b2725efd091b8ece05ff (#15946) 2018-12-11 16:12:41 +09:00
Cheng Zhao
abd3fee870 fix: allow 2 threads for CreateIoCompletionPort on single-core to prevent busy looping (#15975) (#16013)
* allow 2 threads for CreateIoCompletionPort on single-core

* use base::SysInfo::NumberOfProcessors instead of env var

* CHECK that uv_loop_ has not been used before replacing its iocp
2018-12-11 16:11:11 +09:00
Hari Juturu
9313af3f3b fix: enable webview in sandbox renderer (#13435) (#13555)
* Enable webview in sandbox renderer (#13435)

* Enable webview in sandbox renderer
Security: Inherit embedder prefs onto webview

* cache lastwebprefs

* fix expect UT issue

* Fix test
2018-11-27 17:16:11 +09:00
trop[bot]
8ed07298cc fix: schedule a paint after browserview's background is set (#15796) 2018-11-21 14:25:49 -06:00
Electron Bot
126b468eb7 Bump v2.0.14 2018-11-19 11:04:43 -08:00
trop[bot]
0035a7b663 fix: NSWindow crash happening on macos 10.9 (#15729) 2018-11-15 07:58:03 -08:00
trop[bot]
74644e53e8 docs: add Size as an option for pageSize in docs for printToPDF (#15524) 2018-11-02 22:17:55 +11:00
trop[bot]
308ee50831 chore: publish to the latest tag correctly when releasing old versions (#15515) (#15528)
Manual backport of #15274 to <= 3-0-x
2018-11-01 07:42:41 -07:00
trop[bot]
4f26aab86f fix: explicitly set windowsHide to the old node default (#15513)
Notes: fix Electron not being visible when launching in development mode on node v11
2018-10-31 20:32:28 -07:00
Electron Bot
1ebd9761fb Bump v2.0.13 2018-10-31 16:12:36 -07:00
trop[bot]
67c7554b80 docs: add return type for subscribeNotification (#15501) 2018-10-31 09:48:25 -07:00
trop[bot]
d158cce9a3 doc: clarify menu item properties not available top-level (#15460) 2018-10-29 16:23:48 -07:00
trop[bot]
5a73ec2ec8 fix: honor dialog.showMessageBox()'s Icon argument on Linux (backport: 2-0-x) (#15341)
* Don't call gtk_widget_show_all() on popup dialog.

Fixes #15317.

Notes: Fixed incorrect display of some GtkMessageDialog icons.

The issue is caused because GtkMessageDialog contains an icon widget
which is not shown when there's no associated icon. Our call to
`gtk_widget_show_all()` overrides this, showing the uninitialized
icon widget.

This PR fixes the issue by calling `gtk_widget_show()` where needed
and removing use of `gtk_widget_show_all()` in the message dialog.

* use gtk_dialog_set_default_response() for default

* fix: support icons on gtk+ messageboxes.
2018-10-23 12:00:50 -07:00
Michelle Tilley
a03da04578 fix: correct reversed logic in NativeWindowMac::SetEnabled (#15322)
Backport of #15257
2018-10-23 23:22:07 +11:00
trop[bot]
d45c29087b docs: we don't emit an event object for session-created (#15306) 2018-10-21 10:17:37 -07:00
trop[bot]
00200c707e chore: make macOS release builds higher priority to skip the queue (#15283)
Release builds should be run before branch builds on our limited macOS
infra.

Refs: https://docs.microsoft.com/en-us/rest/api/vsts/build/builds/queue?view=vsts-rest-4.1#queuepriority
2018-10-19 09:12:38 -07:00
trop[bot]
b228166900 fix: make release-artifact-cleanup executable (backport: 2-0-x) (#15270)
* fix: make release-artifact-cleanup executable

* fix misc issues in cleanup script
2018-10-18 20:27:45 -07:00
Electron Bot
d281859cf5 Bump v2.0.12 2018-10-18 17:04:22 -07:00
Samuel Attard
e00d217cfb Revert "build: enable PIE when compiling Linux builds, fix #14961. (#15148)"
This reverts commit 2f2761fa47.
2018-10-18 14:12:33 +11:00
Samuel Attard
00f40e84db Revert "chore: enable BIND_NOW when compiling Linux builds"
This reverts commit 9f1e674f30.
2018-10-18 14:12:27 +11:00
Samuel Attard
dde5b3abe6 Revert "Bump v2.0.12"
This reverts commit 97bffde34c.
2018-10-18 14:12:00 +11:00
Electron Bot
97bffde34c Bump v2.0.12 2018-10-17 19:33:51 -07:00
Samuel Attard
a6a1cc3bbb Revert "Bump v2.0.12"
This reverts commit 22e71497ec.
2018-10-18 13:27:04 +11:00
Electron Bot
22e71497ec Bump v2.0.12 2018-10-17 10:29:11 -07:00
Roller Bot
a32529b8fa chore: bump libcc submodule to ccdb085454b0a387ee96e0f81a7ca9a8ce07a710 (#15200) 2018-10-18 00:54:36 +11:00
Cheng Zhao
732f053acd Merge pull request #15207 from electron/window-open-warn-leak-2-0-x
chore: warn memory leak when using nativeWindowOpen with nodeIntegration (2-0-x)
2018-10-17 11:54:32 +09:00
Cheng Zhao
90fc709194 fix: print warning after DOM is created 2018-10-17 10:49:08 +09:00
Cheng Zhao
1d2b926962 chore: warn memory leak when using nativeWindowOpen with nodeIntegration 2018-10-17 10:47:45 +09:00
Cheng Zhao
fbc7b7f8ad fix: do not enable node integration in child window if not enabled (#15109) 2018-10-16 18:10:58 +09:00
Kevin Lynagh
4279f2f3f8 fix: simpleFullscreen window should be on top of other OS X menu bars. (#15182)
If an app has no menu bar (because `app.dock.hide()` has been called),
OS X will still render the menu bar of the previously-focused app.

This commit ensures simpleFullscreen windows will be drawn on top of
that menu bar by setting their level to NSPopUpMenuWindowLevel while
simpleFullscreen mode is active.

Ref: #11468
2018-10-16 11:42:13 +11:00
Shelley Vohr
b8eec43b31 fix: natively implement LoginItem functions (backport: 2-0-x) (#15139)
* fix: natively implement LoginItem functions

* equal => deepEqual
2018-10-15 12:55:09 -07:00
trop[bot]
ce30d6c11f fix: Memory > Profiles > Load in DevTools (#15154) 2018-10-14 15:15:47 -07:00
#DeleteGithub
9f1e674f30 chore: enable BIND_NOW when compiling Linux builds
We've hardened Linux builds by enabling PIE and RELRO,
and should continue to try hardening Linux builds by
enabling BIND_NOW. With both RELRO and BIND_NOW enabled,
we can stop all GOT overwrite attacks. The same hardening
option has been enabled in official Chrome/Chromium
builds since more than five years ago.

This helps to improve the security of a whole range of
applications built upon Electron, including sensetive ones
such as Signal-Desktop.

Signed-off-by: Tom Li <tomli@tomli.me>
2018-10-14 11:13:37 -07:00
#DeleteGithub
2f2761fa47 build: enable PIE when compiling Linux builds, fix #14961. (#15148)
PIE allows an application to utilize the full benefits of ASLR
to prevent itself from exploitations, but it was disabled for
all released versions of Electron (3.0 and prior).

Currently, PIE is already enabled since 9294fac but enabling it
for all released version is still an ongoing work (#14961). This
patch backports PIE to the 2.0.x branch, which is an especially
important branch, since security is an urgency for many existing
programs including Signal-Desktop. Enabling it can help protect
many high-risk users.

Signed-off-by: Tom Li <tomli@tomli.me>
2018-10-14 12:47:45 +11:00
Charles Kerr
411f2be579 Check dbus response for null before using. (#15088)
Fixes #14958.

Manual backport of #15030. Drops some the BindOnce improvements
due to compile issues with older version of Chromium.
2018-10-11 22:01:58 -07:00
Charles Kerr
28a160fc1f fix: SetSize() should honor minSize (#13994) (#15052)
Manual backport of #14931 to fix #13994.
2018-10-10 16:18:04 -05:00
Troy
2663d3e10d Backport of #14648 (#15025) 2018-10-08 20:18:02 -05:00
trop[bot]
e55d7d6f1e fix: support ASAR in fs.copyFile (#14952) 2018-10-04 09:23:07 +10:00
Cheng Zhao
092796f5f4 fix: use white background for non-OSR renderer by default (#14933) 2018-10-02 20:08:49 -07:00
Electron Bot
3f6d86c872 Bump v2.0.11 2018-10-01 09:47:39 -07:00
Samuel Attard
bdc9faa083 Revert "Bump v2.0.11"
This reverts commit 3e35f77da4.
2018-10-02 02:42:49 +10:00
Electron Bot
3e35f77da4 Bump v2.0.11 2018-10-01 08:38:40 -07:00
Roller Bot
464f144a2b chore: bump libcc submodule to e271f9ba29ff73167bbc4a7e125657caccb32960 (#14839) 2018-09-28 10:30:16 -07:00
trop[bot]
8f92396ed4 fix: enable key accelerator flags for Windows and Linux (backport: 2-0-x) (#14858)
* Fix Accelerator Flags for Windows and Linux

* Lint fix

* Lint whitespace
2018-09-28 10:01:09 -07:00
Shelley Vohr
4e41a79404 fix: get background color from GtkMenuBar#menubar (#14813) 2018-09-27 17:44:58 +10:00
trop[bot]
d3c153e85a docs: correct key code reqs for accel doc (#14825) 2018-09-27 12:49:58 +10:00
Shelley Vohr
503b488153 fix: inconsistent titleBarStyle on transparent fullscreen (#14792) 2018-09-25 09:58:32 -04:00
trop[bot]
005a65da79 docs: clarify allowable background colors for BrowserWindow transparency (backport: 2-0-x) (#14780)
* docs: clarify allowable colors for transparency

* fix alpha value specification
2018-09-24 09:39:53 -07:00
trop[bot]
36da7dcd5f docs: specify BrowserWindow features passable to window.open (#14701) 2018-09-20 16:56:11 +10:00
trop[bot]
0e5f734a1a chore: fix await in cleanup script (#14694) 2018-09-19 10:10:20 -07:00
John Kleinschmidt
3aeaf10e64 ci: Skip VSTS testing builds on older branches (#14668)
Also, don't send slack notifications for actual releases
2018-09-19 09:55:48 -07:00
Shelley Vohr
d70942190c fix: quit properly in simpleFullScreen mode (#14671) 2018-09-19 08:31:08 -07:00
Electron Bot
ac400e5cb9 Bump v2.0.10 2018-09-19 02:18:01 -07:00
Samuel Attard
333d5fb5d2 Revert "Bump v2.0.10"
This reverts commit f2c12ccbf5.
2018-09-19 19:10:43 +10:00
Electron Bot
f2c12ccbf5 Bump v2.0.10 2018-09-18 06:45:51 -07:00
trop[bot]
79af1ea6f1 chore: dont pass --stable through to bump-version.py (#14667)
I want to clean up this "stable" and "beta" code smell eventually but
for now this will unblock the 2.0.x releases.
2018-09-18 23:41:20 +10:00
Roller Bot
1ed7875b0b chore: bump libcc submodule to cbd04c0dccc7655cd42f02baee3a622d5170ac08 (#14654) 2018-09-18 17:37:00 +10:00
John Kleinschmidt
67a690e536 Merge pull request #14593 from electron/ignore-gn-debug-builds-2-0-x
ci: don't run gn debug build on older branches (2-0-x)
2018-09-13 09:24:02 -04:00
John Kleinschmidt
5f3bedd1e0 ci: don't run gn debug build on older branches (#14584)
* ci: don't run gn debug build on older branches

Older branches that build using gyp do not run both a debug and testing build.

* Actually skip the build if debug

(cherry picked from commit f924a16055)
2018-09-12 17:10:05 -04:00
Electron Bot
670a875792 Bump v2.0.9 2018-09-10 08:21:03 -07:00
trop[bot]
faf82245dc Fix documentation tyop (#14477) 2018-09-06 10:59:35 -07:00
Shelley Vohr
066eeb5b5f chore: add release-artifact-cleanup script (#14448) 2018-09-04 11:36:57 -07:00
trop[bot]
77ec86b894 docs: added session-created event documentation (backport: 2-0-x) (#14439)
* Added session-created event documentation

Emitted at 1c0ea0286e/lib/browser/api/session.js (L21)

* Removed trailing spaces
2018-09-04 09:26:58 +10:00
trop[bot]
bf82dc7896 fix: crash when tray is destroyed (#14366)
Release the view of status item before destroying it,
gives chance to perform cleanup on the view.
2018-08-28 23:14:08 -07:00
Charles Kerr
b4c5a30469 fix: dont parse arguments after a -- in the inspector (#14297) (#14334) 2018-08-27 14:39:38 -05:00
trop[bot]
7ed6e2b909 fix: don't crash on tray.setContextMenu(null) (#14330) 2018-08-27 12:51:09 -05:00
Wenjun Che
8edd18be90 fix: issue 10962, crash when open devtool (#13808)
* fix: crash when opening devtool (#10962)

* fix: fixed linting issues
2018-08-24 14:36:47 -07:00
Shelley Vohr
3bc9ae7f5b deps: update node for two backports (#14298) 2018-08-24 14:50:55 -05:00
Cheng Zhao
760c2327b4 fix: do not bubble up resize event from webview (#14272) 2018-08-23 15:42:46 +09:00
Cheng Zhao
fcb5069d24 Revert "fix: do not bubble up resize event from webview"
This reverts commit 221ab080a1.

It was an accidental push.
2018-08-23 09:31:10 +09:00
Cheng Zhao
221ab080a1 fix: do not bubble up resize event from webview 2018-08-23 09:29:08 +09:00
Electron Bot
addf069f26 Bump v2.0.8 2018-08-22 11:10:51 -07:00
Samuel Attard
80221e52d9 fix: inheritance of webPreferences sub properties 2018-08-22 12:20:04 -05:00
trop[bot]
3403b4a4de ci: add better logging around request failures for releasing (#14244) 2018-08-21 13:31:29 -07:00
trop[bot]
a1ac930f4d chore: retry for the meta dumper a few times (#14242) 2018-08-21 13:30:53 -07:00
Electron Bot
ed8396c6f5 Bump v2.0.8-nightly.20180820 2018-08-20 16:54:02 -07:00
Samuel Attard
a457d8823a Revert "Bump v2.0.8-nightly.20180820"
This reverts commit 2d44dcb8be.
2018-08-20 16:44:17 -07:00
Electron Bot
2d44dcb8be Bump v2.0.8-nightly.20180820 2018-08-20 13:33:19 -07:00
Samuel Attard
85da731867 fix: support installing nightlies on <= 2.0.x (#14224) 2018-08-20 11:18:45 -07:00
trop[bot]
3af5fdb831 chore: remove autorelease check logic (#14221) 2018-08-20 10:56:40 -07:00
trop[bot]
f1b197acbb chore: add option to return next version from prepare-release (backport: 2-0-x) (#14216)
* chore: add option to return next version from prepare-release

* shuffle logic
2018-08-20 08:35:28 -07:00
Electron Bot
d483c81887 Bump v2.0.8-nightly.20180819 2018-08-19 16:42:46 -07:00
Samuel Attard
3ef980ae2b chore: use metadumper service to create index.json file (#14158) (#14210) 2018-08-19 16:40:49 -07:00
Samuel Attard
36e68b46df Revert "Bump v2.0.8-nightly.20180819"
This reverts commit 148d0d8d29.
2018-08-19 15:38:56 -07:00
Samuel Attard
f611dfdb5c chore: stop auto releasing from windows CI 2018-08-19 15:38:47 -07:00
Electron Bot
148d0d8d29 Bump v2.0.8-nightly.20180819 2018-08-19 14:48:54 -07:00
trop[bot]
79a1382126 chore: match the bump commit exactly, reverts should not count (#14208) 2018-08-19 14:45:49 -07:00
Samuel Attard
b0d5ba1996 Revert "Bump v2.0.8-nightly.20180819"
This reverts commit 48a4b58cc1.
2018-08-19 14:24:11 -07:00
Samuel Attard
088dc70dae chore: disable tests on release builds, this is already done on master/3-0-x (#14206) 2018-08-19 14:22:57 -07:00
trop[bot]
ad686cca68 fix: #14160 (#14204) 2018-08-19 14:13:56 -07:00
Electron Bot
48a4b58cc1 Bump v2.0.8-nightly.20180819 2018-08-19 13:18:10 -07:00
Samuel Attard
c1ef824e4c chore: fix upload script for nightly support (#14203) 2018-08-19 13:03:15 -07:00
Samuel Attard
a2eb532720 Revert "Bump v2.0.8-nightly.20180819"
This reverts commit 0cb53ceb9d.
2018-08-19 12:57:00 -07:00
Electron Bot
0cb53ceb9d Bump v2.0.8-nightly.20180819 2018-08-19 12:33:38 -07:00
Samuel Attard
afe4e610ae chore: always target master for nightly releases (#14190) (#14202) 2018-08-19 12:28:21 -07:00
Shelley Vohr
74d90fbb33 chore: backport release script updates to 2-0-x (#14191)
* chore: alter release scripts to enable sudowoodo

* add example .env file

* chore: only prepare release if last commit not a bump (#14193)
2018-08-18 19:39:06 -07:00
trop[bot]
f3bd8f6133 docs: fix electron.d.ts typings (#14137) 2018-08-16 11:11:31 -07:00
John Kleinschmidt
863c511fbf Merge pull request #13988 from K900/update-lld
fix: update clang/lld version to fix #13972
2018-08-16 10:29:21 -07:00
trop[bot]
03d8689ded fix: add a hidden option to disable remote dereferencing (#14112) 2018-08-15 08:43:41 -07:00
John Kleinschmidt
ff2bc1d705 Merge pull request #14084 from electron/appveyor-rename-2-0-x
ci: rename appveyor-override to appveyor (2-0-x)
2018-08-14 09:56:17 -07:00
John Kleinschmidt
a1df8befde Rename appveyor-override to appveyor 2018-08-14 09:44:15 -07:00
trop[bot]
75909685f7 Fix flaky sandbox tests (#14055)
Windows apparently has issues running opening two windows at once which is causing flakiness on the mixed sandbox tests.
2018-08-13 15:14:21 -07:00
trop[bot]
2e0a015168 fix: make asarStatsToFsStats nherit from fs.stats (#14040) 2018-08-12 21:13:43 -07:00
K900
740b2797c5 vendor: update clang/lld version to fix #13972
This seems like some sort of a weird linker bug, so just update the
toolchain a bit.
2018-08-10 14:55:13 +03:00
Charles Kerr
5f372f7ecc Bump v2.0.7 2018-08-08 16:23:52 -05:00
Jeremy Apthorp
e4f4a1d9f9 chore: roll libcc (#13974)
Picks up electron/libchromiumcontent#637
2018-08-08 09:59:16 -07:00
John Kleinschmidt
bdc255fa9e Merge pull request #13966 from electron/2-0-x-backport-12809
fix: Prevent menu update while it's open (backport: 2-0-x)
2018-08-07 10:05:44 -04:00
John Kleinschmidt
e8e542b3e8 Merge pull request #13960 from electron/miniak/fix-promisify-2.0
fix: some APIs modified for ASAR support cannot be util.promisify'ed (backport: 2-0-x)
2018-08-07 10:04:56 -04:00
Zhuo Lu
dd89aa6c77 Memory safety 2018-08-06 23:50:00 -07:00
Zhuo Lu
79caff69f5 Fix code style 2018-08-06 23:50:00 -07:00
Zhuo Lu
67b10135b6 Update application menu on default runloop
Menu change should be prevented while the menu is open
2018-08-06 23:49:57 -07:00
Milan Burda
6a86831b7c fix: some APIs modified for ASAR support cannot be util.promisify'ed (#13845) 2018-08-07 00:20:54 +02:00
Birunthan Mohanathas
dffd17ab70 fix: Improve --enable-features/--disable-features handling (2.0.x) (#13921)
As it turns out, we can reinitialize the feature list directly after the
user JS script has been executed instead of much later. This allows
modifications to `--enable-features`/`--disable-features` to work with a
greater set of features.

This backports #13920 to `2-0-x`.
2018-08-03 11:09:53 +10:00
Birunthan Mohanathas
cf98934dd9 build: Bump libcc to latest (2.0.x) (#13919)
This picks up electron/libchromiumcontent#627.
2018-08-03 10:54:39 +10:00
trop[bot]
2fff138740 fix: handle SIGINT and SIGTERM from the Electron CLI helper (#13888)
Fixes #12840
2018-08-01 13:25:37 +10:00
Charles Kerr
82bc83c1de Bump v2.0.6 2018-07-31 18:49:35 -05:00
Birunthan Mohanathas
3a699741da build: Bump libcc to latest (2.0.x) (#13896)
This picks up electron/libchromiumcontent#624.
2018-07-31 15:45:39 -05:00
trop[bot]
237ad9a49d fix: util.promisify(setTimeout) (#13859) 2018-07-30 15:02:28 +10:00
trop[bot]
45158bdad5 docs: fix electron.d.ts typings (#13856) 2018-07-30 11:20:02 +10:00
Birunthan Mohanathas
cf4861b575 build: Bump libcc to latest (2.0.x) (#13825)
This picks up electron/libchromiumcontent#619.
2018-07-27 23:05:49 +10:00
Zeke Sikelianos
a76adba2b3 Merge pull request #13782 from electron/fix-enable-disable-features-2-0-x
fix: Use --enable-features and --disable-features (2.0.x)
2018-07-25 11:09:15 -07:00
Birunthan Mohanathas
6689dce5ba fix: Use --enable-features and --disable-features (2.0.x)
Unlike Chrome, we were not using the --enable-features and
--disable-features command-line arguments to initialize
`base::FeatureList`.
2018-07-24 17:12:39 +02:00
Cheng Zhao
9667b835ca fix: create WebContents for webview on request (#13714) 2018-07-20 10:45:57 -07:00
John Kleinschmidt
58295a3198 Merge pull request #13735 from electron/backport-13727-2-0-x
fix: use context counter as contextId (backport 2-0-x)
2018-07-20 10:22:00 -04:00
Cheng Zhao
b60125f782 fix: use webContentsId with contextId together
After after using `processId-contextCounter` as contextId, it may happen
that contexts in different WebContents sharing the same renderer process
get the same contextId. Using webContentsId as part of key in
ObjectsRegistry can fix this.
2018-07-20 10:53:16 +09:00
Cheng Zhao
2af6d9ced7 fix: use context counter as contextId (backport 2-0-x)
For sandboxed renderer it may not have a node::Environment in the context,
using a increasing counter as contextId works for all cases.
2018-07-19 11:35:49 -07:00
Charles Kerr
664c184fcb Bump v2.0.5 2018-07-13 13:55:07 -05:00
John Kleinschmidt
c125576d48 Merge pull request #13644 from electron/release-updates-2
chore: Updates for release process (2-0-x)
2018-07-12 10:31:19 -04:00
John Kleinschmidt
6030146b45 chore: Updates for release process (2-0-x)
* Fix Appveyor URL

* Update docs to reflect current process

Also added troubleshooting steps.

(cherry picked from commit 6b5ccec0c6)
2018-07-12 09:05:02 -04:00
Cheng Zhao
17297d85f8 Merge pull request #13625 from electron/proxy_resolver_oop
fix: use mojo v8 proxy resolver with a utility process
2018-07-12 21:59:12 +09:00
deepak1556
65bbf21c08 update libcc ref 2018-07-12 19:55:42 +09:00
deepak1556
00da6ab43b link mojo proxy resolver in component build 2018-07-12 19:55:42 +09:00
deepak1556
d6d2a46821 REVIEW: create proxy helper per browser context 2018-07-12 19:55:42 +09:00
deepak1556
423bdda1b1 REVIEW: remove pre early initialization of v8 2018-07-12 19:55:42 +09:00
deepak1556
849aeced8f build: use mojo v8 proxy resolver with a utility process 2018-07-12 19:55:42 +09:00
Cheng Zhao
05a7485880 Merge pull request #13604 from electron/fix-remote-2-0-x
fix: guard against double-freeing remote references (2-0-x)
2018-07-12 11:09:38 +09:00
Cheng Zhao
3db1b5a49a fix double-freeing remote references
After the page does navigations, garbage collection can still happen in
the old context. This commit changes to store references to remote objects
by _pages_, instead of by _WebContents_.
2018-07-12 10:45:00 +09:00
Cheng Zhao
1c272503c3 add API to return an unique ID for page 2018-07-12 10:45:00 +09:00
Cheng Zhao
1ebb8975a8 fix assertion caused by PrefServiceFactory::Create 2018-07-12 10:45:00 +09:00
John Kleinschmidt
fcf4c9cef1 build: Updates to the release process (2-0-x) (#13615)
* Update to run new AppVeyor jobs

AppVeyor builds got split into two jobs, `electron-x64` and `electron-ia32`

(cherry picked from commit 90339b7260)

* Move github release checking to node.js

Our upload script was relying on an old python script to find the GitHub release for uploading.

(cherry picked from commit 2040095b96)
2018-07-11 09:08:09 -05:00
John Kleinschmidt
3e5349bf39 Use Visual Studio 2015 for 2-0-x (#13607) 2018-07-10 09:40:22 -05:00
John Kleinschmidt
66988adb0e Bump v2.0.4 2018-07-03 14:39:36 -04:00
John Kleinschmidt
91be3f343f Merge pull request #13545 from electron/fix-core-bluetooth-linking
Fix crash on startup on macOS 10.9 due to linking with CoreBluetooth
2018-07-03 09:47:35 -04:00
Cheng Zhao
475006c10d fix: weak load CoreBluetooth when building with 10.10 SDK
The CoreBluetooth framework does not exist on OS X 10.9.
2018-07-03 16:37:07 +09:00
John Kleinschmidt
d71a7d89bb Merge pull request #13538 from electron/dwm-backport
fix: Disable chromium's redraw locking on Windows when DWM is disabled (#12501)
2018-07-02 16:10:22 -04:00
John Kleinschmidt
abcba2b509 Merge pull request #13516 from trop-bot/2-0-x-bp-fix--tray-setcontextmenu-crash-1530308984992
Backport (2-0-x) - fix: tray setContextMenu crash
2018-07-02 14:12:51 -04:00
John Kleinschmidt
d06c20f836 Merge branch 'trop-bot-2-0-x-bp-fix--tray-setcontextmenu-crash-1530308984992' into 2-0-x 2018-07-02 14:10:14 -04:00
John Kleinschmidt
3ab99663eb Merge branch '2-0-x-bp-fix--tray-setcontextmenu-crash-1530308984992' of git://github.com/trop-bot/electron into trop-bot-2-0-x-bp-fix--tray-setcontextmenu-crash-1530308984992 2018-07-02 14:08:34 -04:00
trop[bot]
a253323ea1 Do not capture cookies and credentials (#13537) 2018-07-03 02:03:48 +10:00
Heilig Benedek
4abe5a2963 Disable chromium's redraw locking on Windows when DWM is disabled (#12501)
* disable redraw locking on windows

* update libcc ref

(cherry picked from commit a14ebc80d2)
2018-07-02 08:54:37 -07:00
Maxine Whitely
aada5fb167 fix: tray setContextMenu crash
Co-authored-by: Zhuo Lu <sethlu@mintkit.net>
Co-authored-by: Kristine Zhang <kzhang@slack-corp.com>
2018-06-29 21:49:51 +00:00
Robo
4efed0f5ed fix: Revert "remove MarkHghMemoryUsage api" (#13421)
* fix: Revert "remove MarkHghMemoryUsage api"

This reverts commit 0de85fd49f.

* update native_mate ref
2018-06-26 10:44:59 -07:00
John Kleinschmidt
475a1e30d9 Add release build to VSTS 2018-06-21 09:33:06 -04:00
John Kleinschmidt
4aedc2c21a Bump v2.0.3 2018-06-21 09:25:33 -04:00
John Kleinschmidt
71668858db Merge pull request #13345 from electron/miniak/fix-libcc-2-0-x
fix: patches/086-backport-f0c82253.patch in libcc
2018-06-21 09:13:25 -04:00
Milan Burda
2573d52860 Bump libcc 2018-06-21 09:29:14 +02:00
John Kleinschmidt
989c2605b3 Merge pull request #13305 from electron/2-0-x_update-libcc-subreference
update submodule reference for libchromiumcontent
2018-06-20 09:36:17 -04:00
John Kleinschmidt
afcfd473d0 Merge pull request #13330 from trop-bot/2-0-x-bp-fix--pass-down-the-bool-value-of-enableautosize-to-setsize-1529484352071
Backport (2-0-x) - fix: pass down the bool value of enableAutoSize to setSize
2018-06-20 09:24:28 -04:00
Justin Guze
1499bafe59 creating new bool for autosize 2018-06-20 08:45:58 +00:00
Justin Guze
419fae76b4 fix: pass the boolean value of enableAutoSize to setSize
The webContents setSize API takes in an optional enableAutoSize boolean.
Looking in the code, if that property is set, regardless if you pass in
true or false, it will always set it to true. This change passes the
appropriate boolean value down properly.
2018-06-20 08:45:58 +00:00
trop[bot]
c7b85a104a Mark browser window affinity as experimental (#13295) 2018-06-20 17:19:46 +10:00
trop[bot]
c6ea424858 Disable node options in node config (#13324) 2018-06-20 17:06:29 +10:00
trop[bot]
ba23c0d600 set mac protocol to none (#13325) 2018-06-19 22:39:07 -07:00
Charles Kerr
d4e716477e update submodule referefence for libchromiumcontent 2018-06-19 14:43:57 -05:00
Jeremy Apthorp
34dbe5f176 Enable WebFrame method forwarding in sandboxed renderers (#12538) (#13076)
* Enable WebFrame method forwarding in sandboxed renderers

Fixes #9073

* Non-change to kick CI
2018-06-19 09:36:14 +10:00
Milan Burda
a09fa53d80 Add FILE_DIALOG_TREAT_PACKAGE_APP_AS_DIRECTORY to web open file dialog (#13220) (#13277) 2018-06-18 10:34:21 -05:00
Milan Burda
c140c84b32 Backport "Allow lookup of videodecoder service to fix HW video decoding on macOS 10.13" (#13275)
https://chromium-review.googlesource.com/677290
2018-06-18 21:35:37 +10:00
Charles Kerr
55ab1d7370 update submodule referefence for node (#13260) 2018-06-17 14:52:25 -07:00
trop[bot]
cfa247967f fix: tray title not inverting when highlighted (#13262) 2018-06-16 11:59:46 -05:00
John Kleinschmidt
311f7ac6bb Bump v2.0.2 2018-05-22 14:52:16 -04:00
trop[bot]
52a44facfd update locale documentation (#13027) 2018-05-21 15:07:46 -05:00
trop[bot]
5acb7a0226 Backport (2-0-x) - docs: Document missing quit events during shutdown (#13026)
* docs: Document missing events during shutdown

* docs: Better language
2018-05-21 12:52:18 -07:00
trop[bot]
afcf94a85c Add a tag to libchromiumcontent when a release is created. (#13025) 2018-05-21 13:35:56 -05:00
John Kleinschmidt
c42b468966 Merge pull request #13022 from trop-bot/2-0-x-bp-fix--menu.setapplicationmenu(null)-crash-on-linux-1526913387556
Backport (2-0-x) - fix: Menu.setApplicationMenu(null) crash on Linux
2018-05-21 11:06:36 -04:00
John Kleinschmidt
e0257acdf5 Merge pull request #13009 from ajmacd/ajm-libcc
Bump libcc ref to pick up patch file extension correction.
2018-05-21 11:05:34 -04:00
Jeremy Apthorp
b555434aa0 fix: Menu.setApplicationMenu(null) crash on Linux 2018-05-21 14:36:33 +00:00
trop[bot]
9574a4f472 Only expand maximum size constraint if there was a constraint originally (#13014) 2018-05-20 19:45:51 -07:00
Andrew MacDonald
2f167ce3d1 Bump libcc ref to pick up patch file extension correction. 2018-05-19 01:01:05 -07:00
John Kleinschmidt
8655d5e9ae Bump v2.0.1 2018-05-16 13:30:26 -04:00
John Kleinschmidt
2e06e0eccd Merge pull request #12964 from trop-bot/2-0-x-bp-fix--support-multiple-inherited-ubuntu-session-for-indicators-1526485540005
Backport (2-0-x) - fix: support multiple inherited ubuntu session for indicators
2018-05-16 12:14:46 -04:00
John Kleinschmidt
773f08ca43 Merge pull request #12963 from trop-bot/2-0-x-bp-fix-empty-description-when-only-one-extension-is-given-(getfiletypesfromaccepttype)-1526480331702
Backport (2-0-x) - Fix empty description when only one extension is given (GetFileTypesFromAcceptType)
2018-05-16 11:46:51 -04:00
Didier Roche
13850b9dff Fix linting error
Thx @MarshallOfSound
2018-05-16 15:45:46 +00:00
Didier Roche
1c57c76496 fix: more scalable code by factorizing appindicator support
- introduce a currentPlatformSupportsAppIndicator() function determining
  if app indicators are supported here.
- handle undefined process.env.XDG_CURRENT_DESKTOP
- added some comments to ensure that the intents are clear
Thanks MarshallOfSound
2018-05-16 15:45:46 +00:00
Didier Roche
e459b38c5d Support multiple inherited ubuntu session for indicators
Multiple sessions inherits the "ubuntu" base settings properties in ubuntu.
One of the most popular one is communitheme: the next ubuntu default theme
has its dedicated session, with thus duplicated indicators for dropbox.
Rather than a string comparison for ubuntu, only match a substring then.
XDG_CURRENT_DESKTOP can be of form: "communitheme:ubuntu:GNOME",
"ubuntu:GNOME", …
Fixes: #12843.
2018-05-16 15:45:46 +00:00
John Kleinschmidt
9796513b83 Merge pull request #12923 from electron/fix-12875-2-0-x
Allow frameless transparent windows to be sized smaller than 64x64 on Windows
2018-05-16 11:42:35 -04:00
Milan Burda
d3e5f430c7 Fix empty description when only one extension is given 2018-05-16 14:18:57 +00:00
John Kleinschmidt
df22eccfc1 Merge pull request #12946 from trop-bot/2-0-x-bp-make-security-warnings-tests-more-robust-1526401028749
Backport (2-0-x) - Make security-warnings tests more robust
2018-05-15 13:12:10 -04:00
Cheng Zhao
214c352f71 make security-warnings tests more robust 2018-05-15 16:17:14 +00:00
John Kleinschmidt
0070637b5a Fix typescript generation error (#12940) 2018-05-15 11:13:35 -05:00
Milan Burda
72b944f862 Fix contents.setSize(options) documentation in web-contents.md 2018-05-15 11:37:45 +02:00
Heilig Benedek
2fbb371689 Lock electron-typescript-definitions at 1.3.2 2018-05-15 04:05:13 +02:00
Heilig Benedek
e2e70e9b1e Match chromium's workaround when setting size of unresizable windows 2018-05-14 21:57:34 +02:00
Charles Kerr
324b769751 update command-line backlist switches (2.0.x) (#12806)
* update command-line backlist switches

Do a better job of finding edge cases, e.g. network_switch_list.h

**NB: This can't be tropped** because the list is dependent on the libcc version

* update list
2018-05-14 11:03:37 -05:00
John Kleinschmidt
e1d54d55be Merge pull request #12856 from trop-bot/2-0-x-bp-fix--listeners-out-of-limit-warning-1525756284370
Backport (2-0-x) - fix: listeners out of limit warning
2018-05-08 10:49:17 -04:00
biuuu
1d54032ba4 fix: listeners out of limit warning
When the Chrome Extension has too many content scripts (above default
10 counts), there will be a warning: possible EventEmitter memory leak
detected. 11 listeners added.
2018-05-08 05:11:30 +00:00
Andrew MacDonald
c6e4de16de Update 2-0-x libcc ref for electron/libchromiumcontent/#533. (#12785) 2018-05-07 09:29:40 -07:00
trop[bot]
f39cc1cc46 docs: fix the type information in in-app-purchase (#12824)
Method returns Boolean, Manually confirmed the
correctness by running `npm run create-api-json`.
2018-05-04 14:50:33 -07:00
trop[bot]
6af89eb260 don't filter out invisible menu separators (#12831) 2018-05-04 11:26:21 -07:00
trop[bot]
d33b71cc2d Backport (2-0-x) - show file filter name for accessory view of file dialog (#12779)
* Show file filter name for accessory view of file dialog

- Respect filters option of dialog.showOpenDialog() and
  dialog.showSaveDialog(). (#10335)
- Show "All Files" for <input> apart from "accept" attribute. (#11456)

* Fix memory leaks in file_dialog_mac.mm
2018-05-02 09:28:16 -05:00
trop[bot]
d0bbf3fb3c Fix context menu for sandbox devtools (#12731) 2018-05-01 17:53:58 -05:00
trop[bot]
289db66fee fix flaky security-warnings test (#12776) 2018-05-01 17:52:03 -05:00
John Kleinschmidt
6b90807cb8 Bump v2.0.0 2018-05-01 16:00:36 -04:00
John Kleinschmidt
cf4f078aca Merge pull request #12768 from electron/support-policy-2-0-x
Manually backport Support Policy docs from master
2018-05-01 15:55:03 -04:00
Charles Kerr
4eedd1455d Manually backport Support Policy docs from master 2018-05-01 14:49:08 -05:00
trop[bot]
9c167b63f2 Backport (2-0-x) - Add sccache option to bootstrap (#12753)
* Add sccache option to bootstrap

Couldn't see a CC wrapper style option for gyp so we inject the sccache commands directly into the generated ninja files.

* Use CC_wrapper

* Update toolchain.gypi

* s/sccache/cc_wrapper
2018-05-01 01:31:37 +10:00
John Kleinschmidt
d18ab0ca08 Bump v2.0.0-beta.8 2018-04-26 10:56:46 -04:00
trop[bot]
724cbc967c revert to more graceful template structure check (#12703) 2018-04-24 14:17:26 -04:00
trop[bot]
b9d589439f Backport (2-0-x) - Fix transparency (#12683)
* Fix transparent window capture. Transparency is preserved and not converted to black pixels anymore

* Add test to make sure aplha channel exists in captured image
2018-04-23 01:16:18 +10:00
trop[bot]
f37bc4a9d4 Backport (2-0-x) - Correct the default of allowRunningInsecureContent as per docs (#12629)
* Correct the default of allowRunningInsecureContent as per docs

* fix linting

* Update calls to match native_mate API change
2018-04-18 05:53:32 -07:00
Alexey Kuzmin
597c8964f6 Preload doesn't load in sandboxed render if preload path contains special chars (#12037) (#12643)
* Adding missing headers

* adding ut

* Removing the file path exists check

* fixing test

* exposing window.require in UT

(cherry picked from commit 2f4fd3324b)
2018-04-17 11:00:07 -05:00
trop[bot]
652f83fc88 Backport (2-0-x) - Fix event leak on reuse of touchbar item (#12624)
* fix event leak on reuse of touchbar item

* Clean up child touch bar item event listeners and escape item listeners
2018-04-15 11:26:56 -05:00
trop[bot]
d432038aab Use CircleCI for Mac builds (#12573) 2018-04-09 19:45:35 -05:00
trop[bot]
5d8f36c53c Check for devtools in BrowserWindow.getFocusedWindow() (#12554) 2018-04-06 12:45:11 -04:00
trop[bot]
85dfdd6665 Expose IsOffScreen method always to JS. (#12531) 2018-04-04 13:25:28 -05:00
electron
de428ebec0 Bump v2.0.0-beta.7 2018-04-03 12:54:17 -07:00
John Kleinschmidt
c6c49b9e4b Add native arm/arm64 mksnapshot for 2-0-x (#12524)
* Add logic to bundle native mksnapshot for arm/arm64

(cherry picked from commit 79eff95a39)

* Update to latest libchromiumcontent
2018-04-03 14:24:38 -05:00
John Kleinschmidt
98495fabfb Fix pushRelease for autorelease (#12523) 2018-04-03 14:14:25 -05:00
trop[bot]
06c33c7e56 WebFrame.setVisualZoomLevelLimits sets user-agent scale constraints (#12510)
Fixes #11216.
2018-04-03 07:50:37 -05:00
trop[bot]
33aad6ae11 Handle in-app-purchase less fatally on non-Darwin (#12512)
Fixes #12471

Right now it throws a new error when the file is even require()d, but this isn't ideal as there are cases where everything is mass-required, such as Spectron.

Instead, we should throw an error on non-Darwin environments only when the IAP methods are invoked.
2018-04-02 19:23:28 -05:00
Charles Kerr
6c00b37dd1 update libcc submodule reference to electron-2-0-x (#12448)
* update libcc submodule reference to electron-2-0-x

* remove MarkHighMemoryUsage api
2018-04-02 19:12:55 -05:00
trop[bot]
d209e59c30 re-enable null check against menu item accelerators (#12455) 2018-03-28 16:45:34 -05:00
trop[bot]
14f8a2a0e8 Backport (2-0-x) - update doc for setProgressBar (#12454)
* update doc for setProgressBar

The linter was unable to get `paused` as a possible value for `mode`

* update doc for setProgressBar

Addressing PR feedback
2018-03-28 11:35:40 +11:00
John Kleinschmidt
65e1252da0 Bump v2.0.0-beta.6 2018-03-27 16:10:49 -04:00
trop[bot]
2903d7608c Backport (2-0-x) - Fix nil tray title crash (#12356)
* Add check for title_ being nil

* remove print stub
2018-03-23 13:05:59 -05:00
John Kleinschmidt
0bc72961ab Merge pull request #12412 from electron/autorelease-fixes
Fixes for autorelease
2018-03-22 16:08:14 -04:00
John Kleinschmidt
b55a24c025 Fixes for autorelease
1. Allow passing in of branch
2. Validate release before trying to run release
3. Fix upload-index-json.py to allow use of release build.
2018-03-22 11:48:41 -04:00
trop[bot]
51bca764f7 Do not block main process for async dialog (#12407) 2018-03-22 08:46:15 -05:00
Shelley Vohr
35976a0a07 fix tray highlight in darkmode (#12398) 2018-03-22 13:59:50 +11:00
trop[bot]
283ab23524 Use the appname as the tray icon's default tooltip (#12393)
This makes an upstream DCHECK happy in AppIndicatorIcon::SetToolTip.
Empty tooltip strings are discouraged, as discussed in commit log
b6c510aa543193337041517c2d70113840189b06.

Fixes #12386.
2018-03-21 16:02:48 -04:00
John Kleinschmidt
2343f7c287 Bump v2.0.0-beta.5 2018-03-20 15:04:20 -04:00
Birunthan Mohanathas
8991ad31d8 Backport (2-0-x) - Update draggable regions when changing BrowserView (#12370)
* Store InspectableWebContents instead of InspectableWebContentsView in NativeBrowserView

* Rename system_drag_exclude_areas => drag_exclude_rects

* Use NSView convertRect:toView: for BrowserView DragRegionView positioning

* Make BrowserView DragRegionViews children of the WebContents view

Previously they were children of the `InspectableWebContentsView` view,
which caused this assertion to fail:

f993888424/brightray/browser/mac/bry_inspectable_web_contents_view.mm (L162)

* Update draggable regions when changing BrowserView

Fixes #12150.
2018-03-20 13:03:45 -05:00
trop[bot]
fae6167308 Backport (2-0-x) - Remove the race condition between new process creation and context release (#12361)
* Remove the race condition between new process creation and old process releasing remote context

Previously there was a race condition where the getId() method would return the new context ID even
though the release was for the old context.  This changes it to send the "initial" context ID with
the release message to ensure there is no race.

* fetch context ID from remote in sandbox mode
2018-03-20 18:11:39 +11:00
John Kleinschmidt
bd25a5f453 Merge pull request #12353 from trop-bot/2-0-x-bp-update-ci-to-use-node.js-8-1521472101213
Backport (2-0-x) - Update CI to use Node.js 8
2018-03-19 13:03:25 -04:00
John Kleinschmidt
c80021924e Update CI to use Node 8 2018-03-19 15:08:27 +00:00
trop[bot]
0cc4584352 Backport (2-0-x) - Check menu.popup options are an object (#12330)
* check menu.popup options are an object

* Add a spec for menu.popup options check

* remove stray .only
2018-03-17 19:46:48 +09:00
trop[bot]
706f0c436d Backport (2-0-x) - Better GTK+ Menu color support (#12331)
* Better GTK+ Menu color support

 * Fix 'invisible menu' issue (#12275)

 * Now updates menu text color when focus changes!

 * Better caching of colors when system theme changes

 * Removed all GTK+ deprecation warnings from menubar

* Don't highlight menu text on mouseover in GTK+

* Fix textColor declaration scope error

* Simplify FocusManager connection management a bit

* Make the linter happy

* Decouple MenuBar view recoloring from rebuilding

This way we don't need to rebuild the subview each time a recolor
is needed, e.g. when window focus changes or the system theme changes

* Don't iterate child views if we don't need to

* Move variable declaration outside of a loop

* More efficient iteration of MenuBar children

* Cleaner MenuButton bounds testing

* Fix oops

* Add a nullptr check in MenuBar::GetItemCount()

* Simplify iteration in MenuBar::RebuildChildren()

* Make the linter happy

* Fix signed-unsigned comparison

* Remove declarations of nonexistent methods

* Make SubmenuButton accessor const

* Cleaner accelerator iteration

* Windows fixes
2018-03-17 19:45:14 +09:00
Charles Kerr
663e1e059b net: change mime type deduction in Change URLRequestAsarJob (#12319) (#12333) 2018-03-17 19:28:37 +09:00
John Kleinschmidt
433aba34e6 Fix AttributeError: 'dict' object has no attribute 'required' (#12307)
(cherry picked from commit 71c3483f55)
2018-03-16 10:23:22 +09:00
trop[bot]
bd33e7198e 🔧 Fix security warning (#12313) 2018-03-16 07:22:36 +09:00
John Kleinschmidt
e1b19140e5 Bump v2.0.0-beta.4 2018-03-15 08:55:16 -04:00
trop[bot]
4632ade7ae Document BrowserView.{destroy,isDestroyed} (#12299) 2018-03-15 16:37:19 +09:00
trop[bot]
b32f332ce3 Backport (2-0-x) - Set appropriate defaults for webview options (#12292)
* Persist defaults to webPreferences object to JS land can read the inferred values instead of just user defined values

* Test inherited default propogation

* Refactor to remove coupling from fetching values and defaults

* Test description type

* Fix up tests
2018-03-15 15:06:40 +09:00
trop[bot]
6ff0d744ee Backport (2-0-x) - Fix require on network share path (#12287)
* first pass at server/network require fix

* refactor for clarity
2018-03-15 12:26:52 +09:00
John Kleinschmidt
37cbf5e4f1 Merge pull request #12280 from trop-bot/2-0-x-bp-switching-all-emails-to-@electronjs.org-domain-1521056557166
Backport (2-0-x) - Switching all emails to `@electronjs.org` domain
2018-03-14 16:33:10 -04:00
John Kleinschmidt
f48f486412 Merge pull request #12249 from electron/auto-release-updates
Auto release updates
2018-03-14 16:32:12 -04:00
Jacob Groundwater
018b676efd Change Contact Emails 2018-03-14 19:42:43 +00:00
John Kleinschmidt
c9e5d17950 Fix autogeneration of release notes 2018-03-14 09:22:25 -04:00
John Kleinschmidt
b1dd013425 Upgrade to node 8 2018-03-14 09:22:25 -04:00
John Kleinschmidt
7a91c5668f Skip prompting for version when running auto build 2018-03-14 09:22:24 -04:00
John Kleinschmidt
2f47b71211 Disable mips release builds
mips builds don't currently work for 2.0.0
2018-03-14 09:22:24 -04:00
Samuel Attard
e8a7cc576e fix remote setInterval flake (#12265) 2018-03-14 15:42:44 +09:00
Cheng Zhao
c00b1ac669 Update libcc to fix private API usage in mas build (#12264) 2018-03-14 15:06:42 +09:00
trop[bot]
c4bde8853f add missing report.length > 1 assertion (#12262) 2018-03-14 14:45:06 +09:00
trop[bot]
ab77b55a90 Backport (2-0-x) - Enable easy rebuild of native modules for unreleased electron (#12260)
* Enable easy rebuild of native modules for unreleased electron

Sometimes when developing locally (as I found this morning) you want to rebuild native modules
against an unreleased version of Electron (in this case local master).  This PR adds a simple
script to launch a local HTTP server that generates and hosts the required header and checksum
files to rebuild modules.  So far only tested on macOS but should work on all OS's

* Allow custom port

* clean up serve script

* make optionality more obvious
2018-03-14 13:34:54 +09:00
trop[bot]
05b0948dd0 Fixed passing of exception to the system crash handler (#12259) 2018-03-14 12:58:26 +09:00
trop[bot]
c9e2140bca Backport - fix: Ensure that getLastCrashReport() is actually the last crash report (#12255)
* 🔧 Sort crashes

* 🔧 Actually test the method

* 🔪 Cut typo

* 👷 Fancy test

* 👷 Tests, how do they work

* 🔧 Linter's gotta lint
2018-03-14 11:36:58 +09:00
Cheng Zhao
9843ce743e Merge pull request #12218 from electron/backport_double_preload_2_0_patch
browser: fix preload loading twice in 2.x
2018-03-14 10:27:42 +09:00
Robo
c846f677c9 browser: fix null pointer dereference with getWebPreferences api (#12245)
* add failing spec

* devtools webContents don't have associated webPreferences
2018-03-14 06:06:51 +09:00
John Kleinschmidt
643dd55e07 Merge pull request #12247 from trop-bot/2-0-x-bp-spec--isolate-sw-file-scheme-spec-storage-with-temp-partition-1520962317089
Backport - spec: isolate sw file scheme spec storage with temp partition
2018-03-13 14:33:07 -04:00
deepak1556
d2045b93b7 spec: isolate sw file scheme spec storage with temp partition 2018-03-13 17:32:04 +00:00
John Kleinschmidt
c22d53be5c Merge pull request #12239 from electron/update-libcc-2.x
update libcc ref for 2.x
2018-03-13 11:35:44 -04:00
trop[bot]
e9d28f9b14 Backport - Parent's visibility trumps inherited 'show' option (#12244)
* Parent's visibility trumps inherited 'show' option

* Add tests

* Remove unnecessary work when merging options

* Use idiomatic ES6 when merging options

* Apply further ES6 bikeshedding
2018-03-13 23:27:44 +09:00
deepak1556
7e53a4c72c update libcc ref for https://github.com/electron/libchromiumcontent/pull/476 2018-03-13 11:36:07 +09:00
trop-devel[bot]
515fbb6fc3 Backport - fix: Incorrect warnings in webviews (#12236)
* 🔧 Get correct webContents

* 🔧 Err, webPreferences
2018-03-13 11:34:32 +09:00
trop-devel[bot]
af4dfcf6fe Fix menubar toggle alt key detection on focus (#12235)
Reset alt keypress flag on window blur so switching window via
Alt+* window manager keybindings can't incedentally trigger
annoying menubar toggles
2018-03-13 11:25:55 +09:00
Charles Kerr
176abdbd80 Linux named notifications - 2-0-0 (#12229)
* Newer CI images (#12188)

* Bump electronbuilds/electron* versions

The linux-appname branch has been gathering dust for awhile.
Some of the versions in `master` are higher, and some of the
versions in `linux-appname` are higher to add libnotify.

This commit takes the higher of the two numbers in each case.

* Add libnotify to the Dockerfiles

* Linux named notifications (#12192)

* Set name & desktop-entry on Linux notifications

* DBusMock now honors verbose mode flag

* Disable DBus Notification tests on ia32

* Fix desktop-id notification edge case (#12216)

* Fix desktop-id notification edge case

* Extract-method platform_util::GetDesktopName()

This removes duplicated code from libnotify_notifications.cc
and atom/common/linux/application_info.cc.

* Check for empty case in GetDesktopName().

* Move GetDesktopName() to brightray::util

* Remove unnecessary changes in platform_util

* Add a brightray::platform_util namespace

* Bump CI
2018-03-13 11:13:34 +09:00
Charles Kerr
cda7b8ccc8 clean planned breaking changes for 3.0 (#12145) (#12222) 2018-03-12 16:09:58 +09:00
deepak1556
1a43ba50b6 move ipc from rvh to rfh 2018-03-12 14:30:42 +09:00
Cheng Zhao
1174fc0ab8 Skip client-certificate test for Linux (#12213) 2018-03-12 09:25:43 +09:00
John Kleinschmidt
3c5ba35d63 Bump v2.0.0-beta.3 2018-03-09 09:15:39 -05:00
Cheng Zhao
0f143fdba0 Merge pull request #12182 from electron/update-libcc-2-0-x
Update to latest libchromiumcontent for 2-0-x
2018-03-09 10:16:43 +09:00
John Kleinschmidt
99ae56b782 Add configurable mocha timeout
Adding an environment variable, MOCHA_TIMEOUT that can be set for slower CI platforms
2018-03-08 16:29:31 -05:00
Aleš Pergl
5471bc313f Use content origin in screen coordinates for calculating popup menu position (#12181) 2018-03-09 05:55:31 +09:00
John Kleinschmidt
b0077241ee Update to latest libchromiumcontent for 2-0-x 2018-03-08 15:12:29 -05:00
John Kleinschmidt
bb40bc4aca Add logic to support automatic releases (#12177) 2018-03-09 02:46:06 +09:00
John Kleinschmidt
76fb7ee87c Allow CI testing on arm64 hardware for 2-0-x (#12178)
* Allow CI building on arm64 hardware

* Use bundled freetype from Chromium

(cherry picked from commit 51f89048d6)
2018-03-09 02:21:55 +09:00
Alexey Kuzmin
bfc0e3f266 Merge pull request #12174 from electron/cp-2-0-x/12059
Merge pull request #12059 from electron/add-tabbedwindow-warning
2018-03-08 15:13:37 +01:00
Alexey Kuzmin
48e068997b More vibrancy fixes (#12157) (#12171)
* Only set title bar to transparent when vibrant with a custom titlebar
* Correctly set the transparent state of the GpuSwitcher so vibrancy works on reload
* Document case where using frame: false without custom titleBarStyle and vibrant

(cherry picked from commit 8c138e74be)
2018-03-08 08:51:36 -05:00
Alexey Kuzmin
f443974f3d Merge pull request #12043 from kaylieEB/fix-menu-item (#12170)
Fix context menu click callback

(cherry picked from commit cc608a3fb0)
2018-03-08 08:43:38 -05:00
shelley vohr
36505ae00e Merge pull request #12059 from electron/add-tabbedwindow-warning
add warning when addTabbedWindow is called on self

(cherry picked from commit dfa1dc43df)
2018-03-08 14:33:10 +01:00
Charles Kerr
b330ff8004 Removals come >=1 major release after deprecation. (#12164) 2018-03-08 11:18:36 +09:00
John Kleinschmidt
6cda9460ea Merge pull request #12161 from electron/backport-flake-fixes
Backport flake fixes (2-0-x)
2018-03-07 14:09:14 -05:00
Charles Kerr
2cac654974 Exit gracefully on linux (#12139)
* Fix timing issue in singleton fixture.

Singleton now sends the "we've started" message out only after it's
received a `'ready'` event from `app`. Previously it sent the message
out immediately, resulting in the parent test trying to manipulate it
before Singleton's event loop was fully bootstrapped.

* Check for graceful exits on Linux, too.

Rewrite the "exits gracefully on macos" spec to run on Linux too.

* Check for graceful exits everywhere.

* Tweak comment

* Better error logging in api-app-spec.js. (#12122)

In the 'exits gracefully' test for app.exit(exitCode),
print the relevant error information if the test fails.

* Run the exit-gracefully test on macOS and Linux.

Windows does not support sending signals, but Node.js offers some
emulation with process.kill(), and subprocess.kill(). Sending signal 0
can be used to test for the existence of a process. Sending SIGINT,
SIGTERM, and SIGKILL cause the unconditional termination of the target
process.

So, we'll need a different approach if we want to test this in win32.
2018-03-07 12:45:26 -05:00
shelley vohr
5a210f3d7a Merge pull request #12137 from electron/deprecate-getMenuBatHeight-2.0.x
Deprecate screen.getMenuBarHeight (2.0.x)
2018-03-06 07:38:53 -08:00
Alexey Kuzmin
4bb10c10e4 Merge pull request #12133 from electron/update-libcc
Update libchromiumcontent for 2-0-x
2018-03-06 12:51:58 +01:00
Shelley Vohr
c0076d9c52 remove screen.getMenuBarHeight spec 2018-03-05 21:00:55 -05:00
Shelley Vohr
95539c5b63 deprecate screen.getMenuBarHeight 2018-03-05 21:00:50 -05:00
John Kleinschmidt
4f8ca2f03a Update to latest libchromiumcontent
Update to get electron/libchromiumcontent#463 security fix
2018-03-05 15:12:02 -05:00
John Kleinschmidt
c9b92aebd3 Bump v2.0.0-beta.2 2018-03-05 13:14:27 -05:00
Cheng Zhao
6d3f60374e Merge pull request #12087 from electron/fix-dock-menu-gc-2-0-x
Fix crash when setting dock menu (2.0.x)
2018-03-02 08:39:03 +09:00
Cheng Zhao
8703298e9d spec: Test garbage collecting dock menu 2018-03-01 09:48:39 +09:00
Cheng Zhao
a42057aabd Fix dockMenu not being referenced in JavaScript 2018-03-01 09:48:39 +09:00
Cheng Zhao
bd2ab27c25 Merge pull request #12053 from electron/network-delegate-race
Fix network delegate race condition in 2-0-x
2018-02-27 08:47:20 +09:00
Cheng Zhao
1e6d7295cf Move the arguments instead of const referrencing
Safer and more efficient.
2018-02-26 09:34:49 -08:00
Cheng Zhao
1918da7c2e Remove the evil URLRequestContextGetter::network_delegate 2018-02-26 09:34:40 -08:00
Cheng Zhao
38345c7267 Fix race condition when getting network delegate 2018-02-26 09:34:32 -08:00
shelley vohr
c4742df1ee Merge pull request #12016 from electron/backport-release-updates
Backport fixes from running 2.0.0-beta.1 release to 2-0-x
2018-02-22 15:27:05 -05:00
John Kleinschmidt
5fc485043b Fixes from running 2.0.0-beta.1 release
This provides the following fixes:
1. Remove logic to delete release branch because that branch is no longer used.
2. Fix --validateRelease to not verifyShasums when release is in draft mode.

(cherry picked from commit fa6510a90c)
2018-02-22 11:26:30 -05:00
shelley vohr
967dcd3471 Merge pull request #12014 from electron/backport-version-fix
Fix deprecated API in tools/dump-version-info.js for 2-0-x
2018-02-22 09:28:52 -05:00
John Kleinschmidt
96f800552c Fix deprecated API in tools/dump-version-info.js 2018-02-22 09:00:37 -05:00
John Kleinschmidt
afcbb589b6 Bump v2.0.0-beta.1 2018-02-21 14:45:36 -05:00
John Kleinschmidt
4159103467 Use new release job 2018-02-21 14:41:18 -05:00
John Kleinschmidt
2a97e48465 Merge pull request #11968 from electron/refactor-menu-popup
Refactor menu.popup
2018-02-21 14:29:52 -05:00
John Kleinschmidt
b4ae41b484 Merge pull request #11999 from electron/no_execstack
Explicitly disable executable stack
2018-02-21 14:00:47 -05:00
Shelley Vohr
e3d4358068 bump electron-typescript-defs to 1.3.2 2018-02-21 12:42:07 -05:00
Ales Pergl
89d5e4a2f0 Explicitly disable executable stack in all Linux binaries 2018-02-21 17:57:53 +01:00
Ales Pergl
c3dbba00a6 Use --icf=all on architectures where it's supported 2018-02-21 17:55:28 +01:00
shelley vohr
77b8c81096 Merge pull request #11963 from perlun/patch-1
security.md: Reformat security recommendation checklist
2018-02-21 10:01:15 -05:00
shelley vohr
0ef8f1bdad Add deprecation warnings fot html/rtf methods (#11995) 2018-02-21 06:53:48 -06:00
Cheng Zhao
f7ec346e9f Merge pull request #11956 from brenca/transparent-window-devtools-fix
Fix transparent windows losing transparency when devtools detaches
2018-02-21 19:54:35 +09:00
Heilig Benedek
6f2609f9d2 Remove outdated comments 2018-02-21 11:28:53 +01:00
shelley vohr
772a69e24a deprecate autoSubmit in favor of uploadToServer (#11992) 2018-02-20 22:31:48 -06:00
shelley vohr
193febd18c deprecate boolean highlightMode param (#11993)
* deprecate boolean highlightMode param

* add process.noDeprecations check

* fix native method override

* add todo
2018-02-20 22:30:32 -06:00
shelley vohr
719e5a93b4 deprecation for webContents.openDevTools (#11986)
* deprecate old openDevTools param

* add deprecation check and existence check

* fix method issues
2018-02-20 22:30:02 -06:00
Charles Kerr
f59d078eea Use more idiomatic JS in WebContents' init() 2018-02-20 19:20:11 -06:00
shelley vohr
c2575c4944 remove app.getAppMemoryInfo (#11985)
* remove app.getMemoryInfo

* semicolons are important
2018-02-20 18:52:33 -06:00
Charles Kerr
9c56b81b71 Throw an error if menu.popup() has no window 2018-02-20 18:38:05 -06:00
Charles Kerr
5a25b88b50 Fix browserWindow detection in menu.popup() 2018-02-20 18:35:39 -06:00
Charles Kerr
21de806c80 document menu.popup() option's window argument 2018-02-20 14:30:37 -06:00
Charles Kerr
708f39a1a5 update a few menu.popup() calls to use the new API 2018-02-20 14:02:24 -06:00
John Kleinschmidt
dcaff20cfd Merge pull request #11981 from electron/set-tray-highlightmode
no longer support bool param for setHighlightMode
2018-02-20 12:57:52 -05:00
Charles Kerr
35e90f742b fix menu.popup() sample code 2018-02-20 11:18:57 -06:00
shelley vohr
846be03f1d remove support for hidden-inset (#11975) 2018-02-20 11:09:54 -06:00
shelley vohr
7bcccdec41 remove atom-shell process name (#11979) 2018-02-20 10:33:38 -06:00
Shelley Vohr
5065e159f1 positionItem => positioningItem 2018-02-20 11:28:34 -05:00
shelley vohr
6a3fde6e20 Merge pull request #11973 from electron/remove-clipboard-methods
Remove html/rtf methods marked for 2.0
2018-02-20 11:21:10 -05:00
Charles Kerr
8d086a43cb Fix brightray::GetApplicationName(), ..Version() on Linux (#11980)
* add brightray API to override app version

* in atom browser, use brightray app version API

* on Linux, have GetApplicationVersion() use brightray version API

* on Linux, implement brightray::GetApplicationName()

* fix typo in brightray API

* make browser.GetName() logic follow GetVersion() logic

* improve variable name in OverrideApplicationVersion declaration

* fix typo in brightray impl
2018-02-20 10:16:51 -06:00
Shelley Vohr
ba933ef085 update docs for single param popup 2018-02-20 11:12:39 -05:00
Cheng Zhao
dc62e51ba4 Fix the cyclic reference in menu delegate (#11967)
* Fix the cyclic reference in menu delegate

* Fix menu tests due to delegate change
2018-02-20 10:11:35 -06:00
Shelley Vohr
fb7fb4972d options all the things 2018-02-20 11:10:53 -05:00
shelley vohr
e1b81b8a62 remove support for crashReporter autoSubmit (#11976) 2018-02-20 10:10:35 -06:00
shelley vohr
8d4bf3e29a Merge pull request #11974 from electron/remove-setZoomLevelLimits
remove setZoomLevelLimits
2018-02-20 10:51:41 -05:00
shelley vohr
a2856db982 Remove nativeImage deprecated methods (#11978)
* remove deprecated nativeimage methods

* remove .only from spec
2018-02-20 09:15:27 -06:00
Shelley Vohr
57738e6981 no longer support bool param for setHighlightMode 2018-02-20 10:06:59 -05:00
shelley vohr
98ba120ae2 Merge pull request #11972 from electron/remove-setextra-param
remove setExtraParameter for 2.0
2018-02-20 09:10:38 -05:00
Shelley Vohr
211b542ae4 remove setZoomLevelLimits 2018-02-20 08:57:48 -05:00
Charles Kerr
2a16b28be4 Cache libnotify server caps (#11965)
* cache libnotify server capabilities

* fix broken production cache in NotifierSupportsActions()

* log a warning if LibnotifyNotification::Initialize() fails
2018-02-20 07:53:10 -06:00
Shelley Vohr
e4e20d667b remove html/rtf methods marked for 2.0 2018-02-20 08:41:58 -05:00
Shelley Vohr
1a3661206e remove unused deprecate module from crashreporter 2018-02-20 08:31:38 -05:00
Shelley Vohr
fc025064f7 remove setExtraParameter for 2.0 2018-02-20 08:26:10 -05:00
Shelley Vohr
56f06187d5 forgot to remove old method 2018-02-19 21:03:10 -05:00
Shelley Vohr
73ab87b87f add new and changed specs 2018-02-19 20:59:47 -05:00
Shelley Vohr
6e11a3e53d add restructured window.popup 2018-02-19 20:59:27 -05:00
shelley vohr
459a5e3a1f Merge pull request #11961 from electron/fix-bw-callback
add conditional for menu.popup(window, callback)
2018-02-19 19:54:20 -05:00
Zeke Sikelianos
35faab89a4 add typing cat to first PR comment (#11964)
* add typing cat to first PR comment

* update cat URL
2018-02-19 17:45:14 -06:00
Zeke Sikelianos
af82b2037e Merge pull request #11950 from electron/semver-doc-tweaks
semver documentation tweaks
2018-02-19 13:07:33 -08:00
Per Lundberg
8375d21cae security.md: Update security recommendation checklist 2018-02-19 23:07:03 +02:00
Shelley Vohr
9c52d273dd add spec for menu.popup(window, callback) 2018-02-19 13:15:49 -05:00
Shelley Vohr
cd9e7142e4 add conditional for menu.popup(window, callback) 2018-02-19 13:06:37 -05:00
Heilig Benedek
d31d2087a3 use SK_ColorTRANSPARENT as the default color to fix issue with transparent window devtools detach 2018-02-19 15:07:28 +01:00
Charles Kerr
56859531cd fix floating reference glib warning (#11948)
use gtk_widget_destroy() rather than g_object_unref() on the floating temporary menubar widget that we use to calculate colors
2018-02-19 00:12:54 -06:00
Charles Kerr
fbce7bafd7 capitalize 'Node.js' 2018-02-18 23:14:08 -06:00
Charles Kerr
e3efe4b378 make the table a real table 2018-02-18 11:04:21 -06:00
Charles Kerr
ac57c7625a minor copyediting 2018-02-18 11:00:06 -06:00
shelley vohr
55d4d74624 Merge pull request #11944 from electron/update-native-mate
update native_mate ref
2018-02-18 09:20:22 -05:00
Shelley Vohr
2a46a63833 update native_mate ref 2018-02-18 08:57:22 -05:00
John Kleinschmidt
f3415c04cd Merge pull request #11804 from electron/fix-protocol-origin-filtering
Fix protocol filtering of net.request
2018-02-16 14:17:46 -05:00
Paul Frazee
01a6104727 Add download from custom protocol test (#11931) 2018-02-16 13:03:53 -05:00
Thiago de Arruda
bc76f35691 Fix protocol filtering of net.request
net::URLRequest inherits from base::SupportsUserData, which allows
associating arbitrary data with the request. Use this mechanism as a
condition for filtering requests from custom protocols.

Close #11657
2018-02-16 13:03:53 -05:00
John Kleinschmidt
78ccfa0612 Merge pull request #11879 from electron/fix-gtk-deprecations
Fix GTK+ 3 deprecations
2018-02-16 10:01:01 -05:00
Cheng Zhao
67fa13d7cf Merge pull request #11925 from electron/squirrel-mac-cdn
Update to use Squirrel.Mac that supports CDN releases
2018-02-16 15:28:39 +09:00
Samuel Attard
a20b379f26 fix windows tests 2018-02-16 16:02:10 +11:00
Samuel Attard
549042160f requestHeaders --> headers 2018-02-16 13:41:21 +11:00
Samuel Attard
f84b8bbfdc Update deps for new squirrel 2018-02-16 13:01:00 +11:00
Charles Kerr
5e7a5ce3a9 run clang-format on changed sources 2018-02-15 15:20:55 -06:00
Charles Kerr
d30310a2f2 don't build libgtkui files on non-GTK+ platforms 2018-02-15 15:15:26 -06:00
Charles Kerr
b0469702ad replace gtk2 with gtk3 in cibuild script 2018-02-15 15:10:21 -06:00
Charles Kerr
4774f32065 replace gtk2 with gtk3 in docs 2018-02-15 15:08:55 -06:00
Charles Kerr
c8e64ff870 replace gtk2 with gtk3 in dockerfiles 2018-02-15 15:03:14 -06:00
Charles Kerr
381ed2e2b2 remove GTK+ 2 specific code 2018-02-15 14:57:45 -06:00
Cheng Zhao
af92b04eb9 Merge pull request #11654 from sethlu/set-notification-close-button-text
feat: Set macOS notification close button title
2018-02-15 16:01:30 +09:00
Cheng Zhao
fdda1c55c5 Merge pull request #11647 from sethlu/accept-additional-notification-actions
feat: Accept additional notification actions
2018-02-15 15:46:36 +09:00
Samuel Attard
6318cd781d Update to use Squirrel.Mac that supports CDN releases 2018-02-15 14:00:46 +11:00
shelley vohr
7e2f7602c1 Merge pull request #11921 from electron/allow-osr-console-message
Emit console-message in OSR mode
2018-02-14 11:02:18 -05:00
Zeke Sikelianos
6f0080be4c Merge pull request #11918 from dakeshi/fix-typo-docs
fix typo in electron-versioning.md
2018-02-14 06:46:37 -08:00
Shelley Vohr
31b074ff0e change to return emit 2018-02-14 09:28:21 -05:00
Shelley Vohr
c3d11a51cc emit console-message in OSR mode 2018-02-14 09:09:45 -05:00
Charles Kerr
402201ac39 Fix cppcheck warnings (#11883)
* remove unused variable

* limit scope of variable 'ret'

* pass shared_ptr<SkBitmap> by reference

* silence warning: value reassign before read

* fix oops

* don't refer to 'response' after std::move()ing it

* make the linter happy
2018-02-14 02:21:46 -06:00
shelley vohr
f8b7145c6b update libcc ref (#11916) 2018-02-13 23:13:38 -05:00
Sangjoon Moon
8a84bd8d19 fix typo in electron-versioning.md
- backport
- stabilization branch
- and some typo
2018-02-14 13:04:57 +09:00
shelley vohr
a55fd06aa2 Revert "Merge pull request #11737 from kwonoj/feat-cache-capacity" (#11906)
This reverts commit 181169b743, reversing
changes made to baced3152f.
2018-02-13 10:49:27 -05:00
Cheng Zhao
eba9abdbe5 Merge pull request #11501 from emmkimme/Enh_WebPrefs_Affinity_Option
Feature : Affinity option for gathering several pages in a single process
2018-02-13 16:21:48 +09:00
Cheng Zhao
affa21600c Remove unnecessary methods on WebContentsPreferences 2018-02-13 15:57:54 +09:00
Cheng Zhao
2b623f5d86 docs: More explaination to affinity option 2018-02-13 15:33:11 +09:00
Emmanuel Kimmerlin
9c1b47361f Add an "affinity" option to webPreferences 2018-02-13 15:18:55 +09:00
John Eismeier
8d55334016 Propose fix some typos (#11905) 2018-02-13 00:18:27 -05:00
John Kleinschmidt
546bd6da5e Merge pull request #11903 from electron/update-release-for2
Change release process for 2.0
2018-02-12 16:52:41 -05:00
Felix Rieseberg
4ed5bb9901 fix: Update touch bar type documentation (#11563)
* fix: Update touch bar type documentation

Tiny change: The `escapeItem` in the touch bar constructor accepts a `null`, but our typings do not reflect that.

* Also uppdate the escapeItem instance property type docs
2018-02-12 14:59:01 -05:00
Samuel Attard
9bd7d53cf8 Handle empty handles (#11598)
* Handle empty handles

* Close and dispose window at end of void test

* Dispose of existing window before running void 0 spec
2018-02-12 14:46:29 -05:00
John Kleinschmidt
12a8d90ef0 Change release process for 2.0
Tag release as soon as version bumps
No longer use release branch
Remove merge step as it is no longer needed.
2018-02-12 14:06:09 -05:00
Samuel Attard
181169b743 Merge pull request #11737 from kwonoj/feat-cache-capacity
feat(webframe): export set cache capacity interface
2018-02-13 06:02:25 +11:00
Samuel Attard
baced3152f Mark securityScopedBookmarks as optional and a boolean (#11901) 2018-02-12 13:48:45 -05:00
Samuel Attard
ae65938752 Fix frameless windows with vibrancy (#11886) 2018-02-12 13:38:37 -05:00
acheronfail
d1d50a4c92 Implement App-Scoped Security scoped bookmarks (#11711)
* implementation of security scoped bookmarks

* option is now only available on mas builds
2018-02-12 13:25:06 -05:00
Samuel Attard
9f78ef0179 Merge pull request #11595 from YurySolovyov/fileicon-task-scheduler
Use task scheduler for app.getFileIcon API
2018-02-13 05:11:22 +11:00
Samuel Attard
01dcddef35 Merge pull request #11819 from kwonoj/feat-worditerator
feat(worditerator): bump up worditerator into latest
2018-02-13 05:11:01 +11:00
Samuel Attard
b3234f634b Add ability to set arbitrary arguments in a renderer process (#11850) 2018-02-12 11:54:31 -06:00
Samuel Attard
66b57858b8 Fix child touch bar items not updating (#11812)
* Fix child touch bar items not updating

Deep children of a TouchBar didn't cause the top level touch bar to update, now they do

Fixes #11761.

* Remove unused newValue property in TB setter
2018-02-12 12:53:04 -05:00
shelley vohr
6943ada7e8 Merge pull request #11897 from electron/fix-contrib-links
add links to new contrib docs
2018-02-12 12:48:47 -05:00
John Kleinschmidt
e6ac2637d3 Merge pull request #11728 from brenca/osr-gpu-update-master
Improve OSR API (master)
2018-02-12 12:29:11 -05:00
shelley vohr
fae71f9987 Merge pull request #11880 from nitsakh/better-ipc-logging
Add ability to log atom ipc messages
2018-02-12 09:20:37 -05:00
Shelley Vohr
8987828ecd add links to new contrib docs 2018-02-12 09:16:29 -05:00
shelley vohr
533dfc42a8 enhance documentation around contributing to electron (#11887)
* add issues document

* add documentation coding style to doc

* copyediting

* replace `nodejs/node` with `electron/electron`
* fix commasplice
* fix two most important... s/is/are/
* omit unnecessary words

* add pull requests doc

* copyediting

* add general code style to styleguide

* updates to CONTRIBUTING.md

* copyediting

* mark shell blocks as ```sh
* mitigate phrase duplication e.g. 'best practice'
* lots of opinionated changes to omit unnecessary words

* fix numbering & re-apply changes that I overwrote
2018-02-12 08:09:38 -06:00
shelley vohr
31e0bc02ba add pr template (#11888) 2018-02-12 08:08:32 -06:00
universeroc
069c6187cf Fix #11893 Remove unused member variable content_client_ (#11894) 2018-02-12 08:07:12 -06:00
Nitish Sakhawalkar
e19e2b9242 Address review comments 2018-02-11 10:25:11 -08:00
shelley vohr
647f0f3a57 Merge pull request #11873 from electron/add-file-format-picker
add accessory view for format picker
2018-02-10 23:32:08 -05:00
Shelley Vohr
36cf548114 change weak ptr ref to strong 2018-02-10 21:04:26 -05:00
shelley vohr
1657c37761 Merge pull request #11881 from electron/update-zoom-level-doc
add formula to setZoomLevel doc
2018-02-10 09:08:59 -05:00
Zhuo Lu
e3b70dd029 Fix grammar 2018-02-10 03:20:20 -08:00
Zhuo Lu
d05791c1ac Tweak wording 2018-02-10 03:20:20 -08:00
Zhuo Lu
bf11b09d35 Mention change of default value scenario in doc 2018-02-10 03:20:20 -08:00
Zhuo Lu
69e65e0d5e Update NotificationAction doc 2018-02-10 03:20:20 -08:00
Zhuo Lu
0b7a629a41 Overload method for naming consistency 2018-02-10 03:20:20 -08:00
Zhuo Lu
75b990faff Use std::string::empty to check 2018-02-10 03:20:20 -08:00
Zhuo Lu
1e1087abbb Simplify formatting 2018-02-10 03:20:20 -08:00
Zhuo Lu
31baafab3b NSUserNotification should respond
NSUserNotification is expected to responsd to `@selector(setContentImage:)` with macOS ^10.9
2018-02-10 03:20:20 -08:00
Zhuo Lu
3ee3e9a3e8 Fix typo 2018-02-10 03:20:20 -08:00
Zhuo Lu
09d51f0a3d Fix include order 2018-02-10 03:20:20 -08:00
Zhuo Lu
844ee0a3f4 Accept additional notification actions
Change to the existing API definition: The first action with type `button` seen will be displayed on the notification, the rest listed as additional actions (shown when holding down on the primary action button)
2018-02-10 03:20:20 -08:00
Zhuo Lu
38d284590f Add Notification tests 2018-02-10 03:19:47 -08:00
Zhuo Lu
29f9929703 Organize code 2018-02-10 03:19:47 -08:00
Zhuo Lu
0d4c6e327f Update Notification API doc 2018-02-10 03:19:47 -08:00
Zhuo Lu
be118d4f13 Make it able to set close button text 2018-02-10 03:19:47 -08:00
Shelley Vohr
5818353ebc add formula to setZoomLevel doc 2018-02-09 23:20:45 -05:00
Shelley Vohr
3085c78bcf implement selectFormat selector 2018-02-09 21:38:21 -05:00
Nitish Sakhawalkar
5194288fce Add ability to log atom ipc messages 2018-02-09 18:01:14 -08:00
Charles Kerr
3710e0e38b make the linter happier 2018-02-09 19:34:37 -06:00
Charles Kerr
4b766d26df make the linter happy 2018-02-09 19:29:32 -06:00
Charles Kerr
3f5ce6d74f fix gtk3 deprecation warnings setting menubar colors 2018-02-09 19:04:59 -06:00
Charles Kerr
b107d3f440 remove icons from messageboxes on gtk
Icons are deprecated in GtkMessageBoxes as of GTK+ 3.12. The GNOME HIG no longer shows icons in example dialogs; see https://developer.gnome.org/hig/stable/dialogs.html.en and https://developer.gnome.org/gtk3/stable/GtkMessageDialog.html
2018-02-09 17:53:02 -06:00
Charles Kerr
ffff400236 fix 'GTK_STOCK_*' deprecation warnings 2018-02-09 17:45:34 -06:00
shelley vohr
647d04cf92 Add brightray to src code structure (#11878)
* add brightray to src code structure

* try new code flag
2018-02-09 13:21:50 -06:00
Charles Kerr
e5eeab6e29 fix 'GTK_STOCK_*' deprecation warnings 2018-02-09 09:57:39 -06:00
Shelley Vohr
0fff336481 add accessory view for format picker 2018-02-09 09:08:04 -05:00
Aleš Pergl
efb44050db Enable official build (#11847)
* Updated libchromiumcontent submodule

* Use same LTO settings as libcc

* Use whole program optimization, favour speed, remove redundancies

* Don't use variable template as it confuses LTCG

* Use lld and ThinLTO only on limited set of architectures
2018-02-08 13:26:23 -06:00
shelley vohr
8b9b1e5595 Merge pull request #11863 from electron/move-locale-test
Move locale doc to command line switches
2018-02-08 14:10:19 -05:00
Shelley Vohr
1e090b9ee7 remove .only 2018-02-08 13:50:44 -05:00
Shelley Vohr
f6d389b159 fix child process import 2018-02-08 13:50:19 -05:00
Shelley Vohr
e10b5e13e9 move spec to chromium_spec 2018-02-08 13:00:41 -05:00
Shelley Vohr
1018cdc225 move locale doc to command line switches 2018-02-08 11:49:28 -05:00
shelley vohr
ca34978e73 add app.setLocale() (#11469)
* infrastructure for setLocale via klang

* add documentation for setLocale

* add test for setLocale

* fix spec

* add spec and update docs

* fix carriage feeds on windows

* SetLocale() sets LC_ALL on Linux

* in SetLocale() on Linux, use g_setenv()

* fix tyop: '#ifdef OSX_POSIX'

* make the linter happy

* improvements from review
2018-02-08 08:26:37 -06:00
Vanessa Yuen
e3f1d90854 Merge pull request #11855 from electron/vanessayuenn-patch-1
Delete `upgradeing-chrome.md`
2018-02-07 17:53:34 +01:00
Vanessa Yuen
4ab13d9e90 Delete upgradeing-chrome.md 2018-02-07 17:11:16 +01:00
OJ Kwon
e869c27041 feat(worditerator): bump up worditerator into latest 2018-02-06 15:31:18 -08:00
Felix Rieseberg
6c6fa3190f Fix PRE_RELEASE_VERSION (on master) (#11844)
* 🔧 Fix PRE_RELEASE_VERSION

* 🔧 Fix spacing

* 🔧 Fix this, but harder
2018-02-06 16:33:51 -06:00
shelley vohr
64f509ea7a Merge pull request #11832 from electron/enable-window
Add API to enable/disable a window
2018-02-06 14:14:45 -05:00
Shelley Vohr
5b901d9f82 revert TOOLKIT_VIEWS check change 2018-02-06 13:34:27 -05:00
John Kleinschmidt
6fd5b168bc Merge pull request #11841 from electron/vanessayuenn-patch-1
Update snapcraft.md
2018-02-06 11:45:14 -05:00
Vanessa Yuen
4685c46b04 Update snapcraft.md
fix super teeny tiny typo 😬
2018-02-06 17:28:40 +01:00
John Kleinschmidt
a0e584efeb Merge pull request #11793 from electron/release-updates
Improvements to release process
2018-02-06 11:12:41 -05:00
Shelley Vohr
3f6d2eb3ab remove extraneous variable 2018-02-06 09:27:30 -05:00
Shelley Vohr
80aa399f8a updates to mac enable method 2018-02-06 09:16:22 -05:00
Shelley Vohr
131aa38768 typo fix 2018-02-06 08:30:33 -05:00
Shelley Vohr
faf08b2b77 add documentation 2018-02-06 08:28:41 -05:00
Shelley Vohr
ae632193c0 migrate to virtual void and start mac impl 2018-02-06 08:21:53 -05:00
Samuel Attard
8c2c7c3634 Merge pull request #11836 from kaylieEB/master
Replace custom function with Object.values()
2018-02-06 15:45:02 +11:00
kaylie
3c64062f69 Replace custom function with Object.values() 2018-02-05 20:03:28 -08:00
Shelley Vohr
97589bbe33 first pass at api method to enable window 2018-02-05 14:49:59 -05:00
shelley vohr
5240352326 Remove extra menu separators (#11827)
* add function to remove leading/trailing separators

* change const  name for clarity

* add spec to check filtered separators

* clean method and add edge case spec per review
2018-02-05 11:55:12 -06:00
shelley vohr
e6a5990b95 Merge pull request #11774 from nitsakh/fix-invalid-utf
Handle invalid utf8 characters for debugger
2018-02-05 12:44:41 -05:00
John Kleinschmidt
e924781ee5 Improvements to release process
1. Prompt user to verify version before version is created.
2. Fix validateRelease instructions and usage
3. Fix ci-release-build so that you don't have to pass in --ghRelease=true; just --ghRelease will work.
2018-02-05 10:57:48 -05:00
Cheng Zhao
42fa018277 Merge pull request #11492 from timmyhadwen/master
Fixed Bluetooth chooser bug. Closes #11399
2018-02-05 20:44:42 +09:00
Cheng Zhao
8ac52b418b Coding style fixes 2018-02-05 17:29:59 +09:00
Samuel Attard
9676c0a4f9 Fix build and ensure no breaking change 2018-02-05 17:29:59 +09:00
Cheng Zhao
1c43768104 Coding style fixes 2018-02-05 17:29:59 +09:00
Samuel Attard
87c2f0f14f Fix build and ensure no breaking change 2018-02-05 17:29:59 +09:00
Samuel Attard
5f7a173d1d Add missing header import 2018-02-05 17:29:59 +09:00
Samuel Attard
72464a6db5 Fix implicit appUserModelId set 2018-02-05 17:29:59 +09:00
Cheng Zhao
ab015e573b Merge pull request #11417 from electron/power-monitor-shutdown-event-and-delay-api
[RFC] New API: powerMonitor "shutdown" event
2018-02-05 17:29:31 +09:00
Cheng Zhao
9337959f51 The tryToTerminateApp is not really needed 2018-02-05 16:25:50 +09:00
Cheng Zhao
983e1b1a70 Implement shutdown event for macOS 2018-02-05 16:20:57 +09:00
Cheng Zhao
c470e758cc Remove the AllocateSystemIOPorts call
It is no longer needed and it is crashing.
2018-02-05 16:15:49 +09:00
Cheng Zhao
109e2c760f Do not use virtual function to request shutdown
Would make it easier to port to other platforms.
2018-02-05 15:50:55 +09:00
Cheng Zhao
8ae3d9dd0b Simplify the public PowerObserver interface 2018-02-05 15:28:58 +09:00
Thiago de Arruda
e0e7dd2a8f fixup! Implement powerMonitor 'shutdown' event for Linux. 2018-02-05 15:21:31 +09:00
Thiago de Arruda
176c03fa15 Add doc for powerMonitor shutdown event 2018-02-05 15:21:31 +09:00
Thiago de Arruda
f0e210360f fixup! Implement powerMonitor 'shutdown' event for Linux 2018-02-05 15:21:31 +09:00
Thiago de Arruda
45763c0afb fixup! Implement powerMonitor 'shutdown' event for Linux 2018-02-05 15:21:31 +09:00
Thiago de Arruda
df6328e5d7 Add some tests for powerMonitor "shutdown" event 2018-02-05 15:21:31 +09:00
Thiago de Arruda
56b53e71aa Implement powerMonitor 'shutdown' event for Linux.
The event is emitted when the OS is rebooting/shutting down, and allows
an electron app to call `e.preventDefault()` in order to delay shutdown
and exit cleanly.
2018-02-05 15:21:31 +09:00
Cheng Zhao
28d96e2d29 Merge pull request #11354 from elegos/feature/create-dist-chromium-dir-option
Adds --chromium_dir argument to script/create-dist.py
2018-02-05 15:08:57 +09:00
Pranjal
732af93fc9 Updated for arm and armv7l documentation (#11825)
* Updated for arm and armv7l documentation

Cleared up the confusion caused by arm or armv7l  mentioned somewhere and not mentioned elsewhere

* 📝 Improve wording a bit.
2018-02-04 18:29:19 -07:00
Felix Rieseberg
d586ef2f39 feature: Hot security tips (#11810)
* 🔧 Add security issue detection (and logs)

* 🔧 Check for it on load

* 👷 Add some tests

* 👷 Make the linter happy

* 🔧 Allow them to be enabled by force

* 📝 Make message slightly prettier

* 🔧 Fix a typo in the code comment

* 🔧 Classic mistake

* 🚀 Optimize things a bit more

* 👷 Add tests, fix tests

* 📝 Document things

* 🔧 Make linter happy

* 🔧 One more piece of cleanup
2018-02-03 07:50:12 -07:00
Nitish Sakhawalkar
62d2a3472f Fix test BrowserWindow.addTabbedWindow() (#11795)
* Fix test BrowserWindow.addTabbedWindow()

* Address review comments
2018-02-02 19:31:02 -07:00
Charles Kerr
bd06abd523 Merge pull request #11806 from electron/security-docs-improvements
docs: Fixs some errors in the security documentation
2018-02-02 07:47:37 -07:00
Zeke Sikelianos
a033a9cd5d Merge pull request #11794 from electron/snapcraft-documentation
Add snapcraft documentation
2018-02-01 19:22:10 -08:00
Nitish Sakhawalkar
e411b49f4e Fix and update debugger UTF char test 2018-02-01 16:47:52 -08:00
Felix Rieseberg
6cf0c56eaf 📝 Some more words 2018-02-01 16:32:58 -08:00
Charles Kerr
714838d65e Merge pull request #11796 from electron/case-insensitive-blacklist
Case insensitive blacklist
2018-02-01 15:51:02 -07:00
shelley vohr
1545a95782 Merge pull request #11799 from electron/browserview-inherit-fix
Don't inherit isBrowserView preference
2018-02-01 14:36:56 -05:00
Felix Rieseberg
ce969c9326 📝 Fix some errors 2018-02-01 09:58:02 -08:00
Felix Rieseberg
be7e46b3fe 📝 A word on strict 2018-02-01 09:47:15 -08:00
Felix Rieseberg
495c6dcff5 📝 Some more words 2018-02-01 09:43:26 -08:00
Charles Kerr
e51c78f10c fix oops
because compiling before pushing is for wusses
2018-01-31 22:25:57 -07:00
Shelley Vohr
db6d84de74 don't inherit isBrowserView for spawned child windows 2018-02-01 00:09:37 -05:00
Charles Kerr
b32a7d4cb4 Merge pull request #11798 from electron/shadowroot-deprecate-fix
Migrate deprecated web-view method
2018-01-31 22:09:33 -07:00
Felix Rieseberg
77dcddf157 📝 Even more words 2018-01-31 17:00:19 -08:00
Felix Rieseberg
9d0d83a002 📝 Some more words 2018-01-31 16:57:45 -08:00
Felix Rieseberg
45119845e8 📝 Callout forge/builder as easiest 2018-01-31 16:56:46 -08:00
Felix Rieseberg
311c0873db 📝 Link to the guide 2018-01-31 16:54:23 -08:00
Felix Rieseberg
1184eca581 🔧 Fix various typos, implement feedback 2018-01-31 16:52:38 -08:00
Charles Kerr
1106cde687 fix oops 2018-01-31 17:40:11 -07:00
Charles Kerr
09a2c80443 use std::binary_search to search switch blacklist 2018-01-31 17:36:06 -07:00
Charles Kerr
8405fe763e Make a copy-paste recipe for rebuilding the blacklist 2018-01-31 17:35:34 -07:00
Samuel Attard
ce361a12e3 Use case-insensitive switch comparisons 2018-01-31 17:35:09 -07:00
Shelley Vohr
b74304145e createShadowRoot => attachShadow 2018-01-31 19:29:23 -05:00
Felix Rieseberg
b49a284ccf 📝 Add snapcraft documentation 2018-01-31 16:01:38 -08:00
John Kleinschmidt
278c58055e Merge pull request #11776 from electron/parallel-releases
Allow multiple releases to run at once
2018-01-31 13:14:09 -05:00
John Kleinschmidt
7e9131d82b Allow multiple releases to run at once
Find draft release by draft flag and tag name
2018-01-30 17:35:16 -07:00
Charles Kerr
67196bdd3e Merge pull request #11770 from electron/security-documentation
Enhance security documentation
2018-01-30 15:03:43 -07:00
shelley vohr
f24eab74d8 Merge pull request #11726 from electron/faster-compare-blacklist
Make use of sorted list to speed up searching
2018-01-30 09:46:38 -05:00
Felix Rieseberg
93dc38a17b 👷 Put ESLint's mind at ease 2018-01-29 16:27:41 -08:00
Felix Rieseberg
d8d19baad3 ❤️ Even more feedback 2018-01-29 16:02:39 -08:00
Felix Rieseberg
1e1729adad ❤️ More feedback 2018-01-29 16:01:05 -08:00
Zeke Sikelianos
aea06ed95f Merge pull request #11758 from nicknish/nn/fix-typo-remote-api-docs
Fix typo in remote api docs
2018-01-29 14:33:16 -08:00
Felix Rieseberg
8f685e9329 👷 Linter errors 2018-01-29 12:36:51 -08:00
Felix Rieseberg
8804b09188 ❤️ Implement @zeke’s feedback 2018-01-29 12:34:46 -08:00
Felix Rieseberg
536ff0b7e2 👷 Fix failed test 2018-01-29 11:29:15 -08:00
Felix Rieseberg
fb8606dd0c 📝 General cleanup 2018-01-29 11:19:43 -08:00
Felix Rieseberg
c4dc8dacbf 📝 Context Isolation 2018-01-29 11:19:21 -08:00
Felix Rieseberg
4cb22dd2ff 📝 allowpopups 2018-01-29 11:04:02 -08:00
Felix Rieseberg
cdb20d2692 🔧 WebSecurity 2018-01-29 11:03:51 -08:00
Felix Rieseberg
7e79ae750f 📝 Blink Features 2018-01-29 11:03:38 -08:00
Felix Rieseberg
39e0efd9a4 📝 Experimental Features 2018-01-29 11:03:27 -08:00
Felix Rieseberg
e73f142adc 📝 allowRunningInsecureContent 2018-01-29 11:03:06 -08:00
Felix Rieseberg
5418866e87 📝 eval() 2018-01-29 11:02:52 -08:00
Felix Rieseberg
c793ee3aeb 📝 Content Security Policy 2018-01-29 11:02:30 -08:00
Felix Rieseberg
a5c900ac7a 📝 Context Isolation 2018-01-29 11:01:22 -08:00
shelley vohr
12d4f984f3 Merge pull request #11754 from electron/menu-events
Add and document menu events
2018-01-29 12:40:57 -05:00
Felix Rieseberg
f790c24c27 📝 Verify WebView creation 2018-01-28 18:19:49 -08:00
Felix Rieseberg
d67c64b6fa 📝 Disable Node Integration 2018-01-28 17:25:05 -08:00
Felix Rieseberg
2db125890c 📝 Secure content 2018-01-28 16:55:11 -08:00
Felix Rieseberg
601fbc8731 📝 Link to security tutorial 2018-01-28 16:54:58 -08:00
Shelley Vohr
c886803d0f change doc to show working on all platforms 2018-01-28 18:57:44 -05:00
Shelley Vohr
a9dd4c927d update menu docs description string 2018-01-28 13:59:53 -05:00
nicknish
30581f78a2 📝 Fix typo in remote api docs [ci skip] 2018-01-28 04:37:13 +08:00
Shelley Vohr
3d032c2b57 forgot to remove .only from spec 2018-01-27 12:38:55 -05:00
Shelley Vohr
3679a9c37a fix event callback placement in spec 2018-01-27 12:36:51 -05:00
Shelley Vohr
e81265bc7f add documentation for new menu events 2018-01-27 11:28:42 -05:00
Shelley Vohr
e345342e36 add first pass at menu event specs 2018-01-27 11:23:46 -05:00
Shelley Vohr
bef4c84799 turn class into observer 2018-01-27 10:40:50 -05:00
Shelley Vohr
3399480304 first pass at menu event emission 2018-01-27 09:35:58 -05:00
Samuel Attard
b0a1575bb7 Merge pull request #11747 from timfish/patch-1
CrashReport structure in docs does not match API output
2018-01-27 23:24:43 +11:00
Tim Fish
e3383c82d1 CrashReport structure does not match API output
Electron 1.7

Docs:
```typescript
  interface CrashReport {
    date: string;
    ID: number;
  }
```
Actual output of `getLastCrashReport`:
```javascript
{ 
  date: 2018-01-26T21:50:05.000Z,
  id: '989d0469-9eb7-4f70-ba58-3425bc6ffa3b' 
}
```
2018-01-27 12:21:09 +01:00
OJ Kwon
1ab92f7866 docs(webframe): reword api instructions 2018-01-26 10:58:25 -08:00
OJ Kwon
690a9e9483 test(webframe): add basic test case 2018-01-26 10:57:52 -08:00
OJ Kwon
004c9427eb docs(webframe): add interface instruction 2018-01-26 10:57:52 -08:00
Heilig Benedek
df3d94b20d Remove web_contents_impl() helper to clarify code and remove unnecessary guard 2018-01-26 10:30:20 +01:00
OJ Kwon
d172e29270 feat(webframe): export set cache capacity interface 2018-01-25 20:43:01 -08:00
Heilig Benedek
406f171c88 Move OSR api to OsrWCV to allow api calls to take effect sooner 2018-01-25 16:11:56 +01:00
Heilig Benedek
1a8916ed47 Call SetAuthoritativeVsyncInterval on the Compositor directly 2018-01-25 16:11:44 +01:00
Heilig Benedek
099bbfbafb Raise maximum OSR framerate to 240 2018-01-25 16:11:31 +01:00
Heilig Benedek
304fd49e84 Don't generate a frame with GPU OSR if IsPainting is false 2018-01-25 16:11:22 +01:00
Heilig Benedek
708cde92cf Don't generate a paint when StartPainting is called inside paint cb 2018-01-25 16:11:12 +01:00
Heilig Benedek
17d85318c3 Use null accelerated widget to avoid showing GPU accelerated OSR surface 2018-01-25 16:10:38 +01:00
Cheng Zhao
b5d5eca224 Make use of sorted order to speed up searching 2018-01-25 14:42:56 +09:00
Cheng Zhao
b9c0bab8f1 Merge pull request #11704 from brenca/fix-10678
Remove WS_EX_COMPOSITED style from window (master)
2018-01-24 14:44:52 +09:00
Cheng Zhao
0207aebad1 Merge pull request #11664 from loc/use_directx_capturer_win
Use same screen capturer settings for thumbnails as getUserMedia
2018-01-24 14:38:32 +09:00
Aleš Pergl
868e792572 Make run-as-node mode optional (#11701) 2018-01-23 18:17:15 -05:00
shelley vohr
19a5ebce66 update submodule ref for updated node (#11706) 2018-01-23 18:14:04 -05:00
shelley vohr
4757980f9c add license file to npm publish (#11705) 2018-01-23 18:09:08 -05:00
Heilig Benedek
50690d25f1 Remove WS_EX_COMPOSITED style from window 2018-01-23 20:14:34 +01:00
Aleš Pergl
39554566cc Allow IO while constructing an absolute path (prevents DCHECK failure) (#11697) 2018-01-23 10:25:01 -05:00
Aleš Pergl
c49cb29ddf Disallow launching unknown apps via browser client.
CVE-2018-1000006
2018-01-22 16:49:30 -06:00
Samuel Attard
32a1395bcf Merge pull request #11565 from electron/add-load-file-helper
Add window.loadFile and webContents.loadFile helper methods
2018-01-23 09:08:23 +11:00
Shelley Vohr
365fe6b067 fix code fence lint failure 2018-01-22 12:41:46 -05:00
Felix Rieseberg
8a4c76d655 docs: Document custom installation (#11640)
* 📝 Document custom installation

* ❤️ Implement feedback

* 🔧 Fix linting errors
2018-01-19 16:33:36 -05:00
Nitish Sakhawalkar
2b4cc0a525 Fix macos Full Screen Toggle menu item label (#11633) 2018-01-19 09:27:36 -05:00
Charles Kerr
d0af17e601 Merge pull request #11644 from brenca/tooltip-fix-master
Explicitly hide tooltip when the window is deactivated (master)
2018-01-18 23:35:06 -06:00
Ryan Baxley
8387d92cd5 Update CONTRIBUTING.md with link to development docs (#11529)
* Update CONTRIBUTING.md with link to development docs

[ci skip]

* Use relative link to development documentation

[ci skip]
2018-01-18 21:29:10 -05:00
Heilig Benedek
f36fda3f5d don't dereference tooltip_controller if it's null 2018-01-18 20:35:19 +01:00
Heilig Benedek
8d8b8c590d update calls to use new namespaces 2018-01-18 15:23:38 +01:00
Heilig Benedek
5e198d9dc6 add todo comment 2018-01-18 15:23:38 +01:00
Heilig Benedek
8233890e39 lint fix 2018-01-18 15:23:38 +01:00
Heilig Benedek
c6c618acdb explicitly hide tooltip on window deactivation 2018-01-18 15:23:38 +01:00
Andy Locascio
ae65c26469 fix lint 2018-01-17 17:04:57 -08:00
Andy Locascio
8253e50e9c use same settings for screen thumbnails as chrome does webrtc capturing
Following along from http://crrev.com/2961193002: make sure the
thumbnail capturers initialize with the same settings as the capturer
from a getUserMedia request does. Otherwise, there is no guarentee that the
sources on Windows will match.
2018-01-17 15:55:10 -08:00
John Kleinschmidt
ea1da93e5e Merge pull request #11662 from electron/fix-ia32-testing-for-forks
Set DISPLAY variable for xvfb
2018-01-17 13:47:41 -05:00
John Kleinschmidt
565946cdff Set DISPLAY variable for xvfb
PRs submitted from forks need this value for xvfb to run properly.
2018-01-17 12:57:42 -05:00
shelley vohr
4f0e1826e5 properly check checkbox state on callback (#11658) 2018-01-17 08:51:49 -05:00
Cheng Zhao
4dab824c6b Merge pull request #11625 from nitsakh/mac-terminate
Change macos app termination process
2018-01-17 16:28:56 +09:00
Nitish Sakhawalkar
ea2056b513 Replace arrow function 2018-01-17 15:27:11 +09:00
Nitish Sakhawalkar
7aefc73ffd Fix lint 2018-01-17 15:27:11 +09:00
Nitish Sakhawalkar
28f1abcb05 Change macos app termination process 2018-01-17 15:27:11 +09:00
Cheng Zhao
d69c17a96a Merge pull request #11656 from electron/update-gyp
Update gyp: Add Visual Studio 2017 support
2018-01-17 11:43:46 +09:00
Cheng Zhao
b45ce8ff2d Update gyp: Add Visual Studio 2017 support 2018-01-17 10:19:02 +09:00
John Kleinschmidt
a6d3dee321 Removing core dump check (#11621)
It appears that the arm build failing with a core dump is a false positive.  Testing the latest arm build from master on a raspberry pi 2, it does not core dump.
2018-01-13 23:02:10 -05:00
Tiago Danin
74769da9a7 [Docs] Fix URLs and Paths (#11584)
* Fix URLs and Paths in docs/

* Avoiding link break to /docs/development/updgrading-chrome.md

* Fix URLs and Paths in docs/ #2

* Removed double spaces in docs
2018-01-12 10:24:48 -05:00
Charles Kerr
fa43cb6ef0 Merge pull request #11557 from josimi/master
Fixes hexColorDWORDToRGBA for transparent colors
2018-01-11 10:28:53 -06:00
Lee Dohm
f5962538f4 Merge pull request #11545 from m1guelpf-forks/patch-1
Update license year
2018-01-10 09:19:12 -08:00
Cheng Zhao
fce84fbe99 Merge pull request #11292 from AdrienFery/in-app-purchase
Add in-app purchase for MacOS
2018-01-10 19:42:03 +09:00
Cheng Zhao
bd271cffb9 Throw when inAppPurchase is used on unsupported platforms 2018-01-10 18:53:55 +09:00
Cheng Zhao
a883d3d50d Fix build on other platforms 2018-01-10 17:39:16 +09:00
Cheng Zhao
839df0ee5a Remove observer on cleanup 2018-01-10 17:30:30 +09:00
Cheng Zhao
6d9c6645a8 Add inAppPurchase to docs index 2018-01-10 17:25:04 +09:00
Cheng Zhao
e77ddd3221 Pass multiple transactions at the same time
This follows the design of SKPayment API.
2018-01-10 17:19:44 +09:00
Cheng Zhao
2dd545ebda Payment should be part of Transaction
This follows The SKPayment API, and makes our JS wrappers easier to
implement.
2018-01-10 17:06:27 +09:00
Cheng Zhao
635b753ecd No need for SKPaymentTransactionState prefix for states 2018-01-10 16:59:17 +09:00
Cheng Zhao
133bef3deb Turn addTransactionListener into transaction-updated event 2018-01-10 16:57:52 +09:00
Cheng Zhao
ac6f895f64 Turn InAppPurchase into an EventEmitter 2018-01-10 16:37:05 +09:00
Cheng Zhao
400bfb3c5a mac: SKProductsRequest should be freed on end 2018-01-10 15:29:32 +09:00
Cheng Zhao
bdeb979d41 spec: Simple tests for inAppPurchase module 2018-01-10 15:21:53 +09:00
Cheng Zhao
5f1c76c688 Reorgnize the platform-specific files 2018-01-10 14:45:42 +09:00
Adrien Fery
b2542a27c3 Update code style 2018-01-10 13:14:18 +09:00
Adrien Fery
d32632f768 Update filenames.gypi 2018-01-10 13:14:18 +09:00
Adrien Fery
eb2520488f Adapt code style 2018-01-10 13:14:18 +09:00
Adrien Fery
329fddaed1 Put in-app purchase files under macOS check 2018-01-10 13:14:18 +09:00
Adrien Fery
f3ae566164 Add in-app purchase for MacOS 2018-01-10 13:14:18 +09:00
Cheng Zhao
143816bee1 Merge pull request #11272 from syntropy-ai/1-7-x
Removed tracking area for tray to prevent mouse leave race condition crash
2018-01-10 13:13:10 +09:00
Matt Way
5504294a6a Replaces tracking removal with proper mem management 2018-01-10 10:24:37 +09:00
Matt Way
8df4402722 removed unnecessary braces 2018-01-10 10:24:13 +09:00
Matt Way
638d8219c4 Removed tracking area when removing icon to prevent mouse exit race condition crash 2018-01-10 10:24:11 +09:00
Jonathon Simister
9c018744f4 Fixes hexColorDWORDToRGBA for transparent colors 2018-01-09 11:07:29 -08:00
John Kleinschmidt
83b351a8fd Merge pull request #11487 from electron/circleci-cross-arch-testing
Add testing for arm, arm64 and ia32 linux builds
2018-01-08 11:01:55 -05:00
Yury Solovyov
49844b6e5b Move the IconLoader to use the task scheduler.
This follows https://codereview.chromium.org/2953633002
2018-01-08 13:21:22 +03:00
Yury Solovyov
b3743058c0 Make gfx::Image instance a local variable.
This follows https://codereview.chromium.org/2709683002
2018-01-08 12:47:25 +03:00
Cheng Zhao
c1d68974ab Merge pull request #11589 from electron/fix-accelerator-problem
Update libcc: Fix Shift not showing  in menu for certain accelerators
2018-01-08 16:15:28 +09:00
Cheng Zhao
f201969f12 Update libcc: Fix Shift not showing
Fix the Shift key not showing in menu for certain accelerators like
Control+Shift+F.
2018-01-08 12:33:43 +09:00
Cheng Zhao
4298aecb7c Merge pull request #11547 from electron/draggable_regions_patch
fix: draggable region ipc should be frame based
2018-01-07 21:15:50 +09:00
Zeke Sikelianos
4e328a2a08 Merge pull request #11481 from teiles/master
docs: change getBlobData return type from Blob to Buffer
2018-01-05 20:43:26 -08:00
Zeke Sikelianos
33da3153b6 Merge pull request #11538 from TiagoDanin-Forks/MD-PATH
Doc update: New path for web-contents.md
2018-01-05 08:43:08 -08:00
Zeke Sikelianos
c272a18204 Merge pull request #11428 from TechnicalSoup/patch-1
docs: specify string values for DownloadItem
2018-01-05 08:42:10 -08:00
Zeke Sikelianos
aeffef766a Merge pull request #11420 from joeydlee95/master
 Add test to check for relative links in docs
2018-01-05 08:39:34 -08:00
Charles Kerr
435c9c1486 Force uv loop cleanup (#11465)
* ensure all uv handles are closed before ending worker's loop

* add DCHECK to test that the Worker loop is finished

* don't call deprecated uv_loop_new(), uv_loop_delete()

* make cpplint happy

* fix comment error

* empty commit for CI

* tweak DCHECK expression

* extract-method: stop_and_close_uv_loop()

* fix DCHECK oops
2018-01-04 11:16:06 -08:00
Zeke Sikelianos
eb89e12c5b Merge pull request #11532 from sethlu/camelcase-menuitem-role
Make MenuItem roles camelCase-compatible
2018-01-04 09:53:58 -08:00
Cheng Zhao
6bc7c8cc49 Merge pull request #11396 from electron/enable_base_dchecks
fix: enable additional dchecks
2018-01-04 21:19:12 +09:00
Cheng Zhao
9bd192ea17 Update libcc to latest 2018-01-04 16:14:01 +09:00
Zhuo Lu
df841fa397 Revert changes made to test case
The MenuItem role should be lowercase
2018-01-04 14:38:58 +08:00
Samuel Attard
1553b54779 Add window.loadFile and webContents.loadFile helper methods 2018-01-04 11:38:56 +13:00
Cheng Zhao
1ff872519c posix: Fix assertion when freeing ProcessSingleton 2018-01-03 19:47:01 +09:00
Cheng Zhao
1072c75e38 Closing asar file should be syncronous 2018-01-03 19:12:16 +09:00
Cheng Zhao
fb78052b3d Remove unnecessary scope 2018-01-03 19:10:48 +09:00
Cheng Zhao
104585e772 Do not create DIR_USER_DATA on IO thread
It would slowdown the startup time of apps since we have wait for two
message posts between threads.
2018-01-03 19:07:24 +09:00
Cheng Zhao
952928dc79 Singleton must be created on request
The creation of singleton relies on the `userData` dir, which can be
changed by user, we have to ensure singleton uses the `userData` dir set
by user.
2018-01-03 18:59:12 +09:00
Cheng Zhao
0cce6b3d21 Fix cpplint warning 2018-01-03 17:32:18 +09:00
Cheng Zhao
d6068759b6 win: Fix assertion when creating Notification 2018-01-03 17:25:19 +09:00
TechnicalSoup
0ea296b1cb docs: specify string values for DownloadItem
Explicitly list the possible string return values for the updated and done events so that the typescript declaration file can model them more accurately. At present they are represented as a string type.

Fixes : https://github.com/electron/electron-typescript-definitions/issues/71
2018-01-03 13:34:19 +11:00
deepak1556
14de22a8c7 Use cached application locale as default for generating accept-lang header 2018-01-02 17:33:46 +05:30
deepak1556
cbc433d4cb update libcc to fix DCHECK errors in ui::clipboard on windows 2018-01-02 16:32:07 +05:30
Cheng Zhao
de93b30d3c win: Fix assertion when getting exe version 2018-01-02 17:02:12 +09:00
Cheng Zhao
82452e7924 win: Fix assertion when getting printers 2018-01-02 16:54:36 +09:00
Cheng Zhao
7bf156d197 win: Fix assertion "IsWprintfFormatPortable(format)" 2018-01-02 16:45:43 +09:00
deepak1556
7b9dd81018 update libcc for macOS render widget dcheck crash fix 2018-01-02 16:37:12 +09:00
deepak1556
b9ace16959 update libcc for using custom platform with gin 2018-01-02 16:37:12 +09:00
deepak1556
769fbd0d3b REVIEW: register BrowserChildProcessObserver once main message loop is ready 2018-01-02 16:37:11 +09:00
deepak1556
1b30cac372 Don't delay node module initialization 2018-01-02 16:37:11 +09:00
Cheng Zhao
1043f07b42 Fix compilation on Windows 2018-01-02 16:37:11 +09:00
deepak1556
237bd6790b FIXME: allow IO access on main thread for crash reporter 2018-01-02 16:37:11 +09:00
deepak1556
abe1faea5c REVIEW: setup request context for NSS OCSP only once 2018-01-02 16:37:11 +09:00
deepak1556
e3a56240c9 REVIEW: fix base::File helper usage on incorrect task sequence 2018-01-02 16:37:10 +09:00
deepak1556
fd297722a8 Note about incorrect usage of blink::SchemeRegistry methods 2018-01-02 16:37:10 +09:00
deepak1556
73919ea91a update libcc 2018-01-02 16:37:10 +09:00
deepak1556
d27744f455 Some blink::WebSecurityPolicy methods should be invoked before other render threads are created 2018-01-02 16:37:10 +09:00
deepak1556
0df464e16a address review comments 2018-01-02 16:37:09 +09:00
deepak1556
ee80313666 opt into location service on main thread 2018-01-02 16:37:09 +09:00
deepak1556
d29c27dc78 REVIEW: obtain mime type from file path only on IO allowed sequence 2018-01-02 16:37:09 +09:00
deepak1556
e072213923 FIXME: dbus ObjectProxy methods should only be invoked on IO allowed sequence 2018-01-02 16:37:09 +09:00
deepak1556
a1592446da REVIEW: access GetApplicationLocale on sequence that allows IO 2018-01-02 16:37:08 +09:00
deepak1556
1912fbb073 reenable some specs 2018-01-02 16:37:08 +09:00
deepak1556
69bd44edbb REVIEW: add render process lifecycle observer only once 2018-01-02 16:37:08 +09:00
deepak1556
ebb0e46380 REVIEW: create AtomNetworkDelegate on the IO thread 2018-01-02 16:37:08 +09:00
Cheng Zhao
b2cef31bc0 Revert "Fix race condition when calling JsAsker::BeforeStartInUI"
This reverts commit 37317d74adb53afdcb22c85f2d3987fbae290ac7.
2018-01-02 16:37:08 +09:00
Cheng Zhao
6d9b186fa7 Fix race condition when calling JsAsker::BeforeStartInUI 2018-01-02 16:37:07 +09:00
deepak1556
e30131f30b Initialize isolate holder in standalone node mode 2018-01-02 16:37:07 +09:00
deepak1556
88e53b1b5e REVIEW: destroy process singleton on sequence where IO is allowed 2018-01-02 16:37:07 +09:00
deepak1556
c3154d86e0 FIXME: disable some specs 2018-01-02 16:37:07 +09:00
deepak1556
1d95241185 FIXME: refactor and remove usage of ScopedAllowIO where possible 2018-01-02 16:37:06 +09:00
deepak1556
90acb22a58 dont use UI methods on IO thread 2018-01-02 16:37:06 +09:00
deepak1556
a518c5c3c4 derefence weak ptr only on the same sequence runner it was created in 2018-01-02 16:37:06 +09:00
deepak1556
fedf1d889b handle NaN conversion from V8 2018-01-02 16:37:06 +09:00
deepak1556
db156865e7 pref store needs to be loaded on a thread that allows IO 2018-01-02 16:37:06 +09:00
deepak1556
b4e6516ad8 fix dcheck failure with invalid UTF8 string conversion for base::Value 2018-01-02 16:37:05 +09:00
deepak1556
5c25855ac5 create user data dir on thread that allows IO 2018-01-02 16:37:05 +09:00
Cheng Zhao
249bd41e11 Merge pull request #11546 from electron/menu-callback
Add callback parameter for Menu.popup
2018-01-02 16:20:58 +09:00
deepak1556
99e26b8318 fix: draggable region ipc should be frame based 2018-01-01 22:54:02 +05:30
Cheng Zhao
d04ae88426 The RenderWidgetHostView might not be available when showing menu 2018-01-01 19:37:59 +09:00
Cheng Zhao
bc61f2eafa Copy the callback instead of reference
I don't really see how this could be a problem, likely a bug of VS 2017?
2018-01-01 19:37:59 +09:00
Cheng Zhao
46330ac2a9 Remove the closed event of Menu
The callback of Menu.popup does more things, and there is actually no
request for the closed event.
2018-01-01 17:22:07 +09:00
Cheng Zhao
73d78d345a Make callback work for old-style Menu.popup call
While the old-style Menu.popup has been deprecated, it is still being
used widely in apps and even in Electron itself.
2018-01-01 17:17:01 +09:00
Cheng Zhao
2ec3b8ce76 spec: callback for Menu.popup 2018-01-01 16:56:22 +09:00
Cheng Zhao
c3eadd5b63 mac: Call callback when menu is programmely closed 2018-01-01 16:49:25 +09:00
Cheng Zhao
9c6aa9ce90 docs: callback of Menu.popup 2018-01-01 16:42:23 +09:00
Cheng Zhao
7b01a8b860 Add callback parameter to Menu.popup 2018-01-01 16:26:19 +09:00
Cheng Zhao
2e3d940749 Fix "test.py -g Menu" not working 2018-01-01 15:46:39 +09:00
Cheng Zhao
d7bc127c60 mac: Correctly close popup menu 2018-01-01 15:40:15 +09:00
Miguel Piedrafita
46121da765 Update license year 2018-01-01 00:51:40 +01:00
Zhuo Lu
b8ec84c761 Fix syntax 2018-01-01 02:23:32 +08:00
Tiago Danin
e9121936e8 Doc Update: New path for web-contents.md 2017-12-28 18:22:30 -02:00
Felix Rieseberg
5f4b62b6c8 feat: Allow testing of single spec modules (#11409)
* 🔧 ES6 for the spec

* 👷 Allow testing of single modules

* ❤️ Implement feedback

* 📝 Add a testing doc

* 📝 Link to it

* 📝 Cleanup
2017-12-28 06:18:33 -05:00
Zhuo Lu
d45914c3f7 MenuItem roles camelCase-compatible 2017-12-28 13:28:20 +08:00
Cheng Zhao
a161f6e368 Merge pull request #11527 from electron/fix-buffer-crash-master
master: Fix crash when using crypto module
2017-12-27 21:45:32 +09:00
Cheng Zhao
e45a125f65 Update node: Fix crash when doing crypto operation 2017-12-27 20:37:04 +09:00
Cheng Zhao
75ac7d9ff2 spec: Add test for crypto operation 2017-12-27 20:37:04 +09:00
Charles Kerr
0cafc3cf52 Merge pull request #11511 from HayateLaTech/patch-1
Update browser-window.md
2017-12-22 09:05:38 -06:00
Cheng Zhao
fe16e24406 Merge pull request #11510 from electron/gin-use-node-platform
Use Node's V8Platform instead of gin's
2017-12-22 23:40:19 +09:00
HayateLaTech
f2e32791b1 Update browser-window.md 2017-12-22 15:13:12 +01:00
Cheng Zhao
c0c2461245 Do not create duplicate V8Platform in NodeDebugger 2017-12-22 20:29:09 +09:00
Cheng Zhao
00afeaba9a Use Node's V8Platform instead of gin's 2017-12-22 20:29:08 +09:00
Charles Kerr
a0ebde0181 Merge pull request #11504 from kylecorry31/master
Add Support for Pop!_OS GNOME Session
2017-12-21 22:57:54 -06:00
Kyle Corry
5aac091f40 Add Support for Pop!_OS GNOME Session
Similar to this PR: https://github.com/electron/electron/pull/10355 , Pop!_OS suffers from the same problem. Using Ubuntu AppIndicator will not show the icon currently unless the XDG_CURRENT_DESKTOP variable is modified. This commit will add support for pop so that this workaround is not needed. 

Ref: https://github.com/pop-os/pop/issues/84
2017-12-21 14:16:15 -05:00
Cheng Zhao
65871cd567 Merge pull request #11238 from electron/spellchecker_iframe_patch
fix: manually set spellchecker for sub frames
2017-12-21 17:00:01 +09:00
Cheng Zhao
06e1fb923b Merge pull request #11495 from electron/libcc-latency-histogram-macros-patch
win: Correctly close popup menu
2017-12-21 16:59:47 +09:00
Cheng Zhao
7a8864063b mac: Handle the case when closing all menu runners 2017-12-21 15:57:27 +09:00
Cheng Zhao
088042841d win: Correctly close popup menu 2017-12-21 15:26:32 +09:00
Cheng Zhao
459db92052 Merge pull request #11493 from electron/libcc-latency-histogram-macros-patch
Update libcc for latency_histogram_macros.patch
2017-12-21 11:52:53 +09:00
Cheng Zhao
05bd5f456a Update libcc for latency_histogram_macros.patch 2017-12-21 11:20:03 +09:00
Charles Kerr
d3eeb84208 Merge pull request #11466 from electron/cppcheck-diff-mode
add changed-files-only mode to cpplint
2017-12-20 10:55:49 -06:00
John Kleinschmidt
06481b5630 Add testing for arm, arm64 and ia32 linux builds 2017-12-20 11:54:52 -05:00
Cheng Zhao
a6228b97cd Merge pull request #11264 from brenca/flash-menu-fix
Fix flash context menu
2017-12-20 19:37:44 +09:00
Cheng Zhao
e4770c7604 Coding style fixes 2017-12-20 18:48:09 +09:00
deepak1556
83d2917363 fix: manually set spellchecker for sub frames 2017-12-20 12:48:02 +05:30
Heilig Benedek
5bf16c2495 remove async:true from menu tests 2017-12-20 15:41:12 +09:00
Heilig Benedek
ef7357dedc update tests for menu closed event and call cancel on closePopup 2017-12-20 15:40:07 +09:00
Heilig Benedek
14b65467d8 add test for menu closed event 2017-12-20 15:40:07 +09:00
Heilig Benedek
bcef6eb3df document menu closed event and fix styling issue 2017-12-20 15:40:07 +09:00
Heilig Benedek
c586806609 fix flash menu being unresponsive to commands 2017-12-20 15:40:07 +09:00
Cheng Zhao
85ef42d99e Merge pull request #11233 from brenca/devtools-fix
Small devtools fixes
2017-12-20 15:35:09 +09:00
Cheng Zhao
0d9ff95526 Revert "dont change window background after devtools is closed"
This reverts commit fdcac8552f.

We are looking for a better fix.
2017-12-20 15:18:26 +09:00
Heilig Benedek
fdcac8552f dont change window background after devtools is closed 2017-12-20 12:57:02 +09:00
Heilig Benedek
d5ab691fdb fix osr devtools crash introduced during merge 2017-12-20 12:57:02 +09:00
Cheng Zhao
5a9221e1dc Merge pull request #11092 from electron/provide-scheme-with-open-external-request
Give user access to the URL that is attempting to be openExternal'ed
2017-12-20 12:56:00 +09:00
Ted Eiles
5ccfac81ed Reviewed getBlobData source, not return value (void) 2017-12-19 22:21:45 -05:00
Cheng Zhao
b2e6340622 Reduce the number of helpers 2017-12-20 10:49:49 +09:00
Cheng Zhao
4fd8b04329 Better field names for details object 2017-12-20 10:25:31 +09:00
Samuel Attard
4d7b85bd01 Appease the linter 2017-12-20 10:21:38 +09:00
Samuel Attard
98e9311669 Give user access to the URL that is attempting to be openExternal'ed 2017-12-20 10:21:38 +09:00
Cheng Zhao
39ec40b901 Merge pull request #11470 from electron/update-node-upgrade-doc
Update branching steps in upgrading-node.md
2017-12-20 10:08:09 +09:00
Ted Eiles
19f2d42c07 change getBlobData return type from Blob to Buffer, fixes doc and typescript def 2017-12-19 19:52:59 -05:00
Charles Kerr
d36e451301 make IGNORE_FILES more readable 2017-12-19 18:37:02 -06:00
Charles Kerr
0521302940 add atom/node/osfhandle.cc to the do-not-lint list 2017-12-19 17:41:34 -06:00
Charles Kerr
4f533dded3 Revert "fix previously-hidden cppcheck warnings in osfcheck.cc"
This reverts commit 8373e1bf41.
2017-12-19 17:39:03 -06:00
Charles Kerr
2f88e69ed4 fix inconsistent indentation 2017-12-19 16:23:27 -06:00
Charles Kerr
8373e1bf41 fix previously-hidden cppcheck warnings in osfcheck.cc 2017-12-19 16:09:53 -06:00
Charles Kerr
58edfc26ed flake8 --ignore=E111,E121 script/cpplint.py 2017-12-19 16:02:36 -06:00
Charles Kerr
30f8660a20 walk all files in atom/ and brightray/ 2017-12-19 15:57:03 -06:00
Charles Kerr
cab1b81026 give find_files() a filename tester function arg 2017-12-19 15:50:09 -06:00
Charles Kerr
f5f6d99cd7 make file list function names clearer
since they return sets rather than lists, don't use 'list' in the name
2017-12-19 15:40:11 -06:00
Charles Kerr
589c6a5b7e remove unnecessary ignore variable 2017-12-19 15:38:23 -06:00
Charles Kerr
512fb670b4 remove unnecessary changed_files variable 2017-12-19 15:37:41 -06:00
Charles Kerr
b6c16a520a only call cppcheck once 2017-12-19 15:07:11 -06:00
Charles Kerr
6f4e97c53a (copyediting) renumber steps 2017-12-19 09:09:35 -06:00
Charles Kerr
781311aa3c Merge pull request #11431 from electron/notifications-debugging
infra: Allow notifications debugging
2017-12-19 09:06:12 -06:00
Cheng Zhao
c15e2e4d92 Merge pull request #10912 from Ajeey/patch-1
Updated auto-updater.md
2017-12-19 16:22:25 +09:00
Cheng Zhao
5d86da48c7 The missing : 2017-12-19 15:44:58 +09:00
Cheng Zhao
4dee778212 Clearer wording 2017-12-19 15:39:57 +09:00
Ajey Charantimath
8953042ee3 Updated auto-updater.md
Missing documentation on the issue https://github.com/electron/electron/issues/10903
2017-12-19 15:33:13 +09:00
Cheng Zhao
90582dfa4f Merge pull request #11154 from electron/update-release-doc
Update release process for API invoked release builds
2017-12-19 15:30:51 +09:00
Cheng Zhao
81527b71ba Merge pull request #11279 from sethlu/openrecent
Update submenu's title at replacement
2017-12-19 15:28:02 +09:00
Cheng Zhao
a02cb8009e Merge pull request #11131 from hugomano/feature/isolated-world
Add Isolated World API
2017-12-19 11:03:28 +09:00
Cheng Zhao
b27e42f3f7 Fix indentions 2017-12-19 10:42:36 +09:00
Hugo Mano
ae7b96991c Add webFrame.setIsolatedWorldSecurityOrigin
Move vector to cc file

Map executed javascript in isolated world to url

Some 💅

Documentation

Use WebSource[] as argument in executeJavaScriptInIsolatedWorld

Refactor and lint with @poiru’s comments

Remove duplicate call

Typo

Lint
2017-12-19 10:36:03 +09:00
Hugo Mano
389edb6229 Add webFrame.setIsolatedWorldHumanReadableName 2017-12-19 10:36:03 +09:00
Hugo Mano
f74f113d23 Add webFrame.setIsolatedWorldContentSecurityPolicy 2017-12-19 10:36:03 +09:00
Alexandre Lachèze
936d8c1117 Add webframe. executeJavaScriptInIsolatedWorld
Attempt runInIsolatedWorldContext

Replace RunInIsolatedWorldContext by GetIsolatedWorldGlobalObject

Fix linting

Remove useless getIsolatedWorldGlobalObject

Add support for scriptExecutionType
2017-12-19 10:36:03 +09:00
Charles Kerr
f01cbf0482 Merge pull request #11467 from electron/leo-patch-1
Clarify Hazel's purpose
2017-12-18 16:17:14 -06:00
Leo Lamprecht
55db062242 Clarify Hazel's purpose 2017-12-18 21:18:11 +01:00
Charles Kerr
6198bbe963 add changed-only mode to cpplint 2017-12-18 10:22:51 -06:00
timmyhadwen
a6bab71215 Fixed BT bug 2017-12-18 20:46:06 +10:00
Giacomo Furlan
b8231b74f2 refs #11353: pylint 2017-12-16 13:11:04 +01:00
Giacomo Furlan
789dbb2dbb Adds --chromium_dir argument to script/create-dist.py 2017-12-16 13:11:04 +01:00
TheDancingCode
605f5472e5 📝 Fix mixed content warning [ci skip] (#11448) 2017-12-15 16:06:38 -05:00
joeydlee95
ac2caef37f test for relative links adheres to npm run lint 2017-12-13 19:06:16 -08:00
Felix Rieseberg
75cdd9ec70 🔧 Linter's gotta lint 2017-12-13 16:31:02 -08:00
Felix Rieseberg
8a8aaaf16c 🔧 Allow notifications debugging (Windows) 2017-12-13 16:25:49 -08:00
Felix Rieseberg
76d9756fb9 🔧 Use LOG instead of NSLOG 2017-12-13 14:47:23 -08:00
joeydlee95
a4db8e1c55 Add executable test to package.json 2017-12-13 14:39:13 -08:00
Charles Kerr
a8b76e1a80 Merge pull request #11418 from electron/add-reg-defaults
[WIP] add back systemPreferences.registerDefaults()
2017-12-13 15:48:20 -06:00
shelley vohr
5a35a5a2b3 Upgrade Node to v8.9.3 (#11422)
* update submodule referefences for node

* update libcc and node refs

* update for cherry-picked a15d0ce

* update libcc ref to master
2017-12-13 16:32:00 -05:00
Shelley Vohr
26ad37c4d1 remove key and value bullts 2017-12-13 16:02:15 -05:00
Shelley Vohr
3fc844c15a add loop to catch null values 2017-12-13 14:02:43 -05:00
Felix Rieseberg
61ec8df418 🔧 More detailed macOS notification logging 2017-12-13 10:31:59 -08:00
Charles Kerr
0ad99444af Merge pull request #11426 from mikoto2000/patch-1
Fix 'electron-versioning' link in README.md
2017-12-13 09:21:41 -06:00
mikoto2000
ef7c5c8e9c Fix 'electron-versioning' link in README.md 2017-12-13 22:18:00 +09:00
Shelley Vohr
d602a30bbc update a few steps in upgrading-node.md 2017-12-12 22:55:37 -05:00
Charles Kerr
057f08a1f8 Merge pull request #11421 from lurch/patch-1
Fix typos
2017-12-12 21:36:35 -06:00
Andrew Scheller
debe77a910 Fix typos 2017-12-13 03:13:41 +00:00
Charles Kerr
5b6b5fe835 Merge pull request #11419 from electron/menu-bugs-take-two
fix: Menu bugs (take two)
2017-12-12 20:56:41 -06:00
joeydlee95
996c914912 Add test to check for relative links in docs directory 2017-12-12 18:53:13 -08:00
Felix Rieseberg
ffd85bfaac 🔧 Allow notifications debugging (macOS) 2017-12-12 16:09:34 -08:00
Felix Rieseberg
317422f431 👷 Close popup in aftereach 2017-12-12 12:23:02 -08:00
Felix Rieseberg
8166a64f98 🔧 Last round of feedback 2017-12-12 11:25:01 -08:00
Felix Rieseberg
c4ec8b4545 🔧 Feedback 2017-12-12 11:25:01 -08:00
Felix Rieseberg
76df41b5d0 👷 Properly test x vs y 2017-12-12 11:25:01 -08:00
Felix Rieseberg
ace558f54a 👷 Hence, better testing 2017-12-12 11:25:01 -08:00
Felix Rieseberg
5b7f7c8a1a 🔧 Menu returns its properties now 2017-12-12 11:25:01 -08:00
Felix Rieseberg
ffc54967e9 🔧 Fix value shift 2017-12-12 11:25:01 -08:00
Felix Rieseberg
5a658fa5f6 👷 Add a spec 2017-12-12 11:25:01 -08:00
Felix Rieseberg
99031834ff 🔧 Cleanup 2017-12-12 11:25:01 -08:00
Felix Rieseberg
3719ee0b53 🔧 Allow for menu.popup({}) 2017-12-12 11:25:01 -08:00
Felix Rieseberg
9e660b1d32 🔧 Always find a window (or error) 2017-12-12 11:25:01 -08:00
Felix Rieseberg
4f901c6d24 🔧 Oh wow, that looks wrong 2017-12-12 11:25:01 -08:00
Shelley Vohr
6252ce466c remove failing badDefault 2017-12-12 13:39:38 -05:00
Shelley Vohr
8b447b9291 fixing error in registerDefaults 2017-12-12 13:08:09 -05:00
Charles Kerr
5720a8e7d5 Merge pull request #11415 from electron/revert-11385-async-menu
Revert "fix: Fix `menu.popup()` bugs"
2017-12-12 08:56:12 -06:00
Charles Kerr
da4af4c90b Merge pull request #11414 from electron/revert-11395-add-reg-defaults
Revert "Add systemPreferences.registerDefaults()"
2017-12-12 08:46:47 -06:00
Alexey Kuzmin
1c8eb03574 Revert "fix: Fix menu.popup() bugs" 2017-12-12 13:59:34 +03:00
Alexey Kuzmin
1caa04c0bf Revert "Add systemPreferences.registerDefaults()" 2017-12-12 13:59:15 +03:00
Cheng Zhao
19f1fef040 Merge pull request #11283 from electron/fix-event-subscriber-race
Fix race condition in event_subscriber.h
2017-12-12 10:49:17 +09:00
Charles Kerr
e73fe100d5 Merge pull request #11385 from electron/async-menu
fix: Fix `menu.popup()` bugs
2017-12-11 18:02:33 -06:00
Charles Kerr
76ee1e1cb6 Merge pull request #11406 from xxczaki/master
Added Polish Electron Community
2017-12-11 17:48:33 -06:00
Charles Kerr
99c980ab40 Merge pull request #11395 from electron/add-reg-defaults
Add systemPreferences.registerDefaults()
2017-12-11 17:45:32 -06:00
Shelley Vohr
a8e67e7f61 fixes from review 2017-12-11 18:20:12 -05:00
Felix Rieseberg
927c63b477 🔧 Last round of feedback 2017-12-11 15:19:33 -08:00
Felix Rieseberg
89b90be6a2 🔧 Feedback 2017-12-11 14:43:35 -08:00
Charles Kerr
dcf2a6f388 Make 'https' explicit in the link to electronpl.github.io 2017-12-11 16:37:14 -06:00
Felix Rieseberg
f7ebfff8ae 👷 Properly test x vs y 2017-12-11 14:05:07 -08:00
Felix Rieseberg
dfd7598d48 👷 Hence, better testing 2017-12-11 14:03:04 -08:00
Felix Rieseberg
22e9d665d2 🔧 Menu returns its properties now 2017-12-11 14:03:01 -08:00
Felix Rieseberg
93b46116f4 🔧 Fix value shift 2017-12-11 13:30:35 -08:00
Anthony
c8bb23a2ff Update README.md 2017-12-11 20:52:56 +01:00
Shelley Vohr
027e78639a update value type to Any 2017-12-11 14:06:02 -05:00
Shelley Vohr
84bab48627 improve error handling 2017-12-11 13:11:03 -05:00
Shelley Vohr
765f223fef update docs and spec 2017-12-11 13:06:23 -05:00
Charles Kerr
87f8bd4ea7 Merge pull request #11359 from electron/fix_spell_checker_crash
Fixed crash in `atom::api::SpellCheckClient`
2017-12-11 10:18:27 -06:00
Shelley Vohr
c5aeda1fdd fixes from code review 2017-12-11 00:20:26 -05:00
Shelley Vohr
5e51ab9791 fix doc parsing error 2017-12-10 14:55:14 -05:00
Shelley Vohr
9a40bbd082 update systemPreferences docs 2017-12-10 14:46:19 -05:00
Shelley Vohr
8a24733ee6 add fail spec and only run mac ci 2017-12-10 12:52:03 -05:00
Shelley Vohr
becabdfff2 add test for registerDefaults 2017-12-10 11:26:07 -05:00
Shelley Vohr
18ee34f1a1 add method binding and error guards 2017-12-10 11:25:43 -05:00
Shelley Vohr
1ccad4a7e9 fix capitalization and clean logic 2017-12-10 11:04:05 -05:00
Shelley Vohr
f82086e6d3 first pass at adding infra for registerDefaults 2017-12-10 00:45:49 -05:00
Felix Rieseberg
725f6c97d6 👷 Add a spec 2017-12-08 14:52:21 -08:00
Felix Rieseberg
abd56eda6f 🔧 Cleanup 2017-12-08 14:40:51 -08:00
Felix Rieseberg
955564abd7 🔧 Allow for menu.popup({}) 2017-12-08 14:37:16 -08:00
Felix Rieseberg
bd6767fac6 🔧 Always find a window (or error) 2017-12-08 14:36:52 -08:00
Felix Rieseberg
38bb9baac5 🔧 Oh wow, that looks wrong 2017-12-08 14:36:29 -08:00
Charles Kerr
6af18895c3 Merge pull request #11380 from electron/cifratila/enable-cfg
Security Improvement: Enable Control Flow Guard compile flag on Windows
2017-12-08 10:09:34 -06:00
Charles Kerr
de1edeea0b Merge pull request #11379 from TiagoDanin-Forks/upgrading_chromium_doc
Fix formatting in documentation
2017-12-08 10:08:44 -06:00
TiagoDanin
079310ab5a fix formatting in upgrading node doc 2017-12-08 11:49:39 -03:00
TiagoDanin
9314d8925e fix formatting in upgrading chromium doc 2017-12-08 11:24:05 -03:00
Catalin Fratila
7faec8e5eb Security Improvement: Enable Control Flow Guard on Windows - https://docs.microsoft.com/en-us/cpp/build/reference/guard-enable-control-flow-guard 2017-12-08 14:31:29 +01:00
John Kleinschmidt
6a29577ab3 Merge pull request #11356 from electron/replace-app-icon
Replace app icons
2017-12-07 16:53:45 -05:00
simurai
0f54e56389 Replace default_app icon 2017-12-07 16:10:45 -05:00
simurai
fe0f203312 Replace app icons 2017-12-07 16:10:45 -05:00
John Kleinschmidt
f10c279322 Merge pull request #11370 from electron/fix_dchecks
Fix: Re-enable some dchecks
2017-12-07 15:55:33 -05:00
shelley vohr
63c91e7dd3 Merge pull request #11321 from electron/add-setExtraParameter-deprecation
Add back setExtraParameter() deprecation warning
2017-12-07 14:49:18 -05:00
Shelley Vohr
276f758560 remove deprecated method call 2017-12-07 14:26:57 -05:00
Shelley Vohr
24f60dcd1b re-add warning removed in https://github.com/electron/electron/pull/11013 2017-12-07 11:42:18 -05:00
deepak1556
16d96a6ef2 Force MediaCaptureDevicesDispatcher to be created on UI thread 2017-12-07 09:47:32 +05:30
deepak1556
19de41b764 BrowserClient::CanCreateWindow is no longer called on the IO thread
https://codereview.chromium.org/2821473002
2017-12-07 09:47:32 +05:30
Charles Kerr
5fa29fcf58 Merge pull request #11329 from electron/remove-classes-key
fix: Properly cleanup in `removeAsDefaultProtocolClient`
2017-12-06 17:31:50 -06:00
Zeke Sikelianos
69c6a68c22 Merge pull request #11367 from electron/revert-to-old-name-of-versioning-doc
revert to old name of versioning doc
2017-12-06 15:05:01 -08:00
Zeke Sikelianos
61937eac0a fix more relative links 2017-12-06 15:01:09 -08:00
Zeke Sikelianos
fa09ff3cbb update links to versioning doc 2017-12-06 15:01:09 -08:00
Zeke Sikelianos
84c207750c revert to old name of versioning doc 2017-12-06 15:01:09 -08:00
Zeke Sikelianos
af756e2441 Merge pull request #11364 from electron/groundwater-patch-1
docs: README make versioning link relative
2017-12-06 15:00:42 -08:00
Jacob Groundwater
8efeb4b71a Update README.md 2017-12-06 14:32:11 -08:00
John Kleinschmidt
78fd6d6435 Merge pull request #11365 from electron/remove-appveyor-yml
Remove appveyor.yml
2017-12-06 16:26:32 -05:00
John Kleinschmidt
4e3e9c9dbc Remove appveyor.yml
This configuration isn't used anymore - appveyor setup is defined on server
2017-12-06 15:14:09 -05:00
Jacob Groundwater
d8368d36db docs: README make versioning link relative
I think we're making links relative within the docs, and not directly pointing to the electronjs.org website.
2017-12-06 11:15:10 -08:00
Ales Pergl
7a73b1d523 Fixed crash in atom::api::SpellCheckClient
The class didn't save the V8 context for the spell checking JS function. When
it later tried to call the JS function and there was no active context, V8
crashed.

I also optimized the spell checking loop by introducing `SpellCheckScope` and
reusing the V8 handles throughout the whole loop.
2017-12-06 14:50:20 +01:00
Cheng Zhao
4355f554cc Merge pull request #11355 from electron/fix-ci
Fix docs linting error
2017-12-06 19:31:03 +09:00
Cheng Zhao
da66e34dce Fix docs linting error 2017-12-06 19:09:10 +09:00
Cheng Zhao
d8610a3f56 Merge pull request #11342 from electron/add-python-dbusmock
Enable testing with python-dbusmock
2017-12-06 15:02:27 +09:00
Cheng Zhao
46f79146ad Merge pull request #11316 from electron/hide-update-exe
fix: Ensure that update.exe doesn't open up a console window
2017-12-06 14:50:12 +09:00
Cheng Zhao
9c109daa4b Merge pull request #11168 from sethlu/fix-icns-color
fix: Update icns
2017-12-06 14:45:36 +09:00
Felix Rieseberg
bd4c7a114a 👷 Fix the last broken test 2017-12-05 17:07:22 -08:00
Zeke Sikelianos
1e0a181f4b Merge pull request #11032 from electron/version2
New Version Policy for 2.x and Beyond
2017-12-05 14:45:50 -08:00
Zeke Sikelianos
032f5ebc6f update highlights 2017-12-05 14:35:16 -08:00
Zeke Sikelianos
4878cd8d5d update intro 2017-12-05 14:32:33 -08:00
Zeke Sikelianos
4101059323 update semantic commits section 2017-12-05 14:31:19 -08:00
Zeke Sikelianos
770778f9a2 update ignore comment 2017-12-05 14:17:15 -08:00
Jacob Groundwater
85b1cd08d3 docs: use relative links 2017-12-05 14:13:56 -08:00
Felix Rieseberg
bf043c92af 👷 Ugh, whitespace 2017-12-05 13:20:34 -08:00
Felix Rieseberg
e6cbb2f3aa 👷 Cleanup on Windows only 2017-12-05 12:14:19 -08:00
Jacob Groundwater
8eed8bdee7 docs: fix images 2017-12-05 12:08:41 -08:00
Jacob Groundwater
7598e31b16 docs: we _do_ follow semver 2017-12-05 12:04:23 -08:00
John Kleinschmidt
e59aa715fd Enable testing with python-dbusmock 2017-12-05 15:01:01 -05:00
Jacob Groundwater
1bce00545d docs: changes based on review 2017-12-05 11:43:59 -08:00
Jacob Groundwater
07a5d7957b use non-relative image paths to interop with website deploy 2017-12-05 11:38:41 -08:00
Jacob Groundwater
b65b939d18 docs: add tl;dr to version doc 2017-12-05 11:38:41 -08:00
Jacob Groundwater
06371a6082 docs: explain versioning policy 1.x, 2.x, and beyond 2017-12-05 11:38:36 -08:00
Felix Rieseberg
d519bfc5fb 👷 Linter fascism 2017-12-05 11:38:19 -08:00
Felix Rieseberg
997f3f31d2 👷 Cleanup after the test 2017-12-05 11:31:40 -08:00
Felix Rieseberg
e77751aab5 👷 Test registry interaction 2017-12-05 11:28:39 -08:00
Felix Rieseberg
60634cac42 📦 Install winreg 2017-12-05 11:28:19 -08:00
Charles Kerr
f2da3e9a14 Merge pull request #11306 from electron/implement-linux-power-monitor
Implement powerMonitor "suspend"/"resume" events for Linux.
2017-12-05 09:16:59 -06:00
Thiago de Arruda
dfd98e3428 Add linux powerMonitor tests using python-dbusmock 2017-12-05 08:33:36 -03:00
Thiago de Arruda
897712359f Implement powerMonitor "suspend"/"resume" events for Linux. 2017-12-05 08:12:44 -03:00
Cheng Zhao
95cb601f2b Merge pull request #10430 from electron/global-preloads
Add ability to set per-session preload scripts
2017-12-05 19:15:11 +09:00
Cheng Zhao
24b3ee3a4a Revert some unnecessary changes 2017-12-05 16:50:25 +09:00
Cheng Zhao
cb3a9c69ab Add a SessionPreferences to manage session related data
By design the BrowserClient should not be aware of the api:: classes.
2017-12-05 15:59:15 +09:00
Cheng Zhao
776e8afa2b Coding style changes 2017-12-05 11:50:06 +09:00
Samuel Attard
eaa4b71c24 Remove .only 2017-12-05 11:35:54 +09:00
Samuel Attard
009459bd38 Standard JS 2017-12-05 11:35:54 +09:00
Samuel Attard
e535ba4808 Don't know why we suddenly need this, but hey :/ 2017-12-05 11:35:54 +09:00
Samuel Attard
d1aded2831 Appease the almighty linter 2017-12-05 11:35:53 +09:00
Samuel Attard
d9359d8b6c s/global/session in constants 2017-12-05 11:35:53 +09:00
Samuel Attard
d2707315e6 s/global/session 2017-12-05 11:35:53 +09:00
Samuel Attard
3b80ee0655 Move global preload implementation to be session based 2017-12-05 11:35:53 +09:00
Samuel Attard
448ccc261d Use const references 2017-12-05 11:35:27 +09:00
Samuel Attard
0ddd078aaf Add ability to set global preload scripts 2017-12-05 11:35:27 +09:00
Cheng Zhao
d598aa1a67 Merge pull request #11300 from electron/external-devtools
Add API to set arbitrary WebContents as devtools
2017-12-05 10:35:49 +09:00
John Kleinschmidt
bdcdb6e9cf Merge pull request #11330 from electron/add-jenkins-timeout
Add 1 hour timeout to Jenkins CI
2017-12-04 14:49:32 -05:00
Felix Rieseberg
d4275b144b 🔧 Linter fascism 2017-12-04 10:46:53 -08:00
Felix Rieseberg
f62e0a4ed4 🔧 Make it actually work 2017-12-04 10:30:20 -08:00
John Kleinschmidt
e7edc6f24f Add 1 hour timeout 2017-12-04 13:19:51 -05:00
Charles Kerr
3e056eec9e Merge pull request #11297 from electron/remove-travis
Remove Travis references
2017-12-04 10:56:53 -06:00
John Kleinschmidt
1989075d54 Ignore all npmrc and package-lock 2017-12-04 11:05:04 -05:00
John Kleinschmidt
e989005122 Merge pull request #11271 from electron/dchecks
Build with dchecks disabled on subset of targets
2017-12-04 10:33:47 -05:00
Cheng Zhao
52c6f4bcc5 docs: responsiblity of destroying devtoolsWebContents 2017-12-04 18:42:42 +09:00
Charles Kerr
6beaafc7e5 Merge pull request #11282 from Toinane/fix-documentation
typographical revision in Documentation
2017-12-03 09:01:24 -06:00
Charles Kerr
851642f4b8 Merge pull request #11311 from electron/fix-typos-in-structures
fix typos in structures
2017-12-03 08:34:08 -06:00
Charles Kerr
2ffcb27abe Merge pull request #11315 from insideGen/patch-1
Update cookies.md
2017-12-02 08:27:42 -06:00
Charles Kerr
467cce6a8b Merge pull request #11317 from electron/asar-video
Make the asar-video test run faster
2017-12-02 08:26:12 -06:00
Ales Pergl
ecdbe79e29 Make the asar-video test run faster
I cut the video to 3 seconds and removed the audio track, which makes the test
finish a lot sooner. Also the asar file is 160 kB instead of 1 MB.
2017-12-02 11:30:57 +01:00
Ales Pergl
4cf6763e70 Updated libchromiumcontent submodule 2017-12-02 11:09:20 +01:00
Felix Rieseberg
b4b729609a 🔪 Delete classes key if empty 2017-12-01 17:39:54 -08:00
Felix Rieseberg
9646f0c99a 🔧 Sprinkle some ES6 across the file 2017-12-01 17:18:57 -08:00
Felix Rieseberg
c5abe96b39 🔧 Hide subprocess window 2017-12-01 17:18:37 -08:00
Zeke Sikelianos
7c8acb5ea8 Merge pull request #11314 from electron/docs--use-full-image-URL
use full image URL
2017-12-01 17:03:16 -08:00
Jonathan
f32f0fb774 Update cookies.md 2017-12-02 01:27:53 +01:00
Zeke Sikelianos
ba56e5ca65 docs: use full image URL 2017-12-01 15:20:49 -08:00
Charles Kerr
ff6596fd05 Merge pull request #11312 from electron/ipc-spec-split
Split ipc specs into three files
2017-12-01 16:03:51 -06:00
Shelley Vohr
45de1e6a7c remove extraneous variables 2017-12-01 16:11:54 -05:00
Shelley Vohr
af6489576a remove onlys 2017-12-01 16:01:03 -05:00
Shelley Vohr
00e8713eac split ipc tests into three files 2017-12-01 15:57:41 -05:00
Zeke Sikelianos
7dd921811f fix typos in structures 2017-12-01 11:43:04 -08:00
John Kleinschmidt
d182bacd00 Ignore/remove package-lock files 2017-12-01 12:55:55 -05:00
Ales Pergl
dadfbd3a4f Reset embedder_zoom_controller_ before assigning new one 2017-12-01 17:55:22 +01:00
Ales Pergl
fd7af5c1d9 Don't call ui::SetAtomArrayProperty with an empty vector (fails DCHECK) 2017-12-01 17:55:22 +01:00
Ales Pergl
7613afe6d7 Disabled DCHECKs that fail when running tests 2017-12-01 17:55:22 +01:00
Ales Pergl
8357a33d81 Don't leak the taskbar object, reuse it instead 2017-12-01 17:55:21 +01:00
deepak1556
903a5b5100 fix dcheck comparison between unsigned long vs int 2017-12-01 17:55:21 +01:00
John Kleinschmidt
db51dcbe7e Merge pull request #11301 from wlbentley/patch-1
🎨 Tweak for grammar.
2017-12-01 11:48:46 -05:00
John Kleinschmidt
3ab69f2358 Merge pull request #11186 from electron/update-linter-and-ts
update electron-docs-linter and electron-typescript-definitions
2017-12-01 11:47:29 -05:00
Cheng Zhao
c2ee0854f4 Merge pull request #11302 from electron/update_pdf_viewer
fix: update pdf viewer ui for chrome 61.0.3163.100
2017-12-01 19:57:25 +09:00
deepak1556
a48cec9b4a fix: update pdf viewer ui for chrome 61.0.3163.100 2017-12-01 14:09:06 +05:30
W L Bentley
6d779c6ec2 Two grammar tweaks. 2017-11-30 19:37:06 -08:00
Cheng Zhao
88c4fd3f2b docs: Remove unnecessary shows 2017-12-01 12:04:50 +09:00
Cheng Zhao
6b408de884 Allow using docked devtools for webview 2017-12-01 11:56:58 +09:00
Cheng Zhao
ea9771702b spec: setDevToolsWebContents 2017-12-01 10:35:23 +09:00
Cheng Zhao
25c5938c76 docs: Open detached devtools in example 2017-12-01 10:35:23 +09:00
Cheng Zhao
580abedbb7 docs: contents.setDevToolsWebContents 2017-12-01 10:35:23 +09:00
Cheng Zhao
59476f0b30 Create webContents for webview even when src is not set 2017-12-01 10:35:23 +09:00
Cheng Zhao
5e4914700e Enable using external WebContents as devtools 2017-12-01 10:35:23 +09:00
John Kleinschmidt
0ef8f58090 Remove Travis references 2017-11-30 15:39:32 -05:00
Zeke Sikelianos
aab35073ee Merge pull request #11255 from electron/fix-11245
Enable nativeImage module addRepresentation() tests
2017-11-30 10:48:11 -08:00
Zeke Sikelianos
c1728720a7 Merge pull request #11256 from electron/fix-11244
Enable "<webview> tag found-in-page event emits when a request is made"
2017-11-30 10:48:00 -08:00
shelley vohr
2bc8b33c2a Merge pull request #11291 from electron/fix-failing-spec
spec: Fix the failing coffee-script test
2017-11-30 13:43:58 -05:00
John Kleinschmidt
2d75eea82a Merge pull request #11254 from electron/fix-11246
Enable crashReporter module tests
2017-11-30 12:55:49 -05:00
Aleksei Kuzmin
b9ed7380aa Explicitly set alpha type of bitmaps with JPEG data to opaque
Actually fixes #11245.
2017-11-30 17:56:32 +01:00
Aleksei Kuzmin
c0c983d28d Light refactoring of the nativeImage module tests 2017-11-30 17:50:51 +01:00
Cheng Zhao
04872bb001 spec: Fix the failing coffee-script test
The latest version has some regression causing our test to fail.
2017-11-30 21:10:22 +09:00
Thiago de Arruda
68bceb9575 Fix race condition in event_subscriber.h 2017-11-29 12:57:47 -03:00
Aleksei Kuzmin
275815002f Inscrease timeout for crashReporter tests
Fixes #11246.
2017-11-29 12:27:06 +01:00
Toinane
3d4ef66775 add some markdown links 2017-11-29 12:13:45 +01:00
Toinane
0a0d88a5dc remove all double spaces not needed 2017-11-29 11:58:24 +01:00
Toinane
323ea2b27b fix(docs): fix all missing dots and add some links 2017-11-29 11:38:35 +01:00
Cheng Zhao
d09e8cc37f Merge pull request #11108 from oktapodia/feature/add-ansi-color-into-menu-title
Feature/add ansi color into menu title
2017-11-29 18:37:52 +09:00
Zhuo Lu
c274312a3a Update submenu's title 2017-11-28 19:38:07 -08:00
Toinane
59607c9a17 feat(docs): fix 'optional' wording 2017-11-28 18:15:15 +01:00
Cheng Zhao
0dc094fffc Do not change logic on highlighing 2017-11-28 17:37:58 +09:00
Cheng Zhao
d1ebce0395 Remove unused methods 2017-11-28 17:31:13 +09:00
Cheng Zhao
590578c187 Cache the attributed string 2017-11-28 17:26:09 +09:00
Cheng Zhao
eab3342065 Fix the detection of ANSI code 2017-11-28 16:36:07 +09:00
Cheng Zhao
c9acccaddc Fix memory leak in ANSCI parsing code
We do not have ARC enabled.
2017-11-28 16:36:07 +09:00
Cheng Zhao
4ded79801f Remove unused code in NSColor+Hex.h 2017-11-28 16:10:24 +09:00
Cheng Zhao
08f30e4ca6 Add license for the vendored files
Checked the original files and they were compatible with MIT.
2017-11-28 15:38:42 +09:00
Cheng Zhao
edede7f33f Fix cpplint warning 2017-11-28 15:36:45 +09:00
Sebastien Bramille
a4905b3c95 Lint 2017-11-28 15:34:13 +09:00
Sebastien Bramille
e8b0897ea1 Fix margin 2017-11-28 15:34:13 +09:00
Sebastien Bramille
71cfb7441c Update header file 2017-11-28 15:34:13 +09:00
Sebastien Bramille
7a8431086c Update doc 2017-11-28 15:34:13 +09:00
Sebastien Bramille
9f89bd8d8e Add isHighlighted method 2017-11-28 15:34:13 +09:00
Sebastien Bramille
6a1cfafbd8 Clean 2017-11-28 15:34:13 +09:00
Sebastien Bramille
85f254316c Add logic 2017-11-28 15:34:13 +09:00
Sebastien Bramille
d722d20974 Use NSString+ANSI on the Menu title 2017-11-28 15:34:13 +09:00
Sebastien Bramille
1d807c552e Add NSString+ANSI class 2017-11-28 15:34:13 +09:00
Cheng Zhao
124667c29b Merge pull request #11227 from emmkimme/Fix_10470_sandbox_preload
🐞 #10470 - prevent from loading preload in each iframe context
2017-11-28 15:25:34 +09:00
Cheng Zhao
b161a4f515 Merge pull request #11166 from sethlu/openrecent
feat: Recent documents menu item
2017-11-28 10:55:14 +09:00
Charles Kerr
2ad425955b Merge pull request #11249 from electron/upgrading-chromium-tweaks
Apply some of my summit notes to the upgrading-chrome docs.
2017-11-28 00:55:12 +01:00
Charles Kerr
18dc63ce77 fix conflicts 2017-11-27 16:40:10 -06:00
Zeke Sikelianos
2e3550b97f update electron-docs-linter and electron-typescript-definitions to latest 2017-11-27 12:44:24 -08:00
Charles Kerr
e24cd329d9 Merge pull request #11268 from electron/fix_crash
Don't access unique pointer after it was moved from
2017-11-27 19:20:44 +01:00
Ales Pergl
f8b683ca3d Don't access unique pointer after it was moved from 2017-11-27 17:55:21 +01:00
Charles Kerr
defa42b458 Merge pull request #11257 from electron/fix-11242
Remove "async" flag from the `menu.popup()` options
2017-11-27 16:41:56 +01:00
Cheng Zhao
141c4e9a0e Merge pull request #11241 from electron/update-to-the-latest-libcc
Use latest libcc with Chromium 61
2017-11-27 17:49:05 +09:00
Zhuo Lu
104d307a4a Use base::scoped_nsobject 2017-11-27 17:26:23 +09:00
Zhuo Lu
8fa3e71ce4 Format code 2017-11-27 17:26:22 +09:00
Zhuo Lu
2f73f4f77e Fix typo 2017-11-27 17:26:22 +09:00
Zhuo Lu
4934685f53 Declare with static 2017-11-27 17:26:22 +09:00
Zhuo Lu
0c4e425872 Do not autorelease global variables 2017-11-27 17:26:22 +09:00
Zhuo Lu
2de7b338ad Update API docs 2017-11-27 17:26:22 +09:00
Zhuo Lu
dcdc3621ac Rename roles 2017-11-27 17:26:22 +09:00
Zhuo Lu
1ab4504e94 No need to make visible 2017-11-27 17:26:22 +09:00
Zhuo Lu
cf73fb737f Small optimization 2017-11-27 17:26:22 +09:00
Zhuo Lu
3e6e327711 Remove redundant menu item
Already addressed with role: clearrecent
2017-11-27 17:26:22 +09:00
Zhuo Lu
5d44dbaf54 Redesign recent documents role API
- For more flexibility in designing the recent documents menu, now there can be one menu item (known issue: you may specify more but AppKit doens't display more than one) in the submenu list, rather than separating the labels with a tab.
- Also added is the role `clearrecent` that can be given to a menu item that can clear the recent documents.
2017-11-27 17:26:22 +09:00
Zhuo Lu
828d233f2a Rollback duplicated feature 2017-11-27 17:26:22 +09:00
Zhuo Lu
0b9cea334f Specify "Clear Menu" through label option
Like a bit of a hack right now, conforming to the existing menu item definition
2017-11-27 17:26:22 +09:00
Zhuo Lu
970babbfd7 Document openrecent menu item 2017-11-27 17:26:22 +09:00
Zhuo Lu
8b720c120d Hide "Open Recent" in xib 2017-11-27 17:26:22 +09:00
Zhuo Lu
4da2eb9366 Introduce openrecent role
- Does not yet accept any options except label--"Clear Menu" can't be modified through exposed node API
- If `openrecent` is present across multiple menu items, the last seen will be visible in the main menu due to that it is designed to behave like a singleton
2017-11-27 17:26:22 +09:00
Zhuo Lu
0ba2fa5cba Use else if 2017-11-27 17:26:22 +09:00
Zhuo Lu
f0bff74995 Add "Open Recent" submenu to default 2017-11-27 17:26:22 +09:00
Cheng Zhao
c0e9dbcc00 Merge pull request #11144 from dittos/mas-login-helper-again
Re-land MAS login helper (w/ regression fix)
2017-11-27 17:02:57 +09:00
Cheng Zhao
1c0ea0286e Merge pull request #11235 from electron/standard-10
infra: Upgrade to StandardJS 10
2017-11-27 15:42:52 +09:00
Charles Kerr
295945b806 copyediting 2017-11-26 08:44:37 +01:00
Charles Kerr
81bc0efc75 fix styleguide errors 2017-11-26 08:38:58 +01:00
Charles Kerr
a75a85449d sync with master 2017-11-26 08:28:27 +01:00
Charles Kerr
d1ac773e01 Merge pull request #11253 from electron/fix-a-codeblock-in-the-upgrading-node-md
Fix a codeblock markup
2017-11-26 08:00:47 +01:00
deepak1556
084292f3ab fix: focus the webview as a temp workaround 2017-11-25 20:18:01 +05:30
Aleksei Kuzmin
9c5acf6233 Remove "async" flag from the menu.popup() options
All menus have become async after the Chromium 61 upgrade.
Fixes #11242.
2017-11-25 13:31:58 +01:00
Aleksei Kuzmin
3e9f9429d1 Enable "<webview> tag found-in-page event emits when a request is made"
Fixes #11244.
2017-11-25 13:21:26 +01:00
Aleksei Kuzmin
91e4193622 Enable nativeImage module addRepresentation() tests
Fixes #11245.
2017-11-25 12:58:33 +01:00
Zeke Sikelianos
df0c7e2f74 Merge pull request #11250 from electron/docs-lint-fix
🔧 fix remark code flag error
2017-11-24 21:05:26 -08:00
Aleksei Kuzmin
ce6af85f98 Fix a codeblock markup 2017-11-25 00:56:07 +01:00
Aleksei Kuzmin
d9d2a8176e Use latest libcc with Chromium 61 2017-11-24 23:43:32 +01:00
Shelley Vohr
d9c7b95141 fix remark code flag error 2017-11-24 21:40:19 +01:00
Charles Kerr
22c15082a3 partial doc update from my sprint notes 2017-11-24 14:21:41 +01:00
shelley vohr
6941f93627 Merge pull request #11247 from electron/use_sh_in_docs
prefer `sh` to `bash` in the docs
2017-11-24 11:38:10 +01:00
Charles Kerr
b59557569c oops, the upgrading-chrome.md changes belonged in a separate PR 2017-11-24 11:19:53 +01:00
Charles Kerr
3e3cac6f1b prefer sh to bash in the docs 2017-11-24 11:17:43 +01:00
shelley vohr
00999a07d8 Merge pull request #11240 from electron/upgrading_docs
Upgrading docs for node, crashpad, and chromium
2017-11-24 11:16:18 +01:00
Shelley Vohr
bd70ec5e97 finalize node upgrade doc 2017-11-24 11:15:07 +01:00
Charles Kerr
1b0c1842ca prefer sh to bash in the docs 2017-11-24 11:13:57 +01:00
Shelley Vohr
ba6224039c make some things more explicit and style conformity 2017-11-24 11:06:04 +01:00
Shelley Vohr
178462b800 chrome -> chromium and updates to crashpad doc 2017-11-24 10:40:37 +01:00
Charles Kerr
f91020a04d add section for updating submodule references 2017-11-24 10:40:30 +01:00
Charles Kerr
f8858a7577 add rough draft of node, crashpad update notes 2017-11-24 10:40:21 +01:00
shelley vohr
c18afc924b Merge pull request #10213 from electron/upgrade-to-chromium-61
[WIP] Upgrade to Chromium 61
2017-11-24 10:17:52 +01:00
Charles Kerr
fcc8e0924e Merge pull request #11097 from brenca/resizable-win-fix
Fix resizable property not working when taskbar was resized
2017-11-24 10:04:43 +01:00
Cheng Zhao
c30faa4ee8 Use 2xlarge for ARM jobs 2017-11-24 11:03:02 +09:00
Aleksei Kuzmin
8e708692b8 Use latest libcc 2017-11-24 10:58:53 +09:00
Cheng Zhao
a34d45d8c4 Fix uninitialized NodePlatform 2017-11-24 10:58:53 +09:00
Cheng Zhao
3138c85218 Fix linking problem with NodePlatform 2017-11-24 10:58:53 +09:00
Aleksei Kuzmin
efd949ea83 Disable a couple of crashReporter tests 2017-11-24 10:58:53 +09:00
Aleksei Kuzmin
d61564bfb1 Disable "<webview> tag > found-in-page event > emits when a request is made" test 2017-11-24 10:58:53 +09:00
Aleksei Kuzmin
c73ba5802e Disable "nativeImage module > addRepresentation()" tests 2017-11-24 10:58:53 +09:00
deepak1556
0b88873e77 add basic inspector module test 2017-11-24 10:58:53 +09:00
deepak1556
ed4482d7a0 Fix node_debugger api changes
* _debugWaitConnect => _breakFirstLine
  * Use default thread pool size specified by node.cc
2017-11-24 10:58:53 +09:00
Aleksei Kuzmin
11f7bb34fc Fix "nghttp2" build 2017-11-24 10:58:53 +09:00
Tomas Rycl
207150c21c Adding node headers to native modules for tests so they will compile and run on Mac 2017-11-24 10:58:53 +09:00
Aleksei Kuzmin
1cf95d2a26 Use node::NodePlatform instead of v8::platform in atom::NodeDebugger 2017-11-24 10:58:53 +09:00
Aleksei Kuzmin
ad732b45d2 Use Node.js v8.7.0 2017-11-24 10:58:53 +09:00
Ales Pergl
9ca658238b Made NotificationDelegateImpl final
The class is designed to call `delete` on itself and because it doesn't have
a virtual destructor, it shouldn't be derived from.
2017-11-24 10:58:53 +09:00
deepak1556
505f2ab9e7 Fix crash when destroying NetLog 2017-11-24 10:58:53 +09:00
deepak1556
214cbf357a Fix cpp lint errors 2017-11-24 10:58:53 +09:00
deepak1556
e60557e2e6 simplify URLRequestContextGetter for HttpNetworkSession::Context 2017-11-24 10:58:53 +09:00
deepak1556
e0860ea7a0 Stop file observer of NetLog to finish writing to disk 2017-11-24 10:58:53 +09:00
Ales Pergl
f3c32647af Sanitized notification delegate implementation
I made `brightray::NotificationDelegate` back into just an interface and
extracted the implementation used by `PlatformNotificationService`, so that
the main process notification implementation can inherit only the interface.
2017-11-24 10:58:53 +09:00
Ales Pergl
8750fde6d3 Added libfreetype dependency to ARM64 build 2017-11-24 10:58:53 +09:00
Ales Pergl
19ef7d7a48 Added build dependency information for arm64 2017-11-24 10:58:53 +09:00
Aleksei Kuzmin
465f9009ff Update stack string parsing in the CallbacksRegistry
Fixes the "ipc module > remote listeners
> detaches listeners subscribed to destroyed renderers, and shows a warning"
test.
2017-11-24 10:58:53 +09:00
Ales Pergl
82394cc06d Use an existing host name so that it resolves quickly and tests don't time out. 2017-11-24 10:58:53 +09:00
deepak1556
7a9892f151 REVIEW: Inject devtools extensions API via browser
Behavior was changed in https://crbug.com/706169
2017-11-24 10:58:53 +09:00
Ales Pergl
531472bad4 Create a TaskScheduler when initializing run-as-node mode.
It fixes crashes when V8 tries to execute background tasks via the TaskScheduler.
2017-11-24 10:58:53 +09:00
Ales Pergl
334b39ef1e Fixed build issues 2017-11-24 10:58:53 +09:00
deepak1556
2fa0b3d33e Enable client certificate tests 2017-11-24 10:58:53 +09:00
deepak1556
a0be734ccb Fix client certificate private key handling api 2017-11-24 10:58:53 +09:00
Gellert Hegyi
a47497bf18 adds extra param for ui compositor creation 2017-11-24 10:58:53 +09:00
Gellert Hegyi
5d79dbc9a1 upgrades offscreen rendering to latest chromium 2017-11-24 10:58:53 +09:00
Tomas Rycl
c9b7fc2922 It fixes crash in tests on Windows
Notification delegate copies the notification ID string
instead of storing reference.
2017-11-24 10:58:53 +09:00
Tomas Rycl
e321a4a433 Setting raw pointer to nullptr as default so it can be detected as noninitialized 2017-11-24 10:58:53 +09:00
Aleksei Kuzmin
3a3eb69d0f Do not specify exception handling mode on Windows
Like Chromium does. Also disable related warnings.
2017-11-24 10:58:53 +09:00
Tomas Rycl
69cd33395a Fixed crash on startup on Windows 2017-11-24 10:58:53 +09:00
Aleksei Kuzmin
fe9ae41f98 Use gtk_toggle_button_get_active() 2017-11-24 10:58:53 +09:00
Aleksei Kuzmin
abcda097fb Use GTK3 instead of GTK2 2017-11-24 10:58:53 +09:00
Samuel Attard
ef40bd4786 Remove dead header file for notification delegate 2017-11-24 10:58:17 +09:00
Samuel Attard
797a58bee0 Result of RunMenuAt is now void, no need to ignore it 2017-11-24 10:58:17 +09:00
Samuel Attard
1b46b5ceda Fix printing_handler_win compilation errors 2017-11-24 10:58:17 +09:00
Tomas Rycl
a723e5a4c5 Fixed moved cert x509 function issue on Windows 2017-11-24 10:58:17 +09:00
Aleksei Kuzmin
89c1b8043f Do not use SkBitmap.deepCopyTo(), it was removed
Copy of the `sk_tool_utils::copy_to()` is used instead.
Probsbly we should use the function itself.
2017-11-24 10:58:17 +09:00
Aleksei Kuzmin
9326ce8cfd allocator: rename use_experimental_allocator_shim to use_allocator_shim
https://codereview.chromium.org/2902043007
2017-11-24 10:58:17 +09:00
Aleksei Kuzmin
6d620c24b5 Update link_settings/libraries list in the brightray.gyp 2017-11-24 10:58:17 +09:00
Birunthan Mohanathas
4e859b4718 Remove "async" option from menu.popup()
All menus are async now. See "Cleanup MenuRunner API"
https://codereview.chromium.org/2790773002
2017-11-24 10:58:17 +09:00
Aleksei Kuzmin
338604239d Cleanup MenuRunner API
https://codereview.chromium.org/2790773002
2017-11-24 10:58:17 +09:00
Aleksei Kuzmin
14eb2af876 Give CustomButton a focus painter.
https://chromium-review.googlesource.com/c/chromium/src/+/516824
2017-11-24 10:58:17 +09:00
Aleksei Kuzmin
e0d7b7d0fc Clean up views::Background.
https://chromium-review.googlesource.com/c/chromium/src/+/520702
2017-11-24 10:58:17 +09:00
Aleksei Kuzmin
93b3d8cb49 Changed top/bottom & left/right border parameters on BoxLayout to take single gfx::Insets parameter.
https://chromium-review.googlesource.com/c/chromium/src/+/515902
2017-11-24 10:58:17 +09:00
Aleksei Kuzmin
4607a1fd13 make base::SharedMemoryHandle a class on POSIX.
https://codereview.chromium.org/2843113002
2017-11-24 10:58:17 +09:00
Tony Ganch
59550b203f Include objbase.h only for Windows 2017-11-24 10:58:17 +09:00
Tony Ganch
513d4fd225 Remove usage of X11AtomCache
See https://codereview.chromium.org/2914103002/
2017-11-24 10:58:17 +09:00
Tony Ganch
da04cbd4d8 Rename set_background to SetBackground 2017-11-24 10:58:17 +09:00
Tony Ganch
d7e4e8d6cc Rename GetPrefferedSize to CalculatePrefferedSize
See https://chromium-review.googlesource.com/c/chromium/src/+/516542
2017-11-24 10:58:17 +09:00
Aleksei Kuzmin
7f5fbb04e2 Migrate from ScopedComPtr::CreateInstance() to CoCreateInstance in chrome/...
https://codereview.chromium.org/2894483002
2017-11-24 10:58:17 +09:00
Aleksei Kuzmin
79e59a88b4 Rename ScopedComPtr::Receive to ScopedComPtr::GetAddressOf
https://codereview.chromium.org/2870263002
2017-11-24 10:58:17 +09:00
Aleksei Kuzmin
485e43636b Rename ScopedComPtr::get() to ScopedComPtr::Get()
https://codereview.chromium.org/2824773002
2017-11-24 10:58:17 +09:00
Aleksei Kuzmin
1073c9b1ed Fix compilation of atom/browser/api/atom_api_app.cc
Refactor client cert private key handling.
https://codereview.chromium.org/2898573002
2017-11-24 10:58:17 +09:00
Aleksei Kuzmin
8c40854983 Move handling of DraggableRegionsChanged notification from "view" to "frame".
https://codereview.chromium.org/2929493003
2017-11-24 10:58:17 +09:00
Aleksei Kuzmin
624b63a1ca Move "atom/common/node_includes.h" to the end of the includes list
https://github.com/electron/electron/issues/10363
2017-11-24 10:58:17 +09:00
Aleksei Kuzmin
3a7b3ba95e Update crashpad revision 2017-11-24 10:58:17 +09:00
Aleksei Kuzmin
96ff534248 Update brightray link_settings on Mac 2017-11-24 10:58:17 +09:00
Aleksei Kuzmin
7a23a79b58 Add protobuf defines and include_dirs 2017-11-24 10:58:17 +09:00
Aleksei Kuzmin
56e7867455 Move IconURLs method from WebFrame to WebLocalFrame
https://codereview.chromium.org/2918903002
2017-11-24 10:58:17 +09:00
Aleksei Kuzmin
fe662ccbdc Remove obsolete Blink popup blocker.
https://chromium-review.googlesource.com/c/chromium/src/+/512347
2017-11-24 10:58:17 +09:00
Aleksei Kuzmin
dcb9925ddd Fix 'constructor cannot be redeclared' error
Upgrade ICU to 59
https://bugs.chromium.org/p/chromium/issues/detail?id=699469
2017-11-24 10:58:17 +09:00
Aleksei Kuzmin
5fb0f005c5 Convert SpellCheckPanel SpellCheckPanelHost IPC to mojo
https://chromium-review.googlesource.com/c/chromium/src/+/515323
2017-11-24 10:58:17 +09:00
Aleksei Kuzmin
c6333728d9 Fix brightray::URLRequestContextGetter::GetURLRequestContext()
Split HttpNetworkSession::Params into two structs.
https://codereview.chromium.org/2907463002

Make HttpNetworkSession::host_mapping_rules no longer a pointer.
https://codereview.chromium.org/2906463002
2017-11-24 10:58:17 +09:00
Tony Ganch
491249108e Fix WebLocalFrame API usage
Related CLs:
https://chromium-review.googlesource.com/c/chromium/src/+/506500
https://chromium-review.googlesource.com/c/chromium/src/+/542658
2017-11-24 10:58:17 +09:00
Tony Ganch
0ad967c9a5 Don't specify URLRequestContext when starting logging
Related CL: https://codereview.chromium.org/2698143004
2017-11-24 10:58:17 +09:00
Tony Ganch
4412836e77 Include header for net::URLRequestContext 2017-11-24 10:58:17 +09:00
Aleksei Kuzmin
59b2fb054e Use blink::WebLocalFrame instead of blink::WebFrame in printing 2017-11-24 10:58:17 +09:00
Aleksei Kuzmin
d817e23050 [c++11 library] Remove ScopedVector
https://bugs.chromium.org/p/chromium/issues/detail?id=554289
2017-11-24 10:58:17 +09:00
Aleksei Kuzmin
ac8c205fd7 Replace deprecated base::NonThreadSafe in chrome in favor of SequenceChecker.
https://codereview.chromium.org/2911983003
2017-11-24 10:58:16 +09:00
Aleksei Kuzmin
75b41102ef Remove unused includes 2017-11-24 10:58:16 +09:00
Aleksei Kuzmin
a9eb0cbec0 Ban raw pointers to ref-counted types on base::Bind
https://chromium-review.googlesource.com/c/chromium/src/+/549537
2017-11-24 10:58:16 +09:00
deepak1556
12a4321e2b Reporting: Wire ReportingDelegate into ChromeNetworkDelegate
https://codereview.chromium.org/2891133003
2017-11-24 10:58:16 +09:00
Aleksei Kuzmin
7d1c1700f8 Implement GetBrowsingDataRemoverDelegate() for BrowserContext subclasses
https://codereview.chromium.org/2898443002
2017-11-24 10:58:16 +09:00
Aleksei Kuzmin
edb7bc6572 Make BlobReader create its own file TaskRunner.
https://chromium-review.googlesource.com/c/chromium/src/+/570945
2017-11-24 10:58:16 +09:00
Aleksei Kuzmin
6ba372f9f2 Move some of IOThread's command line logic to network_session_configurator.
https://codereview.chromium.org/2914893002
2017-11-24 10:58:16 +09:00
Aleksei Kuzmin
47d683f0ad DevTools: do not set visible size while emulating in case of device mode.
https://chromium-review.googlesource.com/c/chromium/src/+/572222
2017-11-24 10:58:16 +09:00
Aleksei Kuzmin
6c7ad3ac58 Remove the dependence on BrowserThread::FILE for
https://codereview.chromium.org/2944313003
2017-11-24 10:58:16 +09:00
Aleksei Kuzmin
b29c485ec4 Consolidate PowerSaveBlocker and WakeLock inside Device Service.
https://chromium-review.googlesource.com/c/chromium/src/+/563159
2017-11-24 10:58:16 +09:00
Aleksei Kuzmin
933bf77a1f printing: Remove BlockingPool use
https://chromium-review.googlesource.com/c/chromium/src/+/541856
2017-11-24 10:58:16 +09:00
Aleksei Kuzmin
5a4a1a5574 Use "blink::WebLocalFrame" for "GetMarginsForPdf()"
Fixes "error: no member named 'IsPrintScalingDisabledForPlugin' in 'blink::WebFrame'"
2017-11-24 10:58:16 +09:00
Aleksei Kuzmin
f0cda8d88c Move Get/SetScrollOffset methods from WebFrame to WebLocalFrame.
https://codereview.chromium.org/2936423003
2017-11-24 10:58:16 +09:00
Aleksei Kuzmin
4ac9659114 Move printing-related methods from WebFrame to WebLocalFrame.
https://codereview.chromium.org/2923343005
2017-11-24 10:58:16 +09:00
Aleksei Kuzmin
e4d9e12ee5 Use blink::WebLocalFrame instead of blink::WebFrame
Move GetDocument method from WebFrame to WebLocalFrame.
https://codereview.chromium.org/2928033002

Move MainWorldScriptContext accessor/method from WebFrame to WebLocalFrame.
https://codereview.chromium.org/2923053002
2017-11-24 10:58:16 +09:00
Aleksei Kuzmin
61797b7802 Move GetDocument method from WebFrame to WebLocalFrame.
https://codereview.chromium.org/2928033002
2017-11-24 10:58:16 +09:00
Aleksei Kuzmin
7608a0489c Network Traffic Annotation added to DownloadURLParams.
https://chromium-review.googlesource.com/c/530307
2017-11-24 10:58:16 +09:00
Aleksei Kuzmin
e926473e5a Partial revert of Provide WebContents::CreateParams to tab helpers.
https://chromium-review.googlesource.com/c/571285
2017-11-24 10:58:16 +09:00
Aleksei Kuzmin
9566904838 Speech recognition: Use BindOnce / OnceCallback / OnceClosure where applicable
https://chromium-review.googlesource.com/c/565762
2017-11-24 10:58:16 +09:00
Aleksei Kuzmin
5831a5ffa1 Refactor client cert private key handling.
https://codereview.chromium.org/2898573002
2017-11-24 10:58:16 +09:00
Aleksei Kuzmin
b69913975b chromeos: Check both original and absolute paths for file: scheme
https://codereview.chromium.org/2786583002
2017-11-24 10:58:16 +09:00
Aleksei Kuzmin
14c61a96af VR: Check focus state browser-side before sending input to renderer.
https://chromium-review.googlesource.com/c/565760
2017-11-24 10:58:16 +09:00
Aleksei Kuzmin
fe48a92422 Propagate opener to BackgroundsContents.
https://codereview.chromium.org/2882513005
2017-11-24 10:58:16 +09:00
Tony Ganch
f694b64d71 FIXME: DesktopNotificationDelegate has been removed
Related CL: https://codereview.chromium.org/2906883003
2017-11-24 10:58:16 +09:00
Aleksei Kuzmin
fe431a9e58 Add WebRTC related defines to the build config 2017-11-24 10:58:16 +09:00
Aleksei Kuzmin
68cbfd9f40 Remove base::ListValue::Set(size_t, base::Value*)
https://codereview.chromium.org/2838893002
2017-11-24 10:58:16 +09:00
Aleksei Kuzmin
2c063f93ff Remove raw base::DictionaryValue::Set
https://codereview.chromium.org/2911033002
2017-11-24 10:58:16 +09:00
Tony Ganch
cf00fc0661 Rename WriteToFileNetLogObserver to FileNetLogObserver 2017-11-24 10:58:16 +09:00
Aleksei Kuzmin
370476c4af Remove unused RenderViewObserver methods.
https://chromium-review.googlesource.com/c/506027

`DidCreateDocumentElement()` observer method was removed.
So I have to use a different approach to check if a document element
has already been created on a web page.
2017-11-24 10:58:16 +09:00
Aleksei Kuzmin
1127452429 PlzNavigate: make NavigationResourceHandler a LayeredResourceHandler
https://codereview.chromium.org/2847443002
2017-11-24 10:58:16 +09:00
Aleksei Kuzmin
a72a08bccc Convert iOS to use X509CertificateBytes.
https://codereview.chromium.org/2864133002
2017-11-24 10:58:16 +09:00
Aleksei Kuzmin
ea8e113b19 SkBitmap and SkPixelRef no longer need lock/unlock
https://codereview.chromium.org/2823003002
2017-11-24 10:58:16 +09:00
Aleksei Kuzmin
ea4a36039a Add Keyboard Latency UMA Metrics.
https://codereview.chromium.org/2756893002
2017-11-24 10:58:16 +09:00
Aleksei Kuzmin
f03ca53af5 Add blink::WebInputEvent::IsPinchGestureEventType().
https://codereview.chromium.org/2861373004
2017-11-24 10:58:16 +09:00
Aleksei Kuzmin
650902c656 Renamed LoadCommittedDetails.is_in_page to is_same_document.
https://codereview.chromium.org/2841833002
2017-11-24 10:58:16 +09:00
Aleksei Kuzmin
90b0984a14 Add missing IWYU message_loop.h includes.
https://codereview.chromium.org/2876013002
2017-11-24 10:58:16 +09:00
Aleksei Kuzmin
e2a224c4e6 Remove rendundant WebLocalFrame parameter in various plugin code.
https://codereview.chromium.org/2855123003
2017-11-24 10:58:16 +09:00
Aleksei Kuzmin
11fa935359 Introduce TaskRunner::RunsTasksInCurrentSequence()
https://codereview.chromium.org/2823103003
2017-11-24 10:58:16 +09:00
Aleksei Kuzmin
f2bcdab037 Provide WebContents::CreateParams to tab helpers.
https://codereview.chromium.org/2894973002
2017-11-24 10:58:16 +09:00
Aleksei Kuzmin
c402658c08 Replicate feature policy container policies.
https://codereview.chromium.org/2797813002
2017-11-24 10:58:16 +09:00
Aleksei Kuzmin
971002a197 Switch to using scoped_ptr with UserData
https://codereview.chromium.org/2815913005
2017-11-24 10:58:16 +09:00
Aleksei Kuzmin
fe952d5c65 Get rid of SharedMemory::GiveToProcess.
https://codereview.chromium.org/2847033003

Changes copied from
"printing: Sandboxed processes must ask the browser to allocate shared memory."
https://codereview.chromium.org/1714643002
2017-11-24 10:58:16 +09:00
Aleksei Kuzmin
ee9a547985 Service CreateNewWindow on the UI thread with a new mojo interface
https://codereview.chromium.org/2821473002
2017-11-24 10:58:16 +09:00
Aleksei Kuzmin
b81ae1c36f REVIEW: Move MediaDeviceIDSalt from ProfileIOData to ProfileImpl.
https://codereview.chromium.org/2820163002
2017-11-24 10:58:15 +09:00
Aleksei Kuzmin
ba6e8b4dff Merge ResourceRequestBodyImpl and ResourceRequestBody.
https://codereview.chromium.org/2954343005
2017-11-24 10:58:15 +09:00
Aleksei Kuzmin
b77b67bfbe Remove client_certs from SSLCertRequestInfo.
https://codereview.chromium.org/2838243002
2017-11-24 10:58:15 +09:00
Aleksei Kuzmin
364c330887 Replace uses of hash_map in //base
https://codereview.chromium.org/2830093003
2017-11-24 10:58:15 +09:00
Aleksei Kuzmin
ba2f33d629 Remove base::Value::GetAsBinary
https://codereview.chromium.org/2839753005
2017-11-24 10:58:15 +09:00
Aleksei Kuzmin
f847291272 [blink] Unique pointers in Platform.h
https://codereview.chromium.org/2846843002
2017-11-24 10:58:15 +09:00
Aleksei Kuzmin
7ad524fa34 Make base::DictionaryValue::Set* return pointers
https://codereview.chromium.org/2850773002
2017-11-24 10:58:15 +09:00
Aleksei Kuzmin
75d02f65d9 Remove base::SharedMemory::ShareToProcess
https://codereview.chromium.org/2852803002
2017-11-24 10:58:15 +09:00
Aleksei Kuzmin
58e0771e47 Remove base::Value::Get{Buffer,Size}
https://codereview.chromium.org/2841623003
2017-11-24 10:58:15 +09:00
Aleksei Kuzmin
132029ea32 Move components/display_compositor to components/viz/display_compositor
https://codereview.chromium.org/2873243002
2017-11-24 10:58:15 +09:00
Tony Ganch
5315a2e8dc Set clang revision to 307486 2017-11-24 10:58:15 +09:00
Aleksei Kuzmin
2bb95ce41e Update chrome_version.h 2017-11-24 10:58:15 +09:00
Aleksei Kuzmin
fed090a44c Use latest libcc with Chromium 61 2017-11-24 10:58:15 +09:00
Cheng Zhao
f8adaed763 Merge pull request #11208 from electron/mips64el
Add support for mips64el
2017-11-24 10:54:19 +09:00
Cheng Zhao
2db845e202 Disable mips64el CI job 2017-11-24 10:12:19 +09:00
Felix Rieseberg
9f0df695ca 🔧 Spec: Fix style issues 2017-11-23 14:22:58 -08:00
Felix Rieseberg
0278e380de 🔧 Spec: Don’t use deprecated new Buffer() 2017-11-23 14:22:31 -08:00
Felix Rieseberg
f7d6e3fa7b 🔧 Disable standard/no-callback-literal where necessary 2017-11-23 13:53:03 -08:00
Felix Rieseberg
f81bfb7b86 🔧 Fix style issues 2017-11-23 13:42:48 -08:00
Felix Rieseberg
97a084a591 🔧 Script: Reject with error 2017-11-23 13:42:31 -08:00
Felix Rieseberg
d0ef834b4f 🔧 Remove redundant await statements 2017-11-23 13:42:09 -08:00
Felix Rieseberg
451a44c4b5 🔧 Don’t use deprecated new Buffer() 2017-11-23 13:41:47 -08:00
Felix Rieseberg
19df1cf070 📦 Upgrade to StandardJS 10 2017-11-23 13:41:14 -08:00
Heilig Benedek
62594780e0 run the new test only on windows 2017-11-23 21:25:26 +01:00
Heilig Benedek
710ca230f3 update tests to reflect new behaviour 2017-11-23 21:25:25 +01:00
Heilig Benedek
bb5eecc16c Use SizeConstraints instead of window events 2017-11-23 21:25:25 +01:00
Heilig Benedek
ca76dda6a6 remove incorrect checks 2017-11-23 21:25:25 +01:00
Heilig Benedek
7a7f1ee711 dont resize on taskbar resize if resizable is false 2017-11-23 21:25:25 +01:00
Charles Kerr
9c217fc6c7 Merge pull request #11224 from electron/browser-view-window
feature: Add `BrowserWindow.fromBrowserView()`
2017-11-23 14:41:36 +01:00
Charles Kerr
3f21e1240f Merge pull request #11231 from Toinane/fix-doc
fix doc in download-item
2017-11-23 14:39:52 +01:00
Toinane
dd139706ea fix doc in download-item 2017-11-23 13:31:09 +01:00
Charles Kerr
d92e229b3b Merge pull request #11207 from kstar0714/master
fix word docs-translation/README.md, CODE_OF_CONDUCT.md
2017-11-23 10:17:11 +01:00
shelley vohr
96aa0aa2f1 Merge pull request #11217 from him2him2/_fix_README.md_HTTPS
Update README.md URLs to HTTPS
2017-11-23 10:08:44 +01:00
Charles Kerr
3c607394d7 Merge pull request #11225 from electron/get-current-browser-view
feature: BrowserView.getAllViews() & BrowserView.fromWebContents()
2017-11-23 09:49:11 +01:00
Emmanuel Kimmerlin
5f658de19f 🐛 #10470 - prevent to load preload in each iframe context 2017-11-23 09:20:52 +01:00
Cheng Zhao
6930f5c3ba Update libcc to include patch on mips64el v8 pagesize 2017-11-23 16:58:58 +09:00
Felix Rieseberg
037f76c47b 🐛 Ooops, fix that 2017-11-22 17:07:57 -08:00
Felix Rieseberg
690e8cf75b 👷 Add specs 2017-11-22 17:06:14 -08:00
Felix Rieseberg
6298748d0b 📝 Document BrowserView.fromWebContents() 2017-11-22 17:02:01 -08:00
Felix Rieseberg
69e461083a 📝 Document BrowserView.getAllViews() 2017-11-22 17:00:09 -08:00
Felix Rieseberg
4d18cbe728 🔧 BrowserView.fromWebContents() 2017-11-22 16:59:00 -08:00
Felix Rieseberg
3cb062b3d6 🔧 BrowserView.getAllViews() 2017-11-22 16:58:32 -08:00
Cheng Zhao
e4064d8dc2 Do not upload symbols for mips64el 2017-11-23 09:19:01 +09:00
Felix Rieseberg
7630ac6e90 🔧 Return null if not found 2017-11-22 15:48:11 -08:00
Felix Rieseberg
8f20ce6dcf 📝 Docs! 2017-11-22 14:38:22 -08:00
Felix Rieseberg
b7bc4eb586 👷 Let’s test the undefined case, too 2017-11-22 14:38:08 -08:00
Felix Rieseberg
14db204315 👷 Add a spec 2017-11-22 14:37:46 -08:00
Felix Rieseberg
8c5aad8b17 🔧 Add BrowserWindow.fromBrowserView() 2017-11-22 14:36:54 -08:00
Ronald Eddy Jr
061447d34e Update README.md URLs to HTTPS
Updating HTTP protocol to HTTPS on applicable URLS
[ci skip]
2017-11-22 10:20:52 -08:00
Charles Kerr
fded32dc4f Merge pull request #11218 from him2him2/_fix_CI_BuildError
Fix continuous-integration build error
2017-11-22 18:11:01 +01:00
Ronald Eddy Jr
7003a2a19c fix continuous-integration build error
Added Missing code-language flags to upgrading-chrome.md
2017-11-22 08:26:23 -08:00
Cheng Zhao
40bad250aa Update libcc to fix error caused by libdrm 2017-11-22 19:31:04 +09:00
Cheng Zhao
7cc73140f8 Fix creating dist for mips64el
Note that dump_syms can not parse mips64 binaries, so we don't have
symbols archive for mips64 arch.
2017-11-22 19:29:39 +09:00
Cheng Zhao
a2f95c5f90 Add libpulse to dependencies of mips64el 2017-11-22 19:07:03 +09:00
hanbyeol
e25a46378b Merge https://github.com/kstar0714/electron 2017-11-22 00:45:03 -08:00
hanbyeol
2cee035b4e fix docs-translation/README.md 2017-11-22 00:40:37 -08:00
Charles Kerr
5d03f3ca64 Merge pull request #11191 from electron/chromium_updates_guide
Proposed update to Chromium checklist
2017-11-22 08:16:37 +01:00
김한별
6fd6315cb2 Update README.md 2017-11-22 15:42:17 +09:00
Zeke Sikelianos
32edf6a2b8 Merge pull request #11203 from electron/document-chromium_src-directory
document chromium_src directory
2017-11-21 21:10:47 -08:00
Cheng Zhao
db6de6a2b2 Run electron-linux-mips64el CI job 2017-11-22 11:31:23 +09:00
Cheng Zhao
34d108e896 Fix linting error 2017-11-22 11:30:06 +09:00
Cheng Zhao
b2564242e0 Add CI job for mips64el
Note that our CI server is not ready for mips64el yet, so the binaries
of libcc are not available yet. Currently it is downloading the binaries
created by me manually, we should redirect to the official mirror before
merging this PR.
2017-11-22 11:21:28 +09:00
Cheng Zhao
7bc58c6a5f Update libcc to latest with mips64el support 2017-11-22 11:14:46 +09:00
Cheng Zhao
16ffff4aec Fix passing rpath to gcc 2017-11-22 11:14:20 +09:00
hanbyeol
78ccf14e53 fix word CODE_OF_CONDUCT.md 2017-11-21 17:15:14 -08:00
hanbyeol
1445ba5116 fix word docs-translation/README.md 2017-11-21 17:06:43 -08:00
Samuel Attard
be9e6700d9 Merge pull request #11204 from andykog/patch-2
Add mobx-devtools to the Supported section
2017-11-22 09:11:48 +11:00
Andy Kogut
0c47207a0e Add mobx-devtools to the Supported section
The library: https://mobx.js.org/
Extension's repo: https://github.com/andykog/mobx-devtools

![screen shot 2017-11-21 at 21 26 56](https://user-images.githubusercontent.com/6760207/33092485-eda05836-cf02-11e7-81a3-c04f8c3ea73b.png)
2017-11-21 21:38:14 +02:00
Zeke Sikelianos
4b41822a62 document chromium_src directory 2017-11-21 10:55:56 -08:00
Catalin Fratila
3b29adc000 Making it prettier. 2017-11-21 15:19:33 +01:00
Vanessa Yuen
b51396f1cd Merge pull request #11199 from duswlsgur/branch
Fixed wrong words & deleted urls in README.md
2017-11-21 21:01:36 +08:00
Cheng Zhao
0d8cfe8dbe Some compiler flags are clang only 2017-11-21 21:48:06 +09:00
Cheng Zhao
4f9c5310a9 Fix compiler warning when building with gcc 2017-11-21 21:47:51 +09:00
Charles Kerr
70643a865b Merge pull request #11178 from electron/fenced-code-block-lang
enforce rules on code blocks style in docs
2017-11-21 13:38:46 +01:00
Cheng Zhao
b2fdfa2710 Use mips64el toolchain 2017-11-21 20:42:20 +09:00
Cheng Zhao
a83b8e751b Download mips64el toolchain 2017-11-21 19:38:21 +09:00
Cheng Zhao
447e0e6c8b Add mips64el to arch list 2017-11-21 19:06:42 +09:00
JinHyeok Yeon
d8fe846d50 Fixed wrong word electron-i18n & url in README.md 2017-11-21 18:23:08 +09:00
shelley vohr
c7e40a2a64 Merge pull request #11133 from electron/skip-tests-that-should-be-skipped
Explicitly skip tests that should be skipped
2017-11-21 10:13:18 +01:00
JinHyeok Yeon
4a42738db9 Merge branch 'master' of github.com:electron/electron into branch 2017-11-21 17:22:17 +09:00
JinHyeok Yeon
51a023e7bb fixed wrong words & urls in README.md 2017-11-21 17:15:58 +09:00
Vanessa Yuen
c122852f09 make verbose execute and non verbose execute do the same things 2017-11-21 16:07:26 +08:00
Charles Kerr
92872154d4 Copyediting 2017-11-21 08:18:12 +01:00
Charles Kerr
dba9181611 Merge pull request #11164 from electron/nstitlebar-hidden
fix: Explicitally set "setTitlebarAppearsTransparent"
2017-11-21 07:51:47 +01:00
Cheng Zhao
596a61f1ad Merge pull request #11059 from electron/clear-permissions-handler
Document setPermissionRequestHandler(null)
2017-11-21 09:50:17 +09:00
Shelley Vohr
be67fcf62b initial updates from meeting today 2017-11-20 23:02:54 +01:00
Charles Kerr
0711e1e5e1 Merge pull request #11170 from him2him2/fixREADMEHeaders
Standardize README.md headers
2017-11-20 13:45:09 -06:00
Charles Kerr
70fae85451 Merge pull request #11187 from electron/util-is-deprecation
fix: Don’t use deprecated util.is* methods
2017-11-20 13:38:56 -06:00
Charles Kerr
432d050481 Merge pull request #11167 from simast/menu-typings-fix
Improve setApplicationMenu/getApplicationMenu docs
2017-11-20 13:28:37 -06:00
Felix Rieseberg
3c38438303 📦 Update electron-typescript-definitions 2017-11-20 09:54:00 -08:00
Felix Rieseberg
05bae0b4c4 🔧 Util is no longer used here 2017-11-20 09:52:13 -08:00
Felix Rieseberg
b029c088db 🔧 Bonus ; 2017-11-20 09:48:33 -08:00
Felix Rieseberg
b8b3b441a7 🔧 util._extend is deprecated, too 2017-11-20 09:46:02 -08:00
Felix Rieseberg
71b8eaf085 🔧 Don’t use deprecated util.is* methods 2017-11-20 09:40:47 -08:00
Charles Kerr
fa37d49fb6 Merge pull request #11185 from electron/fs-optional-options
fix: fs.readFile: make options optional
2017-11-20 10:57:31 -06:00
Charles Kerr
dafd3d69bc Merge pull request #11184 from electron/document-nucleus
docs: Document Nucleus
2017-11-20 10:51:09 -06:00
Felix Rieseberg
4f6bdc5824 📦 Bump electron-docs-linter 2017-11-20 08:24:39 -08:00
Felix Rieseberg
c9f2080e4b 🔧 fs.readFile: options are optional 2017-11-20 08:20:20 -08:00
Felix Rieseberg
6cacb9838e 📝 Document Nucleus 2017-11-20 08:04:14 -08:00
Charles Kerr
5eb00e45aa Merge pull request #11158 from electron/execute-errors
fix: Pass on errors thrown in `executeJavaScript`
2017-11-20 09:14:05 -06:00
Charles Kerr
4c04f1c7ed Merge pull request #11117 from electron/add_deprecations_spec
Add to deprecations spec
2017-11-20 09:07:06 -06:00
Shelley Vohr
7904be8763 comment out unused methods 2017-11-20 15:12:34 +01:00
Aleksei Kuzmin
cf749a8e18 Explicitly skip tests that should be skipped 2017-11-20 14:43:23 +01:00
shelley vohr
42d7d51b75 Merge pull request #11171 from him2him2/electron.atom.io
Update electron.atom.io -> electronjs.org
2017-11-20 13:05:14 +01:00
Cheng Zhao
cb98ed8674 Merge pull request #11176 from electron/proxy-crash-race
Avoid proxy handler race condition crash
2017-11-20 20:15:02 +09:00
Vanessa Yuen
435e027dc3 fix linting for fenced codeblocks only (see electron/electronjs.org#868) 2017-11-20 14:33:25 +08:00
Vanessa Yuen
2441d51093 add remark lint to ensure fenced codeblocks are formatted properly. 2017-11-20 14:05:47 +08:00
Cheng Zhao
cd5785c410 Merge pull request #10793 from ahmedmohamedali/master
Add support for pdf in sub frames (https://github.com/electron/electr…
2017-11-20 11:37:42 +09:00
Cheng Zhao
dc7eaf8d78 Update to latest libcc 2017-11-20 11:07:00 +09:00
Cheng Zhao
79414d4822 Do not open devtools in tests 2017-11-20 11:05:38 +09:00
Cheng Zhao
3cc8330998 Merge branch 'master' into ahmedmohamedali-master 2017-11-20 11:04:47 +09:00
Ted Kim
71c16ad76f lint 2017-11-20 10:17:34 +09:00
Ted Kim
1660fc8d13 Fix getLoginItemSettings timing issue 2017-11-20 10:15:45 +09:00
Matt Crocker
efaf7a6b85 Avoid race condition where login handler webcontents becomes null 2017-11-19 14:08:11 -08:00
Ronald Eddy Jr
5376df1519 Capitalizing Electron 2017-11-19 09:51:03 -08:00
Ronald Eddy Jr
f2d6d6b6a1 Updated Headers now consistent with styleguide
Made headers consistent with styleguide: 
https://github.com/electron/electron/blob/master/docs/styleguide.md#titles
2017-11-19 09:48:09 -08:00
Ronald Eddy
14c6e78147 Update electron.atom.io -> electronjs.org
Update electron.atom.io -> electronjs.org to reduce redirects and speed navigation.
2017-11-19 04:01:33 -08:00
Ronald Eddy Jr
2a826c7ca9 Standardize README.md headers
Small changes to standardize formatting.
2017-11-19 02:48:06 -08:00
Simas Toleikis
c465257d69 Fix docs for menu setApplicationMenu/getApplicationMenu methods [ci skip] 2017-11-19 11:41:22 +02:00
Zhuo Lu
367f7f123d Update icns 2017-11-19 00:33:33 -08:00
Felix Rieseberg
daad465fcd 🔧 Eh, let's do it for all the types 2017-11-18 20:19:22 -08:00
Felix Rieseberg
e3b6271806 🔧 setTitlebarAppearsTransparent=YES 2017-11-18 20:00:01 -08:00
Felix Rieseberg
5b18bea7e3 🔧 Alex has good ideas 2017-11-18 10:59:09 -08:00
Felix Rieseberg
cf7e9df3a0 🔧 Appease the linter 2017-11-18 01:02:09 -08:00
Felix Rieseberg
3311e0bd67 👷 This calls for tests 2017-11-18 00:51:27 -08:00
Felix Rieseberg
9a2d103e7f :thinking_face: What if we made it an Error again? 2017-11-18 00:51:14 -08:00
Felix Rieseberg
1dea186a6e :thinking_face: What if you could return an Error? 2017-11-18 00:50:53 -08:00
John Kleinschmidt
3e4b73ef8f Update branch determination 2017-11-17 16:21:14 -05:00
John Kleinschmidt
df891d2aae Update for API invoked release builds
Also, fixed links
2017-11-17 16:06:42 -05:00
John Kleinschmidt
f469059e90 Merge pull request #11153 from electron/update-ci-release
Move release build process to API calls
2017-11-17 15:52:20 -05:00
Zeke Sikelianos
e2a91ff689 Merge pull request #11152 from electron/fix-typo-in-styleguide
fix typo in styleguide
2017-11-17 12:26:43 -08:00
Zeke Sikelianos
b525f2f031 fix typo in styleguide 2017-11-17 12:14:33 -08:00
John Kleinschmidt
6f11aa169a Run release builds from API
Remove "Bump" logic to run release
2017-11-17 15:13:30 -05:00
John Kleinschmidt
6fab8cc3a5 Merge pull request #11145 from OuYancey/translation-link
fix: wrong translation link in README
2017-11-17 10:54:17 -05:00
John Kleinschmidt
ccb6651752 Merge pull request #11125 from electron/fix-cert-verification-random-crash-on-exit
Fix random crash on app quit
2017-11-17 10:53:56 -05:00
Thiago de Arruda
a9a9e58b68 Fix random crash on app quit.
Move AtomCTDelegate to brightray as RequireCTDelegate and transfer ownership to
brightray::URLRequestContextGetter. This fixes the wrong lifetime assumptions
that result in AtomCTDelegate being used after free in some scenarios.

Close #10051
2017-11-17 12:03:23 -03:00
OuYancey
780c1b8f56 fix: add nation flags and link translations to one address 2017-11-17 12:44:21 +08:00
Ted Kim
d9481430df Fix test failure 2017-11-17 10:53:21 +09:00
Taeho Kim
ada71eea39 📝 Use separate entitlements for login helper 2017-11-17 10:53:15 +09:00
Ted Kim
8184cbfb06 Implement login helper to manage login item in Mac App Store build 2017-11-17 10:53:09 +09:00
Shelley Vohr
aaae1bb176 Merge pull request #11124 from electron/expose-desktop-capturer
Expose desktopCapturer in sandbox mode.
2017-11-16 17:36:39 -05:00
Charles Kerr
9f922e9932 Merge pull request #11099 from electron/fix-emit-call-crash
Fix crash when emitting unhandled error on native EventEmitter
2017-11-16 15:57:07 -06:00
Charles Kerr
e10feb6be2 Merge pull request #11135 from electron/add_callbacks_spec
add callbacks registry spec
2017-11-16 15:47:34 -06:00
John Kleinschmidt
2138c5bff0 Enable verbose mode 2017-11-16 16:05:02 -05:00
John Kleinschmidt
6243d45946 Add AppVeyor and Jenkins 2017-11-16 16:04:50 -05:00
Thiago de Arruda
be0e3d9555 Expose desktopCapturer in sandbox mode. 2017-11-16 16:57:29 -03:00
Shelley Vohr
7f4c501f81 remove only 2017-11-16 14:51:24 -05:00
Samuel Attard
fc265b7600 linter plz 2017-11-17 06:15:53 +11:00
Samuel Attard
bdbc6bb165 Clean up empty logic 2017-11-17 06:09:35 +11:00
Shelley Vohr
933c7330a5 changes from review 2017-11-16 13:39:07 -05:00
Shelley Vohr
75a117e4e2 edit empty function for platform consistency 2017-11-16 13:27:08 -05:00
Shelley Vohr
f5c04c7037 fix includes 2017-11-16 13:27:08 -05:00
Shelley Vohr
c8b544a47d linting is important 2017-11-16 13:27:08 -05:00
Shelley Vohr
e5983eacd6 add callbacks registry spec 2017-11-16 13:27:07 -05:00
Charles Kerr
0bfbd9b3c4 Merge pull request #11140 from electron/revert-10856-mas-login-helper
Revert "Implement login helper to manage login item in Mac App Store build"
2017-11-16 11:20:46 -06:00
Alexey Kuzmin
8657169017 Revert "Implement login helper to manage login item in Mac App Store build" 2017-11-16 19:05:13 +03:00
Charles Kerr
668b736ef2 Merge pull request #11088 from electron/fix-link-to-crowdin
fix link to crowdin
2017-11-16 09:35:38 -06:00
Charles Kerr
97c64de28e Merge pull request #11139 from electron/shall-we-got-a-cup-of-tea
Add Chai library for tests
2017-11-16 09:14:36 -06:00
Aleksei Kuzmin
b51a9cf4f6 Rewrite "nativeImage module" tests assertions with chai.expect() 2017-11-16 16:00:11 +03:00
Aleksei Kuzmin
367b4b05a1 Add Chai library for tests 2017-11-16 15:59:26 +03:00
Charles Kerr
33bd2aa1a0 Merge pull request #11126 from numaanashraf/patch-1
Fix typo in session docs
2017-11-15 12:00:15 -06:00
John Kleinschmidt
f8dd04e5f7 Fix testing fork prs (#11127)
* Make sure DISPLAY is set before XVFB runs
2017-11-15 10:47:36 -05:00
Numaan Ashraf
b695f1221c 📝 Fix typo in session docs 2017-11-15 20:54:24 +05:30
Samuel Attard
57f934a806 Appease the linter 2017-11-15 18:24:18 +11:00
Samuel Attard
8a8f169628 Add comments and use ToLocal instead of ToLocalChecked 2017-11-15 18:24:18 +11:00
Charles Kerr
3a1106d026 Merge pull request #11103 from electron/full-version-string
fix: Provide full and correct version in `process.version`
2017-11-14 19:18:03 -06:00
Felix Rieseberg
ee2a28b35b 🔧 Clean it up 2017-11-14 13:45:50 -08:00
Shelley Vohr
dc410efa36 rename and fix assoc. test 2017-11-14 14:56:16 -05:00
Shelley Vohr
99d35f7786 a few more updates to tests 2017-11-14 13:33:38 -05:00
Charles Kerr
58bd0986c8 Merge pull request #11100 from Raul6469/docs_translations_link
Link to the new docs translations
2017-11-14 10:57:47 -06:00
Charles Kerr
31172ecaa0 Merge pull request #11008 from electron/implement-stream-protocol
Implement {register,intercept}StreamProtocol
2017-11-14 09:31:57 -06:00
Charles Kerr
f6ce1afad3 Merge pull request #11093 from electron/fix-formatting-in-linux-build-instructions-doc
fix formatting in linux build instructions doc
2017-11-14 07:54:16 -06:00
Cheng Zhao
4b8ab8fc97 Merge pull request #10856 from dittos/mas-login-helper
Implement login helper to manage login item in Mac App Store build
2017-11-14 21:34:50 +09:00
Shelley Vohr
d05a1f8053 first pass at deprecation spec updates 2017-11-13 20:21:57 -05:00
Charles Kerr
bbde795a1f Merge pull request #10923 from electron/nvidia-high-sierra-fix
Fix rendering issues with Nvidia GPU on High Sierra
2017-11-13 18:00:38 -06:00
Ahmed Mohamed Ali
4a92e5fc24 Update libchromiumcontent to commit fe6086f 2017-11-13 22:21:18 +01:00
Ahmed Mohamed Ali
b6109030a1 Fix missing eof missing from html test files 2017-11-13 21:22:36 +01:00
Ahmed Mohamed Ali
1f2c949316 Merge branch 'master' of https://github.com/ahmedmohamedali/electron 2017-11-13 21:16:52 +01:00
Ahmed Mohamed Ali
ff707a0f3d Fix issues in the file for the tests. 2017-11-13 21:13:19 +01:00
Felix Rieseberg
7c446cc61c 🔧 Actually fix the test 2017-11-13 11:22:34 -08:00
Thiago de Arruda
5e8618ec3b Add documentation for {intercept,register}StreamProtocol. 2017-11-13 16:16:14 -03:00
Thiago de Arruda
639dc2377f Add tests for URLRequestStreamJob 2017-11-13 16:16:14 -03:00
Thiago de Arruda
5ea3a5886b Implement {register,intecept}StreamProtocol
These new functions are more flexible than the other
{intercept,register}*ProtocoProtocol functions, since it allows the user to
return a node.js stream to feed the data to the protocol handler.

It also allows the user to specify a response header dictionary, which makes it
possible to correctly intercept any request made from renderers.
2017-11-13 16:16:14 -03:00
Thiago de Arruda
68f514b92f Implement EventSubscriber<T> class.
This class simplifies the task of subscribing/handling javascript events from
C++ classes in the main process.
2017-11-13 15:22:50 -03:00
Thiago de Arruda
64bfabdeba Make BindFunctionWith function visible to other modules. 2017-11-13 15:21:22 -03:00
Thiago de Arruda
6b666b69c0 Implement GetLoadTimingInfo in JsAsker class.
This is required to avoid a crash in blink when implementing a custom protocol
handler that deals with redirects.
2017-11-13 15:20:56 -03:00
Thiago de Arruda
6b2ddc4814 Stop allowing electron.net requests to be intercepted.
Not very useful to intercept requests from `electron.net`, since both the
interception machinery and `electron.net` live in the browser process.
2017-11-13 15:20:46 -03:00
Thiago de Arruda
32113bf7f9 Implement V8 -> C++ conversion of net::HttpResponseHeaders. 2017-11-13 15:20:40 -03:00
Thiago de Arruda
9c04d18387 Modify FillRequestDetails to pass headers dictionary. 2017-11-13 15:19:59 -03:00
Felix Rieseberg
163a33a9db Add fallbacks 2017-11-13 09:27:02 -08:00
Felix Rieseberg
b382dec4a2 🔧 Rename the label 2017-11-13 09:26:52 -08:00
Cheng Zhao
4d364fa27a Merge pull request #10510 from brenca/osr-autofill-devtools-fix
OSR fixes - devtools, dialogs
2017-11-13 18:04:35 +09:00
Cheng Zhao
72440d4ae7 No need to add new methods to WebContentsPreferences 2017-11-13 17:35:49 +09:00
Cheng Zhao
cee1c459c7 Do not accidentally change the behavior of did-change-theme-color 2017-11-13 16:20:54 +09:00
Cheng Zhao
7e0593950c Code style fixes 2017-11-13 16:13:54 +09:00
Felix Rieseberg
8de9d5265a 👷 Fix the spec 2017-11-12 23:06:04 -08:00
Heilig Benedek
276e12ce71 pass on web_contents to properly handle devtools 2017-11-13 15:50:50 +09:00
Heilig Benedek
573f664899 fix devtools again 2017-11-13 15:50:49 +09:00
Heilig Benedek
26daffea9c use smart pointer for paint_canvas 2017-11-13 15:50:49 +09:00
Heilig Benedek
4b10445c2e lint fix 2017-11-13 15:50:49 +09:00
Heilig Benedek
193beb57c9 fix datalist element popup position when menu is hidden 2017-11-13 15:50:49 +09:00
Heilig Benedek
f8b3009ebf restructure code to use web_preferences if possible 2017-11-13 15:50:49 +09:00
Heilig Benedek
cafb9477b0 lint fix 2017-11-13 15:46:46 +09:00
Heilig Benedek
71b36ef54d don't show the dummy window for the rest of the dialogs too on mac 2017-11-13 15:46:46 +09:00
Heilig Benedek
5373afa472 set devtools window to visible to avoid a visual glitch on mac with osr window's devtools 2017-11-13 15:46:46 +09:00
Heilig Benedek
13b86598e8 don't show osr dummy window when dialog is shown on mac 2017-11-13 15:46:46 +09:00
Heilig Benedek
35dc6d03b9 lint fix 2017-11-13 15:46:46 +09:00
Heilig Benedek
45d16d5add don't automatically show window when devtools is opened on mac 2017-11-13 15:46:46 +09:00
Heilig Benedek
e39aacb30e fix a bug that caused a crash when using an offscreen window with detached devtools, related to autofill popups 2017-11-13 15:46:46 +09:00
Heilig Benedek
5daaff91ea fix a bug where datalist elements wouldn't actually set the value of the input associated with them 2017-11-13 15:46:46 +09:00
Felix Rieseberg
12653d36ea 🔧 Update the script, too 2017-11-12 22:37:54 -08:00
Felix Rieseberg
7b0b87bfef 🔧 Use full version string 2017-11-12 22:37:46 -08:00
Samuel Attard
3c0b233d04 Fix line length in caller.cc 2017-11-13 11:42:42 +11:00
Samuel Attard
aa6b9a5025 Fix crash when emitting unhandled error on native EventEmitter 2017-11-13 03:03:58 +11:00
Victor
29438940f6 Link to the new docs translations 2017-11-12 17:03:43 +01:00
Zeke Sikelianos
f0facdc01f fix formatting in linux build instructions doc 2017-11-11 09:49:19 -08:00
Samuel Attard
40b94e97e5 Merge pull request #11087 from electron/abi-version
fix: Bring back --abi
2017-11-11 14:47:45 +11:00
Samuel Attard
a06a8a6f79 Merge pull request #11056 from ajmacd/allow-browser-window-logs
Allow BrowserWindows to emit `console-message` events.
2017-11-11 14:34:39 +11:00
Samuel Attard
ba754cf5c3 Merge pull request #11055 from electron/fix-menu-bug
fix: Don't crash on `setApplicationMenu(null)`
2017-11-11 14:33:18 +11:00
Zeke Sikelianos
9a2a98d522 fix link to crowdin 2017-11-10 15:08:03 -08:00
Felix Rieseberg
ae960027f2 🔧 Bring back —abi 2017-11-10 14:58:21 -08:00
Felix Rieseberg
13749797ec 📝 Document setPermissionRequestHandler(null) 2017-11-10 14:48:15 -08:00
Charles Kerr
9291ab95dd Merge pull request #11039 from electron/deprecate-docs-translations
Deprecate /docs-translations
2017-11-10 13:54:51 -06:00
Charles Kerr
5adbbef6cd Merge pull request #11079 from sdj01044/add-korean-community
Add Korean Community
2017-11-10 11:04:08 -06:00
sdj01044
0c88b073d1 Update README.md
Change the URL
https://electron-kr.slack.com     ->   https://electron-kr.github.io/electron-kr
2017-11-10 18:26:07 +09:00
Dongjo Seo
f5b9e1f732 Add Korean Community 2017-11-10 17:04:21 +09:00
Samuel Attard
912c023c6d Merge pull request #11060 from electron/ts-artifact
Generate API and typescript file as artifact on CircleCI
2017-11-09 15:01:10 +11:00
Zeke Sikelianos
2ad1d8ba28 clean up remaining references to docs-translations content 2017-11-08 19:06:18 -08:00
Zeke Sikelianos
387ed21f94 updates from master 2017-11-08 19:01:58 -08:00
Andrew MacDonald
7c5bd62158 Decrease title size. 2017-11-08 09:37:56 -08:00
Andrew MacDonald
00665b9501 Add documentation to web-contents.md. 2017-11-08 09:35:01 -08:00
Ahmed
26fedcf8da Update chromium-spec.js 2017-11-08 18:12:50 +01:00
Ahmed
9b3960fe90 Merge branch 'master' into master 2017-11-08 18:03:55 +01:00
Charles Kerr
9bf950aa33 Merge pull request #10997 from xxczaki/patch-1
Deleted Korean Community
2017-11-08 09:46:04 -06:00
John Kleinschmidt
26baea58c9 Merge pull request #10990 from electron/fix-10988
Enable "document.visibilityState/hidden" tests
2017-11-08 09:55:40 -05:00
Andrew MacDonald
51f6311f32 Handle the possibility of unexpected logs. 2017-11-08 00:09:54 -08:00
Andrew MacDonald
e51042f5a1 Add console-message test. 2017-11-07 23:45:27 -08:00
Samuel Attard
1986236b19 Merge pull request #11058 from electron/forward-declare-scrubber-layout
Forward declare the scrubber layout
2017-11-08 17:57:19 +11:00
Samuel Attard
ef78805a1c Generate API and typescript file as artifact on CircleCI to make verifying changes easier 2017-11-08 16:55:24 +13:00
Samuel Attard
bb997c2ea4 Forward declare the scrubber layout 2017-11-08 16:48:08 +13:00
Felix Rieseberg
d475eaf011 🔧 One commit per character is now hot 2017-11-07 19:44:24 -08:00
Felix Rieseberg
3dcde82485 🔧 Make this easier to read 2017-11-07 18:26:10 -08:00
Andrew MacDonald
c260a0ab78 Allow BrowserWindows to emit console-message events. 2017-11-07 15:31:15 -08:00
John Kleinschmidt
98eee28cbc Merge pull request #11054 from electron/jenkins-pipeline
Move to using Jenkins pipeline
2017-11-07 16:43:54 -05:00
John Kleinschmidt
a34255ceef Add Jenkinsfile to enable rebuilds
Adding this file will allow us to rerun builds in Jenkins.
2017-11-07 16:32:09 -05:00
Felix Rieseberg
07dea13c77 👷 Let’s add a spec! 2017-11-07 13:29:37 -08:00
Felix Rieseberg
1454783450 🔧 Check menu for being falsy 2017-11-07 13:29:14 -08:00
John Kleinschmidt
546ede19c7 Add Jenkinsfile to use Jenkins pipeline 2017-11-07 16:22:04 -05:00
Zeke Sikelianos
8eb38be153 Merge pull request #11000 from sdj01044/fix-korean-styleguide
Fix Korean grammatic mistakes
2017-11-07 07:33:35 -08:00
Samuel Attard
5e50a9ab8f Merge pull request #11009 from electron/docs-aumi-link
fix: Documentation: Add link to App User Model Id
2017-11-08 01:15:24 +11:00
Samuel Attard
bf42426acc Merge pull request #11048 from Toinane/fix-doc
fix(documentation): link in browserwindows.md
2017-11-08 01:14:36 +11:00
Samuel Attard
6b9e67c972 Merge pull request #11004 from electron/upgrade-ts-defs
Upgrade electron-typescript-definitions to latest
2017-11-08 01:04:55 +11:00
Toinane
247af376fe fix(documentation): link in browserwindows.md 2017-11-07 14:17:00 +01:00
Samuel Attard
43aa555d64 Merge pull request #11038 from dashersw/master
Make ScrubberItem width dynamic
2017-11-07 18:18:52 +11:00
Zeke Sikelianos
5e0fe575c9 remove deprecated docs translations 2017-11-06 15:48:47 -08:00
Zeke Sikelianos
11957b62bb add docs-translations deprecation README 2017-11-06 15:47:28 -08:00
Armagan Amcalar
edd113548a Make ScrubberItem width dynamic
Depending on whether a ScrubberItem has text or an icon, this changeset
calculates the actual width and sizes the TouchBar items accordingly.
Previously, all ScrubberItems, regardless of their content, had a static
width of 50px.

This commit also fixes #10539.
2017-11-07 00:09:14 +01:00
John Kleinschmidt
5383b4809f v1.8.2-beta.2 2017-11-06 16:11:34 -05:00
Charles Kerr
083b6e2bbe Merge pull request #11022 from ChangJoo-Park/patch-2
Fix typo inspector to inspect
2017-11-06 10:32:07 -06:00
ChangJoo Park(박창주)
859bb81b29 Fix typo inspector to inspect 2017-11-06 09:23:18 +09:00
Samuel Attard
ca480948aa Merge pull request #11005 from electron/revert-electron-download-version
revert electron-download dependency to ^3.0.1
2017-11-06 12:55:34 +13:00
Vanessa Yuen
f01e5bee92 Merge pull request #11001 from electron/ci-release-build-api
Decouple building electron for release from the actual release cutting process
2017-11-05 10:22:04 +08:00
Shelley Vohr
d1cdcc5760 Merge pull request #11007 from electron/silly-typo-change
fix: One-character typo change
2017-11-04 20:36:55 -04:00
Samuel Attard
fa795ff4cd Merge pull request #11013 from electron/temporary-remove-a-deprecation-warning-from-crashreporter-setextraparameter
Disable deprecation warning of `crashReported.setExtraParameter()`
2017-11-05 03:41:37 +13:00
Aleksei Kuzmin
bd766067ac Remove unused deprecate var to make linter happy 2017-11-04 07:52:47 +03:00
Aleksei Kuzmin
b3a1fc65e5 Disable deprecation warning of crashReported.setExtraParameter()
It caused a couple of Crash Reported tests to timeout on Mac.
Task to enable it back:
https://github.com/electron/electron/issues/11012
2017-11-04 07:48:39 +03:00
Vanessa Yuen
2063af8ac6 a few changes as per code review comments 2017-11-04 10:53:42 +08:00
Charles Kerr
0aaf961f17 empty commit for CI 2017-11-03 16:33:06 -05:00
Felix Rieseberg
067662b304 📝 Oh look, another typo 2017-11-03 13:02:12 -07:00
Felix Rieseberg
8b85a3be23 📝 Add link to App User Model Id 2017-11-03 11:52:27 -07:00
Felix Rieseberg
43bb74cb13 📝 One-character typo change 2017-11-03 10:54:17 -07:00
Charles Kerr
6f3fdb6ae6 revert electron-download dependency to ^3.0.1
undo last week's dependency bump as per discussion at https://github.com/electron/electron/pull/10922

dependency was bumped @ 0c9e106502
2017-11-03 09:45:09 -05:00
Shelley Vohr
8736a41cfb Merge pull request #10909 from electron/update_remote
Simplify and remove excess code from remote module
2017-11-03 09:16:28 -04:00
Shelley Vohr
803fa35484 fix null value check 2017-11-03 08:47:21 -04:00
Birunthan Mohanathas
ecb11b3a4c Upgrade electron-typescript-definitions to latest for electron/electron-typescript-definitions#80 2017-11-03 14:35:19 +02:00
Vanessa Yuen
85a811db55 make target branch name mandatory and specific ci job optional
add it as an npm script `npm run mock-release -- TARGET_BRANCH`
2017-11-03 14:56:16 +08:00
Vanessa Yuen
63632f1137 fix circle config 2017-11-03 14:36:25 +08:00
Cheng Zhao
42d6fe209c Merge pull request #10936 from robinwassen/tray-docs-update
Removed incorrect optional labels from tray.displayBalloon(options) docs
2017-11-03 15:08:43 +09:00
Dongjo Seo
9c8fcfb723 Fix Korean grammatic mistakes
I fixed wrong words & wrong translations.
2017-11-03 14:45:10 +09:00
Vanessa Yuen
3bd38bd1fd add API flags to all other circle jobs 2017-11-03 12:45:30 +08:00
Shelley Vohr
2b2c7d7f9f fix object serialization test issue 2017-11-02 21:29:17 -04:00
Shelley Vohr
41fa61b446 Merge pull request #10995 from electron/initialize-retroactive-event-emitters
singletons that are retroactively turned into EventEmitters should ca…
2017-11-02 21:22:27 -04:00
Shelley Vohr
5c318932c2 add some structural changes 2017-11-02 21:07:40 -04:00
Vanessa Yuen
7cb408838f skip headers and pdbs for fake release builds 2017-11-03 08:12:54 +08:00
Shelley Vohr
c3930f235a Merge pull request #10992 from electron/address_crash_done
remove function invocation from crash test
2017-11-02 19:51:28 -04:00
Shelley Vohr
18a69b8c48 kick ci 2017-11-02 18:36:33 -04:00
Anthony
4b10c39ca0 Deleted Korean Community
Meetup Group doesn't exist.

https://www.meetup.com/electron-kr/
2017-11-02 20:38:07 +01:00
Charles Kerr
4ceeddc09f Merge pull request #10972 from electron/dpi-issues
Workaround for Windows DPI issues
2017-11-02 10:16:11 -05:00
Shelley Vohr
498742d6b3 remove function invocation from crash test 2017-11-02 07:07:19 -04:00
Vanessa Yuen
4cc8008cfc derp.. why did I make a separate parse_args() 2017-11-02 16:42:09 +08:00
Vanessa Yuen
bf5b9e70bb fix linting errors 2017-11-02 16:20:41 +08:00
Vanessa Yuen
b23fa34470 modify upload script to allow uploading release assets to s3 2017-11-02 16:06:28 +08:00
Vanessa Yuen
f937f971c1 make script to hit circle ci api point to build for release 2017-11-02 15:26:37 +08:00
Shelley Vohr
9727717839 Merge pull request #10974 from electron/add_crashreport_tests
Update Crash Report Tests
2017-11-02 01:45:39 -04:00
Shelley Vohr
a7f059d951 switch from set to add in paramater test 2017-11-02 01:02:16 -04:00
Shelley Vohr
1d6803b234 remove deprecated tests 2017-11-02 00:16:51 -04:00
Charles Kerr
1c09dede1a singletons that are retroactively turned into EventEmitters should call the EventEmitter ctor 2017-11-01 23:05:27 -05:00
Shelley Vohr
65f125a245 wrap deprecation warning 2017-11-01 23:27:20 -04:00
Shelley Vohr
14df9a58c7 remove setExtraParam from docs 2017-11-01 22:30:48 -04:00
Shelley Vohr
dc9c2673d7 docs typo fix 2017-11-01 22:25:10 -04:00
Shelley Vohr
24acd74d15 update deprecation warning 2017-11-01 22:23:33 -04:00
Shelley Vohr
577012370e Merge pull request #10977 from electron/refactor-native-image-tests
Light refactoring of the nativeImage module tests
2017-11-01 22:00:01 -04:00
Shelley Vohr
3af83f1c97 add new method and mark setExtraParameter for deprecation 2017-11-01 21:57:43 -04:00
Shelley Vohr
33092e6324 update docs to reflect parameter method change 2017-11-01 21:21:41 -04:00
Aleksei Kuzmin
2bd44612fd Revert "Merge pull request #10989 from electron/temporary-disable-visibility-state-tests"
This reverts commit f3125358c0, reversing
changes made to 7b9ad5001b.
2017-11-02 03:22:27 +03:00
Shelley Vohr
a106956cfe retriggerci 2017-11-01 20:20:26 -04:00
Aleksei Kuzmin
2f7718265a Light refactoring of the nativeImage module tests 2017-11-02 03:18:32 +03:00
Shelley Vohr
f3125358c0 Merge pull request #10989 from electron/temporary-disable-visibility-state-tests
Temporary disable "document.visibilityState/hidden" tests
2017-11-01 20:13:54 -04:00
Aleksei Kuzmin
0df058dc1e Temporary disable "document.visibilityState/hidden" tests
Task to enable them:
https://github.com/electron/electron/issues/10988
2017-11-02 00:06:38 +03:00
Shelley Vohr
7b9ad5001b Merge pull request #10987 from electron/upgrade_last_few_specs
convert shell and browser spec to ES6
2017-11-01 14:30:54 -04:00
Felix Rieseberg
e8f8100e19 🔧 Add fixme 2017-11-01 11:30:32 -07:00
Shelley Vohr
6961162636 another try at fixing travis test 2017-11-01 14:26:39 -04:00
Shelley Vohr
28c009fcc0 linting is important 2017-11-01 10:56:53 -04:00
Shelley Vohr
d2e1705c80 convert app and browser spec to ES6 2017-11-01 10:48:09 -04:00
Shelley Vohr
0adf775d9a clean fixture and fix failing travis test 2017-11-01 08:57:22 -04:00
Shelley Vohr
7f89cd0774 remove const from non-member function 2017-10-31 23:55:22 -04:00
Shelley Vohr
93df164485 add const and other small edits 2017-10-31 23:42:25 -04:00
Shelley Vohr
7b08a93549 remove pesky 'only' 2017-10-31 18:31:44 -04:00
Shelley Vohr
a538e47994 complete GetParameters method & all tests passing 2017-10-31 18:19:04 -04:00
Shelley Vohr
3136f833a5 fixes and updates to GetParameters 2017-10-31 13:51:44 -04:00
Felix Rieseberg
58708d6242 🔧 Lowercase 2017-10-31 10:31:05 -07:00
Shelley Vohr
a9c13359dc first attempt to add new GetParameters method to CrashReporter 2017-10-31 13:06:54 -04:00
Felix Rieseberg
08b8f2df55 📝 Typo! 2017-10-31 08:38:33 -07:00
Shelley Vohr
cd19d7c705 add crashReporter parameter tests 2017-10-31 10:38:48 -04:00
Vanessa Yuen
b2a735ef4f test build script super rough draft 2017-10-31 17:21:13 +08:00
Shelley Vohr
cb78e4875b fix two failing tests 2017-10-30 23:15:57 -04:00
Shelley Vohr
06075c4499 extrapolate removeExtraParameter into new method 2017-10-30 23:12:04 -04:00
Shelley Vohr
603060f051 add new tests 2017-10-30 22:51:22 -04:00
Felix Rieseberg
91414dde62 🔧 I can't believe this helps 2017-10-30 11:22:07 -07:00
Samuel Attard
c9926bed9f Merge pull request #10954 from electron/less-process-metrics-warnings
fix: Don't call idleWakeupsPerSecond on Windows
2017-10-28 12:36:45 +13:00
Samuel Attard
5c6d418b59 Merge pull request #10943 from electron/ensure-contents-clicked
Ensure the click event is only dispatched on ContentsClicked activation type
2017-10-28 12:35:07 +13:00
Samuel Attard
dc8b583363 Merge pull request #10944 from electron/fix-notification-ref-crash
Close the previous notification on multiple calls to show
2017-10-28 12:33:30 +13:00
Felix Rieseberg
da21d6cdda 🔧 Don't call idleWakeupsPerSecond on Windows 2017-10-27 14:23:06 -07:00
Shelley Vohr
e4214a6cbe [WIP] Upgrade more specs (#10945)
Finish upgrading specs to ES6
2017-10-27 16:45:58 -04:00
John Kleinschmidt
04cce89fdc Merge pull request #10953 from electron/get-browser-view
Document and test `getBrowserView`
2017-10-27 16:05:51 -04:00
John Kleinschmidt
60f539789d Merge pull request #10922 from Siilwyn/patch-1
Update electron-download to version 4.1.0
2017-10-27 15:56:06 -04:00
Felix Rieseberg
2e487adf8a 📝 Add a line to the docs 2017-10-27 12:17:30 -07:00
Felix Rieseberg
7bad679a69 📝 Correct types 2017-10-27 12:14:09 -07:00
Felix Rieseberg
29a85bc928 📝 Document it 2017-10-27 11:44:48 -07:00
Felix Rieseberg
541b369175 👷 Add a spec 2017-10-27 11:44:41 -07:00
John Kleinschmidt
ce20f45a45 Update to latest from libcc master 2017-10-27 14:24:14 -04:00
John Kleinschmidt
b429dafa38 Merge pull request #10889 from electron/avoid-eventemitter-crashes
Avoid EventEmitter crashes
2017-10-27 11:39:49 -04:00
Shelley Vohr
9292c7ec53 Merge pull request #10938 from electron/update_protocol_test
Upgrade protocol spec
2017-10-27 09:48:33 -04:00
Matt Crocker
42da83f8ca Update native-mate to pick up related changes 2017-10-27 00:11:16 -07:00
Matt Crocker
b6fb016a9a Cleanup per review comment 2017-10-27 00:07:54 -07:00
Matt Crocker
77a26882a3 Make linter happy 2017-10-27 00:04:19 -07:00
Matt Crocker
c5914516c8 Upstream good ideas from Muon 2017-10-27 00:04:19 -07:00
Matt Crocker
ca8f45a501 Notifications should emit close on close, not eventual GC 2017-10-27 00:04:19 -07:00
Samuel Attard
8719e9f098 Definitely didn't forget to push the header file 2017-10-27 16:27:37 +13:00
Samuel Attard
fe9069c028 Close the previous notification on multiple calls to show 2017-10-27 16:22:21 +13:00
Samuel Attard
85ef4c6d91 Ensure the click event is only dispatched on ContentsClicked activation type 2017-10-27 16:08:15 +13:00
Shelley Vohr
e2d5aaf0f3 Merge pull request #10942 from electron/upgrade_specs
[WIP] Upgrade specs
2017-10-26 22:12:19 -04:00
Shelley Vohr
eed54a18c4 fix comment typo 2017-10-26 22:09:38 -04:00
Shelley Vohr
7a3efd1543 stop leaving onlys there 2017-10-26 21:41:29 -04:00
Shelley Vohr
abecde0572 fix shortcut spec error 2017-10-26 21:41:06 -04:00
Shelley Vohr
ada9dfdc5e Merge pull request #10941 from electron/update_browser_view_spec
migrate api-browser-view-spec to ES6
2017-10-26 21:17:35 -04:00
Shelley Vohr
0317189213 update touch bar spec 2017-10-26 21:08:47 -04:00
Shelley Vohr
1130ccf69b upgrade system pref spec 2017-10-26 20:58:48 -04:00
Shelley Vohr
d8f2183b3d upgrade screen spec 2017-10-26 20:55:07 -04:00
Shelley Vohr
e64e9995b6 small tweak to process spec 2017-10-26 20:53:47 -04:00
Shelley Vohr
13fc080213 small tweaks to global shortcut spec 2017-10-26 20:49:21 -04:00
Shelley Vohr
6feff1d6e8 update desktop capturer spec 2017-10-26 20:44:06 -04:00
Shelley Vohr
6cd308f9ad update deprecations spec 2017-10-26 20:37:35 -04:00
Shelley Vohr
83a290a411 update debugger spec 2017-10-26 20:32:04 -04:00
Shelley Vohr
d4350079c9 update crash reporter spec 2017-10-26 20:21:36 -04:00
Shelley Vohr
56979804ec update clipboard spec 2017-10-26 20:12:51 -04:00
Shelley Vohr
68314dbc05 remove stray only 2017-10-26 20:11:12 -04:00
Shelley Vohr
b53e41af42 migrate api-browser-view-spec to ES6 2017-10-26 20:05:15 -04:00
Shelley Vohr
17f4e53d6b match earlier tests to ES6 later ones 2017-10-26 16:30:07 -04:00
Robin Andersson
08845c9903 Removed incorrect optional labels from tray.displayBalloon(options) docs 2017-10-26 20:21:09 +02:00
John Kleinschmidt
beb06c0787 Merge pull request #10537 from qazbnm456/improve-content_scripts.css
[Security] Use textContent instead innerHTML to remediate DOM based XSS
2017-10-26 11:51:43 -04:00
Charles Kerr
c72e0c1508 Merge pull request #10902 from mattlyons0/master
🐧 Don't wait for xdg-open to exit
2017-10-26 09:43:34 -05:00
John Kleinschmidt
b635962d2b Fix rendering issues with Nvidia GPU on High Sierra 2017-10-26 10:29:24 -04:00
John Kleinschmidt
166fb476a3 Merge pull request #10899 from electron/turn-off-escape-analysis
fix: Apply escape analysis patch
2017-10-26 09:46:31 -04:00
Selwyn
0c9e106502 Update electron-download to version 4.1.0
Respects the OS cache location and be able to set he cache location by setting the environment variable `ELECTRON_CACHE`.
2017-10-26 14:17:34 +02:00
Cheng Zhao
3230048f81 Merge pull request #10918 from pfrazee/fix-protocol-crash-error
Fix crash in custom protocols caused by bad callback exec
2017-10-26 18:35:31 +09:00
Shelley Vohr
52cbec2438 Merge pull request #10911 from electron/fix_window_log_folder
🔧 Fix windows app log path
2017-10-26 01:01:42 -04:00
Shelley Vohr
bb04b22ec8 Merge pull request #10888 from electron/menu_refactor
refactor menu.js to bring it up to readability and es6 standards
2017-10-26 00:31:47 -04:00
Shelley Vohr
fc920ffd06 base::UTF8ToWide --> base::FromUTF8Unsafe 2017-10-26 00:27:27 -04:00
Shelley Vohr
c9dca6b8ad remove unnecessary boolean 2017-10-26 00:21:52 -04:00
Shelley Vohr
246c808222 move away from wstring 2017-10-26 00:18:55 -04:00
Shelley Vohr
a431aa8c4a Merge pull request #10762 from nuriu/patch-1
[docs] [tr-TR] Update README.md
2017-10-26 00:04:32 -04:00
Shelley Vohr
46b775bf46 Merge pull request #10890 from demopark/patch-4
Add a little translation for zh-CN
2017-10-26 00:03:11 -04:00
Shelley Vohr
5f6f117bad changes from review 2017-10-25 23:41:11 -04:00
Paul Frazee
c2d9e082cb Fix crash in custom protocols caused by bad callback exec 2017-10-25 21:01:53 -05:00
Cheng Zhao
4db34ff092 Merge pull request #10711 from yuya-oc/did-attach-webview
Add did-attach-webview event
2017-10-26 10:55:50 +09:00
Shelley Vohr
d4880b135a revert ipc lookup table 2017-10-25 15:36:16 -04:00
Shelley Vohr
bccaf56200 remove common sense comments 2017-10-25 12:23:41 -04:00
Shelley Vohr
06811cc557 appropriately cast pointers to strings 2017-10-25 12:02:50 -04:00
Shelley Vohr
3c1c5a4099 combine homepath and homedrive into single line 2017-10-25 11:46:51 -04:00
Shelley Vohr
1e8bdc15e2 use _wgetenv to get windows env variables 2017-10-25 10:40:38 -04:00
Shelley Vohr
ffd43c1886 remove quotes and const replaces 2017-10-25 10:17:41 -04:00
Shelley Vohr
c0f2a7b44a fix standard issues 2017-10-25 09:56:02 -04:00
Shelley Vohr
f129622446 clean up remote 2017-10-25 09:51:21 -04:00
Shelley Vohr
042f84140d Merge pull request #10896 from electron/update_desktop_capturer
Update desktop capturer to ES6
2017-10-25 08:56:30 -04:00
Shelley Vohr
135454342d remove .only from spec 2017-10-24 22:41:28 -04:00
Shelley Vohr
f7bc5481f3 add a few more tests to api_menu_spec 2017-10-24 22:40:31 -04:00
Matt Lyons
424f9aeae6 🐧 Don't wait for xdg-open to exit
Waiting for xdg-open to return freezes Electron application.
Some file managers (ex: Nemo) don't return until some time after they are closed, this freezes the Electron application until the process returns.
The same is true about any application that can potentially be opened with OpenItem
2017-10-24 19:39:54 -07:00
Shelley Vohr
d54148de4e remove from spec 2017-10-24 20:31:02 -04:00
Shelley Vohr
0e6100ae17 upgrade menu spec to ES6 2017-10-24 20:27:26 -04:00
Felix Rieseberg
8d1ff1c59a Merge pull request #10900 from electron/issue-10877
fix: Ensure that -r isn’t considered interactive
2017-10-24 17:21:08 -07:00
Felix Rieseberg
c38f66cc1b 🔧 Ensure that -r isn’t considered interactive 2017-10-24 17:00:42 -07:00
Shelley Vohr
7593bec687 update reviewed items 2017-10-24 19:36:06 -04:00
Shelley Vohr
e8935232b1 clean falsy statements 2017-10-24 18:52:12 -04:00
John Kleinschmidt
7e1adfcab7 Apply escape analysis patch 2017-10-24 16:28:05 -04:00
Shelley Vohr
98df153750 convert to map and remove shift param 2017-10-24 15:47:09 -04:00
Shelley Vohr
491a00fd84 clean main process desktop_capturer 2017-10-24 12:49:37 -04:00
Vanessa Yuen
aaa8aec946 trying out parameterized builds in circle 2017-10-24 12:42:45 -04:00
Shelley Vohr
b58ceae69c appease linter gods 2017-10-24 12:28:15 -04:00
Shelley Vohr
43e118fe45 update desktop capturer and remove unnessary vars 2017-10-24 12:01:51 -04:00
John Kleinschmidt
36a51bbf4d Merge pull request #10893 from maxibanki/patch-1
Fixed typo
2017-10-24 10:52:14 -04:00
Max Schmitt
c1cad655c8 Fixed typo
`thrid-party` => `third-party`
2017-10-24 11:46:14 +02:00
Jonas Zhang
e7649a800a Add a little translation for zh-CN
Add a little translation for zh-CN
2017-10-24 14:02:07 +08:00
Shelley Vohr
75f32afcd5 clean up excess code from generateGroupId 2017-10-24 00:24:57 -04:00
Shelley Vohr
f93121b226 don't reassign parameters in Menu.prototype.popup 2017-10-24 00:07:39 -04:00
Shelley Vohr
b1e707d535 abstract out switch case from Menu.prototype.insert 2017-10-23 23:46:39 -04:00
Shelley Vohr
7c0f7329d9 appease the linter overlords 2017-10-23 22:35:42 -04:00
Shelley Vohr
508b614769 remove excess code in delegate 2017-10-23 22:33:23 -04:00
Shelley Vohr
9b364d5be3 refactor menuWillShow 2017-10-23 22:22:39 -04:00
Shelley Vohr
9038987e1d significant cleanup; all tests still passing 2017-10-23 20:04:22 -04:00
Zeke Sikelianos
1672fd22e1 Merge pull request #10874 from Toinane/master
Update OSR with more details
2017-10-23 15:54:31 -07:00
Shelley Vohr
3fc5d51a96 clean up delegate 2017-10-23 18:35:16 -04:00
Shelley Vohr
577c0042b0 update to ES6 2017-10-23 14:47:47 -04:00
Toinane
db5a429948 fixe grammar 2017-10-23 18:36:52 +02:00
Shelley Vohr
87802b2c17 initial port of things into a Menu class 2017-10-23 12:11:59 -04:00
John Kleinschmidt
66846bff97 Automate release (#10827)
* Create prepare-release script

* Add script to merge release

* Cleanup/add logging

* Move release process out of upload.py

* Add cleanup release branch

* Update release doc to reflect new scripts

* Fix to allow running with notesOnly

Also fixup release name and body when beta release.

* Fix issues found during release

* Use getRelease instead of getAssets

github.repos.getAssets is limited to 30 entries which means we may not get back the file we are looking for.

* Documentation corrections
2017-10-23 11:02:50 -04:00
John Kleinschmidt
67f0eb7b3b Merge pull request #10873 from ahmedmohamedali/fix_issue_10697
Fixes #10697
2017-10-23 09:32:28 -04:00
Shelley Vohr
61a93c711c clean up popup 2017-10-23 00:47:02 -04:00
Shelley Vohr
f9c3123f5f clean up menuWillShow 2017-10-23 00:16:35 -04:00
Shelley Vohr
1cd53768ab clean up indexToInsertByPosition 2017-10-22 23:57:23 -04:00
Shelley Vohr
b7ebee985b refactor indexOfItemById 2017-10-22 23:51:33 -04:00
Toinane
42f51850cc Update OSR with more details 2017-10-22 00:15:30 +02:00
Ahmed Mohamed Ali
463260b249 Electron crashes if user clicks Dev Tools & Zoom options #10697 2017-10-21 22:21:24 +02:00
Taeho Kim
f8048977ac 📝 Use separate entitlements for login helper 2017-10-21 20:52:20 +09:00
Ahmed Mohamed Ali
1e9942c1bf Fix js coding style errors 2017-10-20 08:46:41 +02:00
Ted Kim
4119da607f Implement login helper to manage login item in Mac App Store build 2017-10-20 11:44:19 +09:00
Ahmed Mohamed Ali
9f3cfa2dbd Fix crash that happens when the PDF viewer is refreshed.
The root cause is the PdfViewerHandler instanceis destroyed but not removed from the list of observer in WebContentsZoomController
2017-10-19 16:27:08 +02:00
Ahmed Mohamed Ali
44f91e12e1 Add tests for fix described in #10793 2017-10-19 16:15:02 +02:00
Zeke Sikelianos
306b627090 Merge pull request #10839 from qazbnm456/update_docs
[docs] update app.md
2017-10-18 20:35:11 -07:00
John Kleinschmidt
90e7d7e112 v1.8.2-beta.1 2017-10-18 16:49:32 -04:00
Boik
7be79613b8 according to https://github.com/electron/electron/pull/10670, update app.md 2017-10-19 00:56:05 +08:00
Ahmed Mohamed Ali
05035eb1e3 Fix linefeeds 2017-10-18 17:36:56 +02:00
John Kleinschmidt
cf12d31875 Merge pull request #10834 from Vehemos/master
Updated online-offline-events.md
2017-10-18 10:06:27 -04:00
Sarthak Tripathi
32f92f7a90 Updated online-offline-events.md
Improved readability and simplicity.
2017-10-18 19:26:19 +05:30
Sarthak Tripathi
392f4b44f0 Updated online-offline-events.md
Added links, removed grammatical error.
2017-10-18 19:11:05 +05:30
John Kleinschmidt
a65ab1d5a7 Merge pull request #10829 from zombieleet/master
update docs to show usage of ipcRenderer.sendTo
2017-10-18 09:33:57 -04:00
John Kleinschmidt
57537ea10e Merge pull request #10810 from qazbnm456/add_error_code_to_session_set_certificate_verify_proc
Add error code to session.setCertificateVerifyProc
2017-10-18 09:33:37 -04:00
John Kleinschmidt
51cbd977f0 Merge pull request #10534 from robbix1206/npx_in_quickstart
[Docs] Add npx command for node version 8.2.0 and later in quickstart guide
2017-10-18 09:32:30 -04:00
Sarthak Tripathi
392e88db34 Updated online-offline-events.md
Added more info, to clarify things.
2017-10-18 16:28:18 +05:30
73mp74710n
0a0897ef28 Update ipc-renderer.md 2017-10-18 02:52:02 +01:00
73mp74710n
5b193bad4b Merge pull request #1 from zombieleet/zombieleet-patch-1
update docs to show usage of ipcRenderer.sendTo
2017-10-18 02:35:51 +01:00
73mp74710n
c647b0c65e update docs to show usage of ipcRenderer.sendTo 2017-10-18 02:35:19 +01:00
Zeke Sikelianos
9193720789 Merge pull request #10825 from electron/vanessayuenn-patch-1
Fix link to version change rules
2017-10-17 14:53:02 -07:00
Vanessa Yuen
3208a77bf3 Fix link to version-change-rules 2017-10-17 13:37:05 -04:00
John Kleinschmidt
cbda307ebf Merge pull request #10696 from primalmotion/patch-1
🍎 skip tabbing category if macOS < Sierra
2017-10-17 10:24:11 -04:00
Cheng Zhao
0358862066 Merge pull request #10812 from electron/fix_symbol_file_names
Use real shared library names for symbol files
2017-10-17 15:27:35 +08:00
Cheng Zhao
d901504ea9 Merge pull request #10804 from robinwassen/optional-cpplint
cpplint skip to run if dependencies has not been bootstrapped
2017-10-17 15:26:49 +08:00
Cheng Zhao
4dc74776c1 Merge pull request #10709 from electron/fix-notification-actions-hs
Fix notification actions not working on High Sierra
2017-10-17 15:18:53 +08:00
Zeke Sikelianos
71f13620d3 Merge pull request #10795 from samthomson/docs/shell-open-external
updated docs
2017-10-16 19:32:09 -07:00
Zeke Sikelianos
a914d3c534 Merge pull request #10612 from electron/notification-docs-fix
Add `string` to notification doc
2017-10-16 19:31:47 -07:00
Vanessa Yuen
242a55aa60 Merge pull request #10740 from demopark/patch-1
Add notification docs translation in Chinese
2017-10-16 21:16:47 -04:00
Vanessa Yuen
9045171ad7 Merge pull request #10748 from demopark/patch-2
Add notifications tutoral in Chinese
2017-10-16 21:07:23 -04:00
Vanessa Yuen
e5797a57a7 Merge pull request #10749 from demopark/patch-3
Add notification-action.md file in Chinese
2017-10-16 21:03:32 -04:00
Ales Pergl
3a571bbdb4 Use real shared library names for symbol files 2017-10-16 16:48:52 +02:00
Boik
f40cc5ab54 add error code to session.setCertificateVerifyProc 2017-10-16 17:17:21 +08:00
Robin Andersson
60e614b10c cpplint skip to run if dependencies has not been bootstrapped
See #10593 for the discussion regarding this
2017-10-15 21:18:20 +02:00
Sam Thomson
f57b619097 updated docs 2017-10-14 13:11:44 +01:00
Ahmed Mohamed Ali
8763e8ee35 Fixing coding style 2017-10-14 11:17:52 +02:00
Ahmed Mohamed Ali
5030db000a Applying changes requested by @deepak1556 after the review:
- Move RenderFrameHost methods in the UI thread
- Check GetAssociatedRenderFrame return value
2017-10-14 11:09:05 +02:00
Zeke Sikelianos
4c9d432bd9 Merge pull request #10777 from reviforks/fix-korean-typo
WIP: Fix Korean translation's minor mistakes
2017-10-13 15:42:12 -07:00
Ahmed Mohamed Ali
1ad95eca4a Add support for pdf in sub frames (https://github.com/electron/electron/issues/9192#issuecomment-335543866) 2017-10-13 19:56:20 +02:00
Yongmin Hong
7b8dc38e88 Fix Korean grammatic mistakes
Mostly spacing errors. Haven't look at full Korean translation, but
will do.

Signed-off-by: Yongmin Hong <revi@pobox.com>
2017-10-13 02:58:44 +09:00
Samuel Attard
bce7d37086 Merge pull request #10773 from jeroenvisser101/patch-1
Fix link to libnotify spec
2017-10-13 02:09:05 +11:00
Birunthan Mohanathas
13b9b5c0c0 Merge pull request #10746 from electron/removeuserdefault
Add systemPreferences.removeUserDefault()
2017-10-12 16:08:57 +03:00
Jeroen Visser
cf6e3ca087 Fix link to libnotify spec
Link was broken
2017-10-12 14:55:21 +02:00
Nuri Uzunoğlu
b79e61db1d [docs] [tr-TR] Update README.md
Minor changes.
2017-10-12 09:22:40 +03:00
Samuel Attard
bdf3552be6 Merge pull request #10727 from electron/named-nativeimage
Add an API to get a nativeImage from a named NSImage
2017-10-12 10:02:07 +11:00
Felix Rieseberg
26220f2b31 Merge pull request #10758 from electron/felixrieseberg-patch-1
Don't be quiet on default loglevel
2017-10-11 15:18:11 -07:00
John Kleinschmidt
f2a1f0124d Merge pull request #10759 from electron/revert-official-build
Revert official build
2017-10-11 15:37:02 -04:00
Felix Rieseberg
2b510d7a06 Update install.js 2017-10-11 11:10:38 -07:00
Felix Rieseberg
d07529feca 🔧 Don't be quiet on default loglevel 2017-10-11 10:56:40 -07:00
John Kleinschmidt
6381f28847 Revert official build
Release builds are not currently building with official build
2017-10-11 11:38:50 -04:00
Jonas Zhang
af99e65876 Add notification-action.md file in Chinese
Add notification-action.md file in Chinese
2017-10-11 09:51:52 +08:00
Jonas Zhang
6fa9249062 Add notification.md file in Chinese
Add notification.md file in Chinese
2017-10-11 09:42:34 +08:00
Birunthan Mohanathas
06d782279c Add systemPreferences.removeUserDefault()
This can be used to restore the default or global value of a `key`
previously set with `setUserDefault`.
2017-10-10 22:57:47 +03:00
John Kleinschmidt
88616df2e5 Merge pull request #10744 from robinwassen/docs-vs-download-link
📝 Updated with link to VS 2015
2017-10-10 15:51:16 -04:00
Robin Andersson
c51ac6048d 📝 Updated with link to VS 2015
The previous link pointed to VS 2017 download location.
2017-10-10 21:33:14 +02:00
John Kleinschmidt
30abdbccf8 Merge pull request #10688 from electron/retry-uploads
Add logic to retry github uploads
2017-10-10 09:46:20 -04:00
Jonas Zhang
66df065e31 Add notification.md file in Chinese
Add notification.md file in Chinese
2017-10-10 21:34:39 +08:00
Samuel Attard
ed25941c65 Add basic specs 2017-10-10 17:30:27 +11:00
Samuel Attard
2c7787900f Follow style guide 2017-10-10 17:20:55 +11:00
Samuel Attard
9308c96f95 Appease the linting overlords 2017-10-10 17:17:51 +11:00
Samuel Attard
4ffb6c5f75 Merge pull request #10725 from electron/version-lock-escape-item
Ensure that the touchbar's esape item can be set before setting it
2017-10-10 17:07:04 +11:00
Samuel Attard
b5ba8699f3 Enable hsl shifting of named images 2017-10-10 17:05:13 +11:00
Zeke Sikelianos
19ac2179fb Merge pull request #10715 from electron/fix_toast_dpi_scaling
Fixed font DPI scaling
2017-10-09 12:56:45 -07:00
Zeke Sikelianos
1e6d51642c Merge pull request #10728 from excfergodst/patch-1
Create updates.md
2017-10-09 12:56:26 -07:00
Zeke Sikelianos
878813f968 Merge pull request #10730 from excfergodst/excfergodst-smalldoc
Adding few simple docs
2017-10-09 12:56:03 -07:00
Zeke Sikelianos
d7e5855ebf Merge pull request #10719 from yunzhenhuan/patch-1
Update build-instructions-linux.md
2017-10-09 12:55:29 -07:00
Zeke Sikelianos
a48219ecf2 Merge pull request #10731 from excfergodst/patch-7
Create v8-development.md
2017-10-09 12:54:58 -07:00
DaLun
995dccc726 Create v8-development.md 2017-10-09 13:00:35 -05:00
DaLun
0572b395ba Delete v8-development.md 2017-10-09 12:55:49 -05:00
DaLun
6e08682a7f Merge pull request #5 from excfergodst/patch-6
Create crash-report.md
2017-10-09 12:52:09 -05:00
DaLun
000ea8febd Merge pull request #4 from excfergodst/patch-5
Create upload-blob.md
2017-10-09 12:52:00 -05:00
DaLun
b02691cebd Merge pull request #3 from excfergodst/patch-4
Create size.md
2017-10-09 12:51:44 -05:00
DaLun
909fc98e1b Merge pull request #2 from excfergodst/patch-3
Create point.md
2017-10-09 12:51:33 -05:00
DaLun
53d138505a Create crash-report.md 2017-10-09 12:47:42 -05:00
DaLun
e655222d2f Create upload-blob.md 2017-10-09 12:45:56 -05:00
DaLun
d096fc8acf Create size.md 2017-10-09 12:37:48 -05:00
DaLun
48be4e765a Create point.md 2017-10-09 12:36:27 -05:00
DaLun
841763326a Create v8-development.md 2017-10-09 12:29:59 -05:00
DaLun
2ed2aedb00 Create updates.md 2017-10-09 12:13:00 -05:00
Samuel Attard
767a178bd1 Do not throw if the named image can not be found 2017-10-10 03:18:44 +11:00
Samuel Attard
ec610cd97b Document new nativeImage.createFromNamedImage method 2017-10-10 03:16:24 +11:00
Samuel Attard
e027ba9c47 Add nativeImage.createFromNamedImage API 2017-10-10 03:13:40 +11:00
Samuel Attard
d350134c4f Ensure that the touchbar's esape item can be set before setting it 2017-10-10 02:24:49 +11:00
XiYang
b8a58d0fce Update build-instructions-linux.md 2017-10-09 17:30:05 +08:00
Ales Pergl
1d25d58c26 Fixed font DPI scaling 2017-10-09 10:17:00 +02:00
Zeke Sikelianos
c85b159d46 Merge pull request #10712 from electron/remove-default-deprecation
remove potential deprecation and fix app close
2017-10-07 22:03:32 -07:00
Felix Rieseberg
77d4927e8b Merge pull request #10713 from electron/remote-node-warning-2
Tiny fix: String comparison for remote node warning
2017-10-07 10:04:49 -07:00
Felix Rieseberg
2bd8877be3 🔧 String comparison 2017-10-07 08:26:32 -07:00
Shelley Vohr
242e097e9b Merge pull request #10670 from electron/add-linuxdefaultprotocol
add setAsDefaultProtocolClient for Linux
2017-10-07 10:07:02 -05:00
Shelley Vohr
443c30890b remove dummy check 2017-10-07 10:38:08 -04:00
Yuya Ochiai
6326c6727e Add did-attach-webview event 2017-10-07 22:52:20 +09:00
Zeke Sikelianos
61e606bedc Merge pull request #10336 from electron/document-prereleases
document new release and versioning process
2017-10-06 22:14:42 -07:00
Shelley Vohr
bedb8ca191 remove potential deprecation and fix app close 2017-10-07 01:03:54 -04:00
Shelley Vohr
35eea8bea5 remove unused xdg setting 2017-10-07 00:38:25 -04:00
Shelley Vohr
66827755e7 remove chrome check and change protocol handler 2017-10-07 00:36:18 -04:00
Shelley Vohr
85ef1ee21f Merge pull request #10633 from electron/update-default-app
updates to default app and cli usage
2017-10-06 23:08:23 -05:00
Samuel Attard
e5d4574d3a Use NSUserNotification identifiers to uniquely find the correct notification from CocoaNotification 2017-10-07 14:51:28 +11:00
Shelley Vohr
a1347f67a1 remove a space from a comment wow thanks linter 2017-10-06 23:40:58 -04:00
Shelley Vohr
c9da806c84 slight refactor and lin cleanup 2017-10-06 23:32:46 -04:00
Shelley Vohr
a45b1625fc remove newline and add deprecation warning 2017-10-06 23:29:54 -04:00
Felix Rieseberg
1761d5da06 Merge pull request #10708 from electron/remote-node-warning
Warn if loading remote content with nodeIntegration
2017-10-06 16:17:52 -07:00
Felix Rieseberg
63749e281d 🔧 Linters gotta lint 2017-10-06 13:36:54 -07:00
Felix Rieseberg
11ac780caf 🔧 Add security warning 2017-10-06 13:02:54 -07:00
Vanessa Yuen
31eb83223b Update the documentation on the release process to reflect the new versioning policy. 2017-10-06 11:48:09 -04:00
Vanessa Yuen
7062a6e55d remove the condition where release draft has to have a prerelease flag 2017-10-06 11:47:28 -04:00
Antoine
5e6b683cfb fixed: trying to fix the build 2017-10-05 15:57:27 -07:00
Antoine
8e1945f768 🍎 skip tabbing category if macOS < Sierra
Previously, the macro was ensuring the` MAC_OS_X_VERSION_10_12` was not defined to decide to compile a `NSWindow` category back porting native tabs or not.

This patch ensures to compile the `NSWindow` category only if the min required version is lesser than 1012 (`MAC_OS_X_VERSION_10_12`)
2017-10-05 14:11:58 -07:00
John Kleinschmidt
0ae12c2b3d Add success message
Also increase retries to 5 attempts.
2017-10-05 16:31:54 -04:00
John Kleinschmidt
54563dc94c Add logic to retry github uploads
When doing release, sometimes the GitHub upload fails, so try to retry it once before bailing.
2017-10-05 16:31:18 -04:00
Zeke Sikelianos
f81e4ec972 order change reasons major, minor, patch 2017-10-05 10:52:38 -07:00
John Kleinschmidt
d7aa0b0ddb Merge pull request #10694 from electron/official-build
Update libchromiumcontent with official_build turned on
2017-10-05 09:48:49 -04:00
Cheng Zhao
e098f414e4 Update libchromiumcontent with official_build turned on 2017-10-05 18:14:12 +09:00
Shelley Vohr
f8f21815eb syntax updates and pointer conversion 2017-10-05 00:30:14 -04:00
Cheng Zhao
80e6a64e47 Merge pull request #10361 from sbannigan/feature/tray-events
add mouse-move event and click event position for tray
2017-10-05 12:20:00 +09:00
Cheng Zhao
bb71b09452 Fix building on Windows 2017-10-05 11:51:41 +09:00
Cheng Zhao
4342480473 Fix cpplint warnings 2017-10-05 11:49:26 +09:00
Sean Bannigan
0b205019b6 add mouse-move event and click event position for tray 2017-10-05 11:41:08 +09:00
Cheng Zhao
ee519b7552 Merge pull request #10693 from makerGeek/patch-1
Update atom-shell-vs-node-webkit.md
2017-10-05 10:21:10 +09:00
Zeke Sikelianos
fae918be59 Merge pull request #10681 from fplucas/master
📝 Translation of environment-variables.md to pt-br [ci skip]
2017-10-04 12:45:37 -07:00
Zeke Sikelianos
b77fe4ca12 add more details to versioning docs 2017-10-04 12:41:12 -07:00
Daniel Imms
3a0de7e24a New release schedule proposal 2017-10-04 12:12:11 -07:00
Zeke Sikelianos
44572dce7d add sh to code block 2017-10-04 12:05:34 -07:00
Zeke Sikelianos
ba6f01a109 add missing backtick 2017-10-04 12:05:34 -07:00
Vanessa Yuen
9f55e162a3 add section on dist-tags 2017-10-04 12:05:34 -07:00
Zeke Sikelianos
d51a8accee tweak versioning doc 2017-10-04 12:05:34 -07:00
Zeke Sikelianos
cd411a5c36 document how we define stable 2017-10-04 12:05:34 -07:00
Zeke Sikelianos
fe7c827e30 remove section on semver, as electron does not fit its mold 2017-10-04 12:05:34 -07:00
Zeke Sikelianos
cc80930e2b document prereleases 2017-10-04 12:05:34 -07:00
Moetaz
d20ce404ef Update atom-shell-vs-node-webkit.md
nwjs now supports a js script as entrypoint.
cf. http://docs.nwjs.io/en/latest/References/Manifest%20Format/#main
2017-10-04 21:01:39 +02:00
John Kleinschmidt
2d269fb7f1 Merge pull request #10690 from electron/fix-tabbed-window-test
Fix failing tests on master
2017-10-04 14:29:38 -04:00
John Kleinschmidt
15bfb86eec Make sure test closes window
Newly added test was leaving window open causing tests to fail
2017-10-04 11:35:41 -04:00
Cheng Zhao
8c5bb5969c Merge pull request #10667 from dittos/window-opacity
Add window opacity support
2017-10-04 15:03:45 +09:00
Felix Rieseberg
a337b12877 Merge pull request #10680 from electron/idlewakeups-windows
Don't call GetIdleWakeupsPerSecond on Win
2017-10-03 22:04:55 -07:00
Felix Rieseberg
4e05d24d1b Merge pull request #10661 from electron/browserview-multiple-screens
BrowserView: Allow dragging of window to screen above menubar
2017-10-03 16:09:11 -07:00
John Kleinschmidt
5c94e23004 Merge pull request #10683 from electron/format-fix-bump-version
Fix formatting on bump-version.
2017-10-03 16:07:24 -04:00
John Kleinschmidt
587c49f6b1 Fix formatting on bump-version. 2017-10-03 15:35:49 -04:00
John Kleinschmidt
211688453c Merge pull request #10403 from electron/modify-bump-version
Modify `bump-version.py`
2017-10-03 14:23:33 -04:00
Lucas Pugliesi
5e7a45d6da Fix link to environment-variables.md in pt-br 2017-10-03 15:22:53 -03:00
Lucas Pugliesi
f72c72f4d4 Fix link to environment-variables.md in pt-br 2017-10-03 15:20:41 -03:00
Lucas Pugliesi
028bab0320 Merge remote-tracking branch 'upstream/master' 2017-10-03 14:57:37 -03:00
Lucas Pugliesi
ee2168b94d 📝 Translation of environment-variables.md to pt-br [ci skip] 2017-10-03 14:54:58 -03:00
Felix Rieseberg
c4de658964 📝 Make a note in the docs 2017-10-03 10:25:42 -07:00
Felix Rieseberg
9fcf7eb27c 🔧 Don't call GetIdleWakeupsPerSecond on Win 2017-10-03 10:21:31 -07:00
Shelley Vohr
6131a523dc add xdg helper method 2017-10-03 11:10:38 -04:00
John Kleinschmidt
93e40ee79c Merge pull request #10677 from rhysd/fix-doc-findInPage
Fix findInPage() documentation for correcting type definition
2017-10-03 10:16:39 -04:00
Cheng Zhao
150a4797a4 Merge pull request #10676 from qazbnm456/fix-unhandle-null-pointer
Add a null-pointer check before processing base::SupportsUserData::GetUserData
2017-10-03 20:18:51 +09:00
Cheng Zhao
745fa707dd Merge pull request #10508 from danielma/dma/native-tab-new-button
feat(NativeWindowMac): addTabbedWindow
2017-10-03 20:16:50 +09:00
Cheng Zhao
09b93aa164 No need of example for such simple API 2017-10-03 20:12:05 +09:00
Daniel Ma
1bb042a661 feat(NativeWindowMac): addTabbedWindow
Add support for the [`NSWindow addTabbedWindow`][nsw] method on MacOSX

This plays nicely with the changes from #9052 and #9725

Usage samples available in [this commit][c] in my fork of
`electron-quick-start`

[nsw]: https://developer.apple.com/documentation/appkit/nswindow/1855947-addtabbedwindow
[c]: 79f06591df
2017-10-03 20:11:16 +09:00
rhysd
32ad59de26 Fix findInPage() documentation for correcting type definition
This update fixes the return type of `findInPage()`, which is currently
typed as `void` but actually it should be `number`.
2017-10-03 16:39:37 +09:00
Boik
d594092675 add a null-pointer check before processing base::SupportsUserData::GetUserData 2017-10-03 12:42:35 +08:00
Taeho Kim
7570ec9d39 Add BrowserWindow.getOpacity for consistency 2017-10-03 00:08:10 +09:00
Shelley Vohr
3f73e000ee first pass at adding linux setAsDefaultProtocolClient 2017-10-02 10:21:30 -04:00
Taeho Kim
7df5182901 Fix lint 2017-10-02 09:52:27 +09:00
Taeho Kim
7c1c8f323c Update browser-window.md 2017-10-01 17:36:22 +09:00
Shelley Vohr
68d35dbeb1 Merge pull request #10660 from electron/add_probot_stale
add initial file for stale bot
2017-09-29 19:47:08 -04:00
Shelley Vohr
7a163ef0cc add issue maintenance and closure information 2017-09-29 18:37:45 -04:00
John Kleinschmidt
b77467ca8f Update CI information (#10644)
* Update CI information

* Formatting updates
2017-09-29 16:11:42 -04:00
Zeke Sikelianos
e8ec1a6ed4 add utm source to outbound links 2017-09-29 12:31:17 -07:00
Zeke Sikelianos
bf2b6b3ac4 fix link behavior 2017-09-29 12:26:03 -07:00
Zeke Sikelianos
56581b416d improve command prompt styles 2017-09-29 12:13:31 -07:00
Zeke Sikelianos
a2f178b664 fix octicon alignment 2017-09-29 12:03:28 -07:00
Zeke Sikelianos
01ca3ae07f make nav link text clickable 2017-09-29 12:03:12 -07:00
Zeke Sikelianos
cc6803b358 remove unused styles 2017-09-29 11:35:39 -07:00
Zeke Sikelianos
33394f76d4 make styles more consistent with website 2017-09-29 11:35:22 -07:00
Zeke Sikelianos
f0048d54b0 make it roomy 2017-09-29 11:34:48 -07:00
Felix Rieseberg
0cc1ebc021 🔧 Allow dragging window to screen above menubar (for real) 2017-09-29 14:20:34 -04:00
Vadim Macagon
3ad1cccb1d [ci skip] Fix link to Chromium Runtime Features JSON file (#10639) 2017-09-29 14:17:00 -04:00
Zeke Sikelianos
9f895879bf Merge pull request #10191 from electron/add_log_path_support
add ability to access logs in getPath()
2017-09-29 11:11:29 -07:00
Zeke Sikelianos
9db9ffd3e4 chrome -> chromium 2017-09-29 10:41:48 -07:00
Zeke Sikelianos
0ca53420d5 use relative path to electron 2017-09-29 10:41:20 -07:00
Shelley Vohr
6932a42b0a updates to probot config 2017-09-29 13:28:49 -04:00
Shelley Vohr
b1e6845409 add initial file for stale bot 2017-09-29 10:38:38 -04:00
Shelley Vohr
96f1a25bbd convert to wstring for windows 2017-09-29 10:29:45 -04:00
Shelley Vohr
e7bb553d3b consolidate code and rename for clarity 2017-09-29 09:32:30 -04:00
Ted Kim
7f2c4a9e06 Add window opacity support 2017-09-29 17:49:10 +09:00
Shelley Vohr
c620d0de05 move overrides into the appropriate namespace 2017-09-28 23:03:01 -04:00
John Kleinschmidt
04430c6dda Bump to use large machine for arm64 build 2017-09-28 13:55:06 -04:00
Shelley Vohr
0dfadf7c09 remove unresolved external symbol 2017-09-28 13:35:24 -04:00
Shelley Vohr
911e266e9a add function signature declaration 2017-09-28 13:35:24 -04:00
Shelley Vohr
223942bf99 fix incorrect std namespacing 2017-09-28 13:35:24 -04:00
Zeke Sikelianos
94f46c9059 fix typo in comment 2017-09-28 13:35:24 -04:00
Shelley Vohr
fc443a8c2c fix header and line length lint errors 2017-09-28 13:35:24 -04:00
Shelley
e05f6102c2 update docs for new getPath() path 2017-09-28 13:35:24 -04:00
Shelley Vohr
d2d4b4cc23 fix escape backslashes 2017-09-28 13:35:24 -04:00
Shelley Vohr
c1c8f7b0f1 fix string concat errors 2017-09-28 13:35:23 -04:00
Shelley Vohr
2353fdb400 add dir creation if none exists 2017-09-28 13:35:23 -04:00
Shelley Vohr
e81cf74b39 add windows override path and cleanup linux 2017-09-28 13:35:23 -04:00
Shelley Vohr
e096b5ce83 fix override path 2017-09-28 13:35:23 -04:00
Shelley Vohr
3de008035a appeasing the linter 2017-09-28 13:35:23 -04:00
Shelley Vohr
f026bbb454 add first go at linux log path override 2017-09-28 13:35:23 -04:00
Shelley Vohr
5ef4caf8ab add ability to access logs in getPath() 2017-09-28 13:35:22 -04:00
John Kleinschmidt
7788b33dc9 Bump v1.8.1 2017-09-28 13:13:49 -04:00
John Kleinschmidt
d9d557dcc5 CircleCI updates (#10647)
* Update CircleCi for release and test

* Update test storage dir
2017-09-28 13:05:42 -04:00
Shelley Vohr
2915617c5c dear god never run beautifier again 2017-09-28 00:10:52 -04:00
Shelley Vohr
0f34967648 redesign and add versions/links 2017-09-27 23:51:53 -04:00
Zeke Sikelianos
0c9ada08a4 Merge pull request #10326 from develar/patch-4
docs: add note about electron-updater
2017-09-27 15:14:44 -07:00
Felix Rieseberg
89246f3714 🔧 Allow dragging over menubar 2017-09-27 17:43:09 -04:00
Shelley Vohr
24913a5ef9 remove drag functions 2017-09-27 14:50:46 -04:00
Shelley Vohr
2289d085fa first pass at reorganizing default usage 2017-09-27 14:23:42 -04:00
Birunthan Mohanathas
945fef8a5a Merge pull request #10483 from jublonet/fix-double-downloads
Use Squirrel.Windows --checkForUpdate
2017-09-27 20:26:24 +03:00
Zeke Sikelianos
928d2f78c3 Merge pull request #10555 from electron/CODEOWNERS
add CODEOWNERS file
2017-09-27 09:07:38 -07:00
Felix Rieseberg
04373b8658 Merge pull request #10627 from electron/fullscreen-drag
Don't drag fullscreen window
2017-09-27 08:08:08 -07:00
Birunthan Mohanathas
044a3a29a6 Simplify checking for NSFullScreenWindowMask 2017-09-27 16:36:18 +03:00
Vladimir Krivosheev
2e747e72cf change wording 2017-09-27 07:11:21 +02:00
Zeke Sikelianos
494000114c Merge pull request #10614 from electron/upload-overwrite
Document how to fix a published release
2017-09-26 21:56:37 -07:00
Zeke Sikelianos
415f1ca3a4 clarify bootstrapping command arg 2017-09-26 21:55:56 -07:00
Zeke Sikelianos
750f59cb55 make the @hubbers team own the .github directory 2017-09-26 20:11:41 -07:00
Cheng Zhao
18589a498c Merge pull request #10620 from electron/v8-promise-field
Update libchromiumcontent to fix crash in Node
2017-09-27 12:11:27 +09:00
Shelley Vohr
15b0878a17 Merge pull request #10618 from electron/add-menuitembyid
[WIP] add getMenuItemById to Menu API
2017-09-26 22:33:05 -04:00
Shelley Vohr
05c50b0a2e fix docs typo 2017-09-26 21:30:27 -04:00
Cheng Zhao
8062962d01 Define V8_PROMISE_INTERNAL_FIELD_COUNT=1 2017-09-27 10:20:06 +09:00
Shelley Vohr
31bf873c20 add docs update for new api call 2017-09-26 21:14:44 -04:00
Cheng Zhao
6e85f82d7a Update libchromiumcontent to fix crash in Node 2017-09-27 10:11:37 +09:00
Shelley Vohr
c932871bb1 change default to null 2017-09-26 20:35:14 -04:00
Shelley Vohr
3c6a7c332a add unit test for getMenuItemById 2017-09-26 20:05:51 -04:00
Felix Rieseberg
d45788a7b8 🔧 Don't drag fullscreen window 2017-09-26 18:03:44 -04:00
Shelley Vohr
f49f7d65a5 remove check on items instance 2017-09-26 14:38:34 -04:00
Zeke Sikelianos
9b6f9a0b18 fix typos in releasing doc 2017-09-26 11:10:29 -07:00
Shelley Vohr
afe033a6e1 stray semicolon fml 2017-09-26 12:10:16 -04:00
Shelley Vohr
4753ada7a9 rewrite method with only id parameter 2017-09-26 12:05:45 -04:00
Shelley Vohr
5217718d7b conform to linter standard 2017-09-26 09:50:47 -04:00
Shelley Vohr
ea42851c9b add first pass at getMenuItemById 2017-09-26 09:47:13 -04:00
Cheng Zhao
91e11f8e6f Merge pull request #10609 from electron/win32_toast_update
Fix for narrowing conversion warnings, minor style change
2017-09-26 10:50:45 +09:00
Cheng Zhao
3545280e1d Add --overwrite to the upload script 2017-09-26 10:43:43 +09:00
Cheng Zhao
c70508edb1 docs: How to re-upload binaries manually 2017-09-26 10:30:42 +09:00
Cheng Zhao
de4cb9022b Use same -ing form and remove trailing whitespaces 2017-09-26 10:18:38 +09:00
Felix Rieseberg
dfd90c3526 Merge pull request #10611 from electron/fix-notification-source
Browser-process notifications: Ensure correct icon on Windows
2017-09-26 09:54:43 +09:00
Felix Rieseberg
ff97817668 Add string to notification doc
Tiny fix: The docs suggest `NativeImage` for `icon`, but a string is also allowed.
2017-09-25 14:02:59 -07:00
Felix Rieseberg
741dc1eb0b 🔧 Ensure correct path 2017-09-25 13:51:16 -07:00
Zeke Sikelianos
c33c21e174 Merge pull request #10573 from electron/add-clarification-about-main-process
add clarification about main process
2017-09-25 12:40:45 -07:00
Ales Pergl
75feb495ad Fix for narrowing conversion warnings, minor style change 2017-09-25 18:08:54 +02:00
Aleš Pergl
2abde14a7c Merge pull request #10517 from yuya-oc/win7-notification-duration
Set duration for Windows 7 notifications based on Control Panel
2017-09-25 17:04:08 +02:00
Cheng Zhao
aeb568b41f Merge pull request #10052 from electron/views-browserview-bounds
Fix BrowserView auto-resize and BrowserWindow resize event on Windows
2017-09-25 14:12:31 +09:00
Birunthan Mohanathas
e1ddd3bdbc Stop sending resize event for minimized windows on Windows
This makes it consistent with macOS.

This also fixes BrowserView auto-resize on Windows when minimizing and
restoring the window. Previously it would incorrectly grow too in some
cases.
2017-09-25 11:44:32 +09:00
Birunthan Mohanathas
f3f6bedf8e Make BrowserView auto-resize relative to window size on Windows/Linux
Previously it was relative to the window web contents size, which was
not consistent with macOS.
2017-09-25 11:44:32 +09:00
Cheng Zhao
42a2126273 Merge pull request #10602 from electron/fix-singleton-test
Fix the flaky test of app.makeSingleInstance
2017-09-25 11:44:00 +09:00
Cheng Zhao
d87ea5713d spec: It is not certain which process starts first 2017-09-25 11:19:25 +09:00
Cheng Zhao
5940231b76 spec: Do not assume which process exits first in singleton test 2017-09-25 10:49:54 +09:00
Zeke Sikelianos
d54cb307d5 do not use globs 2017-09-24 11:34:08 +09:00
Zeke Sikelianos
2bb26b30dc add CODEOWNERS file 2017-09-24 11:34:08 +09:00
Zeke Sikelianos
696c7d59fd Merge pull request #10592 from electron/revert-9603-printer-info-options
Revert "PrinterInfo options object causes TypeScript error"
2017-09-24 11:29:54 +09:00
Zeke Sikelianos
d27f7c25b3 Revert "PrinterInfo options object causes TypeScript error" 2017-09-24 11:11:04 +09:00
Zeke Sikelianos
5843c98153 Merge pull request #10505 from qazbnm456/update-docs
docs: update web-request.md
2017-09-24 09:36:23 +09:00
Zeke Sikelianos
d552c97599 Merge pull request #10542 from EthianWong/master
Remove non-existent option
2017-09-24 09:33:43 +09:00
Zeke Sikelianos
a99280398b Merge pull request #10550 from ColMugX/patch-1
fix menu-item.md chinese version: a typo.
2017-09-24 09:32:51 +09:00
John Kleinschmidt
cb7f8e256e Change GitHub upload to use JS GitHub lib
Needed for Appveyor when running releases
2017-09-24 06:26:04 +09:00
Yuya Ochiai
d621471eb2 🏁 Set duration for Windows 7 notifications based on Control Panel 2017-09-22 21:28:29 +09:00
Cheng Zhao
ec587032b2 Merge pull request #10516 from electron/fix_notification_crash
Fixed potential crash in Win32 notifications.
2017-09-22 12:29:53 +09:00
Cheng Zhao
df098c2b2b Merge pull request #10520 from Alex-D/patch-1
Bump node version number
2017-09-22 12:20:38 +09:00
Zeke Sikelianos
5b5c4787e9 add-clarification-about-main-process 2017-09-22 10:52:43 +09:00
Samuel Attard
c4cfb3e711 Merge pull request #10518 from electron/fix-makesingleinstance
Fix app.makeSingleInstance hanging on posix systems
2017-09-20 13:54:47 +10:00
Cheng Zhao
b4075bed87 spec: Add test case for app.makeSingleInstance 2017-09-20 11:58:32 +09:00
Cheng Zhao
b7119b5756 Create watcher when message loop is ready 2017-09-20 11:58:32 +09:00
Samuel Attard
4147fa4629 Appease the linting gods 2017-09-20 11:58:32 +09:00
Samuel Attard
0ab83b301d Refactor as per @zcbenz comments
Also fix issue where we run the single instance callback *not* on the UI thread,
this apparently results in a hung process.
2017-09-20 11:58:32 +09:00
Samuel Attard
ecbeb0d117 Woops, how did that happen ;) 2017-09-20 11:58:32 +09:00
Samuel Attard
f928a399ae Move OnBrowserReady call to PreMainMessageLoopRun to account for timing issues on macOS 2017-09-20 11:58:32 +09:00
Samuel Attard
28900a9b63 Fix app.makeSingleInstance hanging on posix systems
Wait for the IO thread to be a thing before attempting to listen on the socket

Fixes #9880
2017-09-20 11:58:32 +09:00
Shelley Vohr
fb6a4febb0 Merge pull request #10552 from electron/fix-shell-openItem
update shell.OpenItem to use NSWorkspace
2017-09-19 22:00:40 -04:00
Shelley Vohr
27fd2dad59 update shell.OpenItem to use NSWorkspace 2017-09-19 18:15:37 -04:00
Co1MugX
639f445f5e zh-CN doc had a typo.
zh-CN doc had a typo.
2017-09-19 22:48:33 +08:00
WangYunjian
fa8649e671 Remove non-existent attributes
More details: 8d3e09747a
2017-09-18 13:31:54 +08:00
Samuel Attard
fa444dd029 Merge pull request #10540 from bpasero/touchbar-docs
Docs: set iconPosition as optional
2017-09-18 13:01:02 +10:00
Benjamin Pasero
ba5fe1d161 set iconPosition as optional 2017-09-17 17:44:36 +02:00
Milan Burda
9cfadbe6af Merge pull request #10509 from kewde/patch-1
docs: fix examples for sandbox
2017-09-17 12:26:27 +02:00
Boik
16499358b3 fix lint 2017-09-17 14:09:12 +08:00
Boik
d86724f17a code improvement 2017-09-17 13:56:22 +08:00
Boik
26e6f2c46c use textContent instead innerHTML to remediateDOM based XSS vulnerbilities 2017-09-17 11:27:03 +08:00
robbix1206
0bcc5d37ab Put npx as last option 2017-09-16 15:37:26 +02:00
robbix1206
564ca27679 Forget a # 2017-09-16 14:09:31 +02:00
robbix1206
9fecf4b2f7 Add npx command for node version 8.2.0 and later 2017-09-16 14:03:09 +02:00
Cheng Zhao
800ba9a325 Merge pull request #9950 from alexstrat/fix-content-script-insecure-contents
Fix mixed content errors when loading content from `chrome-extension`
2017-09-15 20:45:57 +09:00
Cheng Zhao
b277353238 Set secure schemes in native code
Code with same functionalities should be put together.
2017-09-15 16:48:55 +09:00
Alexandre Lachèze
5eb4b9ad6f Fix insecure content errors when loading content from chrome-extension 2017-09-15 16:32:47 +09:00
Alexandre Demode
8ebab10cb0 Bump node version number 2017-09-15 00:58:31 +02:00
Cheng Zhao
fc99785314 Merge pull request #10076 from alexstrat/add/add-support-for-content_scripts.css
Add support for css in content_scripts
2017-09-14 21:19:11 +09:00
Ales Pergl
af92a639be Fixed potential crash in Win32 notifications. 2017-09-14 11:52:53 +02:00
Alexandre Lachèze
e1a232e7c8 Add support for css in content_scripts 2017-09-14 17:23:33 +09:00
Cheng Zhao
6bf2ec4188 Merge pull request #10514 from electron/mac-crash
Suppress the destroy() spec on all platforms
2017-09-14 17:21:53 +09:00
Cheng Zhao
af329a9429 Suppress the destroy() spec on all platforms
It is also crashing on mac, but just not as frequent as other platforms.
2017-09-14 17:20:14 +09:00
Cheng Zhao
07840906dd Merge pull request #9869 from rafaelnobrepd/handoff-enhancements
Exposes more Handoff related APIs to Electron
2017-09-14 17:18:14 +09:00
Cheng Zhao
ff023115f5 Style fixes 2017-09-14 16:12:34 +09:00
Rafael Nobre
33dd5e26fb Updates documentation for Handoff related API. 2017-09-14 15:59:43 +09:00
Rafael Nobre
77a1c5d7fc Avoids deadlock in case NSUserActivityDelegate method start being called from main thread. 2017-09-14 15:59:43 +09:00
Rafael Nobre
9483f0fc14 Adds synchronization logic to allow NSUserActivityDelegate to wait Javascript updating the NSUserActiity UserInfo if requested. 2017-09-14 15:59:43 +09:00
Rafael Nobre
c23b4a48ec Fixes NSUserActivityDelegate that was called on a background thread thus not working. 2017-09-14 15:59:43 +09:00
Rafael Nobre
76efee675f Requests updated user info data before each Handoff operation. 2017-09-14 15:59:43 +09:00
Rafael Nobre
f6ac00532f Fix typo and remove extraneous doc entries. 2017-09-14 15:59:43 +09:00
Rafael Nobre
a870799c32 Exposes more Handoff related APIs to Electron. 2017-09-14 15:59:43 +09:00
Cheng Zhao
787675ab08 Merge pull request #9343 from xaviergonz/fix-osx-child-window-show
Make OSX child windows honor the show option to fix #8836
2017-09-14 15:50:13 +09:00
Cheng Zhao
ac55c358e9 Merge pull request #9603 from electron/printer-info-options
PrinterInfo options object causes TypeScript error
2017-09-14 15:49:41 +09:00
Kevin Sawicki
53b0698ee2 Add options object 2017-09-14 14:57:59 +09:00
Cheng Zhao
073583ff3d spec: The parent option should not affect show option 2017-09-14 14:48:42 +09:00
Cheng Zhao
19a7c7ac39 Styling fixes 2017-09-14 14:43:22 +09:00
xaviergonz
0d69738bd6 using standard javascript 2017-09-14 14:38:54 +09:00
xaviergonz
0301961c25 Update api-browser-window-spec.js 2017-09-14 14:38:54 +09:00
xaviergonz
e18cdc185a add the fix for showinactive 2017-09-14 14:35:53 +09:00
xaviergonz
d0c91daaed make sure setparentwindow only shows the window if already visible 2017-09-14 14:35:53 +09:00
xaviergonz
dc7cc6921e fix for mac child windows so they honor show option 2017-09-14 14:35:53 +09:00
xaviergonz
dae63d323c add new internal set parent window method 2017-09-14 14:33:24 +09:00
Cheng Zhao
a19a229a59 Merge pull request #10254 from zachflower/feature/simple-fullscreen-mode
Feature/simple fullscreen mode
2017-09-14 09:39:50 +09:00
Kewde
589585a269 Fix examples
w -> win
2017-09-13 20:53:30 +00:00
Zachary Flower
432b912c6a 🎨 Rename ambiguous simple_fullscreen_ variable to always_simple_fullscreen_ 2017-09-13 12:16:37 -06:00
John Kleinschmidt
5819acfd3d Rerun builds 2017-09-13 10:25:42 -04:00
Boik
0d312f3674 docs: update web-request.md 2017-09-13 22:09:21 +08:00
John Kleinschmidt
64c8ff62af Add CircleCI for Linux builds (#10344) 2017-09-13 09:48:19 -04:00
Cheng Zhao
2048a1a638 Merge pull request #10429 from qazbnm456/web-request-origin
Track the origin of webRequest events
2017-09-13 22:23:44 +09:00
Cheng Zhao
c34fb146f6 Fix styling 2017-09-13 21:40:29 +09:00
Vanessa Yuen
c39f5f1fad Merge pull request #9814 from shubham2892/fix-fullscreen-with-resizable-flag
Fix full screen when resizable is set to true
2017-09-12 20:20:19 -04:00
Vanessa Yuen
9a7d8a0511 merge master into fix-fullscreen-with-resizable-flag. 2017-09-12 18:34:23 -04:00
Vladimir Krivosheev
6bded6bf7b Fix link 2017-09-12 21:37:29 +02:00
Zachary Flower
fa4d52f042 🎨 Track/restore original stylemask, rather than individual states. 2017-09-12 12:27:30 -06:00
Zeke Sikelianos
618f8a9d06 Merge pull request #10497 from Toinane/fix-word-docs
Add markdown linking when missing
2017-09-12 08:49:35 -07:00
Milan Burda
ddb1d92c77 Merge pull request #10499 from miniak/doc-fix
Fix app.getGPUFeatureStatus in app.md
2017-09-12 16:04:17 +02:00
Toinane
1cb13be65f style: fix the word incompatible in docs 2017-09-12 15:51:53 +02:00
Milan Burda
d6bab3043c Fix app.getGPUFeatureStatus in app.md 2017-09-12 15:31:00 +02:00
Boik
e66341ec59 add back the missing 'resourceType' property 2017-09-12 21:27:49 +08:00
Boik
a01abd0fee fix lint-cpp 2017-09-12 20:28:30 +08:00
Boik
2d771674bb get webContentsId instead 2017-09-12 20:17:11 +08:00
Toinane
74cb673ce1 style: add uppercase 2017-09-12 12:07:33 +02:00
Toinane
b9f0131165 style: add link to when missing 2017-09-12 12:05:09 +02:00
Boik
13d363d1f1 fix lint-cpp 2017-09-12 15:40:35 +08:00
Boik
9f60673e4b remove package-lock.json 2017-09-12 15:40:35 +08:00
Boik
549c30f9b2 first attempt to track the origin requesters of webRequest events 2017-09-12 15:40:35 +08:00
Cheng Zhao
59cadf9e4b Merge pull request #10366 from syohex/window-close-order
Close window in order from newer one on macOS
2017-09-12 16:22:38 +09:00
Cheng Zhao
bca71fcfc1 Merge pull request #10393 from j3l11234/fix_mac_crack
fix mac ime crack
2017-09-12 16:19:08 +09:00
Cheng Zhao
1430faa2fd Merge pull request #10492 from electron/libcc-latest
Update libcc to latest
2017-09-12 16:18:47 +09:00
Cheng Zhao
8493d5707e Fix cpplint warnings 2017-09-12 15:35:24 +09:00
Cheng Zhao
92d0772eba Update libcc to latest
It was using a branch that had been deleted.
2017-09-12 15:25:29 +09:00
Cheng Zhao
6ebd00267e Merge pull request #10355 from owais/master
Add support for indicators in Ubuntu Gnome Session
2017-09-12 15:22:31 +09:00
Cheng Zhao
894bcdf749 Merge pull request #9896 from ferreus/dev/vladimir_8017
Fix #8017: Crash copying cropped image to clipboard
2017-09-12 15:02:44 +09:00
Zachary Flower
f256967414 📝 make clear what simple fullscreen mode is 2017-09-11 23:09:45 -06:00
Zeke Sikelianos
64c447bf04 Merge pull request #10487 from Toinane/fix-word-docs
Fix word in documentation
2017-09-11 10:08:01 -07:00
Toinane
2c56b67ea5 style: fix directory word in docs 2017-09-11 17:49:58 +02:00
Cheng Zhao
10ab870237 Merge pull request #10321 from kaylanm/macos-native-tab-api
🍎 Add macOS native tab methods to window API
2017-09-11 18:49:56 +09:00
Cheng Zhao
cc9771a3d0 Merge pull request #10307 from liusy182/10240-theme-color-2
return null when theme color is transparent or not found
2017-09-11 18:40:35 +09:00
Cheng Zhao
e6733b4b23 Merge pull request #10305 from ivmirx/macos-accessibility
Special attribute for macOS accessibility
2017-09-11 17:58:20 +09:00
Cheng Zhao
0694334487 Merge pull request #10271 from kaylanm/macos-native-tab-menu-items
🍎 Add roles for macOS native tab menu items
2017-09-11 17:41:31 +09:00
Zeke Sikelianos
c51e3c2882 Merge pull request #10481 from John2143/fix-docs
Redirect dead link in docs
2017-09-10 17:28:57 -07:00
J.M
6442e6b5e8 Use Squirrel.Windows --checkForUpdate
Avoid downloading updates twice. Fix #5057.
2017-09-11 00:54:08 +02:00
John Schmidt
38342fbe48 📝 Redirect dead link [ci skip] 2017-09-10 08:27:10 -04:00
Zeke Sikelianos
f293e1422b Merge pull request #10472 from lucaslopes/patch-1
Update coding-style.md
2017-09-09 12:38:07 -07:00
Lucas Lopes
20325b9952 Update coding-style.md 2017-09-09 08:08:28 -03:00
Birunthan Mohanathas
c265ea21c2 Merge pull request #10469 from electron/fix-save-dialog-extension-macos
Fix missing extension when saving a file without filters
2017-09-08 07:22:18 -07:00
Zeke Sikelianos
fbfd781426 Merge pull request #10454 from electron/MarshallOfSound-patch-1
Mark filters as optional inside webRequest
2017-09-07 21:45:24 -07:00
Samuel Attard
195cb91721 Make crashesDirectory optional 2017-09-08 13:21:35 +10:00
Birunthan Mohanathas
511e82de67 Fix missing extension when saving a file without filters
Previously, when triggering the save dialog through e.g. `<a download>`
links (e.g. http://jsfiddle.net/koldev/cW7W5/), the extension was only
saved if Finder was set to show all extensions by default. We now always
display the extension to make sure that it is saved.

If we want to keep the extension hidden, we could also populate the
allowed file types array with the extension from the default filename,
but that would have interfered with how we set the filters.
2017-09-07 16:48:14 -07:00
Samuel Attard
8e9b98360a Mark filters as optional inside webRequest 2017-09-07 14:26:37 +10:00
Samuel Attard
6ba3ee3950 Merge pull request #10453 from bpasero/fix-10448
Docs: add crashesDirectory to crash reporter options
2017-09-07 14:19:18 +10:00
Benjamin Pasero
54bd60d657 add crashesDirectory to crash reporter options 2017-09-07 06:07:28 +02:00
Vanessa Yuen
4fb800a899 more docs edit 2017-09-06 16:44:41 -04:00
Vanessa Yuen
a81ea1ffde Update release documentation to reflect new usage of bump-version script. 2017-09-06 16:41:51 -04:00
Vanessa Yuen
c56d8b4fe9 Add examples to make usage description clearer. 2017-09-06 16:31:58 -04:00
John Kleinschmidt
5bb7b4bb42 Bump v1.8.0 2017-08-31 16:31:59 -04:00
John Kleinschmidt
4b1e2b42a4 Bump v1.8.0 2017-08-31 16:16:19 -04:00
Vanessa Yuen
c784968e85 Merge pull request #10303 from MathieuDebit/doc/fix-desktopcapture-example
📝 Fix desktopCapturer example
2017-08-31 14:49:16 -04:00
Samuel Attard
6b010614e2 Implement moveToApplicationsFolder (#10142)
* Implement moveToApplicationsFolder

* Fix tabs / spaces

* Fix linting

* Use Browser::Quit, instead of exit

* Update documentation as per feedback

* Fix spec
2017-08-31 10:37:12 -04:00
John Kleinschmidt
14eea98566 Merge pull request #10333 from electron/more-releasing-tips
add more releasing tips
2017-08-30 10:42:59 -04:00
Cheng Zhao
c2ab4f711f Merge pull request #10396 from electron/cleanup
Cleanup obsolete code
2017-08-30 19:05:05 +09:00
Cheng Zhao
1630f14b99 Merge pull request #10395 from electron/fix_exit_crash2
Fixed crash on process exit on Windows
2017-08-30 17:43:46 +09:00
Ales Pergl
64d9e5b861 Removed obsolete io.h wrappers, included atlbase.h in atom_main.cc 2017-08-30 10:43:29 +02:00
Cheng Zhao
346a4bee0b Merge pull request #10394 from electron/another-async-crash
Fix another crash caused by assertion of asyncContext
2017-08-30 17:42:03 +09:00
Cheng Zhao
db0aeaa26e Fix another crash caused by assertion of asyncContext 2017-08-30 17:05:20 +09:00
Ales Pergl
7cd64f1bd1 Fixed crash on process exit on Windows 2017-08-30 09:23:19 +02:00
allenliu
5978775ce1 fix mac ime crack 2017-08-30 12:07:04 +08:00
Vanessa Yuen
a936430fd5 fix lint errors 2017-08-29 19:55:34 -04:00
Vanessa Yuen
b54804d449 change process.versions.electron to reflect suffixes in version name. 2017-08-29 19:37:49 -04:00
Vanessa Yuen
74c970c25f add dry run option 2017-08-29 18:56:16 -04:00
Vanessa Yuen
8fe675e56c Update bump-version.py to handle prerelease versions 2017-08-29 18:33:49 -04:00
Zeke Sikelianos
cc666c727f Merge pull request #10389 from electron/move-issue-template
move issue template to .github directory
2017-08-29 13:26:27 -07:00
Zeke Sikelianos
178b39b5a8 Merge pull request #10380 from electron/MarshallOfSound-patch-1
Mark channel as non-optional in ipcRenderer
2017-08-29 13:22:41 -07:00
Zeke Sikelianos
6c201fcae4 move issue template to .github directory 2017-08-29 12:51:02 -07:00
Cheng Zhao
39a366cf76 Merge pull request #10277 from electron/re-enable_debug_mode
Re-enabled debug mode
2017-08-29 19:22:37 +09:00
Cheng Zhao
0550a4a9b8 Fix crash when emitting render-view-deleted event 2017-08-29 17:46:46 +09:00
Cheng Zhao
7f4b74f8c6 spec: Compare id instead of the object
Otherwise it is impossible to see what's wrong.
2017-08-29 15:45:16 +09:00
Samuel Attard
e58ba1dc8e Update ipc-renderer.md 2017-08-29 16:12:55 +10:00
Cheng Zhao
f0f17fffd8 spec: Do not test window positions
They were too flaky.
2017-08-29 14:23:39 +09:00
Cheng Zhao
4febbec102 Fix crash when switching menus in menubar 2017-08-29 14:19:23 +09:00
Cheng Zhao
b2f3625eaa Fix deprecated node::MakeCallback call 2017-08-29 14:19:23 +09:00
Cheng Zhao
593ae7bf0e Fix crash caused by freeing capturer task 2017-08-29 14:19:22 +09:00
Cheng Zhao
5510d8cfb1 Revert "Revert "spec: Suppress the select-client-certificate test""
This reverts commit 8e989170f1.
2017-08-29 14:19:22 +09:00
Cheng Zhao
68e0fbfd60 Revert "Revert "spec: Suppress the app.importCertificate test""
This reverts commit a7cb89aeb5.
2017-08-29 14:19:21 +09:00
Cheng Zhao
9337e29482 Fix the crash caused by asyncContext 2017-08-29 14:19:20 +09:00
John Kleinschmidt
56233054ae Fix CI for Linux 2017-08-29 14:19:20 +09:00
Cheng Zhao
6e6b097968 Revert "Revert "spec: Suppress the test that destroys WebContents in event listener""
This reverts commit 210652ed54.
2017-08-29 14:19:19 +09:00
Ales Pergl
a7bae32527 Re-enabled debug mode 2017-08-29 14:19:19 +09:00
Zeke Sikelianos
c6918966c2 Merge pull request #10214 from psh0628/contextisolation-sandbox-fix
fix contextIsolation issue while webPreference sandbox is on
2017-08-28 21:20:04 -07:00
Ivan Mir
93a8e75238 Add clarifications to the documentation 2017-08-28 20:33:16 -03:00
Zeke Sikelianos
66a5ac4d67 Merge pull request #10215 from electron/update-chromium-upgrade-docs
Update Chromium Upgrade docs
2017-08-28 08:42:14 -07:00
Zeke Sikelianos
e1c4962312 add sh to code fences 2017-08-28 08:41:52 -07:00
Shohei YOSHIDA
55f2b524e7 Close window in order from newer one on macOS
A parent window is not closed if a child modal window still exists.
So a child window should be closed before parent window closed.
2017-08-28 13:56:05 +09:00
Ivan Mir
75b2915fee Change the parameter name for consistency 2017-08-27 11:53:25 -03:00
Tony Ganch
6a285e2e76 Update Chromium Upgrade docs 2017-08-27 17:51:47 +03:00
Aleksei Kuzmin
c4634f7e98 Update Chromium Upgrade docs 2017-08-27 17:51:47 +03:00
Zeke Sikelianos
87d4666648 Merge pull request #10356 from electron/update-browser-window-docs
update browser-window.md
2017-08-26 20:03:55 -07:00
Vanessa Yuen
deb7ccbef3 fix lint error 2017-08-25 17:24:50 -04:00
Vanessa Yuen
bb153ee79e update browser-window.md
Add a note about the subtle difference between `window.onbeforeunload = handler` and `window.addEventListener('beforeunload', handler)`.
2017-08-25 17:14:20 -04:00
Owais Lone
dc43dc2a13 Add support for indicators in Ubuntu Gnome Session
Ubuntu is switching to Gnome in 17.10 but it's not going to be the stock Gnome session. It's going to support the existing Unity APIs. Support has already landed for application indicators and likely other APIs (Launcher,etc) will be supported soon. The Ubuntu Gnome session will have `XDG_CURRENT_DESKTOP=ubuntu:GNOME` environment variable.

Ref: https://didrocks.fr/2017/08/23/ubuntu-gnome-shell-in-artful-day-7/
2017-08-25 23:25:08 +05:30
sungpark
65eb4e1994 fix compile error 2017-08-24 14:31:25 -07:00
Ivan Mir
6717f0d2bb Add accessibility setter to the app 2017-08-24 11:22:28 -03:00
Cheng Zhao
6a93052f7d Merge pull request #10298 from electron/update-external-binaries
Bump external binaries to 1.2.2
2017-08-24 19:29:13 +09:00
Samuel Attard
7ecac42214 Merge pull request #10232 from electron/drag-browser-view
Add -webkit-app-region support to BrowserView
2017-08-24 10:30:56 +10:00
Felix Rieseberg
fdfbf3abfa 🔧 Respect the header 2017-08-23 17:26:18 -07:00
Felix Rieseberg
a44c2d5dcc 🔧 Extend interface 2017-08-23 16:10:31 -07:00
sungpark
f984bd2ff5 use spaces instead of hard tabs for indentation and add the supported modules as a sub-list 2017-08-23 10:52:02 -07:00
sungpark
eca7ff986c add webFrame to sandboxed renderer 2017-08-23 10:52:02 -07:00
sungpark
bf07c5aebd fix contextIsolation issue while webPreference sandbox is on
contextIsolation didn't work while sandbox is on. The fix is contextIsolation picked up while sandbox on
2017-08-23 10:52:02 -07:00
Liu Siyuan
e64d4e5bd7 update web-content.md based on review 2017-08-23 23:37:37 +08:00
Liu Siyuan
15d2cfe458 update docs 2017-08-23 23:04:00 +08:00
Zeke Sikelianos
88b3109137 change backport branch creation steps 2017-08-22 21:03:03 -07:00
Siyuan Liu
5cb58cd42f use nullptr instead of nullptr_t() 2017-08-23 09:30:58 +08:00
Zeke Sikelianos
485b9099f1 Merge pull request #10328 from electron/bump-@types-node-to-8
bump @types/node to 8
2017-08-22 15:03:04 -07:00
Felix Rieseberg
cd5cd25f74 🔪 Bonus colon 2017-08-22 11:14:21 -07:00
Zeke Sikelianos
18e7354b4a bump @types/node to 8 2017-08-22 11:01:40 -07:00
Ivan Mir
9605e6cb40 Add documentation for macOS accessibility 2017-08-22 13:01:33 -03:00
Vladimir Krivosheev
d3f30e7a9c docs: add note about electron-updater 2017-08-22 16:51:57 +02:00
Cheng Zhao
1f604c0826 Merge pull request #10219 from HAMIDx9/master
Add arm64 build support
2017-08-22 17:02:23 +09:00
Cheng Zhao
2bfc2be8c9 Merge pull request #10279 from electron/fix-10279
Fix 'BrowserWindow module "webPreferences" option "sandbox" option can print to PDF'
2017-08-22 15:25:37 +09:00
Cheng Zhao
d233fc044a Pass dpiVertical and dpiHorizontal to print settings 2017-08-22 13:54:49 +09:00
Michael Kaylan
b4428e7e41 🍎 Add macOS native tab methods to window API 2017-08-21 23:24:30 -04:00
Aleksei Kuzmin
8b55e6e2f5 Revert "Disable a failing test"
This reverts commit 9487222726.
2017-08-22 11:49:53 +09:00
Cheng Zhao
94ab1c790f Verify arm64 builds in prerelease 2017-08-22 10:08:27 +09:00
Cheng Zhao
de67e42fc9 Update breakpad for ia32/arm fix 2017-08-22 10:02:51 +09:00
Cheng Zhao
136857952e Add arm64 task in travis ci 2017-08-22 10:02:51 +09:00
HAMIDx9
cd42133651 Add arm64 build support 2017-08-22 10:02:51 +09:00
Cheng Zhao
0c93e4b8d7 Merge pull request #10318 from electron/module-version
Use 57 as node module version in Electron 1.8
2017-08-22 10:02:15 +09:00
Cheng Zhao
f954b60119 Use 57 as node module version
This matches Node v8, which uses 57 for V8 5.8 - 6.0.
2017-08-22 09:24:18 +09:00
Cheng Zhao
565ece6986 Merge pull request #10308 from electron/native-view
Add WebContents.getNativeView() API
2017-08-22 09:19:27 +09:00
Felix Rieseberg
f0680587fa 🔧 Linter fascism 2017-08-21 16:52:59 -07:00
Charlie Hess
f17bd040ad Merge pull request #10293 from electron/notification-sounds
Add support for soundName in main process notifications
2017-08-21 16:15:47 -07:00
Zeke Sikelianos
b1011768e5 Merge pull request #10251 from electron/new-update-docs
New guide for implementing updates
2017-08-21 15:22:43 -07:00
Zeke Sikelianos
b6787dbbb3 link to updates guide from docs readme 2017-08-21 15:22:13 -07:00
Zeke Sikelianos
1731359a17 tweak the updates guide 2017-08-21 15:19:59 -07:00
Charlie Hess
f2c0d1f0c5 📝 Little cleanup. 2017-08-21 13:56:10 -07:00
Charlie Hess
db081d95d5 Review CommentZ. 2017-08-21 13:53:50 -07:00
Zeke Sikelianos
a50e36d256 Merge pull request #10304 from kyo-ago/patch-1
Fix typo on japanese document
2017-08-21 09:17:26 -07:00
Zeke Sikelianos
6c60c6ca76 Merge pull request #10306 from lisurc/patch-1
📝 Fix markdown syntax
2017-08-21 09:14:56 -07:00
Cheng Zhao
2c1984b6ed Add WebContents.getNativeView API 2017-08-21 19:50:12 +09:00
Cheng Zhao
dede3d6213 Merge pull request #10280 from electron/fix-10280
Fix 'BrowserWindow module window states resizable state works for a frameless window'
2017-08-21 19:28:13 +09:00
Cheng Zhao
70fd42808e Fix build on Linux 2017-08-21 17:42:45 +09:00
Cheng Zhao
19323c88f9 win: Fix "thickFrame: false" not working for normal window 2017-08-21 17:21:59 +09:00
Aleksei Kuzmin
c0331673da Revert "Disable a failing test"
This reverts commit 25c0cf0612.
2017-08-21 16:48:24 +09:00
Siyuan Liu
eeb2e58ad8 return null when theme color is not found 2017-08-20 22:48:13 +08:00
Bastien
39c2a4721b 📝 Fix markdown syntax
Also fix some grammar and syntax typing mistakes.
[ci skip]
2017-08-19 22:29:34 +02:00
Ivan Mir
94dd068e15 Special attribute for macOS accessibility #7206
In the linked issue we were discussing that Electron apps are inaccessible unless VoiceOver is enabled. While it's a working solution for users with vision impairment, all other users and apps that require accessibility can't interact with Electron-based software because they don't keep VoiceOver running.

I suggest adding `AXManualAccessibility` for programmatically enabling it in Electron apps. The reason for a new attribute is that `AXEnhancedUserInterface` is already reserved by VoiceOver.

Adding this attribute will allow both Electron developers and 3rd party developers to enable and disable accessibility from their code by calling `accessibilitySetValue:forAttribute:` on the application.

It will be also possible to create a small utility app to switch accessibility in Electron-based apps until there's a native UI solution (like the accessibility settings page in Chrome).
2017-08-19 17:18:12 -03:00
kyo_ago
8695672082 fix typo 2017-08-19 15:37:07 +09:00
Samuel Attard
15db4ee450 Merge pull request #10275 from electron/windowclose-exception
Fixing uncaught exception on window close
2017-08-19 13:58:55 +10:00
Mathieu Débit
81f7b422e4 📝 Fix desktopCapturer example (#10303)
[ci skip]

Based on MDN example:
https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia#Examples
2017-08-18 22:02:28 +02:00
Josh Abernathy
766b604de5 Bump external binaries to 1.2.2 2017-08-18 08:20:07 -04:00
Cheng Zhao
ac6a44f0ac Merge pull request #10273 from rhysd/doc-fix-optional-args
fix some optional args docs
2017-08-18 19:07:56 +09:00
Charlie Hess
2b9b186fd1 Rename soundName → sound. 2017-08-17 17:28:14 -07:00
Charlie Hess
0cfae1cc2b Plumb in the macOS soundName property for notifications. 2017-08-17 13:31:20 -07:00
Hari Juturu
340431750b Removing try/catch 2017-08-17 10:56:37 -07:00
Cheng Zhao
4bc4a0c45b Merge pull request #10289 from electron/fix-compile
Fix compilation on mac
2017-08-17 17:41:13 +09:00
rhysd
01f549628f fix signature of <webview>.executeJavaScript 2017-08-17 17:06:30 +09:00
Cheng Zhao
9c552644d8 Fix compilation on mac 2017-08-17 16:47:12 +09:00
Cheng Zhao
f6792c0232 Merge pull request #10264 from electron/fix-sandbox-crash-on-background-tab
Fix sandbox crash when opening a background tab
2017-08-17 15:57:29 +09:00
Cheng Zhao
ecff620528 Merge pull request #10081 from renaesop/master
Add a callback option to `webContents.print`
2017-08-17 15:56:02 +09:00
Cheng Zhao
f908678e8e Merge pull request #10183 from andens/mouse_forward
Mouse forward functionality on Windows
2017-08-17 15:54:22 +09:00
Vanessa Yuen
32121b9c38 Merge pull request #10283 from electron/welcome-probots-config
add welcome probots
2017-08-16 15:56:19 -04:00
Vanessa Yuen
c4d1fb929c Update config.yml 2017-08-16 15:04:34 -04:00
Vanessa Yuen
65908bbb87 Create config.yml 2017-08-16 14:54:10 -04:00
John Kleinschmidt
44481db1ee Merge pull request #9946 from electron/upgrade-to-chromium-59
Upgrade to Chromium 59
2017-08-16 10:00:34 -04:00
Aleksei Kuzmin
5543bfc278 Use the latest libcc version with Chromium 59 2017-08-16 14:29:03 +03:00
Andreas Flöjt
d4bbd7c7ab Add example of using mouse forwarding. 2017-08-16 03:28:52 +02:00
Andreas Flöjt
814702f5b8 Cleanup potential mouse forwarding resources when window is destroyed. 2017-08-16 03:28:07 +02:00
Felix Rieseberg
6191e6e787 🔧 Implement feedback 2017-08-15 16:14:58 -07:00
Hari Juturu
9120774c00 Fixing uncaught exception on window close 2017-08-15 14:59:48 -07:00
Leo Lamprecht
78c87d4bd3 Made dialog message clear 2017-08-15 22:55:55 +02:00
Zeke Sikelianos
5f82168213 lint 2017-08-15 13:09:06 -07:00
Zeke Sikelianos
a84d49fe5c add newline 2017-08-15 13:06:45 -07:00
Zeke Sikelianos
2ec223ba11 use an arrow function 2017-08-15 13:04:52 -07:00
Zeke Sikelianos
35b2bc6b51 implement a dialog in the download handler 2017-08-15 12:53:46 -07:00
Leo Lamprecht
68250d80cd Improved error logging 2017-08-15 21:38:31 +02:00
rhysd
2edf4da859 fix some optional args docs 2017-08-16 02:23:36 +09:00
Michael Kaylan
7741a0e6ad 🍎 Add roles for macOS native tab menu items
Fixes #9086, #10064.
2017-08-15 11:30:39 -04:00
Aleksei Kuzmin
25c0cf0612 Disable a failing test
BrowserWindow module window states resizable state works for a frameless window
2017-08-15 16:19:29 +03:00
Aleksei Kuzmin
9487222726 Disable a failing test
BrowserWindow module "webPreferences" option "sandbox" option can print to PDF
2017-08-15 16:19:29 +03:00
Catalin Fratila
60b363fa3b Fixing Windows tray icon content menu - based on chrome/browser/ui/views/status_icons/status_icon_win.cc 2017-08-15 16:19:23 +03:00
Kevin Sawicki
90fbe5c06c Disable warnings in node.cc and string_bytes.cc 2017-08-15 16:19:23 +03:00
Kevin Sawicki
7226adee29 Upgrade node for windows build fixes 2017-08-15 16:19:23 +03:00
Kevin Sawicki
27c1612f44 Upgrade to node 8.2.1 2017-08-15 16:19:23 +03:00
Kevin Sawicki
fb6759b5e0 Downgrade to node 8.1.4 since 8.2.0 will be against v8 6.0 2017-08-15 16:19:23 +03:00
Kevin Sawicki
eabbac4ca1 Upgrade node for version module change 2017-08-15 16:19:23 +03:00
Kevin Sawicki
d943519fb4 Update text expectation for new --inspect-brk message 2017-08-15 16:19:23 +03:00
Kevin Sawicki
9d2aa6f1c7 Upgrade to node 8.2.0 2017-08-15 16:19:23 +03:00
Ales Pergl
9f8f95f4c9 Lock pixels before calling SkBitmap::getPixels and copy bitmap row-wise in case (stride != width) 2017-08-15 16:19:23 +03:00
John Kleinschmidt
924a345fac Try fix to boto on Trusty 2017-08-15 16:19:23 +03:00
John Kleinschmidt
59238a915e Require sudo 2017-08-15 16:19:23 +03:00
John Kleinschmidt
03d15809be Explicity use Precise for Travis CI 2017-08-15 16:19:23 +03:00
deepak1556
778772710a intialize WebTextCheckClient https://codereview.chromium.org/2791753003 2017-08-15 16:19:22 +03:00
Kevin Sawicki
fb02343ec0 Remove unneeded volumes and env 2017-08-15 16:19:22 +03:00
Kevin Sawicki
dc6e451010 Only start xvfb when tests will be run 2017-08-15 16:19:22 +03:00
Kevin Sawicki
1f71a2e94c Simplify xvfb init script 2017-08-15 16:19:22 +03:00
Kevin Sawicki
b407834ed7 Remove default 2017-08-15 16:19:22 +03:00
Kevin Sawicki
f1036f7305 Add xvfb-init.sh to docker context 2017-08-15 16:19:22 +03:00
Kevin Sawicki
c3e0e4682d Use xvfb from container on CI 2017-08-15 16:19:22 +03:00
Kevin Sawicki
a0fd37c8a3 Try always using DISPLAY=unix:99:0 on Linux CI 2017-08-15 16:19:22 +03:00
Kevin Sawicki
23b35af7f2 Use DISPLAY=:99.0 on Linux CI 2017-08-15 16:19:22 +03:00
Kevin Sawicki
ddefc08ec5 Remove command logging 2017-08-15 16:19:22 +03:00
Kevin Sawicki
f79a90161c Extend libcc Dockerfile for Electron Linux build 2017-08-15 16:19:22 +03:00
Kevin Sawicki
29dc06c89d Configure spec UI to run in docker container 2017-08-15 16:19:22 +03:00
Kevin Sawicki
5737f8b74e Remove unneeded nodenv setup 2017-08-15 16:19:22 +03:00
Kevin Sawicki
bbd1b325fb Initial docker-based linux builds 2017-08-15 16:19:22 +03:00
Kevin Sawicki
152d573fbd Build with jessie sysroot on ARM 2017-08-15 16:19:22 +03:00
Aleksei Kuzmin
adaec2d32b Fix brightray.gyp 2017-08-15 16:19:22 +03:00
Aleksei Kuzmin
b6f0d04813 net: remove CryptoModule class
https://codereview.chromium.org/2724013002
2017-08-15 16:19:22 +03:00
Aleksei Kuzmin
fe0a96200d Use Jessie sysroot for building on amd64 and i386 2017-08-15 16:19:22 +03:00
Gellert Hegyi
c6ba812d79 re-enables OSR 2017-08-15 16:19:22 +03:00
Gellert Hegyi
6ab0a8a287 removes unused autoresizelock from osrrwhv 2017-08-15 16:19:22 +03:00
Aleksei Kuzmin
90ec61fbe9 Revert "Enable OSR"
This reverts commit 5925d737afcd1b8dbbccc1d2b52ced025e291436.
2017-08-15 16:19:22 +03:00
Aleksei Kuzmin
ba0c43e1fc Do not run navigator.getUserMedia related test on CI build machines 2017-08-15 16:19:22 +03:00
Gellert Hegyi
1d10654a22 fixes bitmap to canvas conversion 2017-08-15 16:19:22 +03:00
Gellert Hegyi
76d46ce509 adds compositor resize lock client implementation 2017-08-15 16:19:22 +03:00
Aleksei Kuzmin
5ef668de64 Enable OSR 2017-08-15 16:19:22 +03:00
Gellert Hegyi
ca4a6e4692 fixes offscreen rendering on macos 2017-08-15 16:19:22 +03:00
Aleksei Kuzmin
1d132565c9 FIXME: enable_osr=0 2017-08-15 16:19:21 +03:00
Kevin Sawicki
7d1a49db48 Use kPointsPerInch instead of desired_dpi
Changed in https://codereview.chromium.org/2788343003
2017-08-15 16:19:21 +03:00
Kevin Sawicki
9945fc5148 Don't destroy menu delegate until OnMenuClosed fires 2017-08-15 16:19:21 +03:00
Kevin Sawicki
ad33e569d6 Register default layout provider 2017-08-15 16:19:21 +03:00
Kevin Sawicki
34fff57646 Grant the devtools access to the extension origins 2017-08-15 16:19:21 +03:00
Aleksei Kuzmin
4fc2b3e642 Make download item drags look like bookmark
https://codereview.chromium.org/2750253002
2017-08-15 16:19:21 +03:00
Kevin Sawicki
4bb95acc2b 👕 Remove linter errors 2017-08-15 16:19:21 +03:00
Aleksei Kuzmin
c7cf844bcd Update CHROME_VERSION_STRING 2017-08-15 16:19:21 +03:00
Aleksei Kuzmin
ba9b8719ac The Blink Rename 2017-08-15 16:19:21 +03:00
Aleksei Kuzmin
f4411889a9 Fix free memory calculation.
https://codereview.chromium.org/2558043007
2017-08-15 16:19:21 +03:00
Aleksei Kuzmin
627eb30409 The Blink Rename 2017-08-15 16:19:21 +03:00
Aleksei Kuzmin
b8b7d0ab1a Rename methods in autofill 2017-08-15 16:19:21 +03:00
Kevin Sawicki
45db999593 Extend blink::WebTextCheckClient in atom::api::SpellCheckClient 2017-08-15 16:19:21 +03:00
Tony Ganch
4d9f309888 Fix HasServiceWorker check
Revert cb2014f9e8ae0283e5f20d4e2167be1592228887.
2017-08-15 16:19:21 +03:00
Aleksei Kuzmin
e2fe95894f Require explicit selection of traits for LazyInstance
https://codereview.chromium.org/2733283002
2017-08-15 16:19:21 +03:00
Aleksei Kuzmin
e16e1e2854 Remove URLRequestJobFactory::IsHandledURL.
https://codereview.chromium.org/2783343002
2017-08-15 16:19:21 +03:00
Tony Ganch
90574160db Replace x/y in WebMouseEvent with proper getters/setters 2017-08-15 16:19:21 +03:00
Aleksei Kuzmin
b997c2ffc1 Don't call deprecated copyPixelsTo
don't call deprecated copyPixelsTo
https://codereview.chromium.org/2812853002

stop using copyPixelsTo -- deprecated
https://codereview.chromium.org/2798413002

remove unused SkBitmap::copyPixelsTo
https://skia-review.googlesource.com/c/13171/
2017-08-15 16:19:21 +03:00
Aleksei Kuzmin
f824b1e9d4 Migrate base::TaskRunner from Closure to OnceClosure
Migrate base::TaskRunner from Closure to OnceClosure
https://codereview.chromium.org/2637843002

Pass Callback to TaskRunner by value and consume it on invocation (1)
https://codereview.chromium.org/2726523002

Replace base::get with std::get
https://codereview.chromium.org/2797133002
2017-08-15 16:19:21 +03:00
Aleksei Kuzmin
48821a6d2a Fix compilation 2017-08-15 16:19:21 +03:00
Aleksei Kuzmin
d09cab2e21 Migrate base::TaskRunner from Closure to OnceClosure
Migrate base::TaskRunner from Closure to OnceClosure
https://codereview.chromium.org/2637843002

Pass Callback to TaskRunner by value and consume it on invocation (1)
https://codereview.chromium.org/2726523002

Replace base::get with std::get
https://codereview.chromium.org/2797133002
2017-08-15 16:19:21 +03:00
Aleksei Kuzmin
ffbb16e854 Adds a basic offline check to InstallableManager.
https://codereview.chromium.org/2751343002
2017-08-15 16:19:21 +03:00
Aleksei Kuzmin
30fafc2772 Fix CompositorResizeLock to do something.
https://codereview.chromium.org/2773433003
2017-08-15 16:19:21 +03:00
Aleksei Kuzmin
9b8a77f0d8 Adds the ability for WebContentsDelegate to decide if event should be updated
https://codereview.chromium.org/2775553002
2017-08-15 16:19:20 +03:00
Aleksei Kuzmin
d322769de8 WebMouseEvent coordinates are now fractional & private
https://codereview.chromium.org/2782893002
2017-08-15 16:19:20 +03:00
Aleksei Kuzmin
faaeab7e4a Add EME support for new VP9 codec string in WebM.
https://codereview.chromium.org/2793163003
2017-08-15 16:19:20 +03:00
Aleksei Kuzmin
567646e624 Fix cc/paint skia type mismatches
https://codereview.chromium.org/2717943002
2017-08-15 16:19:20 +03:00
Aleksei Kuzmin
adddff3ee2 Move PrefRegistrySimple to use unique_ptr<Value>
https://codereview.chromium.org/2784513002
2017-08-15 16:19:20 +03:00
Aleksei Kuzmin
99e57f9072 Add display::GetDisplayNearestView
https://codereview.chromium.org/2751833004
2017-08-15 16:19:20 +03:00
Aleksei Kuzmin
6415f181ca Downloads: Added transient flag to download item and download database
https://codereview.chromium.org/2720613002
2017-08-15 16:19:20 +03:00
Aleksei Kuzmin
bd971b6371 Added last_access_time to DownloadItem and History DB
https://codereview.chromium.org/2705283003
2017-08-15 16:19:20 +03:00
Aleksei Kuzmin
0adc887b32 [downloads] Allow download target determination to indicate an error.
https://chromium-review.googlesource.com/c/465526/
2017-08-15 16:19:20 +03:00
Aleksei Kuzmin
7c7300ff82 Make GetDisplayedNotifications asynchronous.
https://codereview.chromium.org/2749453002
2017-08-15 16:19:20 +03:00
Aleksei Kuzmin
bda5e4efcb Moving LatencyInfo into a separate component.
https://codereview.chromium.org/2783973002
2017-08-15 16:19:20 +03:00
Aleksei Kuzmin
cc350efbd8 Remove base::BinaryValue
https://codereview.chromium.org/2799093006
2017-08-15 16:19:20 +03:00
Aleksei Kuzmin
49fbb52b01 Add X509CertificateBytes which uses CRYPTO_BUFFER instead of macOS-native certificate types.
https://codereview.chromium.org/2746103003
2017-08-15 16:19:20 +03:00
Aleksei Kuzmin
3d700ee49f Remove base::Value::CreateNullValue
https://codereview.chromium.org/2792573002
2017-08-15 16:19:20 +03:00
Aleksei Kuzmin
c7f2e2731c Allow content embedder to set a cursor for RenderWidgetHost
https://codereview.chromium.org/2808763009
2017-08-15 16:19:20 +03:00
Aleksei Kuzmin
1126719e7f Separate ContentSettingsClient out from LocalFrameClient
https://codereview.chromium.org/2786673002
2017-08-15 16:19:20 +03:00
Aleksei Kuzmin
a20f633272 Remove base::StringValue
https://codereview.chromium.org/2664753002
2017-08-15 16:19:20 +03:00
Aleksei Kuzmin
fb7bd8f11e Remove desired DPI
https://codereview.chromium.org/2788343003
2017-08-15 16:19:20 +03:00
Aleksei Kuzmin
7a4ca08a8d The Blink Rename 2017-08-15 16:19:20 +03:00
Aleksei Kuzmin
3939359354 Update clang revision to match Chromium 59.0.3071.104 2017-08-15 16:19:20 +03:00
Thiago de Arruda
1709b8e39d Fix sandbox crash when opening a background tab
When a link is clicked with the middle mouse button, chrome opens a window with
"background-tab" disposition. This is not currently handled in sandbox mode,
causing an api::WebContents to leak leading to eventual crash(since it has no
wrapper).

Also fix the event handler for "-add-new-contents" by having it call
`event.preventDefault()` when the window creation should be cancelled.
2017-08-15 09:55:39 -03:00
Cheng Zhao
a419fe75ca Merge pull request #10253 from electron/improvements-for-libcc-development
Improve development workflow with built libchromiumcontent
2017-08-15 19:40:06 +09:00
Leo Lamprecht
4ba4fe4f62 Examples for events 2017-08-15 11:38:54 +02:00
Leo Lamprecht
3062027bab Better wording about Now deployment 2017-08-15 11:29:28 +02:00
Leo Lamprecht
78f11df6e4 Full Windows section is back 2017-08-15 11:27:33 +02:00
Leo Lamprecht
3405596983 Brought back Windows section 2017-08-15 11:24:59 +02:00
Thiago de Arruda
d6fbf5f1bb Improve development workflow with built libchromiumcontent
- Add `--debug_libchromiumcontent` to build libchromiumcontent for debugging
  (shared library build).
- By default, only invoke `gclient sync` the first time to checkout chromium
  source tree. Add `--force_update_libchromiumcontent` switch to force updating.
- Document new options.

The goal is to allow faster edit/compile cycles when debugging/making changes
to libchromiumcontent.
2017-08-15 05:40:22 -03:00
renaesop
6d16eb81d2 Add a callback option to webContents.print 2017-08-15 14:44:24 +08:00
Zeke Sikelianos
6a872dd938 update the updates doc 2017-08-14 13:26:33 -07:00
Zeke Sikelianos
796664ef1c Merge pull request #10266 from electron/revert-10250-remove-preinstall-no-op
Revert "remove no-op preinstall script"
2017-08-14 11:34:44 -07:00
Zeke Sikelianos
10f2c80162 Revert "remove no-op preinstall script" 2017-08-14 11:33:32 -07:00
Andreas Flöjt
3d33da7696 Make mouse forward option of setIgnoreMouseMessages and update documentation. 2017-08-14 20:21:00 +02:00
Andreas Flöjt
60c0bf1636 Set up legacy window subclass and mouse hook during setForwardMouseMessages.
As opposed to when a legacy window is created/destroyed. This enables forwarding on a per-window basis.
2017-08-14 18:12:55 +02:00
Zeke Sikelianos
646a8eb753 Merge pull request #10250 from electron/remove-preinstall-no-op
remove no-op preinstall script
2017-08-13 21:19:29 -07:00
Zachary Flower
8a2c35023f 📝 Document simple fullscreen functionality [ci skip] 2017-08-13 00:58:28 -06:00
Zachary Flower
ba5fa2c8b1 Add support for simple (pre-Lion) fullscreen on Mac OS 2017-08-13 00:28:33 -06:00
Leo Lamprecht
235ae0989f Mention that the app needs to check for updates 2017-08-12 12:48:49 +02:00
Leo Lamprecht
837a34cf71 Indicate that Nuts supports private repositories 2017-08-12 12:44:21 +02:00
Leo Lamprecht
01f31edb95 Cut down platform notices a little 2017-08-12 01:30:29 +02:00
Leo Lamprecht
cfe914ff83 Fixed wording 2017-08-12 01:24:56 +02:00
Leo Lamprecht
06f4c1b337 Be clear about the usage example 2017-08-12 01:23:54 +02:00
Leo Lamprecht
3815ed8af4 Fixed a typo 2017-08-12 01:18:34 +02:00
Leo Lamprecht
c1a40fbd98 Linked guide about implementing updates 2017-08-12 01:10:20 +02:00
Leo Lamprecht
bb1627a69b Added guide for updates 2017-08-12 01:04:25 +02:00
John Kleinschmidt
ad90de0c82 Merge pull request #10230 from electron/prerelease
add a prerelease check
2017-08-11 16:41:08 -04:00
Zeke Sikelianos
0cd99d9815 remove no-op preinstall script 2017-08-11 12:18:51 -07:00
John Kleinschmidt
6956f2fc69 Merge pull request #10246 from electron/another-final-step-in-releasing
edit release on github after promoting to latest
2017-08-11 09:50:08 -04:00
Zeke Sikelianos
fd6aeda6f6 edit release on github after promoting to latest 2017-08-10 20:53:02 -07:00
Felix Rieseberg
b4bb00843b 🔧 Spaces for the Spacelord 2017-08-10 09:38:01 -07:00
Felix Rieseberg
4c48908a31 Merge branch 'drag-browser-view' of https://github.com/electron/electron into drag-browser-view 2017-08-10 09:36:12 -07:00
Zeke Sikelianos
404589d9b5 add more releasing tips 2017-08-10 09:26:22 -07:00
Felix Rieseberg
d913b53fea 🔧 Handle offset BrowserView 2017-08-10 08:00:21 -07:00
Cheng Zhao
c6289ef219 Merge pull request #10223 from ajmacd/shutdown-desktop-capturers
Ensure DesktopCapturers are destroyed when no longer needed.
2017-08-10 21:28:31 +09:00
Felix Rieseberg
47d652b5a2 🔧 Properly derive 2017-08-09 15:21:58 -07:00
Felix Rieseberg
7bfece1144 🔧 Make work with complex shapes 2017-08-09 15:21:58 -07:00
Felix Rieseberg
a55015d63d 🔧 Support older versions of macOS 2017-08-09 15:21:58 -07:00
Felix Rieseberg
a5dfb09037 🔧 Draggable (using the window’s regions) 2017-08-09 15:21:58 -07:00
Felix Rieseberg
ae5c8e63d9 🔧 Properly derive 2017-08-10 07:09:03 +09:00
Felix Rieseberg
ebe058e7cb 🔧 Make work with complex shapes 2017-08-09 14:53:36 -07:00
Zeke Sikelianos
96dd9b9ab8 update prerelease to check for files on s3 2017-08-09 13:40:52 -07:00
Felix Rieseberg
fdd0d67fd3 🔧 Support older versions of macOS 2017-08-09 11:57:57 -07:00
Zeke Sikelianos
a16c4167eb standardize 2017-08-09 11:06:16 -07:00
Zeke Sikelianos
1a6f0ae437 add a prerelease check 2017-08-09 10:49:31 -07:00
Felix Rieseberg
df66223f4c 🔧 Draggable (using the window’s regions) 2017-08-08 17:00:00 -07:00
Vladimir Vainer
39c46a9b75 added comment to mention sk_tools_utils::copy_to 2017-08-08 13:06:39 +03:00
Vladimir Vainer
e6abfa959a Revert "Do not use deprecated deepCopyTo"
This reverts commit 517184b89b.
2017-08-08 13:02:20 +03:00
Andrew MacDonald
a8759a3176 Ensure DesktopCapturers are destroyed when no longer needed. 2017-08-04 15:06:58 -07:00
Andreas Flöjt
0736de1e8d Fix lint errors 2017-08-03 23:23:42 +02:00
Andreas Flöjt
12dbcfa2ea 📝 Documentation for setForwardMouseMessages. 2017-08-02 21:50:42 +02:00
Andreas Flöjt
a84fa0eecb 🏁 Add API to forward mouse messages.
As opposed to the existing setIgnoreMouseEvents this call makes Chromium aware of mouse movements, allowing the user to stop forwarding according to movements in the webpage.
2017-08-02 21:16:37 +02:00
Vladimir Vainer
517184b89b Do not use deprecated deepCopyTo 2017-07-16 06:33:37 +03:00
Vladimir Vainer
5f2dd2ef6c Fix #8017: Crash copying croped image to clipboard 2017-07-09 06:56:14 +03:00
Shubham
1b8963ff6e 🍎 Fix full screen when resizable is set to true 2017-06-20 16:11:28 -04:00
1087 changed files with 29698 additions and 55550 deletions

764
.circleci/config.yml Normal file
View File

@@ -0,0 +1,764 @@
version: 2
jobs:
electron-linux-arm:
docker:
- image: electronbuilds/electron:0.0.7
environment:
TARGET_ARCH: arm
resource_class: 2xlarge
steps:
- checkout
- run:
name: Check for release
command: |
if [ -n "${RUN_RELEASE_BUILD}" ]; then
echo 'release build triggered from api'
echo 'export ELECTRON_RELEASE=1 TRIGGERED_BY_API=1' >> $BASH_ENV
fi
- run:
name: Bootstrap
command: |
if [ "$ELECTRON_RELEASE" == "1" ]; then
echo 'Bootstrapping Electron for release build'
script/bootstrap.py --target_arch=$TARGET_ARCH
else
echo 'Bootstrapping Electron for debug build'
script/bootstrap.py --target_arch=$TARGET_ARCH --dev
fi
- run: npm run lint
- run:
name: Build
command: |
if [ "$ELECTRON_RELEASE" == "1" ]; then
echo 'Building Electron for release'
script/build.py -c R
else
echo 'Building Electron for debug'
script/build.py -c D
fi
- run:
name: Create distribution
command: |
if [ "$ELECTRON_RELEASE" == "1" ]; then
echo 'Creating Electron release distribution'
script/create-dist.py
else
echo 'Skipping create distribution because build is not for release'
fi
- run:
name: Upload distribution
command: |
if [ "$ELECTRON_RELEASE" == "1" ] && [ "$TRIGGERED_BY_API" != "1" ]; then
echo 'Uploading Electron release distribution to github releases'
script/upload.py
elif [ "$ELECTRON_RELEASE" == "1" ] && [ "$TRIGGERED_BY_API" == "1" ]; then
echo 'Uploading Electron release distribution to s3'
script/upload.py --upload_to_s3
else
echo 'Skipping upload distribution because build is not for release'
fi
- run:
name: Optionally finish release
shell: /bin/sh
command: |
if [ "$ELECTRON_RELEASE" == "1" ] && [ "$AUTO_RELEASE" == "true" ]; then
echo 'Trying to finish release'
node script/release.js --validateRelease --automaticRelease
releaseExitCode=$?
if [ $releaseExitCode -eq 0 ]; then
echo 'Release is ready to go; releasing'
node script/release.js--automaticRelease
if [ $releaseExitCode -eq 0 ]; then
echo 'Release successful, now publishing to npm'
echo "//registry.npmjs.org/:_authToken=$ELECTRON_NPM_TOKEN" >> ~/.npmrc
npm run publish-to-npm
echo 'Release has been published to npm'
fi
else
echo 'Release is not complete, skipping publish for now'
fi
else
echo 'Skipping finishing release because build is not for release'
fi
- run:
name: Zip out directory
command: |
if [ "$ELECTRON_RELEASE" != "1" ]; then
zip -r electron.zip out/D
fi
- persist_to_workspace:
root: /home/builduser
paths:
- project/out
- store_artifacts:
path: electron.zip
electron-linux-arm-test:
machine: true
steps:
- attach_workspace:
at: /tmp/workspace
- checkout
- run:
name: Test in ARM docker container
command: |
if [ "$ELECTRON_RELEASE" != "1" ]; then
docker run --rm --privileged multiarch/qemu-user-static:register --reset
docker run -it \
--mount type=bind,source=/tmp/workspace,target=/tmp/workspace \
--rm electronbuilds/electronarm7:0.0.5 > version.txt
cat version.txt
if grep -q `script/get-version.py` version.txt; then
echo "Versions match"
else
echo "Versions do not match"
exit 1
fi
else
echo "Skipping test for release build"
fi
electron-linux-arm64:
docker:
- image: electronbuilds/electron:0.0.7
environment:
TARGET_ARCH: arm64
resource_class: 2xlarge
steps:
- checkout
- run:
name: Check for release
command: |
if [ -n "${RUN_RELEASE_BUILD}" ]; then
echo 'release build triggered from api'
echo 'export ELECTRON_RELEASE=1 TRIGGERED_BY_API=1' >> $BASH_ENV
fi
- run:
name: Bootstrap
command: |
if [ "$ELECTRON_RELEASE" == "1" ]; then
echo 'Bootstrapping Electron for release build'
script/bootstrap.py --target_arch=$TARGET_ARCH
else
echo 'Bootstrapping Electron for debug build'
script/bootstrap.py --target_arch=$TARGET_ARCH --dev
fi
- run: npm run lint
- run:
name: Build
command: |
if [ "$ELECTRON_RELEASE" == "1" ]; then
echo 'Building Electron for release'
script/build.py -c R
else
echo 'Building Electron for debug'
script/build.py -c D
fi
- run:
name: Create distribution
command: |
if [ "$ELECTRON_RELEASE" == "1" ]; then
echo 'Creating Electron release distribution'
script/create-dist.py
else
echo 'Skipping create distribution because build is not for release'
fi
- run:
name: Upload distribution
command: |
if [ "$ELECTRON_RELEASE" == "1" ] && [ "$TRIGGERED_BY_API" != "1" ]; then
echo 'Uploading Electron release distribution to github releases'
script/upload.py
elif [ "$ELECTRON_RELEASE" == "1" ] && [ "$TRIGGERED_BY_API" == "1" ]; then
echo 'Uploading Electron release distribution to s3'
script/upload.py --upload_to_s3
else
echo 'Skipping upload distribution because build is not for release'
fi
- run:
name: Optionally finish release
shell: /bin/sh
command: |
if [ "$ELECTRON_RELEASE" == "1" ] && [ "$AUTO_RELEASE" == "true" ]; then
echo 'Trying to finish release'
node script/release.js --validateRelease --automaticRelease
releaseExitCode=$?
if [ $releaseExitCode -eq 0 ]; then
echo 'Release is ready to go; releasing'
node script/release.js--automaticRelease
if [ $releaseExitCode -eq 0 ]; then
echo 'Release successful, now publishing to npm'
echo "//registry.npmjs.org/:_authToken=$ELECTRON_NPM_TOKEN" >> ~/.npmrc
npm run publish-to-npm
echo 'Release has been published to npm'
fi
else
echo 'Release is not complete, skipping publish for now'
fi
else
echo 'Skipping finishing release because build is not for release'
fi
- run:
name: Zip out directory
command: |
if [ "$ELECTRON_RELEASE" != "1" ]; then
zip -r electron.zip out/D
fi
- persist_to_workspace:
root: /home/builduser
paths:
- project/out
- store_artifacts:
path: electron.zip
electron-linux-arm64-test:
machine: true
steps:
- attach_workspace:
at: /tmp/workspace
- checkout
- run:
name: Test in ARM64 docker container
command: |
if [ "$ELECTRON_RELEASE" != "1" ]; then
docker run --rm --privileged multiarch/qemu-user-static:register --reset
docker run -it \
--mount type=bind,source=/tmp/workspace,target=/tmp/workspace \
--rm electronbuilds/electronarm64:0.0.6 > version.txt
cat version.txt
if grep -q `script/get-version.py` version.txt; then
echo "Versions match"
else
echo "Versions do not match"
exit 1
fi
else
echo "Skipping test for release build"
fi
electron-linux-ia32:
docker:
- image: electronbuilds/electron:0.0.7
environment:
TARGET_ARCH: ia32
DISPLAY: ':99.0'
resource_class: xlarge
steps:
- checkout
- run:
name: Setup for headless testing
command: sh -e /etc/init.d/xvfb start
- run:
name: Check for release
command: |
if [ -n "${RUN_RELEASE_BUILD}" ]; then
echo 'release build triggered from api'
echo 'export ELECTRON_RELEASE=1 TRIGGERED_BY_API=1' >> $BASH_ENV
fi
- run:
name: Bootstrap
command: |
if [ "$ELECTRON_RELEASE" == "1" ]; then
echo 'Bootstrapping Electron for release build'
script/bootstrap.py --target_arch=$TARGET_ARCH
else
echo 'Bootstrapping Electron for debug build'
script/bootstrap.py --target_arch=$TARGET_ARCH --dev
fi
- run: npm run lint
- run:
name: Build
command: |
if [ "$ELECTRON_RELEASE" == "1" ]; then
echo 'Building Electron for release'
script/build.py -c R
else
echo 'Building Electron for debug'
script/build.py -c D
fi
- run:
name: Create distribution
command: |
if [ "$ELECTRON_RELEASE" == "1" ]; then
echo 'Creating Electron release distribution'
script/create-dist.py
else
echo 'Skipping create distribution because build is not for release'
fi
- run:
name: Upload distribution
command: |
if [ "$ELECTRON_RELEASE" == "1" ] && [ "$TRIGGERED_BY_API" != "1" ]; then
echo 'Uploading Electron release distribution to github releases'
script/upload.py
elif [ "$ELECTRON_RELEASE" == "1" ] && [ "$TRIGGERED_BY_API" == "1" ]; then
echo 'Uploading Electron release distribution to s3'
script/upload.py --upload_to_s3
else
echo 'Skipping upload distribution because build is not for release'
fi
- run:
name: Optionally finish release
shell: /bin/sh
command: |
if [ "$ELECTRON_RELEASE" == "1" ] && [ "$AUTO_RELEASE" == "true" ]; then
echo 'Trying to finish release'
node script/release.js --validateRelease --automaticRelease
releaseExitCode=$?
if [ $releaseExitCode -eq 0 ]; then
echo 'Release is ready to go; releasing'
node script/release.js--automaticRelease
if [ $releaseExitCode -eq 0 ]; then
echo 'Release successful, now publishing to npm'
echo "//registry.npmjs.org/:_authToken=$ELECTRON_NPM_TOKEN" >> ~/.npmrc
npm run publish-to-npm
echo 'Release has been published to npm'
fi
else
echo 'Release is not complete, skipping publish for now'
fi
else
echo 'Skipping finishing release because build is not for release'
fi
- run:
name: Test
environment:
MOCHA_FILE: junit/test-results.xml
MOCHA_REPORTER: mocha-junit-reporter
command: |
if [ "$ELECTRON_RELEASE" != "1" ]; then
echo 'Testing Electron debug build'
out/D/electron --version
mkdir junit
script/test.py --ci --rebuild_native_modules
else
echo 'Skipping testing on release build'
fi
- run:
name: Verify FFmpeg
command: |
if [ "$ELECTRON_RELEASE" != "1" ]; then
echo 'Verifying ffmpeg on debug build'
script/verify-ffmpeg.py
else
echo 'Skipping verify ffmpeg on release build'
fi
electron-linux-mips64el:
docker:
- image: electronbuilds/electron:0.0.7
environment:
TARGET_ARCH: mips64el
resource_class: xlarge
steps:
- checkout
- run:
name: Check for release
command: |
if [ -n "${RUN_RELEASE_BUILD}" ]; then
echo 'release build triggered from api'
echo 'export ELECTRON_RELEASE=1 TRIGGERED_BY_API=1' >> $BASH_ENV
fi
- run:
name: Bootstrap
command: |
if [ "$ELECTRON_RELEASE" == "1" ]; then
echo 'Bootstrapping Electron for release build'
script/bootstrap.py --target_arch=$TARGET_ARCH
else
echo 'Bootstrapping Electron for debug build'
script/bootstrap.py --target_arch=$TARGET_ARCH --dev
fi
- run: npm run lint
- run:
name: Build
command: |
if [ "$ELECTRON_RELEASE" == "1" ]; then
echo 'Building Electron for release'
script/build.py -c R
else
echo 'Building Electron for debug'
script/build.py -c D
fi
- run:
name: Create distribution
command: |
if [ "$ELECTRON_RELEASE" == "1" ]; then
echo 'Creating Electron release distribution'
script/create-dist.py
else
echo 'Skipping create distribution because build is not for release'
fi
- run:
name: Upload distribution
command: |
if [ "$ELECTRON_RELEASE" == "1" ] && [ "$TRIGGERED_BY_API" != "1" ]; then
echo 'Uploading Electron release distribution to github releases'
script/upload.py
elif [ "$ELECTRON_RELEASE" == "1" ] && [ "$TRIGGERED_BY_API" == "1" ]; then
echo 'Uploading Electron release distribution to s3'
script/upload.py --upload_to_s3
else
echo 'Skipping upload distribution because build is not for release'
fi
- run:
name: Optionally finish release
shell: /bin/sh
command: |
if [ "$ELECTRON_RELEASE" == "1" ] && [ "$AUTO_RELEASE" == "true" ]; then
echo 'Trying to finish release'
node script/release.js --validateRelease --automaticRelease
releaseExitCode=$?
if [ $releaseExitCode -eq 0 ]; then
echo 'Release is ready to go; releasing'
node script/release.js--automaticRelease
if [ $releaseExitCode -eq 0 ]; then
echo 'Release successful, now publishing to npm'
echo "//registry.npmjs.org/:_authToken=$ELECTRON_NPM_TOKEN" >> ~/.npmrc
npm run publish-to-npm
echo 'Release has been published to npm'
fi
else
echo 'Release is not complete, skipping publish for now'
fi
else
echo 'Skipping finishing release because build is not for release'
fi
electron-linux-x64:
docker:
- image: electronbuilds/electron:0.0.7
environment:
TARGET_ARCH: x64
DISPLAY: ':99.0'
resource_class: xlarge
steps:
- checkout
- run:
name: Setup for headless testing
command: sh -e /etc/init.d/xvfb start
- run:
name: Check for release
command: |
if [ -n "${RUN_RELEASE_BUILD}" ]; then
echo 'release build triggered from api'
echo 'export ELECTRON_RELEASE=1 TRIGGERED_BY_API=1' >> $BASH_ENV
fi
- run:
name: Bootstrap
command: |
if [ "$ELECTRON_RELEASE" == "1" ]; then
echo 'Bootstrapping Electron for release build'
script/bootstrap.py --target_arch=$TARGET_ARCH
else
echo 'Bootstrapping Electron for debug build'
script/bootstrap.py --target_arch=$TARGET_ARCH --dev
fi
- run: npm run lint
- run:
name: Build
command: |
if [ "$ELECTRON_RELEASE" == "1" ]; then
echo 'Building Electron for release'
script/build.py -c R
else
echo 'Building Electron for debug'
script/build.py -c D
fi
- run:
name: Create distribution
command: |
if [ "$ELECTRON_RELEASE" == "1" ]; then
echo 'Creating Electron release distribution'
script/create-dist.py
else
echo 'Skipping create distribution because build is not for release'
fi
- run:
name: Upload distribution
command: |
if [ "$ELECTRON_RELEASE" == "1" ] && [ "$TRIGGERED_BY_API" != "1" ]; then
echo 'Uploading Electron release distribution to github releases'
script/upload.py
elif [ "$ELECTRON_RELEASE" == "1" ] && [ "$TRIGGERED_BY_API" == "1" ]; then
echo 'Uploading Electron release distribution to s3'
script/upload.py --upload_to_s3
else
echo 'Skipping upload distribution because build is not for release'
fi
- run:
name: Optionally finish release
shell: /bin/sh
command: |
if [ "$ELECTRON_RELEASE" == "1" ] && [ "$AUTO_RELEASE" == "true" ]; then
echo 'Trying to finish release'
node script/release.js --validateRelease --automaticRelease
releaseExitCode=$?
if [ $releaseExitCode -eq 0 ]; then
echo 'Release is ready to go; releasing'
node script/release.js--automaticRelease
if [ $releaseExitCode -eq 0 ]; then
echo 'Release successful, now publishing to npm'
echo "//registry.npmjs.org/:_authToken=$ELECTRON_NPM_TOKEN" >> ~/.npmrc
npm run publish-to-npm
echo 'Release has been published to npm'
fi
else
echo 'Release is not complete, skipping publish for now'
fi
else
echo 'Skipping finishing release because build is not for release'
fi
- run:
name: Test
environment:
MOCHA_FILE: junit/test-results.xml
MOCHA_REPORTER: mocha-junit-reporter
command: |
if [ "$ELECTRON_RELEASE" != "1" ]; then
echo 'Testing Electron debug build'
mkdir junit
script/test.py --ci --rebuild_native_modules
else
echo 'Skipping testing on release build'
fi
- run:
name: Verify FFmpeg
command: |
if [ "$ELECTRON_RELEASE" != "1" ]; then
echo 'Verifying ffmpeg on debug build'
script/verify-ffmpeg.py
else
echo 'Skipping verify ffmpeg on release build'
fi
- run:
name: Generate Typescript Definitions
command: npm run create-typescript-definitions
- store_test_results:
path: junit
- store_artifacts:
path: junit
- store_artifacts:
path: out/electron.d.ts
- store_artifacts:
path: out/electron-api.json
electron-osx-x64:
environment:
TARGET_ARCH: x64
resource_class: large
macos:
xcode: "9.0"
steps:
- checkout
- run:
name: Reclaim disk space
command: |
df -h
sudo rm -rf /Library/Developer/CoreSimulator
df -h
sysctl -n hw.ncpu
- run:
name: Check for release
command: |
if [ -n "${RUN_RELEASE_BUILD}" ]; then
echo 'release build triggered from api'
echo 'export ELECTRON_RELEASE=1 TRIGGERED_BY_API=1' >> $BASH_ENV
fi
- run:
name: Bootstrap
command: |
if [ "$ELECTRON_RELEASE" == "1" ]; then
echo 'Bootstrapping Electron for release build'
script/bootstrap.py --target_arch=$TARGET_ARCH
else
echo 'Bootstrapping Electron for debug build'
script/bootstrap.py --target_arch=$TARGET_ARCH --dev
fi
- run: npm run lint
- run:
name: Build
command: |
if [ "$ELECTRON_RELEASE" == "1" ]; then
echo 'Building Electron for release'
script/build.py -c R
else
echo 'Building Electron for debug'
script/build.py -c D
fi
- run:
name: Create distribution
command: |
if [ "$ELECTRON_RELEASE" == "1" ]; then
echo 'Creating Electron release distribution'
script/create-dist.py
else
echo 'Skipping create distribution because build is not for release'
fi
- run:
name: Upload distribution
command: |
if [ "$ELECTRON_RELEASE" == "1" ] && [ "$TRIGGERED_BY_API" != "1" ]; then
echo 'Uploading Electron release distribution to github releases'
script/upload.py
elif [ "$ELECTRON_RELEASE" == "1" ] && [ "$TRIGGERED_BY_API" == "1" ]; then
echo 'Uploading Electron release distribution to s3'
script/upload.py --upload_to_s3
else
echo 'Skipping upload distribution because build is not for release'
fi
- run:
name: Test
environment:
MOCHA_FILE: junit/test-results.xml
MOCHA_REPORTER: mocha-junit-reporter
command: |
if [ "$ELECTRON_RELEASE" != "1" ]; then
echo 'Testing Electron debug build'
mkdir junit
script/test.py --ci --rebuild_native_modules
else
echo 'Skipping testing on release build'
fi
- run:
name: Verify FFmpeg
command: |
if [ "$ELECTRON_RELEASE" != "1" ]; then
echo 'Verifying ffmpeg on debug build'
script/verify-ffmpeg.py
else
echo 'Skipping verify ffmpeg on release build'
fi
- run:
name: Generate Typescript Definitions
command: npm run create-typescript-definitions
- store_test_results:
path: junit
- store_artifacts:
path: junit
- store_artifacts:
path: out/electron.d.ts
- store_artifacts:
path: out/electron-api.json
electron-mas-x64:
environment:
TARGET_ARCH: x64
MAS_BUILD: 1
macos:
xcode: "9.0"
resource_class: large
steps:
- checkout
- run:
name: Reclaim disk space
command: |
df -h
sudo rm -rf /Library/Developer/CoreSimulator
df -h
sysctl -n hw.ncpu
- run:
name: Check for release
command: |
if [ -n "${RUN_RELEASE_BUILD}" ]; then
echo 'release build triggered from api'
echo 'export ELECTRON_RELEASE=1 TRIGGERED_BY_API=1' >> $BASH_ENV
fi
- run:
name: Bootstrap
command: |
if [ "$ELECTRON_RELEASE" == "1" ]; then
echo 'Bootstrapping Electron for release build'
script/bootstrap.py --target_arch=$TARGET_ARCH
else
echo 'Bootstrapping Electron for debug build'
script/bootstrap.py --target_arch=$TARGET_ARCH --dev
fi
- run: npm run lint
- run:
name: Build
command: |
if [ "$ELECTRON_RELEASE" == "1" ]; then
echo 'Building Electron for release'
script/build.py -c R
else
echo 'Building Electron for debug'
script/build.py -c D
fi
- run:
name: Create distribution
command: |
if [ "$ELECTRON_RELEASE" == "1" ]; then
echo 'Creating Electron release distribution'
script/create-dist.py
else
echo 'Skipping create distribution because build is not for release'
fi
- run:
name: Upload distribution
command: |
if [ "$ELECTRON_RELEASE" == "1" ] && [ "$TRIGGERED_BY_API" != "1" ]; then
echo 'Uploading Electron release distribution to github releases'
script/upload.py
elif [ "$ELECTRON_RELEASE" == "1" ] && [ "$TRIGGERED_BY_API" == "1" ]; then
echo 'Uploading Electron release distribution to s3'
script/upload.py --upload_to_s3
else
echo 'Skipping upload distribution because build is not for release'
fi
- run:
name: Test
environment:
MOCHA_FILE: junit/test-results.xml
MOCHA_REPORTER: mocha-junit-reporter
command: |
if [ "$ELECTRON_RELEASE" != "1" ]; then
echo 'Testing Electron debug build'
mkdir junit
script/test.py --ci --rebuild_native_modules
else
echo 'Skipping testing on release build'
fi
- run:
name: Verify FFmpeg
command: |
if [ "$ELECTRON_RELEASE" != "1" ]; then
echo 'Verifying ffmpeg on debug build'
script/verify-ffmpeg.py
else
echo 'Skipping verify ffmpeg on release build'
fi
- run:
name: Generate Typescript Definitions
command: npm run create-typescript-definitions
- store_test_results:
path: junit
- store_artifacts:
path: junit
- store_artifacts:
path: out/electron.d.ts
- store_artifacts:
path: out/electron-api.json
workflows:
version: 2
build-arm:
jobs:
- electron-linux-arm
- electron-linux-arm-test:
requires:
- electron-linux-arm
build-arm64:
jobs:
- electron-linux-arm64
- electron-linux-arm64-test:
requires:
- electron-linux-arm64
build-ia32:
jobs:
- electron-linux-ia32
build-x64:
jobs:
- electron-linux-x64
build-osx-x64:
jobs:
- electron-osx-x64
build-mas-x64:
jobs:
- electron-mas-x64

3
.dockerignore Normal file
View File

@@ -0,0 +1,3 @@
*
!tools/xvfb-init.sh
!tools/run-electron.sh

7
.env.example Normal file
View File

@@ -0,0 +1,7 @@
# These env vars are only necessary for creating Electron releases.
# See docs/development/releasing.md
APPVEYOR_TOKEN=
CIRCLE_TOKEN=
ELECTRON_GITHUB_TOKEN=
VSTS_TOKEN=

21
.github/CODEOWNERS vendored Normal file
View File

@@ -0,0 +1,21 @@
# Order is important. The LAST matching pattern has the MOST precedence.
# gitignore style patterns are used, not globs.
# https://help.github.com/articles/about-codeowners
# https://git-scm.com/docs/gitignore
# Everything that falls through the cracks:
* @electron/reviewers
# filename patterns
*browser_view* @electron/browserview
*notification* @electron/notifications
*pdf* @electron/printing
*printing* @electron/printing
*updater* @electron/updater
# directories
/.github/ @electron/hubbers
/default_app/ @electron/docs
/docs/ @electron/docs
/docs-translations/ @electron/i18n
/npm/ @electron/hubbers

8
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View File

@@ -0,0 +1,8 @@
<!--
Thank you for your Pull Request. Please provide a description above and review
the requirements below.
Bug fixes and new features should include tests and possibly benchmarks.
Contributors guide: https://github.com/electron/electron/blob/master/CONTRIBUTING.md
-->

31
.github/config.yml vendored Normal file
View File

@@ -0,0 +1,31 @@
# Configuration for new-issue-welcome - https://github.com/behaviorbot/new-issue-welcome
# Comment to be posted to on first time issues
newIssueWelcomeComment: |
👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.
To help make it easier for us to investigate your issue, please follow the [contributing guidelines](https://github.com/electron/electron/blob/master/CONTRIBUTING.md#submitting-issues).
# Configuration for new-pr-welcome - https://github.com/behaviorbot/new-pr-welcome
# Comment to be posted to on PRs from first time contributors in your repository
newPRWelcomeComment: |
💖 Thanks for opening this pull request! 💖
![typing cat](https://user-images.githubusercontent.com/2289/36400158-2c7c589e-1584-11e8-81c7-bd34fd3c392b.gif)
Here is a list of things that will help get it across the finish line:
- Follow the JavaScript, C++, and Python [coding style](https://github.com/electron/electron/blob/master/docs/development/coding-style.md).
- Run `npm run lint` locally to catch formatting errors earlier.
- Document any user-facing changes you've made following the [documentation styleguide](https://github.com/electron/electron/blob/master/docs/styleguide.md).
- Include tests when adding/changing behavior.
- Include screenshots and animated GIFs whenever possible.
We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can.
# Configuration for first-pr-merge - https://github.com/behaviorbot/first-pr-merge
# Comment to be posted to on pull requests merged by a first time user
firstPRMergeComment: >
Congrats on merging your first pull request! 🎉🎉🎉
# It is recommend to include as many gifs and emojis as possible

25
.github/stale.yml vendored Normal file
View File

@@ -0,0 +1,25 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 45
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 7
# Issues with these labels will never be considered stale
exemptLabels:
- fixme/bug
- fixme/crash
- fixme/regression
- fixme/security
- blocked
- blocking-stable
- needs-review
# Label to use when marking an issue as stale
staleLabel: stale
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity and is not currently prioritized. It will be closed
in a week if no further activity occurs :)
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: >
If you still think this issue is relevant, please ping a maintainer or
leave a comment!

13
.gitignore vendored
View File

@@ -1,6 +1,7 @@
.DS_Store
.env
.npmrc
.gclient_done
**/.npmrc
.tags*
.vs/
.vscode/
@@ -14,7 +15,6 @@
*.vcxproj.filters
*.vcxproj.user
*.xcodeproj
node_modules/
/.idea/
/brightray/brightray.opensdf
/brightray/brightray.sdf
@@ -32,12 +32,19 @@ node_modules/
/vendor/debian_jessie_arm-sysroot/
/vendor/debian_jessie_arm64-sysroot/
/vendor/debian_jessie_i386-sysroot/
/vendor/debian_jessie_mips64-sysroot/
/vendor/debian_wheezy_amd64-sysroot/
/vendor/debian_wheezy_arm-sysroot/
/vendor/debian_wheezy_i386-sysroot/
/vendor/gcc-4.8.3-d197-n64-loongson/
/vendor/readme-gcc483-loongson.txt
/vendor/download/
/vendor/llvm-build/
/vendor/llvm/
/vendor/node/deps/node-inspect/.npmrc
/vendor/npm/
/vendor/python_26/
/vendor/native_mksnapshot
/vendor/LICENSES.chromium.html
node_modules/
SHASUMS256.txt
**/package-lock.json

View File

@@ -1 +1 @@
v7.9.0
v8.2.1

6
.remarkrc Normal file
View File

@@ -0,0 +1,6 @@
{
"plugins": [
["remark-lint-code-block-style", "fenced"],
["remark-lint-fenced-code-flag"]
]
}

View File

@@ -5,7 +5,7 @@ notifications:
before_install:
- export BOTO_CONFIG=/dev/null
language: node_js
node_js:
- "4"
@@ -22,6 +22,8 @@ matrix:
env: TARGET_ARCH=arm
- os: linux
env: TARGET_ARCH=ia32
- os: linux
env: TARGET_ARCH=arm64
allow_failures:
- os: osx

View File

@@ -1,4 +1,4 @@
# Contributor Covenant Code of Conduct
# Contributor Covenant Code of Conduct:
## Our Pledge
@@ -34,13 +34,13 @@ This Code of Conduct applies both within project spaces and in public spaces whe
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [electron@github.com](mailto:electron@github.com). All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [coc@electronjs.org](mailto:coc@electronjs.org). All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
This Code of Conduct is adapted from the [Contributor-Covenant][homepage], version 1.4, available at [https://contributor-covenant.org/version/1/4][version]
[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
[homepage]: https://contributor-covenant.org
[version]: https://contributor-covenant.org/version/1/4/

View File

@@ -1,79 +1,56 @@
# Contributing to Electron
:memo: Available Translations: [Korean](https://github.com/electron/electron/tree/master/docs-translations/ko-KR/project/CONTRIBUTING.md) | [Simplified Chinese](https://github.com/electron/electron/tree/master/docs-translations/zh-CN/project/CONTRIBUTING.md) | [Brazilian Portuguese](https://github.com/electron/electron/tree/master/docs-translations/pt-BR/project/CONTRIBUTING.md) | [Dutch](https://github.com/electron/electron/tree/master/docs-translations/nl/project/CONTRIBUTING.md)
:+1::tada: First off, thanks for taking the time to contribute! :tada::+1:
This project adheres to the Contributor Covenant [code of conduct](CODE_OF_CONDUCT.md).
By participating, you are expected to uphold this code. Please report unacceptable
behavior to electron@github.com.
behavior to coc@electronjs.org.
The following is a set of guidelines for contributing to Electron.
These are just guidelines, not rules, use your best judgment and feel free to
propose changes to this document in a pull request.
## Submitting Issues
## [Issues](https://electronjs.org/docs/development/issues)
* You can create an issue [here](https://github.com/electron/electron/issues/new),
but before doing that please read the notes below and include as many details as
possible with your report. If you can, please include:
* The version of Electron you are using
* The operating system you are using
* If applicable, what you were doing when the issue arose and what you
expected to happen
* Other things that will help resolve your issue:
* Screenshots and animated GIFs
* Error output that appears in your terminal, dev tools or as an alert
* Perform a [cursory search](https://github.com/electron/electron/issues?utf8=✓&q=is%3Aissue+)
to see if a similar issue has already been submitted
Issues are created [here](https://github.com/electron/electron/issues/new).
## Submitting Pull Requests
* [How to Contribute in Issues](https://electronjs.org/docs/development/issues#how-to-contribute-in-issues)
* [Asking for General Help](https://electronjs.org/docs/development/issues#asking-for-general-help)
* [Submitting a Bug Report](https://electronjs.org/docs/development/issues#submitting-a-bug-report)
* [Triaging a Bug Report](https://electronjs.org/docs/development/issues#triaging-a-bug-report)
* [Resolving a Bug Report](https://electronjs.org/docs/development/issues#resolving-a-bug-report)
* Include screenshots and animated GIFs in your pull request whenever possible.
* Follow the JavaScript, C++, and Python [coding style defined in docs](/docs/development/coding-style.md).
* Write documentation in [Markdown](https://daringfireball.net/projects/markdown).
See the [Documentation Styleguide](/docs/styleguide.md).
* Use short, present tense commit messages. See [Commit Message Styleguide](#git-commit-messages).
### Issue Maintenance and Closure
* If an issue is inactive for 45 days (no activity of any kind), it will be
marked for closure with `stale`.
* If after this label is applied, no further activity occurs in the next 7 days,
the issue will be closed.
* If an issue has been closed and you still feel it's relevant, feel free to
ping a maintainer or add a comment!
## Styleguides
## [Pull Requests](https://electronjs.org/docs/development/pull-requests)
### General Code
Pull Requests are the way concrete changes are made to the code, documentation,
dependencies, and tools contained in the `electron/electron` repository.
* End files with a newline.
* Place requires in the following order:
* Built in Node Modules (such as `path`)
* Built in Electron Modules (such as `ipc`, `app`)
* Local Modules (using relative paths)
* Place class properties in the following order:
* Class methods and properties (methods starting with a `@`)
* Instance methods and properties
* Avoid platform-dependent code:
* Use `path.join()` to concatenate filenames.
* Use `os.tmpdir()` rather than `/tmp` when you need to reference the
temporary directory.
* Using a plain `return` when returning explicitly at the end of a function.
* Not `return null`, `return undefined`, `null`, or `undefined`
* [Setting up your local environment](https://electronjs.org/docs/development/pull-requests#setting-up-your-local-environment)
* [Step 1: Fork](https://electronjs.org/docs/development/pull-requests#step-1-fork)
* [Step 2: Build](https://electronjs.org/docs/development/pull-requests#step-2-build)
* [Step 3: Branch](https://electronjs.org/docs/development/pull-requests#step-3-branch)
* [The Process of Making Changes](https://electronjs.org/docs/development/pull-requests#the-process-of-making-changes)
* [Step 4: Code](https://electronjs.org/docs/development/pull-requests#step-4-code)
* [Step 5: Commit](https://electronjs.org/docs/development/pull-requests#step-5-commit)
* [Commit message guidelines](https://electronjs.org/docs/development/pull-requests#commit-message-guidelines)
* [Step 6: Rebase](https://electronjs.org/docs/development/pull-requests#step-6-rebase)
* [Step 7: Test](https://electronjs.org/docs/development/pull-requests#step-7-test)
* [Step 8: Push](https://electronjs.org/docs/development/pull-requests#step-8-push)
* [Step 8: Opening the Pull Request](https://electronjs.org/docs/development/pull-requests#step-8-opening-the-pull-request)
* [Step 9: Discuss and Update](#step-9-discuss-and-update)
* [Approval and Request Changes Workflow](https://electronjs.org/docs/development/pull-requests#approval-and-request-changes-workflow)
* [Step 10: Landing](https://electronjs.org/docs/development/pull-requests#step-10-landing)
* [Continuous Integration Testing](https://electronjs.org/docs/development/pull-requests#continuous-integration-testing)
### Git Commit Messages
## Style Guides
See [Coding Style](https://electronjs.org/docs/development/coding-style) for information about which standards Electron adheres to in different parts of its codebase.
* Use the present tense ("Add feature" not "Added feature")
* Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
* Limit the first line to 72 characters or less
* Reference issues and pull requests liberally
* When only changing documentation, include `[ci skip]` in the commit description
* Consider starting the commit message with an applicable emoji:
* :art: `:art:` when improving the format/structure of the code
* :racehorse: `:racehorse:` when improving performance
* :non-potable_water: `:non-potable_water:` when plugging memory leaks
* :memo: `:memo:` when writing docs
* :penguin: `:penguin:` when fixing something on Linux
* :apple: `:apple:` when fixing something on macOS
* :checkered_flag: `:checkered_flag:` when fixing something on Windows
* :bug: `:bug:` when fixing a bug
* :fire: `:fire:` when removing code or files
* :green_heart: `:green_heart:` when fixing the CI build
* :white_check_mark: `:white_check_mark:` when adding tests
* :lock: `:lock:` when dealing with security
* :arrow_up: `:arrow_up:` when upgrading dependencies
* :arrow_down: `:arrow_down:` when downgrading dependencies
* :shirt: `:shirt:` when removing linter warnings

24
Dockerfile Normal file
View File

@@ -0,0 +1,24 @@
FROM electronbuilds/libchromiumcontent:0.0.4
USER root
# Set up HOME directory
ENV HOME=/home
RUN chmod a+rwx /home
# Install node.js
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
RUN apt-get update && apt-get install -y nodejs
# Install wget used by crash reporter
RUN apt-get install -y wget
# Install python-dbusmock
RUN apt-get install -y python-dbusmock
# Install libnotify
RUN apt-get install -y libnotify-bin
# Add xvfb init script
ADD tools/xvfb-init.sh /etc/init.d/xvfb
RUN chmod a+x /etc/init.d/xvfb

35
Dockerfile.arm64 Normal file
View File

@@ -0,0 +1,35 @@
FROM multiarch/debian-debootstrap:arm64-jessie
RUN apt-get update && apt-get install -y\
bison \
build-essential \
clang \
curl \
gperf \
libasound2 \
libasound2-dev \
libcap-dev \
libcups2-dev \
libdbus-1-dev \
libgconf-2-4 \
libgconf2-dev \
libgnome-keyring-dev \
libgtk-3-0 \
libgtk-3-dev \
libnotify-bin \
libnotify-dev \
libnss3 \
libnss3-dev \
libx11-xcb-dev \
libxss1 \
libxtst-dev \
libxtst6 \
python-dbusmock \
wget \
xvfb
ADD tools/xvfb-init.sh /etc/init.d/xvfb
RUN chmod a+x /etc/init.d/xvfb
ADD tools/run-electron.sh /run-electron.sh
RUN chmod a+x /run-electron.sh
CMD sh /run-electron.sh

63
Dockerfile.arm64v8 Normal file
View File

@@ -0,0 +1,63 @@
FROM arm64v8/ubuntu:16.04
RUN groupadd --gid 1000 builduser \
&& useradd --uid 1000 --gid builduser --shell /bin/bash --create-home builduser
RUN groupadd --gid 114 jenkins \
&& useradd --uid 110 --gid jenkins --shell /bin/bash --create-home jenkins
# Set up TEMP directory
ENV TEMP=/tmp
RUN chmod a+rwx /tmp
RUN apt-get update && apt-get install -y\
bison \
build-essential \
clang \
curl \
gperf \
git \
libasound2 \
libasound2-dev \
libcap-dev \
libcups2-dev \
libdbus-1-dev \
libgconf-2-4 \
libgconf2-dev \
libgnome-keyring-dev \
libgtk2.0-0 \
libgtk2.0-dev \
libgtk-3-0 \
libgtk-3-dev \
libnotify-dev \
libnss3 \
libnss3-dev \
libx11-xcb-dev \
libxss1 \
libxtst-dev \
libxtst6 \
lsb-release \
locales \
ninja \
python-setuptools \
python-pip \
python-dbusmock \
wget \
xvfb
# Install node.js
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
RUN apt-get update && apt-get install -y nodejs
# Install crcmod
RUN pip install -U crcmod
ADD tools/xvfb-init.sh /etc/init.d/xvfb
RUN chmod a+x /etc/init.d/xvfb
# Install ninja in /usr/local
RUN cd /usr/local && git clone https://github.com/martine/ninja.git -b v1.5.3
RUN cd /usr/local/ninja && ./configure.py --bootstrap
USER builduser
WORKDIR /home/builduser

36
Dockerfile.armv7 Normal file
View File

@@ -0,0 +1,36 @@
FROM multiarch/debian-debootstrap:armhf-jessie
RUN apt-get update && apt-get install -y\
bison \
build-essential \
clang \
curl \
gperf \
libasound2 \
libasound2-dev \
libcap-dev \
libcups2-dev \
libdbus-1-dev \
libgconf-2-4 \
libgconf2-dev \
libgnome-keyring-dev \
libgtk-3-0 \
libgtk-3-dev \
libnotify-bin \
libnotify-dev \
libnss3 \
libnss3-dev \
libx11-xcb-dev \
libxss1 \
libxtst-dev \
libxtst6 \
python-dbusmock \
git \
wget \
xvfb
ADD tools/xvfb-init.sh /etc/init.d/xvfb
RUN chmod a+x /etc/init.d/xvfb
ADD tools/run-electron.sh /run-electron.sh
RUN chmod a+x /run-electron.sh
CMD sh /run-electron.sh

23
Dockerfile.circleci Normal file
View File

@@ -0,0 +1,23 @@
FROM electronbuilds/libchromiumcontent:0.0.4
USER root
# Install node.js
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
RUN apt-get update && apt-get install -y nodejs
# Install wget used by crash reporter
RUN apt-get install -y wget
# Install python-dbusmock
RUN apt-get install -y python-dbusmock
# Install libnotify
RUN apt-get install -y libnotify-bin
# Add xvfb init script
ADD tools/xvfb-init.sh /etc/init.d/xvfb
RUN chmod a+x /etc/init.d/xvfb
USER builduser
WORKDIR /home/builduser

48
Jenkinsfile vendored Normal file
View File

@@ -0,0 +1,48 @@
pipeline {
agent none
stages {
stage('Build') {
parallel {
stage('electron-osx-x64') {
agent {
label 'osx'
}
steps {
timeout(60) {
sh 'script/bootstrap.py --target_arch=x64 --dev'
sh 'npm run lint'
sh 'script/build.py -c D'
sh 'script/test.py --ci --rebuild_native_modules'
}
}
post {
always {
cleanWs()
}
}
}
stage('electron-mas-x64') {
agent {
label 'osx'
}
environment {
MAS_BUILD = '1'
}
steps {
timeout(60) {
sh 'script/bootstrap.py --target_arch=x64 --dev'
sh 'npm run lint'
sh 'script/build.py -c D'
sh 'script/test.py --ci --rebuild_native_modules'
}
}
post {
always {
cleanWs()
}
}
}
}
}
}
}

36
Jenkinsfile.arm64 Normal file
View File

@@ -0,0 +1,36 @@
pipeline {
agent {
docker {
image 'electronbuilds/arm64v8:0.0.2'
args '--privileged'
}
}
environment {
TARGET_ARCH='arm64'
DISPLAY=':99.0'
MOCHA_TIMEOUT='60000'
}
stages {
stage('Bootstrap') {
steps {
sh 'script/bootstrap.py -v --dev --target_arch=$TARGET_ARCH'
}
}
stage('Build') {
steps {
sh 'script/build.py -c D --ninja-path /usr/local/ninja/ninja'
}
}
stage('Test') {
steps {
sh '/etc/init.d/xvfb start'
sh 'script/test.py --ci'
}
}
}
post {
always {
cleanWs()
}
}
}

View File

@@ -1,4 +1,4 @@
Copyright (c) 2013-2017 GitHub Inc.
Copyright (c) 2013-2018 GitHub Inc.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the

View File

@@ -1,24 +1,27 @@
[![Electron Logo](https://electron.atom.io/images/electron-logo.svg)](https://electron.atom.io/)
[![Electron Logo](https://electronjs.org/images/electron-logo.svg)](https://electronjs.org)
[![Travis Build Status](https://travis-ci.org/electron/electron.svg?branch=master)](https://travis-ci.org/electron/electron)
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/bc56v83355fi3369/branch/master?svg=true)](https://ci.appveyor.com/project/electron-bot/electron/branch/master)
[![CircleCI Build Status](https://circleci.com/gh/electron/electron/tree/master.svg?style=shield)](https://circleci.com/gh/electron/electron/tree/master)
[![AppVeyor Build Status](https://windows-ci.electronjs.org/api/projects/status/nilyf07hcef14dvj/branch/master?svg=true)](https://windows-ci.electronjs.org/project/AppVeyor/electron/branch/master)
[![Jenkins Build Status](https://mac-ci.electronjs.org/buildStatus/icon?job=Electron%20org/electron/master)](https://mac-ci.electronjs.org/blue/organizations/jenkins/Electron%20org%2Felectron/activity?branch=master)
[![devDependency Status](https://david-dm.org/electron/electron/dev-status.svg)](https://david-dm.org/electron/electron?type=dev)
[![Join the Electron Community on Slack](http://atom-slack.herokuapp.com/badge.svg)](http://atom-slack.herokuapp.com/)
[![Join the Electron Community on Slack](https://atom-slack.herokuapp.com/badge.svg)](https://atom-slack.herokuapp.com/)
:memo: Available Translations: [Korean](https://github.com/electron/electron/tree/master/docs-translations/ko-KR/project/README.md) | [Simplified Chinese](https://github.com/electron/electron/tree/master/docs-translations/zh-CN/project/README.md) | [Brazilian Portuguese](https://github.com/electron/electron/tree/master/docs-translations/pt-BR/project/README.md) | [Traditional Chinese](https://github.com/electron/electron/tree/master/docs-translations/zh-TW/project/README.md) | [Spanish](https://github.com/electron/electron/tree/master/docs-translations/es/project/README.md) | [Turkish](https://github.com/electron/electron/tree/master/docs-translations/tr-TR/project/README.md) | [German](https://github.com/electron/electron/tree/master/docs-translations/de-DE/project/README.md)
:memo: Available Translations: 🇨🇳 🇹🇼 🇧🇷 🇪🇸 🇰🇷 🇯🇵 🇷🇺 🇫🇷 🇹🇭 🇳🇱 🇹🇷 🇮🇩 🇺🇦 🇨🇿 🇮🇹.
View these docs in other languages at [electron/electron-i18n](https://github.com/electron/electron-i18n/tree/master/content/).
The Electron framework lets you write cross-platform desktop applications
using JavaScript, HTML and CSS. It is based on [Node.js](https://nodejs.org/) and
[Chromium](http://www.chromium.org) and is used by the [Atom
editor](https://github.com/atom/atom) and many other [apps](https://electron.atom.io/apps).
[Chromium](https://www.chromium.org) and is used by the [Atom
editor](https://github.com/atom/atom) and many other [apps](https://electronjs.org/apps).
Follow [@ElectronJS](https://twitter.com/electronjs) on Twitter for important
announcements.
This project adheres to the Contributor Covenant
This project adheres to the Contributor Covenant
[code of conduct](https://github.com/electron/electron/tree/master/CODE_OF_CONDUCT.md).
By participating, you are expected to uphold this code. Please report unacceptable
behavior to [electron@github.com](mailto:electron@github.com).
behavior to [coc@electronjs.org](mailto:coc@electronjs.org).
## Installation
@@ -32,29 +35,29 @@ npm install electron --save-dev --save-exact
The `--save-exact` flag is recommended as Electron does not follow semantic
versioning. For info on how to manage Electron versions in your apps, see
[Electron versioning](https://electron.atom.io/docs/tutorial/electron-versioning/).
[Electron versioning](docs/tutorial/electron-versioning.md).
For more installation options and troubleshooting tips, see
[installation](https://electron.atom.io/docs/tutorial/installation/).
[installation](docs/tutorial/installation.md).
## Quick Start
## Quick start
Clone and run the
Clone and run the
[electron/electron-quick-start](https://github.com/electron/electron-quick-start)
repository to see a minimal Electron app in action:
```
```sh
git clone https://github.com/electron/electron-quick-start
cd electron-quick-start
npm install
npm start
```
## Resources for Learning Electron
## Resources for learning Electron
- [electron.atom.io/docs](http://electron.atom.io/docs) - all of Electron's documentation
- [electronjs.org/docs](https://electronjs.org/docs) - all of Electron's documentation
- [electron/electron-quick-start](https://github.com/electron/electron-quick-start) - a very basic starter Electron app
- [electron.atom.io/community/#boilerplates](http://electron.atom.io/community/#boilerplates) - sample starter apps created by the community
- [electronjs.org/community#boilerplates](https://electronjs.org/community#boilerplates) - sample starter apps created by the community
- [electron/simple-samples](https://github.com/electron/simple-samples) - small applications with ideas for taking them further
- [electron/electron-api-demos](https://github.com/electron/electron-api-demos) - an Electron app that teaches you how to use Electron
- [hokein/electron-sample-apps](https://github.com/hokein/electron-sample-apps) - small demo apps for the various Electron APIs
@@ -82,36 +85,12 @@ const child = proc.spawn(electron)
## Documentation Translations
- [Brazilian Portuguese](https://github.com/electron/electron/tree/master/docs-translations/pt-BR)
- [Korean](https://github.com/electron/electron/tree/master/docs-translations/ko-KR)
- [Japanese](https://github.com/electron/electron/tree/master/docs-translations/jp)
- [Spanish](https://github.com/electron/electron/tree/master/docs-translations/es)
- [Simplified Chinese](https://github.com/electron/electron/tree/master/docs-translations/zh-CN)
- [Traditional Chinese](https://github.com/electron/electron/tree/master/docs-translations/zh-TW)
- [Turkish](https://github.com/electron/electron/tree/master/docs-translations/tr-TR)
- [Thai](https://github.com/electron/electron/tree/master/docs-translations/th-TH)
- [Ukrainian](https://github.com/electron/electron/tree/master/docs-translations/uk-UA)
- [Russian](https://github.com/electron/electron/tree/master/docs-translations/ru-RU)
- [French](https://github.com/electron/electron/tree/master/docs-translations/fr-FR)
- [Indonesian](https://github.com/electron/electron/tree/master/docs-translations/id)
Find documentation translations in [electron/electron-i18n](https://github.com/electron/electron-i18n).
## Community
You can ask questions and interact with the community in the following
locations:
- [`electron`](http://discuss.atom.io/c/electron) category on the Atom
forums
- `#atom-shell` channel on Freenode
- [`Atom`](http://atom-slack.herokuapp.com/) channel on Slack
- [`electron-ru`](https://telegram.me/electron_ru) *(Russian)*
- [`electron-br`](https://electron-br.slack.com) *(Brazilian Portuguese)*
- [`electron-kr`](http://www.meetup.com/electron-kr/) *(Korean)*
- [`electron-jp`](https://electron-jp.slack.com) *(Japanese)*
- [`electron-tr`](http://electron-tr.herokuapp.com) *(Turkish)*
- [`electron-id`](https://electron-id.slack.com) *(Indonesia)*
Check out [awesome-electron](https://github.com/sindresorhus/awesome-electron)
for a community maintained list of useful example apps, tools and resources.
Info on reporting bugs, getting help, finding third-party tools and sample apps,
and more can be found in the [support document](docs/tutorial/support.md#finding-support).
## License

View File

@@ -2,8 +2,11 @@
The Electron team and community take security bugs in Electron seriously. We appreciate your efforts to responsibly disclose your findings, and will make every effort to acknowledge your contributions.
To report a security issue, email [electron@github.com](mailto:electron@github.com) and include the word "SECURITY" in the subject line.
To report a security issue, email [security@electronjs.org](mailto:security@electronjs.org) and include the word "SECURITY" in the subject line.
The Electron team will send a response indicating the next steps in handling your report. After the initial reply to your report, the security team will keep you informed of the progress towards a fix and full announcement, and may ask for additional information or guidance.
Report security bugs in third-party modules to the person or team maintaining the module. You can also report a vulnerability through the [Node Security Project](https://nodesecurity.io/report).
## Learning More About Security
To learn more about securing an Electron application, please see the [security tutorial](docs/tutorial/security.md).

View File

@@ -1,25 +1,69 @@
# appveyor file
# http://www.appveyor.com/docs/appveyor-yml
version: "{build}"
os: Visual Studio 2015
init:
- git config --global core.autocrlf input
platform:
- x86
- x64
install:
- cmd: SET PATH=C:\Program Files (x86)\MSBuild\14.0\bin\;%PATH%
- cmd: SET PATH=C:\python27;%PATH%
- cmd: python script/cibuild
branches:
only:
- master
# disable build and test phases
build: off
test: off
build_cloud: electron-16
image: electron-16-vs2015
build_script:
- ps: >-
if($env:SKIP_GYP_BUILD -eq "true") {
Write-warning "Skipping debug build for older branch"; Exit-AppveyorBuild
} elseif(($env:APPVEYOR_PULL_REQUEST_HEAD_REPO_NAME -split "/")[0] -eq ($env:APPVEYOR_REPO_NAME -split "/")[0]) {
Write-warning "Skipping PR build for branch"; Exit-AppveyorBuild
} else {
Add-Path "$env:ProgramFiles (x86)\Windows Kits\10\Debuggers\x64"
$env:path = "$env:ProgramFiles (x86)\Windows Kits\10\Debuggers\x64;$env:path"
if($env:APPVEYOR_SCHEDULED_BUILD -eq 'True') {
$env:RUN_RELEASE_BUILD = "1"
}
$Message = (git log --format=%B -n 1 HEAD) | Out-String
if ((Test-Path Env:\RUN_RELEASE_BUILD)) {
$env:ELECTRON_RELEASE = '1'
Write-Output "release build triggered from api"
}
if ((Test-Path Env:\ELECTRON_RELEASE)) {
Write-Output "Running release build"
python script\bootstrap.py --target_arch=$env:TARGET_ARCH
python script\build.py -c R
python script\create-dist.py
} else {
Write-Output "Running debug build"
python script\bootstrap.py --target_arch=$env:TARGET_ARCH --dev
python script\build.py -c D
}
if ($? -ne 'True') {
throw "Build failed with exit code $?"
} else {
"Build succeeded."
}
Push-AppveyorArtifact out
}
test_script:
- ps: >-
if (Test-Path Env:\ELECTRON_RELEASE) {
Write-Output "Skipping tests for release build"
} else {
Write-Output "Running tests for debug build"
python script\test.py --ci --rebuild_native_modules
if ($LASTEXITCODE -ne '0') {
throw "Tests failed with exit code $LASTEXITCODE"
} else {
Write-Output "Tests succeeded."
}
python script\verify-ffmpeg.py
if ($LASTEXITCODE -ne '0') {
throw "Verify ffmpeg failed with exit code $LASTEXITCODE"
} else {
"Verify ffmpeg succeeded."
}
}
artifacts:
- path: test-results.xml
name: test-results.xml
deploy_script:
- ps: >-
if (Test-Path Env:\ELECTRON_RELEASE) {
if (Test-Path Env:\RUN_RELEASE_BUILD) {
Write-Output "Uploading Electron release distribution to s3"
& python script\upload.py --upload_to_s3
} else {
Write-Output "Uploading Electron release distribution to github releases"
& python script\upload.py
}
}

View File

@@ -10,7 +10,7 @@
#if defined(OS_MACOSX)
extern "C" {
__attribute__((visibility("default")))
int AtomMain(int argc, const char* argv[]);
int AtomMain(int argc, char* argv[]);
__attribute__((visibility("default")))
int AtomInitializeICUandStartNode(int argc, char *argv[]);

View File

@@ -15,11 +15,11 @@
#include "content/public/app/content_main.h"
#if defined(OS_MACOSX)
int AtomMain(int argc, const char* argv[]) {
int AtomMain(int argc, char* argv[]) {
atom::AtomMainDelegate delegate;
content::ContentMainParams params(&delegate);
params.argc = argc;
params.argv = argv;
params.argv = const_cast<const char**>(argv);
atom::AtomCommandLine::Init(argc, argv);
return content::ContentMain(params);
}

View File

@@ -0,0 +1,11 @@
#import <Cocoa/Cocoa.h>
int main(int argc, char* argv[]) {
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
NSArray* pathComponents = [[[NSBundle mainBundle] bundlePath] pathComponents];
pathComponents = [pathComponents subarrayWithRange:NSMakeRange(0, [pathComponents count] - 4)];
NSString* path = [NSString pathWithComponents:pathComponents];
[[NSWorkspace sharedWorkspace] launchApplication:path];
[pool drain];
return 0;
}

View File

@@ -4,19 +4,23 @@
#include "atom/app/atom_main.h"
#include <stdlib.h>
#include <cstdlib>
#include <vector>
#if defined(OS_WIN)
#include <windows.h> // windows.h must be included first
#include <atlbase.h> // ensures that ATL statics like `_AtlWinModule` are initialized (it's an issue in static debug build)
#include <shellapi.h>
#include <shellscalingapi.h>
#include <tchar.h>
#include "atom/app/atom_main_delegate.h"
#include "atom/app/command_line_args.h"
#include "atom/common/crash_reporter/win/crash_service_main.h"
#include "base/environment.h"
#include "base/process/launch.h"
#include "base/strings/utf_string_conversions.h"
#include "base/win/windows_version.h"
#include "content/public/app/sandbox_helper_win.h"
#include "sandbox/win/src/sandbox_types.h"
@@ -34,7 +38,9 @@
namespace {
const char* kRunAsNode = "ELECTRON_RUN_AS_NODE";
#ifdef ENABLE_RUN_AS_NODE
const auto kRunAsNode = "ELECTRON_RUN_AS_NODE";
#endif
bool IsEnvSet(const char* name) {
#if defined(OS_WIN)
@@ -51,59 +57,91 @@ bool IsEnvSet(const char* name) {
#if defined(OS_WIN)
int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE, wchar_t* cmd, int) {
int argc = 0;
wchar_t** wargv = ::CommandLineToArgvW(::GetCommandLineW(), &argc);
struct Arguments {
int argc = 0;
wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc);
~Arguments() { LocalFree(argv); }
} arguments;
if (!arguments.argv)
return -1;
#ifdef _DEBUG
// Don't display assert dialog boxes in CI test runs
static const auto kCI = "ELECTRON_CI";
bool is_ci = IsEnvSet(kCI);
if (!is_ci) {
for (int i = 0; i < arguments.argc; ++i) {
if (!_wcsicmp(arguments.argv[i], L"--ci")) {
is_ci = true;
_putenv_s(kCI, "1"); // set flag for child processes
break;
}
}
}
if (is_ci) {
_CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_DEBUG | _CRTDBG_MODE_FILE);
_CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR);
_CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_DEBUG | _CRTDBG_MODE_FILE);
_CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);
_set_error_mode(_OUT_TO_STDERR);
}
#endif
#ifdef ENABLE_RUN_AS_NODE
bool run_as_node = IsEnvSet(kRunAsNode);
#else
bool run_as_node = false;
#endif
// Make sure the output is printed to console.
if (run_as_node || !IsEnvSet("ELECTRON_NO_ATTACH_CONSOLE"))
base::RouteStdioToConsole(false);
// Convert argv to to UTF8
char** argv = new char*[argc];
for (int i = 0; i < argc; i++) {
// Compute the size of the required buffer
DWORD size = WideCharToMultiByte(CP_UTF8,
0,
wargv[i],
-1,
NULL,
0,
NULL,
NULL);
if (size == 0) {
// This should never happen.
fprintf(stderr, "Could not convert arguments to utf8.");
exit(1);
}
// Do the actual conversion
argv[i] = new char[size];
DWORD result = WideCharToMultiByte(CP_UTF8,
0,
wargv[i],
-1,
argv[i],
size,
NULL,
NULL);
if (result == 0) {
// This should never happen.
fprintf(stderr, "Could not convert arguments to utf8.");
exit(1);
}
}
#ifndef DEBUG
// Chromium has its own TLS subsystem which supports automatic destruction
// of thread-local data, and also depends on memory allocation routines
// provided by the CRT. The problem is that the auto-destruction mechanism
// uses a hidden feature of the OS loader which calls a callback on thread
// exit, but only after all loaded DLLs have been detached. Since the CRT is
// also a DLL, it happens that by the time Chromium's `OnThreadExit` function
// is called, the heap functions, though still in memory, no longer perform
// their duties, and when Chromium calls `free` on its buffer, it triggers
// an access violation error.
// We work around this problem by invoking Chromium's `OnThreadExit` in time
// from within the CRT's atexit facility, ensuring the heap functions are
// still active. The second invocation from the OS loader will be a no-op.
extern void NTAPI OnThreadExit(PVOID module, DWORD reason, PVOID reserved);
atexit([]() {
OnThreadExit(nullptr, DLL_THREAD_DETACH, nullptr);
});
#endif
#ifdef ENABLE_RUN_AS_NODE
if (run_as_node) {
// Now that argv conversion is done, we can finally start.
std::vector<char*> argv(arguments.argc);
std::transform(
arguments.argv, arguments.argv + arguments.argc, argv.begin(),
[](auto& a) { return _strdup(base::WideToUTF8(a).c_str()); });
base::AtExitManager atexit_manager;
base::i18n::InitializeICU();
return atom::NodeMain(argc, argv);
} else if (IsEnvSet("ELECTRON_INTERNAL_CRASH_SERVICE")) {
auto ret = atom::NodeMain(argv.size(), argv.data());
std::for_each(argv.begin(), argv.end(), free);
return ret;
}
#endif
if (IsEnvSet("ELECTRON_INTERNAL_CRASH_SERVICE")) {
return crash_service::Main(cmd);
}
if (!atom::CheckCommandLineArguments(arguments.argc, arguments.argv))
return -1;
sandbox::SandboxInterfaceInfo sandbox_info = {0};
content::InitializeSandboxInfo(&sandbox_info);
atom::AtomMainDelegate delegate;
@@ -111,34 +149,37 @@ int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE, wchar_t* cmd, int) {
content::ContentMainParams params(&delegate);
params.instance = instance;
params.sandbox_info = &sandbox_info;
atom::AtomCommandLine::Init(argc, argv);
atom::AtomCommandLine::InitW(argc, wargv);
atom::AtomCommandLine::Init(arguments.argc, arguments.argv);
return content::ContentMain(params);
}
#elif defined(OS_LINUX) // defined(OS_WIN)
int main(int argc, const char* argv[]) {
int main(int argc, char* argv[]) {
#ifdef ENABLE_RUN_AS_NODE
if (IsEnvSet(kRunAsNode)) {
base::i18n::InitializeICU();
base::AtExitManager atexit_manager;
return atom::NodeMain(argc, const_cast<char**>(argv));
return atom::NodeMain(argc, argv);
}
#endif
atom::AtomMainDelegate delegate;
content::ContentMainParams params(&delegate);
params.argc = argc;
params.argv = argv;
params.argv = const_cast<const char**>(argv);
atom::AtomCommandLine::Init(argc, argv);
return content::ContentMain(params);
}
#else // defined(OS_LINUX)
int main(int argc, const char* argv[]) {
int main(int argc, char* argv[]) {
#ifdef ENABLE_RUN_AS_NODE
if (IsEnvSet(kRunAsNode)) {
return AtomInitializeICUandStartNode(argc, const_cast<char**>(argv));
return AtomInitializeICUandStartNode(argc, argv);
}
#endif
return AtomMain(argc, argv);
}

View File

@@ -21,9 +21,18 @@
#include "base/logging.h"
#include "chrome/common/chrome_paths.h"
#include "content/public/common/content_switches.h"
#include "ipc/ipc_features.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
#if BUILDFLAG(IPC_MESSAGE_LOG_ENABLED)
#define IPC_MESSAGE_MACROS_LOG_ENABLED
#include "content/public/common/content_ipc_logging.h"
#define IPC_LOG_TABLE_ADD_ENTRY(msg_id, logger) \
content::RegisterIPCLogger(msg_id, logger)
#include "atom/common/common_message_generator.h"
#endif
namespace atom {
namespace {
@@ -86,9 +95,10 @@ bool AtomMainDelegate::BasicStartupComplete(int* exit_code) {
logging::SetLogItems(true, false, true, false);
// Enable convient stack printing.
bool enable_stack_dumping = env->HasVar("ELECTRON_ENABLE_STACK_DUMPING");
#if defined(DEBUG) && defined(OS_LINUX)
enable_stack_dumping = true;
bool enable_stack_dumping = true;
#else
bool enable_stack_dumping = env->HasVar("ELECTRON_ENABLE_STACK_DUMPING");
#endif
if (enable_stack_dumping)
base::debug::EnableInProcessStackDumping();

View File

@@ -44,7 +44,6 @@ class AtomMainDelegate : public brightray::MainDelegate {
void SetUpBundleOverrides();
#endif
brightray::ContentClient content_client_;
std::unique_ptr<content::ContentBrowserClient> browser_client_;
std::unique_ptr<content::ContentRendererClient> renderer_client_;
std::unique_ptr<content::ContentUtilityClient> utility_client_;

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,17 @@
// Copyright (c) 2018 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef ATOM_APP_COMMAND_LINE_ARGS_H_
#define ATOM_APP_COMMAND_LINE_ARGS_H_
#include "base/command_line.h"
namespace atom {
bool CheckCommandLineArguments(int argc, base::CommandLine::CharType** argv);
} // namespace atom
#endif // ATOM_APP_COMMAND_LINE_ARGS_H_

View File

@@ -2,6 +2,8 @@
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifdef ENABLE_RUN_AS_NODE
#include "atom/app/node_main.h"
#include "atom/app/uv_task_runner.h"
@@ -12,6 +14,7 @@
#include "atom/common/native_mate_converters/string16_converter.h"
#include "base/command_line.h"
#include "base/feature_list.h"
#include "base/task_scheduler/task_scheduler.h"
#include "base/threading/thread_task_runner_handle.h"
#include "gin/array_buffer.h"
#include "gin/public/isolate_holder.h"
@@ -40,6 +43,11 @@ int NodeMain(int argc, char *argv[]) {
gin::V8Initializer::LoadV8Snapshot();
gin::V8Initializer::LoadV8Natives();
// V8 requires a task scheduler apparently
base::TaskScheduler::CreateAndStartWithDefaultParams("Electron");
// Initialize gin::IsolateHolder.
JavascriptEnvironment gin_env;
int exec_argc;
@@ -53,7 +61,7 @@ int NodeMain(int argc, char *argv[]) {
// Enable support for v8 inspector.
NodeDebugger node_debugger(env);
node_debugger.Start();
node_debugger.Start(gin_env.platform());
mate::Dictionary process(gin_env.isolate(), env->process_object());
#if defined(OS_WIN)
@@ -88,9 +96,18 @@ int NodeMain(int argc, char *argv[]) {
node::FreeEnvironment(env);
}
// According to "src/gin/shell/gin_main.cc":
//
// gin::IsolateHolder waits for tasks running in TaskScheduler in its
// destructor and thus must be destroyed before TaskScheduler starts skipping
// CONTINUE_ON_SHUTDOWN tasks.
base::TaskScheduler::GetInstance()->Shutdown();
v8::V8::Dispose();
return exit_code;
}
} // namespace atom
#endif // ENABLE_RUN_AS_NODE

View File

@@ -5,10 +5,14 @@
#ifndef ATOM_APP_NODE_MAIN_H_
#define ATOM_APP_NODE_MAIN_H_
#ifdef ENABLE_RUN_AS_NODE
namespace atom {
int NodeMain(int argc, char *argv[]);
} // namespace atom
#endif // ENABLE_RUN_AS_NODE
#endif // ATOM_APP_NODE_MAIN_H_

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleIdentifier</key>
<string>${ATOM_BUNDLE_ID}</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundleExecutable</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>LSBackgroundOnly</key>
<true/>
</dict>
</plist>

View File

@@ -2,6 +2,8 @@
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include <utility>
#include "atom/app/uv_task_runner.h"
#include "base/stl_util.h"
@@ -19,25 +21,25 @@ UvTaskRunner::~UvTaskRunner() {
}
bool UvTaskRunner::PostDelayedTask(const tracked_objects::Location& from_here,
const base::Closure& task,
base::OnceClosure task,
base::TimeDelta delay) {
auto* timer = new uv_timer_t;
timer->data = this;
uv_timer_init(loop_, timer);
uv_timer_start(timer, UvTaskRunner::OnTimeout, delay.InMilliseconds(), 0);
tasks_[timer] = task;
tasks_[timer] = std::move(task);
return true;
}
bool UvTaskRunner::RunsTasksOnCurrentThread() const {
bool UvTaskRunner::RunsTasksInCurrentSequence() const {
return true;
}
bool UvTaskRunner::PostNonNestableDelayedTask(
const tracked_objects::Location& from_here,
const base::Closure& task,
base::OnceClosure task,
base::TimeDelta delay) {
return PostDelayedTask(from_here, task, delay);
return PostDelayedTask(from_here, std::move(task), delay);
}
// static
@@ -46,7 +48,7 @@ void UvTaskRunner::OnTimeout(uv_timer_t* timer) {
if (!ContainsKey(self->tasks_, timer))
return;
self->tasks_[timer].Run();
std::move(self->tasks_[timer]).Run();
self->tasks_.erase(timer);
uv_timer_stop(timer);
uv_close(reinterpret_cast<uv_handle_t*>(timer), UvTaskRunner::OnClose);

View File

@@ -21,12 +21,12 @@ class UvTaskRunner : public base::SingleThreadTaskRunner {
// base::SingleThreadTaskRunner:
bool PostDelayedTask(const tracked_objects::Location& from_here,
const base::Closure& task,
base::OnceClosure task,
base::TimeDelta delay) override;
bool RunsTasksOnCurrentThread() const override;
bool RunsTasksInCurrentSequence() const override;
bool PostNonNestableDelayedTask(
const tracked_objects::Location& from_here,
const base::Closure& task,
base::OnceClosure task,
base::TimeDelta delay) override;
private:
@@ -35,7 +35,7 @@ class UvTaskRunner : public base::SingleThreadTaskRunner {
uv_loop_t* loop_;
std::map<uv_timer_t*, base::Closure> tasks_;
std::map<uv_timer_t*, base::OnceClosure> tasks_;
DISALLOW_COPY_AND_ASSIGN(UvTaskRunner);
};

View File

@@ -45,6 +45,7 @@
#include "content/public/common/content_switches.h"
#include "media/audio/audio_manager.h"
#include "native_mate/object_template_builder.h"
#include "net/ssl/client_cert_identity.h"
#include "net/ssl/ssl_cert_request_info.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/gfx/image/image.h"
@@ -54,6 +55,10 @@
#include "base/strings/utf_string_conversions.h"
#endif
#if defined(OS_MACOSX)
#include "atom/browser/ui/cocoa/atom_bundle_mover.h"
#endif
using atom::Browser;
namespace mate {
@@ -371,6 +376,8 @@ int GetPathConstant(const std::string& name) {
return brightray::DIR_CACHE;
else if (name == "userCache")
return brightray::DIR_USER_CACHE;
else if (name == "logs")
return brightray::DIR_APP_LOGS;
else if (name == "home")
return base::DIR_HOME;
else if (name == "temp")
@@ -414,19 +421,26 @@ bool NotificationCallbackWrapper(
return !Browser::Get()->is_shutting_down();
}
void GotPrivateKey(std::shared_ptr<content::ClientCertificateDelegate> delegate,
scoped_refptr<net::X509Certificate> cert,
scoped_refptr<net::SSLPrivateKey> private_key) {
delegate->ContinueWithCertificate(cert, private_key);
}
void OnClientCertificateSelected(
v8::Isolate* isolate,
std::shared_ptr<content::ClientCertificateDelegate> delegate,
std::shared_ptr<net::ClientCertIdentityList> identities,
mate::Arguments* args) {
if (args->Length() == 2) {
delegate->ContinueWithCertificate(nullptr);
delegate->ContinueWithCertificate(nullptr, nullptr);
return;
}
v8::Local<v8::Value> val;
args->GetNext(&val);
if (val->IsNull()) {
delegate->ContinueWithCertificate(nullptr);
delegate->ContinueWithCertificate(nullptr, nullptr);
return;
}
@@ -442,8 +456,17 @@ void OnClientCertificateSelected(
auto certs = net::X509Certificate::CreateCertificateListFromBytes(
data.c_str(), data.length(), net::X509Certificate::FORMAT_AUTO);
if (!certs.empty())
delegate->ContinueWithCertificate(certs[0].get());
if (!certs.empty()) {
scoped_refptr<net::X509Certificate> cert(certs[0].get());
for (size_t i = 0; i < identities->size(); ++i) {
if (cert->Equals((*identities)[i]->certificate())) {
net::ClientCertIdentity::SelfOwningAcquirePrivateKey(
std::move((*identities)[i]),
base::Bind(&GotPrivateKey, delegate, std::move(cert)));
break;
}
}
}
}
void PassLoginInformation(scoped_refptr<LoginHandler> login_handler,
@@ -509,7 +532,6 @@ App::App(v8::Isolate* isolate) {
static_cast<AtomBrowserClient*>(AtomBrowserClient::Get())->set_delegate(this);
Browser::Get()->AddObserver(this);
content::GpuDataManager::GetInstance()->AddObserver(this);
content::BrowserChildProcessObserver::Add(this);
base::ProcessId pid = base::GetCurrentProcId();
std::unique_ptr<atom::ProcessMetric> process_metric(
new atom::ProcessMetric(
@@ -575,11 +597,30 @@ void App::OnFinishLaunching(const base::DictionaryValue& launch_info) {
Emit("ready", launch_info);
}
void App::OnPreMainMessageLoopRun() {
content::BrowserChildProcessObserver::Add(this);
if (process_singleton_) {
process_singleton_->OnBrowserReady();
}
}
void App::OnAccessibilitySupportChanged() {
Emit("accessibility-support-changed", IsAccessibilitySupportEnabled());
}
#if defined(OS_MACOSX)
void App::OnWillContinueUserActivity(
bool* prevent_default,
const std::string& type) {
*prevent_default = Emit("will-continue-activity", type);
}
void App::OnDidFailToContinueUserActivity(
const std::string& type,
const std::string& error) {
Emit("continue-activity-error", type, error);
}
void App::OnContinueUserActivity(
bool* prevent_default,
const std::string& type,
@@ -587,50 +628,72 @@ void App::OnContinueUserActivity(
*prevent_default = Emit("continue-activity", type, user_info);
}
void App::OnUserActivityWasContinued(
const std::string& type,
const base::DictionaryValue& user_info) {
Emit("activity-was-continued", type, user_info);
}
void App::OnUpdateUserActivityState(
bool* prevent_default,
const std::string& type,
const base::DictionaryValue& user_info) {
*prevent_default = Emit("update-activity-state", type, user_info);
}
void App::OnNewWindowForTab() {
Emit("new-window-for-tab");
}
#endif
void App::OnLogin(LoginHandler* login_handler,
const base::DictionaryValue& request_details) {
v8::Locker locker(isolate());
v8::HandleScope handle_scope(isolate());
bool prevent_default = Emit(
"login",
WebContents::CreateFrom(isolate(), login_handler->GetWebContents()),
request_details,
login_handler->auth_info(),
base::Bind(&PassLoginInformation, make_scoped_refptr(login_handler)));
bool prevent_default = false;
content::WebContents* web_contents = login_handler->GetWebContents();
if (web_contents) {
prevent_default =
Emit("login",
WebContents::CreateFrom(isolate(), web_contents),
request_details,
login_handler->auth_info(),
base::Bind(&PassLoginInformation,
make_scoped_refptr(login_handler)));
}
// Default behavior is to always cancel the auth.
if (!prevent_default)
login_handler->CancelAuth();
}
void App::OnCreateWindow(
bool App::CanCreateWindow(
content::RenderFrameHost* opener,
const GURL& opener_url,
const GURL& opener_top_level_frame_url,
const GURL& source_origin,
content::mojom::WindowContainerType container_type,
const GURL& target_url,
const content::Referrer& referrer,
const std::string& frame_name,
WindowOpenDisposition disposition,
const std::vector<std::string>& features,
const scoped_refptr<content::ResourceRequestBodyImpl>& body,
int render_process_id,
int render_frame_id) {
const blink::mojom::WindowFeatures& features,
const std::vector<std::string>& additional_features,
const scoped_refptr<content::ResourceRequestBody>& body,
bool user_gesture,
bool opener_suppressed,
bool* no_javascript_access) {
v8::Locker locker(isolate());
v8::HandleScope handle_scope(isolate());
content::RenderFrameHost* rfh =
content::RenderFrameHost::FromID(render_process_id, render_frame_id);
content::WebContents* web_contents =
content::WebContents::FromRenderFrameHost(rfh);
content::WebContents::FromRenderFrameHost(opener);
if (web_contents) {
auto api_web_contents = WebContents::CreateFrom(isolate(), web_contents);
api_web_contents->OnCreateWindow(target_url,
frame_name,
disposition,
features,
body);
api_web_contents->OnCreateWindow(target_url, frame_name, disposition,
additional_features, body);
}
return false;
}
void App::AllowCertificateError(
@@ -661,22 +724,35 @@ void App::AllowCertificateError(
void App::SelectClientCertificate(
content::WebContents* web_contents,
net::SSLCertRequestInfo* cert_request_info,
net::ClientCertIdentityList identities,
std::unique_ptr<content::ClientCertificateDelegate> delegate) {
std::shared_ptr<content::ClientCertificateDelegate>
shared_delegate(delegate.release());
// Convert the ClientCertIdentityList to a CertificateList
// to avoid changes in the API.
auto client_certs = net::CertificateList();
for (const std::unique_ptr<net::ClientCertIdentity>& identity : identities)
client_certs.push_back(identity->certificate());
auto shared_identities =
std::make_shared<net::ClientCertIdentityList>(std::move(identities));
bool prevent_default =
Emit("select-client-certificate",
WebContents::CreateFrom(isolate(), web_contents),
cert_request_info->host_and_port.ToString(),
cert_request_info->client_certs,
base::Bind(&OnClientCertificateSelected,
isolate(),
shared_delegate));
cert_request_info->host_and_port.ToString(), std::move(client_certs),
base::Bind(&OnClientCertificateSelected, isolate(), shared_delegate,
shared_identities));
// Default to first certificate from the platform store.
if (!prevent_default)
shared_delegate->ContinueWithCertificate(
cert_request_info->client_certs[0].get());
if (!prevent_default) {
scoped_refptr<net::X509Certificate> cert =
(*shared_identities)[0]->certificate();
net::ClientCertIdentity::SelfOwningAcquirePrivateKey(
std::move((*shared_identities)[0]),
base::Bind(&GotPrivateKey, shared_delegate, std::move(cert)));
}
}
void App::OnGpuProcessCrashed(base::TerminationStatus status) {
@@ -775,7 +851,7 @@ void App::SetDesktopName(const std::string& desktop_name) {
}
std::string App::GetLocale() {
return l10n_util::GetApplicationLocale("");
return g_browser_process->GetApplicationLocale();
}
bool App::MakeSingleInstance(
@@ -791,9 +867,10 @@ bool App::MakeSingleInstance(
switch (process_singleton_->NotifyOtherProcessOrCreate()) {
case ProcessSingleton::NotifyResult::LOCK_ERROR:
case ProcessSingleton::NotifyResult::PROFILE_IN_USE:
case ProcessSingleton::NotifyResult::PROCESS_NOTIFIED:
case ProcessSingleton::NotifyResult::PROCESS_NOTIFIED: {
process_singleton_.reset();
return true;
}
case ProcessSingleton::NotifyResult::PROCESS_NONE:
default: // Shouldn't be needed, but VS warns if it is not there.
return false;
@@ -820,11 +897,7 @@ bool App::Relaunch(mate::Arguments* js_args) {
}
if (!override_argv) {
#if defined(OS_WIN)
const relauncher::StringVector& argv = atom::AtomCommandLine::wargv();
#else
const relauncher::StringVector& argv = atom::AtomCommandLine::argv();
#endif
return relauncher::RelaunchApp(argv);
}
@@ -869,6 +942,16 @@ bool App::IsAccessibilitySupportEnabled() {
return ax_state->IsAccessibleBrowser();
}
void App::SetAccessibilitySupportEnabled(bool enabled) {
auto ax_state = content::BrowserAccessibilityState::GetInstance();
if (enabled) {
ax_state->OnScreenReaderDetected();
} else {
ax_state->DisableAccessibility();
}
Browser::Get()->OnAccessibilitySupportChanged();
}
Browser::LoginItemSettings App::GetLoginItemSettings(mate::Arguments* args) {
Browser::LoginItemSettings options;
args->GetNext(&options);
@@ -1027,8 +1110,17 @@ std::vector<mate::Dictionary> App::GetAppMetrics(v8::Isolate* isolate) {
cpu_dict.Set("percentCPUUsage",
process_metric.second->metrics->GetPlatformIndependentCPUUsage()
/ processor_count);
#if !defined(OS_WIN)
cpu_dict.Set("idleWakeupsPerSecond",
process_metric.second->metrics->GetIdleWakeupsPerSecond());
#else
// Chrome's underlying process_metrics.cc will throw a non-fatal warning
// that this method isn't implemented on Windows, so set it to 0 instead
// of calling it
cpu_dict.Set("idleWakeupsPerSecond", 0);
#endif
pid_dict.Set("cpu", cpu_dict);
pid_dict.Set("pid", process_metric.second->pid);
pid_dict.Set("type",
@@ -1072,6 +1164,16 @@ void App::EnableMixedSandbox(mate::Arguments* args) {
command_line->AppendSwitch(switches::kEnableMixedSandbox);
}
#if defined(OS_MACOSX)
bool App::MoveToApplicationsFolder(mate::Arguments* args) {
return ui::cocoa::AtomBundleMover::Move(args);
}
bool App::IsInApplicationsFolder() {
return ui::cocoa::AtomBundleMover::IsCurrentAppInApplicationsFolder();
}
#endif
// static
mate::Handle<App> App::Create(v8::Isolate* isolate) {
return mate::CreateHandle(isolate, new App(isolate));
@@ -1115,6 +1217,10 @@ void App::BuildPrototype(
base::Bind(&Browser::SetUserActivity, browser))
.SetMethod("getCurrentActivityType",
base::Bind(&Browser::GetCurrentActivityType, browser))
.SetMethod("invalidateCurrentActivity",
base::Bind(&Browser::InvalidateCurrentActivity, browser))
.SetMethod("updateCurrentActivity",
base::Bind(&Browser::UpdateCurrentActivity, browser))
.SetMethod("setAboutPanelOptions",
base::Bind(&Browser::SetAboutPanelOptions, browser))
#endif
@@ -1141,6 +1247,8 @@ void App::BuildPrototype(
.SetMethod("relaunch", &App::Relaunch)
.SetMethod("isAccessibilitySupportEnabled",
&App::IsAccessibilitySupportEnabled)
.SetMethod("setAccessibilitySupportEnabled",
&App::SetAccessibilitySupportEnabled)
.SetMethod("disableHardwareAcceleration",
&App::DisableHardwareAcceleration)
.SetMethod("disableDomainBlockingFor3DAPIs",
@@ -1148,9 +1256,16 @@ void App::BuildPrototype(
.SetMethod("getFileIcon", &App::GetFileIcon)
.SetMethod("getAppMetrics", &App::GetAppMetrics)
.SetMethod("getGPUFeatureStatus", &App::GetGPUFeatureStatus)
.SetMethod("enableMixedSandbox", &App::EnableMixedSandbox)
// TODO(juturu): Remove in 2.0, deprecate before then with warnings
.SetMethod("getAppMemoryInfo", &App::GetAppMetrics);
#if defined(OS_MACOSX)
.SetMethod("moveToApplicationsFolder", &App::MoveToApplicationsFolder)
.SetMethod("isInApplicationsFolder", &App::IsInApplicationsFolder)
#endif
#if defined(MAS_BUILD)
.SetMethod("startAccessingSecurityScopedResource",
&App::StartAccessingSecurityScopedResource)
#endif
.SetMethod("enableMixedSandbox", &App::EnableMixedSandbox);
}
} // namespace api

View File

@@ -25,6 +25,7 @@
#include "native_mate/dictionary.h"
#include "native_mate/handle.h"
#include "net/base/completion_callback.h"
#include "net/ssl/client_cert_identity.h"
#if defined(USE_NSS_CERTS)
#include "chrome/browser/certificate_manager_model.h"
@@ -74,16 +75,6 @@ class App : public AtomBrowserClient::Delegate,
static void BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::FunctionTemplate> prototype);
// Called when window with disposition needs to be created.
void OnCreateWindow(
const GURL& target_url,
const std::string& frame_name,
WindowOpenDisposition disposition,
const std::vector<std::string>& features,
const scoped_refptr<content::ResourceRequestBodyImpl>& body,
int render_process_id,
int render_frame_id);
#if defined(USE_NSS_CERTS)
void OnCertificateManagerModelCreated(
std::unique_ptr<base::DictionaryValue> options,
@@ -94,6 +85,7 @@ class App : public AtomBrowserClient::Delegate,
base::FilePath GetAppPath() const;
void RenderProcessReady(content::RenderProcessHost* host);
void RenderProcessDisconnected(base::ProcessId host_pid);
void PreMainMessageLoopRun();
protected:
explicit App(v8::Isolate* isolate);
@@ -112,12 +104,25 @@ class App : public AtomBrowserClient::Delegate,
void OnLogin(LoginHandler* login_handler,
const base::DictionaryValue& request_details) override;
void OnAccessibilitySupportChanged() override;
void OnPreMainMessageLoopRun() override;
#if defined(OS_MACOSX)
void OnWillContinueUserActivity(
bool* prevent_default,
const std::string& type) override;
void OnDidFailToContinueUserActivity(
const std::string& type,
const std::string& error) override;
void OnContinueUserActivity(
bool* prevent_default,
const std::string& type,
const base::DictionaryValue& user_info) override;
void OnUserActivityWasContinued(
const std::string& type,
const base::DictionaryValue& user_info) override;
void OnUpdateUserActivityState(
bool* prevent_default,
const std::string& type,
const base::DictionaryValue& user_info) override;
void OnNewWindowForTab() override;
#endif
@@ -136,7 +141,23 @@ class App : public AtomBrowserClient::Delegate,
void SelectClientCertificate(
content::WebContents* web_contents,
net::SSLCertRequestInfo* cert_request_info,
net::ClientCertIdentityList client_certs,
std::unique_ptr<content::ClientCertificateDelegate> delegate) override;
bool CanCreateWindow(content::RenderFrameHost* opener,
const GURL& opener_url,
const GURL& opener_top_level_frame_url,
const GURL& source_origin,
content::mojom::WindowContainerType container_type,
const GURL& target_url,
const content::Referrer& referrer,
const std::string& frame_name,
WindowOpenDisposition disposition,
const blink::mojom::WindowFeatures& features,
const std::vector<std::string>& additional_features,
const scoped_refptr<content::ResourceRequestBody>& body,
bool user_gesture,
bool opener_suppressed,
bool* no_javascript_access) override;
// content::GpuDataManagerObserver:
void OnGpuProcessCrashed(base::TerminationStatus status) override;
@@ -171,6 +192,7 @@ class App : public AtomBrowserClient::Delegate,
void DisableHardwareAcceleration(mate::Arguments* args);
void DisableDomainBlockingFor3DAPIs(mate::Arguments* args);
bool IsAccessibilitySupportEnabled();
void SetAccessibilitySupportEnabled(bool enabled);
Browser::LoginItemSettings GetLoginItemSettings(mate::Arguments* args);
#if defined(USE_NSS_CERTS)
void ImportCertificate(const base::DictionaryValue& options,
@@ -183,6 +205,15 @@ class App : public AtomBrowserClient::Delegate,
v8::Local<v8::Value> GetGPUFeatureStatus(v8::Isolate* isolate);
void EnableMixedSandbox(mate::Arguments* args);
#if defined(OS_MACOSX)
bool MoveToApplicationsFolder(mate::Arguments* args);
bool IsInApplicationsFolder();
#endif
#if defined(MAS_BUILD)
base::Callback<void()> StartAccessingSecurityScopedResource(
mate::Arguments* args);
#endif
#if defined(OS_WIN)
// Get the current Jump List settings.
v8::Local<v8::Value> GetJumpListSettings();

View File

@@ -0,0 +1,59 @@
// Copyright (c) 2013 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "atom/browser/api/atom_api_app.h"
#import <Cocoa/Cocoa.h>
#include "base/strings/sys_string_conversions.h"
namespace atom {
namespace api {
// Callback passed to js which will stop accessing the given bookmark.
void OnStopAccessingSecurityScopedResource(NSURL* bookmarkUrl) {
[bookmarkUrl stopAccessingSecurityScopedResource];
[bookmarkUrl release];
}
// Get base64 encoded NSData, create a bookmark for it and start accessing it.
base::Callback<void ()> App::StartAccessingSecurityScopedResource(mate::Arguments* args) {
std::string data;
args->GetNext(&data);
NSString *base64str = base::SysUTF8ToNSString(data);
NSData *bookmarkData = [[NSData alloc] initWithBase64EncodedString: base64str options: 0];
// Create bookmarkUrl from NSData.
BOOL isStale = false;
NSError *error = nil;
NSURL *bookmarkUrl = [NSURL URLByResolvingBookmarkData: bookmarkData
options: NSURLBookmarkResolutionWithSecurityScope
relativeToURL: nil
bookmarkDataIsStale: &isStale
error: &error];
if (error != nil) {
NSString *err = [NSString stringWithFormat: @"NSError: %@ %@", error, [error userInfo]];
args->ThrowError(base::SysNSStringToUTF8(err));
}
if (isStale) {
args->ThrowError("bookmarkDataIsStale - try recreating the bookmark");
}
if (error == nil && isStale == false) {
[bookmarkUrl startAccessingSecurityScopedResource];
}
// Stop the NSURL from being GC'd.
[bookmarkUrl retain];
// Return a js callback which will close the bookmark.
return base::Bind(&OnStopAccessingSecurityScopedResource, bookmarkUrl);
}
} // namespace atom
} // namespace api

View File

@@ -99,10 +99,8 @@ void AutoUpdater::OnWindowAllClosed() {
QuitAndInstall();
}
void AutoUpdater::SetFeedURL(const std::string& url, mate::Arguments* args) {
auto_updater::AutoUpdater::HeaderMap headers;
args->GetNext(&headers);
auto_updater::AutoUpdater::SetFeedURL(url, headers);
void AutoUpdater::SetFeedURL(mate::Arguments* args) {
auto_updater::AutoUpdater::SetFeedURL(args);
}
void AutoUpdater::QuitAndInstall() {

View File

@@ -47,7 +47,7 @@ class AutoUpdater : public mate::EventEmitter<AutoUpdater>,
private:
std::string GetFeedURL();
void SetFeedURL(const std::string& url, mate::Arguments* args);
void SetFeedURL(mate::Arguments* args);
void QuitAndInstall();
DISALLOW_COPY_AND_ASSIGN(AutoUpdater);

View File

@@ -68,8 +68,8 @@ void BrowserView::Init(v8::Isolate* isolate,
web_contents_.Reset(isolate, web_contents.ToV8());
api_web_contents_ = web_contents.get();
view_.reset(NativeBrowserView::Create(
api_web_contents_->managed_web_contents()->GetView()));
view_.reset(
NativeBrowserView::Create(api_web_contents_->managed_web_contents()));
InitWith(isolate, wrapper);
}
@@ -114,7 +114,7 @@ void BrowserView::SetBackgroundColor(const std::string& color_name) {
view_->SetBackgroundColor(ParseHexColor(color_name));
}
v8::Local<v8::Value> BrowserView::WebContents() {
v8::Local<v8::Value> BrowserView::GetWebContents() {
if (web_contents_.IsEmpty()) {
return v8::Null(isolate());
}
@@ -131,7 +131,7 @@ void BrowserView::BuildPrototype(v8::Isolate* isolate,
.SetMethod("setAutoResize", &BrowserView::SetAutoResize)
.SetMethod("setBounds", &BrowserView::SetBounds)
.SetMethod("setBackgroundColor", &BrowserView::SetBackgroundColor)
.SetProperty("webContents", &BrowserView::WebContents)
.SetProperty("webContents", &BrowserView::GetWebContents)
.SetProperty("id", &BrowserView::ID);
}
@@ -154,6 +154,8 @@ void Initialize(v8::Local<v8::Object> exports,
isolate, BrowserView::GetConstructor(isolate)->GetFunction());
browser_view.SetMethod("fromId",
&mate::TrackableObject<BrowserView>::FromWeakMapID);
browser_view.SetMethod("getAllViews",
&mate::TrackableObject<BrowserView>::GetAll);
mate::Dictionary dict(isolate, exports);
dict.Set("BrowserView", browser_view);
}

View File

@@ -56,7 +56,7 @@ class BrowserView : public mate::TrackableObject<BrowserView> {
void SetBounds(const gfx::Rect& bounds);
void SetBackgroundColor(const std::string& color_name);
v8::Local<v8::Value> WebContents();
v8::Local<v8::Value> GetWebContents();
v8::Global<v8::Value> web_contents_;
class WebContents* api_web_contents_;

View File

@@ -9,7 +9,9 @@
#include "atom/browser/atom_browser_main_parts.h"
#include "atom/common/native_mate_converters/callback.h"
#include "atom/common/native_mate_converters/value_converter.h"
#include "base/json/json_reader.h"
#include "base/json/json_writer.h"
#include "base/memory/ptr_util.h"
#include "content/public/browser/devtools_agent_host.h"
#include "content/public/browser/web_contents.h"
#include "native_mate/dictionary.h"
@@ -47,20 +49,11 @@ void Debugger::DispatchProtocolMessage(DevToolsAgentHost* agent_host,
v8::Locker locker(isolate());
v8::HandleScope handle_scope(isolate());
v8::Local<v8::String> local_message =
v8::String::NewFromUtf8(isolate(), message.data());
v8::MaybeLocal<v8::Value> parsed_message = v8::JSON::Parse(
isolate()->GetCurrentContext(), local_message);
if (parsed_message.IsEmpty()) {
std::unique_ptr<base::Value> parsed_message = base::JSONReader::Read(message);
if (!parsed_message || !parsed_message->is_dict())
return;
}
std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
if (!mate::ConvertFromV8(isolate(), parsed_message.ToLocalChecked(),
dict.get())) {
return;
}
base::DictionaryValue* dict =
static_cast<base::DictionaryValue*>(parsed_message.get());
int id;
if (!dict->GetInteger("id", &id)) {
std::string method;
@@ -143,7 +136,7 @@ void Debugger::SendCommand(mate::Arguments* args) {
request.SetInteger("id", request_id);
request.SetString("method", method);
if (!command_params.empty())
request.Set("params", command_params.DeepCopy());
request.Set("params", base::WrapUnique(command_params.DeepCopy()));
std::string json_args;
base::JSONWriter::Write(request, &json_args);

View File

@@ -10,6 +10,7 @@ using base::PlatformThreadRef;
#include "atom/common/native_mate_converters/gfx_converter.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/media/desktop_media_list.h"
#include "content/public/browser/desktop_capture.h"
#include "native_mate/dictionary.h"
#include "third_party/webrtc/modules/desktop_capture/desktop_capture_options.h"
#include "third_party/webrtc/modules/desktop_capture/desktop_capturer.h"
@@ -50,17 +51,7 @@ void DesktopCapturer::StartHandling(bool capture_window,
bool capture_screen,
const gfx::Size& thumbnail_size) {
webrtc::DesktopCaptureOptions options =
webrtc::DesktopCaptureOptions::CreateDefault();
#if defined(OS_WIN)
// On windows, desktop effects (e.g. Aero) will be disabled when the Desktop
// capture API is active by default.
// We keep the desktop effects in most times. Howerver, the screen still
// fickers when the API is capturing the window due to limitation of current
// implemetation. This is a known and wontFix issue in webrtc (see:
// http://code.google.com/p/webrtc/issues/detail?id=3373)
options.set_disable_effects(false);
#endif
content::CreateDesktopCaptureOptions();
std::unique_ptr<webrtc::DesktopCapturer> screen_capturer(
capture_screen ? webrtc::DesktopCapturer::CreateScreenCapturer(options)

View File

@@ -54,6 +54,9 @@ struct Converter<file_dialog::DialogSettings> {
dict.Get("filters", &(out->filters));
dict.Get("properties", &(out->properties));
dict.Get("showsTagField", &(out->shows_tag_field));
#if defined(MAS_BUILD)
dict.Get("securityScopedBookmarks", &(out->security_scoped_bookmarks));
#endif
return true;
}
};

View File

@@ -0,0 +1,115 @@
// Copyright (c) 2017 Amaplex Software, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "atom/browser/api/atom_api_in_app_purchase.h"
#include <string>
#include <utility>
#include <vector>
#include "atom/common/native_mate_converters/callback.h"
#include "native_mate/dictionary.h"
#include "atom/common/node_includes.h"
namespace mate {
template <>
struct Converter<in_app_purchase::Payment> {
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate,
const in_app_purchase::Payment& payment) {
mate::Dictionary dict = mate::Dictionary::CreateEmpty(isolate);
dict.SetHidden("simple", true);
dict.Set("productIdentifier", payment.productIdentifier);
dict.Set("quantity", payment.quantity);
return dict.GetHandle();
}
};
template <>
struct Converter<in_app_purchase::Transaction> {
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate,
const in_app_purchase::Transaction& val) {
mate::Dictionary dict = mate::Dictionary::CreateEmpty(isolate);
dict.SetHidden("simple", true);
dict.Set("transactionIdentifier", val.transactionIdentifier);
dict.Set("transactionDate", val.transactionDate);
dict.Set("originalTransactionIdentifier",
val.originalTransactionIdentifier);
dict.Set("transactionState", val.transactionState);
dict.Set("errorCode", val.errorCode);
dict.Set("errorMessage", val.errorMessage);
dict.Set("payment", val.payment);
return dict.GetHandle();
}
};
} // namespace mate
namespace atom {
namespace api {
#if defined(OS_MACOSX)
// static
mate::Handle<InAppPurchase> InAppPurchase::Create(v8::Isolate* isolate) {
return mate::CreateHandle(isolate, new InAppPurchase(isolate));
}
// static
void InAppPurchase::BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::FunctionTemplate> prototype) {
prototype->SetClassName(mate::StringToV8(isolate, "InAppPurchase"));
mate::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
.SetMethod("canMakePayments", &in_app_purchase::CanMakePayments)
.SetMethod("getReceiptURL", &in_app_purchase::GetReceiptURL)
.SetMethod("purchaseProduct", &InAppPurchase::PurchaseProduct);
}
InAppPurchase::InAppPurchase(v8::Isolate* isolate) {
Init(isolate);
}
InAppPurchase::~InAppPurchase() {
}
void InAppPurchase::PurchaseProduct(const std::string& product_id,
mate::Arguments* args) {
int quantity = 1;
in_app_purchase::InAppPurchaseCallback callback;
args->GetNext(&quantity);
args->GetNext(&callback);
in_app_purchase::PurchaseProduct(product_id, quantity, callback);
}
void InAppPurchase::OnTransactionsUpdated(
const std::vector<in_app_purchase::Transaction>& transactions) {
Emit("transactions-updated", transactions);
}
#endif
} // namespace api
} // namespace atom
namespace {
using atom::api::InAppPurchase;
void Initialize(v8::Local<v8::Object> exports,
v8::Local<v8::Value> unused,
v8::Local<v8::Context> context,
void* priv) {
#if defined(OS_MACOSX)
v8::Isolate* isolate = context->GetIsolate();
mate::Dictionary dict(isolate, exports);
dict.Set("inAppPurchase", InAppPurchase::Create(isolate));
dict.Set("InAppPurchase",
InAppPurchase::GetConstructor(isolate)->GetFunction());
#endif
}
} // namespace
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_browser_in_app_purchase, Initialize)

View File

@@ -0,0 +1,46 @@
// Copyright (c) 2017 Amaplex Software, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef ATOM_BROWSER_API_ATOM_API_IN_APP_PURCHASE_H_
#define ATOM_BROWSER_API_ATOM_API_IN_APP_PURCHASE_H_
#include <string>
#include <vector>
#include "atom/browser/api/event_emitter.h"
#include "atom/browser/mac/in_app_purchase.h"
#include "atom/browser/mac/in_app_purchase_observer.h"
#include "native_mate/handle.h"
namespace atom {
namespace api {
class InAppPurchase: public mate::EventEmitter<InAppPurchase>,
public in_app_purchase::TransactionObserver {
public:
static mate::Handle<InAppPurchase> Create(v8::Isolate* isolate);
static void BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::FunctionTemplate> prototype);
protected:
explicit InAppPurchase(v8::Isolate* isolate);
~InAppPurchase() override;
void PurchaseProduct(const std::string& product_id, mate::Arguments* args);
// TransactionObserver:
void OnTransactionsUpdated(
const std::vector<in_app_purchase::Transaction>& transactions) override;
private:
DISALLOW_COPY_AND_ASSIGN(InAppPurchase);
};
} // namespace api
} // namespace atom
#endif // ATOM_BROWSER_API_ATOM_API_IN_APP_PURCHASE_H_

View File

@@ -23,9 +23,13 @@ Menu::Menu(v8::Isolate* isolate, v8::Local<v8::Object> wrapper)
: model_(new AtomMenuModel(this)),
parent_(nullptr) {
InitWith(isolate, wrapper);
model_->AddObserver(this);
}
Menu::~Menu() {
if (model_) {
model_->RemoveObserver(this);
}
}
void Menu::AfterInit(v8::Isolate* isolate) {
@@ -43,15 +47,21 @@ void Menu::AfterInit(v8::Isolate* isolate) {
}
bool Menu::IsCommandIdChecked(int command_id) const {
return is_checked_.Run(command_id);
v8::Locker locker(isolate());
v8::HandleScope handle_scope(isolate());
return is_checked_.Run(GetWrapper(), command_id);
}
bool Menu::IsCommandIdEnabled(int command_id) const {
return is_enabled_.Run(command_id);
v8::Locker locker(isolate());
v8::HandleScope handle_scope(isolate());
return is_enabled_.Run(GetWrapper(), command_id);
}
bool Menu::IsCommandIdVisible(int command_id) const {
return is_visible_.Run(command_id);
v8::Locker locker(isolate());
v8::HandleScope handle_scope(isolate());
return is_visible_.Run(GetWrapper(), command_id);
}
bool Menu::GetAcceleratorForCommandIdWithParams(
@@ -61,18 +71,23 @@ bool Menu::GetAcceleratorForCommandIdWithParams(
v8::Locker locker(isolate());
v8::HandleScope handle_scope(isolate());
v8::Local<v8::Value> val = get_accelerator_.Run(
command_id, use_default_accelerator);
GetWrapper(), command_id, use_default_accelerator);
return mate::ConvertFromV8(isolate(), val, accelerator);
}
void Menu::ExecuteCommand(int command_id, int flags) {
v8::Locker locker(isolate());
v8::HandleScope handle_scope(isolate());
execute_command_.Run(
GetWrapper(),
mate::internal::CreateEventFromFlags(isolate(), flags),
command_id);
}
void Menu::MenuWillShow(ui::SimpleMenuModel* source) {
menu_will_show_.Run();
v8::Locker locker(isolate());
v8::HandleScope handle_scope(isolate());
menu_will_show_.Run(GetWrapper());
}
void Menu::InsertItemAt(
@@ -153,6 +168,14 @@ bool Menu::IsVisibleAt(int index) const {
return model_->IsVisibleAt(index);
}
void Menu::OnMenuWillClose() {
Emit("menu-will-close");
}
void Menu::OnMenuWillShow() {
Emit("menu-will-show");
}
// static
void Menu::BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::FunctionTemplate> prototype) {

View File

@@ -18,7 +18,8 @@ namespace atom {
namespace api {
class Menu : public mate::TrackableObject<Menu>,
public AtomMenuModel::Delegate {
public AtomMenuModel::Delegate,
public AtomMenuModel::Observer {
public:
static mate::WrappableBase* New(mate::Arguments* args);
@@ -53,13 +54,17 @@ class Menu : public mate::TrackableObject<Menu>,
void ExecuteCommand(int command_id, int event_flags) override;
void MenuWillShow(ui::SimpleMenuModel* source) override;
virtual void PopupAt(
Window* window, int x, int y, int positioning_item, bool async) = 0;
virtual void PopupAt(Window* window, int x, int y, int positioning_item,
const base::Closure& callback) = 0;
virtual void ClosePopupAt(int32_t window_id) = 0;
std::unique_ptr<AtomMenuModel> model_;
Menu* parent_;
// Observable:
void OnMenuWillClose() override;
void OnMenuWillShow() override;
private:
void InsertItemAt(int index, int command_id, const base::string16& label);
void InsertSeparatorAt(int index);
@@ -88,12 +93,14 @@ class Menu : public mate::TrackableObject<Menu>,
bool IsVisibleAt(int index) const;
// Stored delegate methods.
base::Callback<bool(int)> is_checked_;
base::Callback<bool(int)> is_enabled_;
base::Callback<bool(int)> is_visible_;
base::Callback<v8::Local<v8::Value>(int, bool)> get_accelerator_;
base::Callback<void(v8::Local<v8::Value>, int)> execute_command_;
base::Callback<void()> menu_will_show_;
base::Callback<bool(v8::Local<v8::Value>, int)> is_checked_;
base::Callback<bool(v8::Local<v8::Value>, int)> is_enabled_;
base::Callback<bool(v8::Local<v8::Value>, int)> is_visible_;
base::Callback<v8::Local<v8::Value>(v8::Local<v8::Value>, int, bool)>
get_accelerator_;
base::Callback<void(v8::Local<v8::Value>, v8::Local<v8::Value>, int)>
execute_command_;
base::Callback<void(v8::Local<v8::Value>)> menu_will_show_;
DISALLOW_COPY_AND_ASSIGN(Menu);
};

View File

@@ -22,17 +22,20 @@ class MenuMac : public Menu {
protected:
MenuMac(v8::Isolate* isolate, v8::Local<v8::Object> wrapper);
void PopupAt(
Window* window, int x, int y, int positioning_item, bool async) override;
void PopupAt(Window* window, int x, int y, int positioning_item,
const base::Closure& callback) override;
void PopupOnUI(const base::WeakPtr<NativeWindow>& native_window,
int32_t window_id, int x, int y, int positioning_item,
bool async);
int32_t window_id,
int x,
int y,
int positioning_item,
base::Closure callback);
void ClosePopupAt(int32_t window_id) override;
private:
friend class Menu;
static void SendActionToFirstResponder(const std::string& action);
void OnClosed(int32_t window_id, base::Closure callback);
scoped_nsobject<AtomMenuController> menu_controller_;

View File

@@ -18,6 +18,12 @@
using content::BrowserThread;
namespace {
static scoped_nsobject<NSMenu> applicationMenu_;
} // namespace
namespace atom {
namespace api {
@@ -27,24 +33,24 @@ MenuMac::MenuMac(v8::Isolate* isolate, v8::Local<v8::Object> wrapper)
weak_factory_(this) {
}
void MenuMac::PopupAt(
Window* window, int x, int y, int positioning_item, bool async) {
void MenuMac::PopupAt(Window* window, int x, int y, int positioning_item,
const base::Closure& callback) {
NativeWindow* native_window = window->window();
if (!native_window)
return;
auto popup = base::Bind(&MenuMac::PopupOnUI, weak_factory_.GetWeakPtr(),
native_window->GetWeakPtr(), window->ID(), x, y,
positioning_item, async);
if (async)
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, popup);
else
popup.Run();
positioning_item, callback);
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, popup);
}
void MenuMac::PopupOnUI(const base::WeakPtr<NativeWindow>& native_window,
int32_t window_id, int x, int y, int positioning_item,
bool async) {
int32_t window_id,
int x,
int y,
int positioning_item,
base::Closure callback) {
if (!native_window)
return;
brightray::InspectableWebContents* web_contents =
@@ -52,8 +58,8 @@ void MenuMac::PopupOnUI(const base::WeakPtr<NativeWindow>& native_window,
if (!web_contents)
return;
auto close_callback = base::Bind(&MenuMac::ClosePopupAt,
weak_factory_.GetWeakPtr(), window_id);
auto close_callback = base::Bind(
&MenuMac::OnClosed, weak_factory_.GetWeakPtr(), window_id, callback);
popup_controllers_[window_id] = base::scoped_nsobject<AtomMenuController>(
[[AtomMenuController alloc] initWithModel:model()
useDefaultAccelerator:NO]);
@@ -92,33 +98,41 @@ void MenuMac::PopupOnUI(const base::WeakPtr<NativeWindow>& native_window,
if (rightmostMenuPoint > screenRight)
position.x = position.x - [menu size].width;
[popup_controllers_[window_id] setCloseCallback:close_callback];
// Make sure events can be pumped while the menu is up.
base::MessageLoop::ScopedNestableTaskAllower allow(
base::MessageLoop::current());
if (async) {
[popup_controllers_[window_id] setCloseCallback:close_callback];
// Make sure events can be pumped while the menu is up.
base::MessageLoop::ScopedNestableTaskAllower allow(
base::MessageLoop::current());
// One of the events that could be pumped is |window.close()|.
// User-initiated event-tracking loops protect against this by
// setting flags in -[CrApplication sendEvent:], but since
// web-content menus are initiated by IPC message the setup has to
// be done manually.
base::mac::ScopedSendingEvent sendingEventScoper;
// One of the events that could be pumped is |window.close()|.
// User-initiated event-tracking loops protect against this by
// setting flags in -[CrApplication sendEvent:], but since
// web-content menus are initiated by IPC message the setup has to
// be done manually.
base::mac::ScopedSendingEvent sendingEventScoper;
// Don't emit unresponsive event when showing menu.
atom::UnresponsiveSuppressor suppressor;
[menu popUpMenuPositioningItem:item atLocation:position inView:view];
} else {
// Don't emit unresponsive event when showing menu.
atom::UnresponsiveSuppressor suppressor;
[menu popUpMenuPositioningItem:item atLocation:position inView:view];
close_callback.Run();
}
// Don't emit unresponsive event when showing menu.
atom::UnresponsiveSuppressor suppressor;
[menu popUpMenuPositioningItem:item atLocation:position inView:view];
}
void MenuMac::ClosePopupAt(int32_t window_id) {
auto controller = popup_controllers_.find(window_id);
if (controller != popup_controllers_.end()) {
// Close the controller for the window.
[controller->second cancel];
} else if (window_id == -1) {
// Or just close all opened controllers.
for (auto it = popup_controllers_.begin();
it != popup_controllers_.end();) {
// The iterator is invalidated after the call.
[(it++)->second cancel];
}
}
}
void MenuMac::OnClosed(int32_t window_id, base::Closure callback) {
popup_controllers_.erase(window_id);
callback.Run();
}
// static
@@ -127,7 +141,18 @@ void Menu::SetApplicationMenu(Menu* base_menu) {
base::scoped_nsobject<AtomMenuController> menu_controller(
[[AtomMenuController alloc] initWithModel:menu->model_.get()
useDefaultAccelerator:YES]);
[NSApp setMainMenu:[menu_controller menu]];
NSRunLoop* currentRunLoop = [NSRunLoop currentRunLoop];
[currentRunLoop cancelPerformSelector:@selector(setMainMenu:)
target:NSApp
argument:applicationMenu_];
applicationMenu_.reset([[menu_controller menu] retain]);
[[NSRunLoop currentRunLoop]
performSelector:@selector(setMainMenu:)
target:NSApp
argument:applicationMenu_
order:0
modes:[NSArray arrayWithObject:NSDefaultRunLoopMode]];
// Ensure the menu_controller_ is destroyed after main menu is set.
menu_controller.swap(menu->menu_controller_);

View File

@@ -6,7 +6,8 @@
#include "atom/browser/native_window_views.h"
#include "atom/browser/unresponsive_suppressor.h"
#include "content/public/browser/render_widget_host_view.h"
#include "brightray/browser/inspectable_web_contents.h"
#include "brightray/browser/inspectable_web_contents_view.h"
#include "ui/display/screen.h"
using views::MenuRunner;
@@ -20,30 +21,22 @@ MenuViews::MenuViews(v8::Isolate* isolate, v8::Local<v8::Object> wrapper)
weak_factory_(this) {
}
void MenuViews::PopupAt(
Window* window, int x, int y, int positioning_item, bool async) {
NativeWindow* native_window = static_cast<NativeWindow*>(window->window());
void MenuViews::PopupAt(Window* window, int x, int y, int positioning_item,
const base::Closure& callback) {
auto* native_window = static_cast<NativeWindowViews*>(window->window());
if (!native_window)
return;
content::WebContents* web_contents = native_window->web_contents();
if (!web_contents)
return;
content::RenderWidgetHostView* view = web_contents->GetRenderWidgetHostView();
if (!view)
return;
// (-1, -1) means showing on mouse location.
gfx::Point location;
if (x == -1 || y == -1) {
location = display::Screen::GetScreen()->GetCursorScreenPoint();
} else {
gfx::Point origin = view->GetViewBounds().origin();
gfx::Point origin = native_window->GetContentBounds().origin();
location = gfx::Point(origin.x() + x, origin.y() + y);
}
int flags = MenuRunner::CONTEXT_MENU | MenuRunner::HAS_MNEMONICS;
if (async)
flags |= MenuRunner::ASYNC;
// Don't emit unresponsive event when showing menu.
atom::UnresponsiveSuppressor suppressor;
@@ -51,19 +44,34 @@ void MenuViews::PopupAt(
// Show the menu.
int32_t window_id = window->ID();
auto close_callback = base::Bind(
&MenuViews::ClosePopupAt, weak_factory_.GetWeakPtr(), window_id);
&MenuViews::OnClosed, weak_factory_.GetWeakPtr(), window_id, callback);
menu_runners_[window_id] = std::unique_ptr<MenuRunner>(new MenuRunner(
model(), flags, close_callback));
ignore_result(menu_runners_[window_id]->RunMenuAt(
static_cast<NativeWindowViews*>(window->window())->widget(),
menu_runners_[window_id]->RunMenuAt(
native_window->widget(),
NULL,
gfx::Rect(location, gfx::Size()),
views::MENU_ANCHOR_TOPLEFT,
ui::MENU_SOURCE_MOUSE));
ui::MENU_SOURCE_MOUSE);
}
void MenuViews::ClosePopupAt(int32_t window_id) {
auto runner = menu_runners_.find(window_id);
if (runner != menu_runners_.end()) {
// Close the runner for the window.
runner->second->Cancel();
} else if (window_id == -1) {
// Or just close all opened runners.
for (auto it = menu_runners_.begin(); it != menu_runners_.end();) {
// The iterator is invalidated after the call.
(it++)->second->Cancel();
}
}
}
void MenuViews::OnClosed(int32_t window_id, base::Closure callback) {
menu_runners_.erase(window_id);
callback.Run();
}
// static

View File

@@ -21,11 +21,13 @@ class MenuViews : public Menu {
MenuViews(v8::Isolate* isolate, v8::Local<v8::Object> wrapper);
protected:
void PopupAt(
Window* window, int x, int y, int positioning_item, bool async) override;
void PopupAt(Window* window, int x, int y, int positioning_item,
const base::Closure& callback) override;
void ClosePopupAt(int32_t window_id) override;
private:
void OnClosed(int32_t window_id, base::Closure callback);
// window ID -> open context menu
std::map<int32_t, std::unique_ptr<views::MenuRunner>> menu_runners_;

View File

@@ -9,13 +9,15 @@
#include "atom/common/native_mate_converters/gfx_converter.h"
#include "atom/common/native_mate_converters/image_converter.h"
#include "atom/common/native_mate_converters/string16_converter.h"
#include "atom/common/node_includes.h"
#include "base/strings/utf_string_conversions.h"
#include "brightray/browser/browser_client.h"
#include "native_mate/constructor.h"
#include "native_mate/dictionary.h"
#include "native_mate/object_template_builder.h"
#include "url/gurl.h"
// Must be the last in the includes list.
// See https://github.com/electron/electron/issues/10363
#include "atom/common/node_includes.h"
namespace mate {
template<>
@@ -67,6 +69,8 @@ Notification::Notification(v8::Isolate* isolate,
opts.Get("replyPlaceholder", &reply_placeholder_);
opts.Get("hasReply", &has_reply_);
opts.Get("actions", &actions_);
opts.Get("sound", &sound_);
opts.Get("closeButtonText", &close_button_text_);
}
}
@@ -101,18 +105,26 @@ bool Notification::GetSilent() const {
return silent_;
}
base::string16 Notification::GetReplyPlaceholder() const {
return reply_placeholder_;
}
bool Notification::GetHasReply() const {
return has_reply_;
}
base::string16 Notification::GetReplyPlaceholder() const {
return reply_placeholder_;
}
base::string16 Notification::GetSound() const {
return sound_;
}
std::vector<brightray::NotificationAction> Notification::GetActions() const {
return actions_;
}
base::string16 Notification::GetCloseButtonText() const {
return close_button_text_;
}
// Setters
void Notification::SetTitle(const base::string16& new_title) {
title_ = new_title;
@@ -130,12 +142,16 @@ void Notification::SetSilent(bool new_silent) {
silent_ = new_silent;
}
void Notification::SetHasReply(bool new_has_reply) {
has_reply_ = new_has_reply;
}
void Notification::SetReplyPlaceholder(const base::string16& new_placeholder) {
reply_placeholder_ = new_placeholder;
}
void Notification::SetHasReply(bool new_has_reply) {
has_reply_ = new_has_reply;
void Notification::SetSound(const base::string16& new_sound) {
sound_ = new_sound;
}
void Notification::SetActions(
@@ -143,6 +159,10 @@ void Notification::SetActions(
actions_ = actions;
}
void Notification::SetCloseButtonText(const base::string16& text) {
close_button_text_ = text;
}
void Notification::NotificationAction(int index) {
Emit("action", index);
}
@@ -160,14 +180,22 @@ void Notification::NotificationDisplayed() {
}
void Notification::NotificationDestroyed() {
Emit("close");
}
void Notification::NotificationClosed() {
Emit("close");
}
void Notification::Close() {
if (notification_) {
notification_->Dismiss();
notification_.reset();
}
}
// Showing notifications
void Notification::Show() {
Close();
if (presenter_) {
notification_ = presenter_->CreateNotification(this);
if (notification_) {
@@ -181,6 +209,8 @@ void Notification::Show() {
options.has_reply = has_reply_;
options.reply_placeholder = reply_placeholder_;
options.actions = actions_;
options.sound = sound_;
options.close_button_text = close_button_text_;
notification_->Show(options);
}
}
@@ -197,17 +227,23 @@ void Notification::BuildPrototype(v8::Isolate* isolate,
mate::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
.MakeDestroyable()
.SetMethod("show", &Notification::Show)
.SetMethod("close", &Notification::Close)
.SetProperty("title", &Notification::GetTitle, &Notification::SetTitle)
.SetProperty("subtitle", &Notification::GetSubtitle,
&Notification::SetSubtitle)
.SetProperty("body", &Notification::GetBody, &Notification::SetBody)
.SetProperty("silent", &Notification::GetSilent, &Notification::SetSilent)
.SetProperty("replyPlaceholder", &Notification::GetReplyPlaceholder,
&Notification::SetReplyPlaceholder)
.SetProperty("silent", &Notification::GetSilent,
&Notification::SetSilent)
.SetProperty("hasReply", &Notification::GetHasReply,
&Notification::SetHasReply)
.SetProperty("replyPlaceholder", &Notification::GetReplyPlaceholder,
&Notification::SetReplyPlaceholder)
.SetProperty("sound", &Notification::GetSound,
&Notification::SetSound)
.SetProperty("actions", &Notification::GetActions,
&Notification::SetActions);
&Notification::SetActions)
.SetProperty("closeButtonText", &Notification::GetCloseButtonText,
&Notification::SetCloseButtonText);
}
} // namespace api

View File

@@ -45,24 +45,29 @@ class Notification : public mate::TrackableObject<Notification>,
~Notification() override;
void Show();
void Close();
// Prop Getters
base::string16 GetTitle() const;
base::string16 GetSubtitle() const;
base::string16 GetBody() const;
bool GetSilent() const;
base::string16 GetReplyPlaceholder() const;
bool GetHasReply() const;
base::string16 GetReplyPlaceholder() const;
base::string16 GetSound() const;
std::vector<brightray::NotificationAction> GetActions() const;
base::string16 GetCloseButtonText() const;
// Prop Setters
void SetTitle(const base::string16& new_title);
void SetSubtitle(const base::string16& new_subtitle);
void SetBody(const base::string16& new_body);
void SetSilent(bool new_silent);
void SetReplyPlaceholder(const base::string16& new_reply_placeholder);
void SetHasReply(bool new_has_reply);
void SetReplyPlaceholder(const base::string16& new_reply_placeholder);
void SetSound(const base::string16& sound);
void SetActions(const std::vector<brightray::NotificationAction>& actions);
void SetCloseButtonText(const base::string16& text);
private:
base::string16 title_;
@@ -72,9 +77,11 @@ class Notification : public mate::TrackableObject<Notification>,
base::string16 icon_path_;
bool has_icon_ = false;
bool silent_ = false;
base::string16 reply_placeholder_;
bool has_reply_ = false;
base::string16 reply_placeholder_;
base::string16 sound_;
std::vector<brightray::NotificationAction> actions_;
base::string16 close_button_text_;
brightray::NotificationPresenter* presenter_;

View File

@@ -16,6 +16,13 @@ namespace atom {
namespace api {
PowerMonitor::PowerMonitor(v8::Isolate* isolate) {
#if defined(OS_LINUX)
SetShutdownHandler(base::Bind(&PowerMonitor::ShouldShutdown,
base::Unretained(this)));
#elif defined(OS_MACOSX)
Browser::Get()->SetShutdownHandler(base::Bind(&PowerMonitor::ShouldShutdown,
base::Unretained(this)));
#endif
base::PowerMonitor::Get()->AddObserver(this);
Init(isolate);
}
@@ -24,6 +31,20 @@ PowerMonitor::~PowerMonitor() {
base::PowerMonitor::Get()->RemoveObserver(this);
}
bool PowerMonitor::ShouldShutdown() {
return !Emit("shutdown");
}
#if defined(OS_LINUX)
void PowerMonitor::BlockShutdown() {
PowerObserverLinux::BlockShutdown();
}
void PowerMonitor::UnblockShutdown() {
PowerObserverLinux::UnblockShutdown();
}
#endif
void PowerMonitor::OnPowerStateChange(bool on_battery_power) {
if (on_battery_power)
Emit("on-battery");
@@ -55,6 +76,11 @@ v8::Local<v8::Value> PowerMonitor::Create(v8::Isolate* isolate) {
void PowerMonitor::BuildPrototype(
v8::Isolate* isolate, v8::Local<v8::FunctionTemplate> prototype) {
prototype->SetClassName(mate::StringToV8(isolate, "PowerMonitor"));
#if defined(OS_LINUX)
mate::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
.SetMethod("blockShutdown", &PowerMonitor::BlockShutdown)
.SetMethod("unblockShutdown", &PowerMonitor::UnblockShutdown);
#endif
}
} // namespace api
@@ -68,10 +94,6 @@ using atom::api::PowerMonitor;
void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
v8::Local<v8::Context> context, void* priv) {
#if defined(OS_MACOSX)
base::PowerMonitorDeviceSource::AllocateSystemIOPorts();
#endif
v8::Isolate* isolate = context->GetIsolate();
mate::Dictionary dict(isolate, exports);
dict.Set("powerMonitor", PowerMonitor::Create(isolate));

View File

@@ -6,8 +6,8 @@
#define ATOM_BROWSER_API_ATOM_API_POWER_MONITOR_H_
#include "atom/browser/api/trackable_object.h"
#include "atom/browser/lib/power_observer.h"
#include "base/compiler_specific.h"
#include "base/power_monitor/power_observer.h"
#include "native_mate/handle.h"
namespace atom {
@@ -15,7 +15,7 @@ namespace atom {
namespace api {
class PowerMonitor : public mate::TrackableObject<PowerMonitor>,
public base::PowerObserver {
public PowerObserver {
public:
static v8::Local<v8::Value> Create(v8::Isolate* isolate);
@@ -26,6 +26,15 @@ class PowerMonitor : public mate::TrackableObject<PowerMonitor>,
explicit PowerMonitor(v8::Isolate* isolate);
~PowerMonitor() override;
// Called by native calles.
bool ShouldShutdown();
#if defined(OS_LINUX)
// Private JS APIs.
void BlockShutdown();
void UnblockShutdown();
#endif
// base::PowerObserver implementations:
void OnPowerStateChange(bool on_battery_power) override;
void OnSuspend() override;

View File

@@ -9,8 +9,8 @@
#include <memory>
#include "atom/browser/api/trackable_object.h"
#include "device/power_save_blocker/power_save_blocker.h"
#include "native_mate/handle.h"
#include "services/device/wake_lock/power_save_blocker/power_save_blocker.h"
namespace mate {
class Dictionary;

View File

@@ -10,6 +10,7 @@
#include "atom/browser/net/url_request_async_asar_job.h"
#include "atom/browser/net/url_request_buffer_job.h"
#include "atom/browser/net/url_request_fetch_job.h"
#include "atom/browser/net/url_request_stream_job.h"
#include "atom/browser/net/url_request_string_job.h"
#include "atom/common/native_mate_converters/callback.h"
#include "atom/common/native_mate_converters/value_converter.h"
@@ -208,6 +209,8 @@ void Protocol::BuildPrototype(
&Protocol::RegisterProtocol<URLRequestAsyncAsarJob>)
.SetMethod("registerHttpProtocol",
&Protocol::RegisterProtocol<URLRequestFetchJob>)
.SetMethod("registerStreamProtocol",
&Protocol::RegisterProtocol<URLRequestStreamJob>)
.SetMethod("unregisterProtocol", &Protocol::UnregisterProtocol)
.SetMethod("isProtocolHandled", &Protocol::IsProtocolHandled)
.SetMethod("interceptStringProtocol",
@@ -218,6 +221,8 @@ void Protocol::BuildPrototype(
&Protocol::InterceptProtocol<URLRequestAsyncAsarJob>)
.SetMethod("interceptHttpProtocol",
&Protocol::InterceptProtocol<URLRequestFetchJob>)
.SetMethod("interceptStreamProtocol",
&Protocol::InterceptProtocol<URLRequestStreamJob>)
.SetMethod("uninterceptProtocol", &Protocol::UninterceptProtocol);
}

View File

@@ -9,6 +9,7 @@ namespace atom {
namespace api {
//TODO(codebytere): deprecated; remove in 3.0
int Screen::getMenuBarHeight() {
return [[NSApp mainMenu] menuBarHeight];
}

View File

@@ -17,6 +17,7 @@
#include "atom/browser/atom_permission_manager.h"
#include "atom/browser/browser.h"
#include "atom/browser/net/atom_cert_verifier.h"
#include "atom/browser/session_preferences.h"
#include "atom/common/native_mate_converters/callback.h"
#include "atom/common/native_mate_converters/content_converter.h"
#include "atom/common/native_mate_converters/file_path_converter.h"
@@ -28,10 +29,10 @@
#include "base/guid.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/threading/thread_task_runner_handle.h"
#include "brightray/browser/media/media_device_id_salt.h"
#include "brightray/browser/net/devtools_network_conditions.h"
#include "brightray/browser/net/devtools_network_controller_handle.h"
#include "chrome/browser/browser_process.h"
#include "chrome/common/pref_names.h"
#include "components/prefs/pref_service.h"
#include "content/public/browser/browser_thread.h"
@@ -45,7 +46,6 @@
#include "net/http/http_auth_handler_factory.h"
#include "net/http/http_auth_preferences.h"
#include "net/proxy/proxy_config_service_fixed.h"
#include "net/proxy/proxy_service.h"
#include "net/url_request/static_http_user_agent_settings.h"
#include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_context_getter.h"
@@ -212,6 +212,7 @@ struct Converter<atom::VerifyRequestParams> {
dict.Set("hostname", val.hostname);
dict.Set("certificate", val.certificate);
dict.Set("verificationResult", val.default_result);
dict.Set("errorCode", val.error_code);
return dict.GetHandle();
}
};
@@ -229,59 +230,6 @@ const char kPersistPrefix[] = "persist:";
// Referenced session objects.
std::map<uint32_t, v8::Global<v8::Object>> g_sessions;
class ResolveProxyHelper {
public:
ResolveProxyHelper(AtomBrowserContext* browser_context,
const GURL& url,
const Session::ResolveProxyCallback& callback)
: callback_(callback),
original_thread_(base::ThreadTaskRunnerHandle::Get()) {
scoped_refptr<net::URLRequestContextGetter> context_getter =
browser_context->url_request_context_getter();
context_getter->GetNetworkTaskRunner()->PostTask(
FROM_HERE,
base::Bind(&ResolveProxyHelper::ResolveProxy,
base::Unretained(this), context_getter, url));
}
void OnResolveProxyCompleted(int result) {
std::string proxy;
if (result == net::OK)
proxy = proxy_info_.ToPacString();
original_thread_->PostTask(FROM_HERE,
base::Bind(callback_, proxy));
delete this;
}
private:
void ResolveProxy(scoped_refptr<net::URLRequestContextGetter> context_getter,
const GURL& url) {
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
net::ProxyService* proxy_service =
context_getter->GetURLRequestContext()->proxy_service();
net::CompletionCallback completion_callback =
base::Bind(&ResolveProxyHelper::OnResolveProxyCompleted,
base::Unretained(this));
// Start the request.
int result = proxy_service->ResolveProxy(
url, "GET", &proxy_info_, completion_callback, &pac_req_, nullptr,
net::NetLogWithSource());
// Completed synchronously.
if (result != net::ERR_IO_PENDING)
completion_callback.Run(result);
}
Session::ResolveProxyCallback callback_;
net::ProxyInfo proxy_info_;
net::ProxyService::PacRequest* pac_req_;
scoped_refptr<base::SingleThreadTaskRunner> original_thread_;
DISALLOW_COPY_AND_ASSIGN(ResolveProxyHelper);
};
// Runs the callback in UI thread.
void RunCallbackInUI(const base::Callback<void()>& callback) {
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, callback);
@@ -433,9 +381,22 @@ void DownloadIdCallback(content::DownloadManager* download_manager,
content::DownloadItem::INTERRUPTED,
content::DownloadDangerType::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS,
content::DOWNLOAD_INTERRUPT_REASON_NETWORK_TIMEOUT, false,
base::Time(), false,
std::vector<content::DownloadItem::ReceivedSlice>());
}
void SetDevToolsNetworkEmulationClientIdInIO(
brightray::URLRequestContextGetter* url_request_context_getter,
const std::string& client_id) {
if (!url_request_context_getter)
return;
net::URLRequestContext* context =
url_request_context_getter->GetURLRequestContext();
AtomNetworkDelegate* network_delegate =
static_cast<AtomNetworkDelegate*>(context->network_delegate());
network_delegate->SetDevToolsNetworkEmulationClientId(client_id);
}
} // namespace
Session::Session(v8::Isolate* isolate, AtomBrowserContext* browser_context)
@@ -445,6 +406,8 @@ Session::Session(v8::Isolate* isolate, AtomBrowserContext* browser_context)
content::BrowserContext::GetDownloadManager(browser_context)->
AddObserver(this);
new SessionPreferences(browser_context);
Init(isolate);
AttachAsUserData(browser_context);
}
@@ -472,8 +435,10 @@ void Session::OnDownloadCreated(content::DownloadManager* manager,
}
}
void Session::ResolveProxy(const GURL& url, ResolveProxyCallback callback) {
new ResolveProxyHelper(browser_context(), url, callback);
void Session::ResolveProxy(
const GURL& url,
const ResolveProxyHelper::ResolveProxyCallback& callback) {
browser_context_->GetResolveProxyHelper()->ResolveProxy(url, callback);
}
template<Session::CacheAction action>
@@ -543,16 +508,24 @@ void Session::EnableNetworkEmulation(const mate::Dictionary& options) {
browser_context_->network_controller_handle()->SetNetworkState(
devtools_network_emulation_client_id_, std::move(conditions));
browser_context_->network_delegate()->SetDevToolsNetworkEmulationClientId(
devtools_network_emulation_client_id_);
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
base::Bind(
&SetDevToolsNetworkEmulationClientIdInIO,
base::RetainedRef(browser_context_->url_request_context_getter()),
devtools_network_emulation_client_id_));
}
void Session::DisableNetworkEmulation() {
std::unique_ptr<brightray::DevToolsNetworkConditions> conditions;
browser_context_->network_controller_handle()->SetNetworkState(
devtools_network_emulation_client_id_, std::move(conditions));
browser_context_->network_delegate()->SetDevToolsNetworkEmulationClientId(
std::string());
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
base::Bind(
&SetDevToolsNetworkEmulationClientIdInIO,
base::RetainedRef(browser_context_->url_request_context_getter()),
std::string()));
}
void Session::SetCertVerifyProc(v8::Local<v8::Value> val,
@@ -618,10 +591,11 @@ void Session::SetUserAgent(const std::string& user_agent,
mate::Arguments* args) {
browser_context_->SetUserAgent(user_agent);
std::string accept_lang = l10n_util::GetApplicationLocale("");
std::string accept_lang = g_browser_process->GetApplicationLocale();
args->GetNext(&accept_lang);
auto getter = browser_context_->GetRequestContext();
scoped_refptr<brightray::URLRequestContextGetter> getter(
browser_context_->GetRequestContext());
getter->GetNetworkTaskRunner()->PostTask(
FROM_HERE,
base::Bind(&SetUserAgentInIO, getter, accept_lang, user_agent));
@@ -677,6 +651,19 @@ void Session::CreateInterruptedDownload(const mate::Dictionary& options) {
length, last_modified, etag, base::Time::FromDoubleT(start_time)));
}
void Session::SetPreloads(
const std::vector<base::FilePath::StringType>& preloads) {
auto* prefs = SessionPreferences::FromBrowserContext(browser_context());
DCHECK(prefs);
prefs->set_preloads(preloads);
}
std::vector<base::FilePath::StringType> Session::GetPreloads() const {
auto* prefs = SessionPreferences::FromBrowserContext(browser_context());
DCHECK(prefs);
return prefs->preloads();
}
v8::Local<v8::Value> Session::Cookies(v8::Isolate* isolate) {
if (cookies_.IsEmpty()) {
auto handle = Cookies::Create(isolate, browser_context());
@@ -763,6 +750,8 @@ void Session::BuildPrototype(v8::Isolate* isolate,
.SetMethod("getBlobData", &Session::GetBlobData)
.SetMethod("createInterruptedDownload",
&Session::CreateInterruptedDownload)
.SetMethod("setPreloads", &Session::SetPreloads)
.SetMethod("getPreloads", &Session::GetPreloads)
.SetProperty("cookies", &Session::Cookies)
.SetProperty("protocol", &Session::Protocol)
.SetProperty("webRequest", &Session::WebRequest);

View File

@@ -6,9 +6,11 @@
#define ATOM_BROWSER_API_ATOM_API_SESSION_H_
#include <string>
#include <vector>
#include "atom/browser/api/trackable_object.h"
#include "atom/browser/atom_blob_reader.h"
#include "atom/browser/net/resolve_proxy_helper.h"
#include "base/values.h"
#include "content/public/browser/download_manager.h"
#include "native_mate/handle.h"
@@ -38,8 +40,6 @@ namespace api {
class Session: public mate::TrackableObject<Session>,
public content::DownloadManager::Observer {
public:
using ResolveProxyCallback = base::Callback<void(std::string)>;
enum class CacheAction {
CLEAR,
STATS,
@@ -61,7 +61,8 @@ class Session: public mate::TrackableObject<Session>,
v8::Local<v8::FunctionTemplate> prototype);
// Methods.
void ResolveProxy(const GURL& url, ResolveProxyCallback callback);
void ResolveProxy(const GURL& url,
const ResolveProxyHelper::ResolveProxyCallback& callback);
template<CacheAction action>
void DoCacheAction(const net::CompletionCallback& callback);
void ClearStorageData(mate::Arguments* args);
@@ -81,6 +82,8 @@ class Session: public mate::TrackableObject<Session>,
void GetBlobData(const std::string& uuid,
const AtomBlobReader::CompletionCallback& callback);
void CreateInterruptedDownload(const mate::Dictionary& options);
void SetPreloads(const std::vector<base::FilePath::StringType>& preloads);
std::vector<base::FilePath::StringType> GetPreloads() const;
v8::Local<v8::Value> Cookies(v8::Isolate* isolate);
v8::Local<v8::Value> Protocol(v8::Isolate* isolate);
v8::Local<v8::Value> WebRequest(v8::Isolate* isolate);

View File

@@ -65,8 +65,10 @@ void SystemPreferences::BuildPrototype(
&SystemPreferences::SubscribeLocalNotification)
.SetMethod("unsubscribeLocalNotification",
&SystemPreferences::UnsubscribeLocalNotification)
.SetMethod("registerDefaults", &SystemPreferences::RegisterDefaults)
.SetMethod("getUserDefault", &SystemPreferences::GetUserDefault)
.SetMethod("setUserDefault", &SystemPreferences::SetUserDefault)
.SetMethod("removeUserDefault", &SystemPreferences::RemoveUserDefault)
.SetMethod("isSwipeTrackingFromScrollEventsEnabled",
&SystemPreferences::IsSwipeTrackingFromScrollEventsEnabled)
#endif

View File

@@ -73,9 +73,11 @@ class SystemPreferences : public mate::EventEmitter<SystemPreferences>
void UnsubscribeLocalNotification(int request_id);
v8::Local<v8::Value> GetUserDefault(const std::string& name,
const std::string& type);
void RegisterDefaults(mate::Arguments* args);
void SetUserDefault(const std::string& name,
const std::string& type,
mate::Arguments* args);
void RemoveUserDefault(const std::string& name);
bool IsSwipeTrackingFromScrollEventsEnabled();
#endif
bool IsDarkMode();

View File

@@ -144,6 +144,28 @@ v8::Local<v8::Value> SystemPreferences::GetUserDefault(
}
}
void SystemPreferences::RegisterDefaults(mate::Arguments* args) {
base::DictionaryValue value;
if(!args->GetNext(&value)) {
args->ThrowError("Invalid userDefault data provided");
} else {
@try {
NSDictionary* dict = DictionaryValueToNSDictionary(value);
for (id key in dict) {
id value = [dict objectForKey:key];
if ([value isKindOfClass:[NSNull class]] || value == nil) {
args->ThrowError("Invalid userDefault data provided");
return;
}
}
[[NSUserDefaults standardUserDefaults] registerDefaults:dict];
} @catch (NSException* exception) {
args->ThrowError("Invalid userDefault data provided");
}
}
}
void SystemPreferences::SetUserDefault(const std::string& name,
const std::string& type,
mate::Arguments* args) {
@@ -229,6 +251,11 @@ void SystemPreferences::SetUserDefault(const std::string& name,
}
}
void SystemPreferences::RemoveUserDefault(const std::string& name) {
NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
[defaults removeObjectForKey:base::SysUTF8ToNSString(name)];
}
bool SystemPreferences::IsDarkMode() {
NSString* mode = [[NSUserDefaults standardUserDefaults]
stringForKey:@"AppleInterfaceStyle"];

View File

@@ -2,6 +2,8 @@
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include <iomanip>
#include "atom/browser/api/atom_api_system_preferences.h"
#include "atom/common/color_util.h"
@@ -26,10 +28,10 @@ bool SystemPreferences::IsAeroGlassEnabled() {
}
std::string hexColorDWORDToRGBA(DWORD color) {
DWORD rgba = color << 8 | color >> 24;
std::ostringstream stream;
stream << std::hex << color;
std::string hexColor = stream.str();
return hexColor.substr(2) + hexColor.substr(0, 2);
stream << std::hex << std::setw(8) << std::setfill('0') << rgba;
return stream.str();
}
std::string SystemPreferences::GetAccentColor() {

View File

@@ -40,8 +40,6 @@ struct Converter<atom::TrayIcon::HighlightMode> {
}
}
// Support old boolean parameter
// TODO(kevinsawicki): Remove in 2.0, deprecate before then with warnings
bool highlight;
if (ConvertFromV8(isolate, val, &highlight)) {
if (highlight)
@@ -86,8 +84,10 @@ mate::WrappableBase* Tray::New(mate::Handle<NativeImage> image,
return new Tray(args->isolate(), args->GetThis(), image);
}
void Tray::OnClicked(const gfx::Rect& bounds, int modifiers) {
EmitWithFlags("click", modifiers, bounds);
void Tray::OnClicked(const gfx::Rect& bounds,
const gfx::Point& location,
int modifiers) {
EmitWithFlags("click", modifiers, bounds, location);
}
void Tray::OnDoubleClicked(const gfx::Rect& bounds, int modifiers) {
@@ -130,6 +130,10 @@ void Tray::OnMouseExited(const gfx::Point& location, int modifiers) {
EmitWithFlags("mouse-leave", modifiers, location);
}
void Tray::OnMouseMoved(const gfx::Point& location, int modifiers) {
EmitWithFlags("mouse-move", modifiers, location);
}
void Tray::OnDragEntered() {
Emit("drag-enter");
}
@@ -202,7 +206,7 @@ void Tray::PopUpContextMenu(mate::Arguments* args) {
void Tray::SetContextMenu(v8::Isolate* isolate, mate::Handle<Menu> menu) {
menu_.Reset(isolate, menu.ToV8());
tray_icon_->SetContextMenu(menu->model());
tray_icon_->SetContextMenu(menu.IsEmpty() ? nullptr : menu->model());
}
gfx::Rect Tray::GetBounds() {

View File

@@ -47,7 +47,9 @@ class Tray : public mate::TrackableObject<Tray>,
~Tray() override;
// TrayIconObserver:
void OnClicked(const gfx::Rect& bounds, int modifiers) override;
void OnClicked(const gfx::Rect& bounds,
const gfx::Point& location,
int modifiers) override;
void OnDoubleClicked(const gfx::Rect& bounds, int modifiers) override;
void OnRightClicked(const gfx::Rect& bounds, int modifiers) override;
void OnBalloonShow() override;
@@ -61,6 +63,7 @@ class Tray : public mate::TrackableObject<Tray>,
void OnDragEnded() override;
void OnMouseEntered(const gfx::Point& location, int modifiers) override;
void OnMouseExited(const gfx::Point& location, int modifiers) override;
void OnMouseMoved(const gfx::Point& location, int modifiers) override;
void SetImage(v8::Isolate* isolate, mate::Handle<NativeImage> image);
void SetPressedImage(v8::Isolate* isolate, mate::Handle<NativeImage> image);

View File

@@ -43,6 +43,7 @@
#include "atom/common/native_mate_converters/string16_converter.h"
#include "atom/common/native_mate_converters/value_converter.h"
#include "atom/common/options_switches.h"
#include "base/message_loop/message_loop.h"
#include "base/process/process_handle.h"
#include "base/strings/utf_string_conversions.h"
#include "base/threading/thread_task_runner_handle.h"
@@ -56,6 +57,7 @@
#include "content/browser/renderer_host/render_widget_host_view_base.h"
#include "content/browser/web_contents/web_contents_impl.h"
#include "content/common/view_messages.h"
#include "content/public/browser/child_process_security_policy.h"
#include "content/public/browser/favicon_status.h"
#include "content/public/browser/native_web_keyboard_event.h"
#include "content/public/browser/navigation_details.h"
@@ -81,6 +83,7 @@
#include "third_party/WebKit/public/web/WebFindOptions.h"
#include "ui/display/screen.h"
#include "ui/events/base_event_utils.h"
#include "ui/latency/latency_info.h"
#if !defined(OS_MACOSX)
#include "ui/aura/window.h"
@@ -110,7 +113,7 @@ struct Converter<atom::SetSizeParams> {
return false;
bool autosize;
if (params.Get("enableAutoSize", &autosize))
out->enable_auto_size.reset(new bool(true));
out->enable_auto_size.reset(new bool(autosize));
gfx::Size size;
if (params.Get("min", &size))
out->min_size.reset(new gfx::Size(size));
@@ -269,11 +272,35 @@ content::ServiceWorkerContext* GetServiceWorkerContext(
void OnCapturePageDone(const base::Callback<void(const gfx::Image&)>& callback,
const SkBitmap& bitmap,
content::ReadbackResponse response) {
// Hack to enable transparency in captured image
// TODO(nitsakh) Remove hack once fixed in chromium
const_cast<SkBitmap&>(bitmap).setAlphaType(kPremul_SkAlphaType);
callback.Run(gfx::Image::CreateFrom1xBitmap(bitmap));
}
} // namespace
struct WebContents::FrameDispatchHelper {
WebContents* api_web_contents;
content::RenderFrameHost* rfh;
bool Send(IPC::Message* msg) { return rfh->Send(msg); }
void OnSetTemporaryZoomLevel(double level, IPC::Message* reply_msg) {
api_web_contents->OnSetTemporaryZoomLevel(rfh, level, reply_msg);
}
void OnGetZoomLevel(IPC::Message* reply_msg) {
api_web_contents->OnGetZoomLevel(rfh, reply_msg);
}
void OnRendererMessageSync(const base::string16& channel,
const base::ListValue& args,
IPC::Message* message) {
api_web_contents->OnRendererMessageSync(rfh, channel, args, message);
}
};
WebContents::WebContents(v8::Isolate* isolate,
content::WebContents* web_contents,
Type type)
@@ -283,13 +310,15 @@ WebContents::WebContents(v8::Isolate* isolate,
type_(type),
request_id_(0),
background_throttling_(true),
enable_devtools_(true) {
enable_devtools_(true),
is_dom_ready_(false) {
const mate::Dictionary options = mate::Dictionary::CreateEmpty(isolate);
if (type == REMOTE) {
web_contents->SetUserAgentOverride(GetBrowserContext()->GetUserAgent());
Init(isolate);
AttachAsUserData(web_contents);
InitZoomController(web_contents, options);
} else {
const mate::Dictionary options = mate::Dictionary::CreateEmpty(isolate);
auto session = Session::CreateFrom(isolate, GetBrowserContext());
session_.Reset(isolate, session.ToV8());
InitWithSessionAndOptions(isolate, web_contents, session, options);
@@ -303,6 +332,10 @@ WebContents::WebContents(v8::Isolate* isolate, const mate::Dictionary& options)
request_id_(0),
background_throttling_(true),
enable_devtools_(true) {
// WebContents may need to emit events when it is garbage collected, so it
// has to be deleted in the first gc callback.
MarkHighMemoryUsage();
// Read options.
options.Get("backgroundThrottling", &background_throttling_);
@@ -332,7 +365,7 @@ WebContents::WebContents(v8::Isolate* isolate, const mate::Dictionary& options)
// Obtain the session.
std::string partition;
mate::Handle<api::Session> session;
if (options.Get("session", &session)) {
if (options.Get("session", &session) && !session.IsEmpty()) {
} else if (options.Get("partition", &partition)) {
session = Session::FromPartition(isolate, partition);
} else {
@@ -370,8 +403,8 @@ WebContents::WebContents(v8::Isolate* isolate, const mate::Dictionary& options)
options.Get("transparent", &transparent);
content::WebContents::CreateParams params(session->browser_context());
auto* view = new OffScreenWebContentsView(
transparent, base::Bind(&WebContents::OnPaint, base::Unretained(this)));
auto* view = new OffScreenWebContentsView(transparent,
base::Bind(&WebContents::OnPaint, base::Unretained(this)));
params.view = view;
params.delegate_view = view;
@@ -386,6 +419,15 @@ WebContents::WebContents(v8::Isolate* isolate, const mate::Dictionary& options)
InitWithSessionAndOptions(isolate, web_contents, session, options);
}
void WebContents::InitZoomController(content::WebContents* web_contents,
const mate::Dictionary& options) {
WebContentsZoomController::CreateForWebContents(web_contents);
zoom_controller_ = WebContentsZoomController::FromWebContents(web_contents);
double zoom_factor;
if (options.Get(options::kZoomFactor, &zoom_factor))
zoom_controller_->SetDefaultZoomFactor(zoom_factor);
}
void WebContents::InitWithSessionAndOptions(v8::Isolate* isolate,
content::WebContents *web_contents,
mate::Handle<api::Session> session,
@@ -403,11 +445,7 @@ void WebContents::InitWithSessionAndOptions(v8::Isolate* isolate,
// Initialize security state client.
SecurityStateTabHelper::CreateForWebContents(web_contents);
// Initialize zoom controller.
WebContentsZoomController::CreateForWebContents(web_contents);
zoom_controller_ = WebContentsZoomController::FromWebContents(web_contents);
double zoom_factor;
if (options.Get(options::kZoomFactor, &zoom_factor))
zoom_controller_->SetDefaultZoomFactor(zoom_factor);
InitZoomController(web_contents, options);
web_contents->SetUserAgentOverride(GetBrowserContext()->GetUserAgent());
@@ -468,12 +506,7 @@ bool WebContents::DidAddMessageToConsole(content::WebContents* source,
const base::string16& message,
int32_t line_no,
const base::string16& source_id) {
if (type_ == BROWSER_WINDOW || type_ == OFF_SCREEN) {
return false;
} else {
Emit("console-message", level, message, line_no, source_id);
return true;
}
return Emit("console-message", level, message, line_no, source_id);
}
void WebContents::OnCreateWindow(
@@ -481,19 +514,20 @@ void WebContents::OnCreateWindow(
const std::string& frame_name,
WindowOpenDisposition disposition,
const std::vector<std::string>& features,
const scoped_refptr<content::ResourceRequestBodyImpl>& body) {
const scoped_refptr<content::ResourceRequestBody>& body) {
if (type_ == BROWSER_WINDOW || type_ == OFF_SCREEN)
Emit("-new-window", target_url, frame_name, disposition, features, body);
else
Emit("new-window", target_url, frame_name, disposition, features);
}
void WebContents::WebContentsCreated(content::WebContents* source_contents,
int opener_render_process_id,
int opener_render_frame_id,
const std::string& frame_name,
const GURL& target_url,
content::WebContents* new_contents) {
void WebContents::WebContentsCreated(
content::WebContents* source_contents,
int opener_render_process_id,
int opener_render_frame_id,
const std::string& frame_name,
const GURL& target_url,
content::WebContents* new_contents) {
v8::Locker locker(isolate());
v8::HandleScope handle_scope(isolate());
auto api_web_contents = CreateFrom(isolate(), new_contents, BROWSER_WINDOW);
@@ -586,16 +620,18 @@ void WebContents::HandleKeyboardEvent(
}
}
bool WebContents::PreHandleKeyboardEvent(
content::KeyboardEventProcessingResult WebContents::PreHandleKeyboardEvent(
content::WebContents* source,
const content::NativeWebKeyboardEvent& event,
bool* is_keyboard_shortcut) {
if (event.type() == blink::WebInputEvent::Type::RawKeyDown ||
event.type() == blink::WebInputEvent::Type::KeyUp) {
return Emit("before-input-event", event);
} else {
return false;
const content::NativeWebKeyboardEvent& event) {
if (event.GetType() == blink::WebInputEvent::Type::kRawKeyDown ||
event.GetType() == blink::WebInputEvent::Type::kKeyUp) {
bool prevent_default = Emit("before-input-event", event);
if (prevent_default) {
return content::KeyboardEventProcessingResult::HANDLED;
}
}
return content::KeyboardEventProcessingResult::NOT_HANDLED;
}
void WebContents::EnterFullscreenModeForTab(content::WebContents* source,
@@ -637,8 +673,10 @@ void WebContents::RendererResponsive(content::WebContents* source) {
bool WebContents::HandleContextMenu(const content::ContextMenuParams& params) {
if (params.custom_context.is_pepper_menu) {
Emit("pepper-context-menu", std::make_pair(params, web_contents()));
web_contents()->NotifyContextMenuClosed(params.custom_context);
Emit("pepper-context-menu",
std::make_pair(params, web_contents()),
base::Bind(&content::WebContents::NotifyContextMenuClosed,
base::Unretained(web_contents()), params.custom_context));
} else {
Emit("context-menu", std::make_pair(params, web_contents()));
}
@@ -753,13 +791,19 @@ void WebContents::MediaStoppedPlaying(const MediaPlayerInfo& video_type,
}
void WebContents::DidChangeThemeColor(SkColor theme_color) {
Emit("did-change-theme-color", atom::ToRGBHex(theme_color));
if (theme_color != SK_ColorTRANSPARENT) {
Emit("did-change-theme-color", atom::ToRGBHex(theme_color));
} else {
Emit("did-change-theme-color", nullptr);
}
}
void WebContents::DocumentLoadedInFrame(
content::RenderFrameHost* render_frame_host) {
if (!render_frame_host->GetParent())
if (!render_frame_host->GetParent()) {
is_dom_ready_ = true;
Emit("dom-ready");
}
}
void WebContents::DidFinishLoad(content::RenderFrameHost* render_frame_host,
@@ -781,6 +825,7 @@ void WebContents::DidFailLoad(content::RenderFrameHost* render_frame_host,
}
void WebContents::DidStartLoading() {
is_dom_ready_ = false;
Emit("did-start-loading");
}
@@ -818,10 +863,10 @@ void WebContents::DidFinishNavigation(
bool is_main_frame = navigation_handle->IsInMainFrame();
if (navigation_handle->HasCommitted() && !navigation_handle->IsErrorPage()) {
auto url = navigation_handle->GetURL();
bool is_in_page = navigation_handle->IsSamePage();
if (is_main_frame && !is_in_page) {
bool is_same_document = navigation_handle->IsSameDocument();
if (is_main_frame && !is_same_document) {
Emit("did-navigate", url);
} else if (is_in_page) {
} else if (is_same_document) {
Emit("did-navigate-in-page", url, is_main_frame);
}
} else {
@@ -846,7 +891,7 @@ void WebContents::DidUpdateFaviconURL(
const std::vector<content::FaviconURL>& urls) {
std::set<GURL> unique_urls;
for (const auto& iter : urls) {
if (iter.icon_type != content::FaviconURL::FAVICON)
if (iter.icon_type != content::FaviconURL::IconType::kFavicon)
continue;
const GURL& url = iter.icon_url;
if (url.is_valid())
@@ -875,10 +920,11 @@ void WebContents::DevToolsOpened() {
managed_web_contents()->CallClientFunction(
"DevToolsAPI.setInspectedTabId", &tab_id, nullptr, nullptr);
// Inherit owner window in devtools.
if (owner_window())
handle->SetOwnerWindow(managed_web_contents()->GetDevToolsWebContents(),
owner_window());
// Inherit owner window in devtools when it doesn't have one.
auto* devtools = managed_web_contents()->GetDevToolsWebContents();
bool has_window = devtools->GetUserData(NativeWindowRelay::UserDataKey());
if (owner_window() && !has_window)
handle->SetOwnerWindow(devtools, owner_window());
Emit("devtools-opened");
}
@@ -891,16 +937,20 @@ void WebContents::DevToolsClosed() {
Emit("devtools-closed");
}
void WebContents::ShowAutofillPopup(content::RenderFrameHost* frame_host,
const gfx::RectF& bounds,
const std::vector<base::string16>& values,
const std::vector<base::string16>& labels) {
auto relay = NativeWindowRelay::FromWebContents(web_contents());
if (relay) {
relay->window->ShowAutofillPopup(
frame_host, web_contents(), bounds, values, labels);
}
}
bool WebContents::OnMessageReceived(const IPC::Message& message) {
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(WebContents, message)
IPC_MESSAGE_HANDLER(AtomViewHostMsg_Message, OnRendererMessage)
IPC_MESSAGE_HANDLER_DELAY_REPLY(AtomViewHostMsg_Message_Sync,
OnRendererMessageSync)
IPC_MESSAGE_HANDLER_DELAY_REPLY(AtomViewHostMsg_SetTemporaryZoomLevel,
OnSetTemporaryZoomLevel)
IPC_MESSAGE_HANDLER_DELAY_REPLY(AtomViewHostMsg_GetZoomLevel,
OnGetZoomLevel)
IPC_MESSAGE_HANDLER_CODE(ViewHostMsg_SetCursor, OnCursorChange,
handled = false)
IPC_MESSAGE_UNHANDLED(handled = false)
@@ -910,16 +960,28 @@ bool WebContents::OnMessageReceived(const IPC::Message& message) {
}
bool WebContents::OnMessageReceived(const IPC::Message& message,
content::RenderFrameHost* frame_host) {
content::RenderFrameHost* frame_host) {
bool handled = true;
FrameDispatchHelper helper = {this, frame_host};
auto relay = NativeWindowRelay::FromWebContents(web_contents());
if (!relay)
return false;
IPC_BEGIN_MESSAGE_MAP_WITH_PARAM(NativeWindow, message, frame_host)
IPC_MESSAGE_FORWARD(AtomAutofillFrameHostMsg_ShowPopup,
relay->window.get(), NativeWindow::ShowAutofillPopup)
IPC_MESSAGE_FORWARD(AtomAutofillFrameHostMsg_HidePopup,
relay->window.get(), NativeWindow::HideAutofillPopup)
if (relay) {
IPC_BEGIN_MESSAGE_MAP_WITH_PARAM(NativeWindow, message, frame_host)
IPC_MESSAGE_FORWARD(AtomAutofillFrameHostMsg_HidePopup,
relay->window.get(), NativeWindow::HideAutofillPopup)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
}
IPC_BEGIN_MESSAGE_MAP_WITH_PARAM(WebContents, message, frame_host)
IPC_MESSAGE_HANDLER(AtomFrameHostMsg_Message, OnRendererMessage)
IPC_MESSAGE_FORWARD_DELAY_REPLY(AtomFrameHostMsg_Message_Sync, &helper,
FrameDispatchHelper::OnRendererMessageSync)
IPC_MESSAGE_FORWARD_DELAY_REPLY(
AtomFrameHostMsg_SetTemporaryZoomLevel, &helper,
FrameDispatchHelper::OnSetTemporaryZoomLevel)
IPC_MESSAGE_FORWARD_DELAY_REPLY(AtomFrameHostMsg_GetZoomLevel, &helper,
FrameDispatchHelper::OnGetZoomLevel)
IPC_MESSAGE_HANDLER(AtomAutofillFrameHostMsg_ShowPopup, ShowAutofillPopup)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
@@ -956,14 +1018,18 @@ void WebContents::WebContentsDestroyed() {
void WebContents::NavigationEntryCommitted(
const content::LoadCommittedDetails& details) {
Emit("navigation-entry-commited", details.entry->GetURL(),
details.is_in_page, details.did_replace_entry);
details.is_same_document, details.did_replace_entry);
}
int64_t WebContents::GetIDForContents(content::WebContents* web_contents) {
int64_t process_id = web_contents->GetRenderProcessHost()->GetID();
int64_t routing_id = web_contents->GetMainFrame()->GetRoutingID();
int64_t rv = (process_id << 32) + routing_id;
return rv;
}
int64_t WebContents::GetID() const {
int64_t process_id = web_contents()->GetRenderProcessHost()->GetID();
int64_t routing_id = web_contents()->GetRenderViewHost()->GetRoutingID();
int64_t rv = (process_id << 32) + routing_id;
return rv;
return WebContents::GetIDForContents(web_contents());
}
int WebContents::GetProcessID() const {
@@ -1002,7 +1068,7 @@ void WebContents::LoadURL(const GURL& url, const mate::Dictionary& options) {
GURL http_referrer;
if (options.Get("httpReferrer", &http_referrer))
params.referrer = content::Referrer(http_referrer.GetAsReferrer(),
blink::WebReferrerPolicyDefault);
blink::kWebReferrerPolicyDefault);
std::string user_agent;
if (options.Get("userAgent", &user_agent))
@@ -1012,7 +1078,7 @@ void WebContents::LoadURL(const GURL& url, const mate::Dictionary& options) {
if (options.Get("extraHeaders", &extra_headers))
params.extra_headers = extra_headers;
scoped_refptr<content::ResourceRequestBodyImpl> body;
scoped_refptr<content::ResourceRequestBody> body;
if (options.Get("postData", &body)) {
params.post_data = body;
params.load_type = content::NavigationController::LOAD_TYPE_HTTP_POST;
@@ -1053,7 +1119,7 @@ void WebContents::DownloadURL(const GURL& url) {
download_manager->DownloadUrl(
content::DownloadUrlParameters::CreateForWebContentsMainFrame(
web_contents(), url));
web_contents(), url, NO_TRAFFIC_ANNOTATION_YET));
}
GURL WebContents::GetURL() const {
@@ -1146,7 +1212,8 @@ void WebContents::OpenDevTools(mate::Arguments* args) {
std::string state;
if (type_ == WEB_VIEW || !owner_window()) {
state = "detach";
} else if (args && args->Length() == 1) {
}
if (args && args->Length() == 1) {
bool detach = false;
mate::Dictionary options;
if (args->GetNext(&options)) {
@@ -1240,9 +1307,22 @@ void WebContents::HasServiceWorker(
if (!context)
return;
context->CheckHasServiceWorker(web_contents()->GetLastCommittedURL(),
GURL::EmptyGURL(),
callback);
struct WrappedCallback {
base::Callback<void(bool)> callback_;
explicit WrappedCallback(const base::Callback<void(bool)>& callback)
: callback_(callback) {}
void Run(content::ServiceWorkerCapability capability) {
callback_.Run(capability !=
content::ServiceWorkerCapability::NO_SERVICE_WORKER);
delete this;
}
};
auto wrapped_callback = new WrappedCallback(callback);
context->CheckHasServiceWorker(
web_contents()->GetLastCommittedURL(), GURL::EmptyGURL(),
base::Bind(&WrappedCallback::Run, base::Unretained(wrapped_callback)));
}
void WebContents::UnregisterServiceWorker(
@@ -1267,15 +1347,27 @@ bool WebContents::IsAudioMuted() {
return web_contents()->IsAudioMuted();
}
bool WebContents::IsDOMReady() const {
return is_dom_ready_;
}
void WebContents::Print(mate::Arguments* args) {
PrintSettings settings = { false, false, base::string16() };
if (args->Length() == 1 && !args->GetNext(&settings)) {
if (args->Length() >= 1 && !args->GetNext(&settings)) {
args->ThrowError();
return;
}
printing::PrintViewManagerBasic::FromWebContents(web_contents())->
PrintNow(web_contents()->GetMainFrame(),
auto print_view_manager_basic_ptr =
printing::PrintViewManagerBasic::FromWebContents(web_contents());
if (args->Length() == 2) {
base::Callback<void(bool)> callback;
if (!args->GetNext(&callback)) {
args->ThrowError();
return;
}
print_view_manager_basic_ptr->SetCallback(callback);
}
print_view_manager_basic_ptr->PrintNow(web_contents()->GetMainFrame(),
settings.silent,
settings.print_background,
settings.device_name);
@@ -1284,6 +1376,7 @@ void WebContents::Print(mate::Arguments* args) {
std::vector<printing::PrinterBasicInfo> WebContents::GetPrinterList() {
std::vector<printing::PrinterBasicInfo> printers;
auto print_backend = printing::PrintBackend::CreateInstance(nullptr);
base::ThreadRestrictions::ScopedAllowIO allow_io;
print_backend->EnumeratePrinters(&printers);
return printers;
}
@@ -1415,7 +1508,12 @@ void WebContents::TabTraverse(bool reverse) {
bool WebContents::SendIPCMessage(bool all_frames,
const base::string16& channel,
const base::ListValue& args) {
return Send(new AtomViewMsg_Message(routing_id(), all_frames, channel, args));
auto frame_host = web_contents()->GetMainFrame();
if (frame_host) {
return frame_host->Send(new AtomFrameMsg_Message(
frame_host->GetRoutingID(), all_frames, channel, args));
}
return false;
}
void WebContents::SendInputEvent(v8::Isolate* isolate,
@@ -1425,23 +1523,24 @@ void WebContents::SendInputEvent(v8::Isolate* isolate,
if (!view)
return;
int type = mate::GetWebInputEventType(isolate, input_event);
if (blink::WebInputEvent::isMouseEventType(type)) {
blink::WebInputEvent::Type type = mate::GetWebInputEventType(isolate,
input_event);
if (blink::WebInputEvent::IsMouseEventType(type)) {
blink::WebMouseEvent mouse_event;
if (mate::ConvertFromV8(isolate, input_event, &mouse_event)) {
view->ProcessMouseEvent(mouse_event, ui::LatencyInfo());
return;
}
} else if (blink::WebInputEvent::isKeyboardEventType(type)) {
} else if (blink::WebInputEvent::IsKeyboardEventType(type)) {
content::NativeWebKeyboardEvent keyboard_event(
blink::WebKeyboardEvent::RawKeyDown,
blink::WebInputEvent::NoModifiers,
blink::WebKeyboardEvent::kRawKeyDown,
blink::WebInputEvent::kNoModifiers,
ui::EventTimeForNow());
if (mate::ConvertFromV8(isolate, input_event, &keyboard_event)) {
view->ProcessKeyboardEvent(keyboard_event);
view->ProcessKeyboardEvent(keyboard_event, ui::LatencyInfo());
return;
}
} else if (type == blink::WebInputEvent::MouseWheel) {
} else if (type == blink::WebInputEvent::kMouseWheel) {
blink::WebMouseWheelEvent mouse_wheel_event;
if (mate::ConvertFromV8(isolate, input_event, &mouse_wheel_event)) {
view->ProcessMouseWheelEvent(mouse_wheel_event, ui::LatencyInfo());
@@ -1541,7 +1640,7 @@ void WebContents::CapturePage(mate::Arguments* args) {
gfx::Size bitmap_size = view_size;
const gfx::NativeView native_view = view->GetNativeView();
const float scale =
display::Screen::GetScreen()->GetDisplayNearestWindow(native_view)
display::Screen::GetScreen()->GetDisplayNearestView(native_view)
.device_scale_factor();
if (scale > 1.0f)
bitmap_size = gfx::ScaleToCeiledSize(view_size, scale);
@@ -1553,7 +1652,7 @@ void WebContents::CapturePage(mate::Arguments* args) {
}
void WebContents::OnCursorChange(const content::WebCursor& cursor) {
content::WebCursor::CursorInfo info;
content::CursorInfo info;
cursor.GetCursorInfo(&info);
if (cursor.IsCustom()) {
@@ -1584,10 +1683,6 @@ bool WebContents::IsOffScreen() const {
#endif
}
bool WebContents::IsOffScreenOrEmbedderOffscreen() const {
return IsOffScreen() || (embedder_ && embedder_->IsOffScreen());
}
void WebContents::OnPaint(const gfx::Rect& dirty_rect, const SkBitmap& bitmap) {
Emit("paint", dirty_rect, gfx::Image::CreateFrom1xBitmap(bitmap));
}
@@ -1597,10 +1692,10 @@ void WebContents::StartPainting() {
return;
#if defined(ENABLE_OSR)
auto* osr_rwhv = static_cast<OffScreenRenderWidgetHostView*>(
web_contents()->GetRenderWidgetHostView());
if (osr_rwhv)
osr_rwhv->SetPainting(true);
const auto* wc_impl = static_cast<content::WebContentsImpl*>(web_contents());
auto* osr_wcv = static_cast<OffScreenWebContentsView*>(wc_impl->GetView());
if (osr_wcv)
osr_wcv->SetPainting(true);
#endif
}
@@ -1609,10 +1704,10 @@ void WebContents::StopPainting() {
return;
#if defined(ENABLE_OSR)
auto* osr_rwhv = static_cast<OffScreenRenderWidgetHostView*>(
web_contents()->GetRenderWidgetHostView());
if (osr_rwhv)
osr_rwhv->SetPainting(false);
const auto* wc_impl = static_cast<content::WebContentsImpl*>(web_contents());
auto* osr_wcv = static_cast<OffScreenWebContentsView*>(wc_impl->GetView());
if (osr_wcv)
osr_wcv->SetPainting(false);
#endif
}
@@ -1621,9 +1716,10 @@ bool WebContents::IsPainting() const {
return false;
#if defined(ENABLE_OSR)
const auto* osr_rwhv = static_cast<OffScreenRenderWidgetHostView*>(
web_contents()->GetRenderWidgetHostView());
return osr_rwhv && osr_rwhv->IsPainting();
const auto* wc_impl = static_cast<content::WebContentsImpl*>(web_contents());
auto* osr_wcv = static_cast<OffScreenWebContentsView*>(wc_impl->GetView());
return osr_wcv && osr_wcv->IsPainting();
#else
return false;
#endif
@@ -1634,10 +1730,11 @@ void WebContents::SetFrameRate(int frame_rate) {
return;
#if defined(ENABLE_OSR)
auto* osr_rwhv = static_cast<OffScreenRenderWidgetHostView*>(
web_contents()->GetRenderWidgetHostView());
if (osr_rwhv)
osr_rwhv->SetFrameRate(frame_rate);
const auto* wc_impl = static_cast<content::WebContentsImpl*>(web_contents());
auto* osr_wcv = static_cast<OffScreenWebContentsView*>(wc_impl->GetView());
if (osr_wcv)
osr_wcv->SetFrameRate(frame_rate);
#endif
}
@@ -1646,9 +1743,10 @@ int WebContents::GetFrameRate() const {
return 0;
#if defined(ENABLE_OSR)
const auto* osr_rwhv = static_cast<OffScreenRenderWidgetHostView*>(
web_contents()->GetRenderWidgetHostView());
return osr_rwhv ? osr_rwhv->GetFrameRate() : 0;
const auto* wc_impl = static_cast<content::WebContentsImpl*>(web_contents());
auto* osr_wcv = static_cast<OffScreenWebContentsView*>(wc_impl->GetView());
return osr_wcv ? osr_wcv->GetFrameRate() : 0;
#else
return 0;
#endif
@@ -1699,25 +1797,38 @@ double WebContents::GetZoomFactor() {
return content::ZoomLevelToZoomFactor(level);
}
void WebContents::OnSetTemporaryZoomLevel(double level,
void WebContents::OnSetTemporaryZoomLevel(content::RenderFrameHost* rfh,
double level,
IPC::Message* reply_msg) {
zoom_controller_->SetTemporaryZoomLevel(level);
double new_level = zoom_controller_->GetZoomLevel();
AtomViewHostMsg_SetTemporaryZoomLevel::WriteReplyParams(reply_msg, new_level);
Send(reply_msg);
AtomFrameHostMsg_SetTemporaryZoomLevel::WriteReplyParams(reply_msg,
new_level);
rfh->Send(reply_msg);
}
void WebContents::OnGetZoomLevel(IPC::Message* reply_msg) {
AtomViewHostMsg_GetZoomLevel::WriteReplyParams(reply_msg, GetZoomLevel());
Send(reply_msg);
void WebContents::OnGetZoomLevel(content::RenderFrameHost* rfh,
IPC::Message* reply_msg) {
AtomFrameHostMsg_GetZoomLevel::WriteReplyParams(reply_msg, GetZoomLevel());
rfh->Send(reply_msg);
}
v8::Local<v8::Value> WebContents::GetWebPreferences(v8::Isolate* isolate) {
WebContentsPreferences* web_preferences =
WebContentsPreferences::FromWebContents(web_contents());
if (!web_preferences)
return v8::Null(isolate);
return mate::ConvertToV8(isolate, *web_preferences->web_preferences());
}
v8::Local<v8::Value> WebContents::GetLastWebPreferences(v8::Isolate* isolate) {
WebContentsPreferences* web_preferences =
WebContentsPreferences::FromWebContents(web_contents());
if (!web_preferences)
return v8::Null(isolate);
return mate::ConvertToV8(isolate, *web_preferences->last_web_preferences());
}
v8::Local<v8::Value> WebContents::GetOwnerBrowserWindow() {
if (owner_window())
return Window::From(isolate(), owner_window());
@@ -1758,6 +1869,21 @@ void WebContents::SetEmbedder(const WebContents* embedder) {
}
}
void WebContents::SetDevToolsWebContents(const WebContents* devtools) {
if (managed_web_contents())
managed_web_contents()->SetDevToolsWebContents(devtools->web_contents());
}
v8::Local<v8::Value> WebContents::GetNativeView() const {
gfx::NativeView ptr = web_contents()->GetNativeView();
auto buffer = node::Buffer::Copy(
isolate(), reinterpret_cast<char*>(&ptr), sizeof(gfx::NativeView));
if (buffer.IsEmpty())
return v8::Null(isolate());
else
return buffer.ToLocalChecked();
}
v8::Local<v8::Value> WebContents::DevToolsWebContents(v8::Isolate* isolate) {
if (devtools_web_contents_.IsEmpty())
return v8::Null(isolate);
@@ -1773,6 +1899,12 @@ v8::Local<v8::Value> WebContents::Debugger(v8::Isolate* isolate) {
return v8::Local<v8::Value>::New(isolate, debugger_);
}
void WebContents::GrantOriginAccess(const GURL& url) {
content::ChildProcessSecurityPolicy::GetInstance()->GrantOrigin(
web_contents()->GetMainFrame()->GetProcess()->GetID(),
url::Origin(url));
}
// static
void WebContents::BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::FunctionTemplate> prototype) {
@@ -1810,6 +1942,7 @@ void WebContents::BuildPrototype(v8::Isolate* isolate,
&WebContents::SetIgnoreMenuShortcuts)
.SetMethod("setAudioMuted", &WebContents::SetAudioMuted)
.SetMethod("isAudioMuted", &WebContents::IsAudioMuted)
.SetMethod("isDomReady", &WebContents::IsDOMReady)
.SetMethod("undo", &WebContents::Undo)
.SetMethod("redo", &WebContents::Redo)
.SetMethod("cut", &WebContents::Cut)
@@ -1833,9 +1966,7 @@ void WebContents::BuildPrototype(v8::Isolate* isolate,
.SetMethod("startDrag", &WebContents::StartDrag)
.SetMethod("setSize", &WebContents::SetSize)
.SetMethod("isGuest", &WebContents::IsGuest)
#if defined(ENABLE_OSR)
.SetMethod("isOffscreen", &WebContents::IsOffScreen)
#endif
.SetMethod("startPainting", &WebContents::StartPainting)
.SetMethod("stopPainting", &WebContents::StopPainting)
.SetMethod("isPainting", &WebContents::IsPainting)
@@ -1848,6 +1979,7 @@ void WebContents::BuildPrototype(v8::Isolate* isolate,
.SetMethod("_getZoomFactor", &WebContents::GetZoomFactor)
.SetMethod("getType", &WebContents::GetType)
.SetMethod("getWebPreferences", &WebContents::GetWebPreferences)
.SetMethod("getLastWebPreferences", &WebContents::GetLastWebPreferences)
.SetMethod("getOwnerBrowserWindow", &WebContents::GetOwnerBrowserWindow)
.SetMethod("hasServiceWorker", &WebContents::HasServiceWorker)
.SetMethod("unregisterServiceWorker",
@@ -1863,10 +1995,13 @@ void WebContents::BuildPrototype(v8::Isolate* isolate,
.SetMethod("copyImageAt", &WebContents::CopyImageAt)
.SetMethod("capturePage", &WebContents::CapturePage)
.SetMethod("setEmbedder", &WebContents::SetEmbedder)
.SetMethod("setDevToolsWebContents", &WebContents::SetDevToolsWebContents)
.SetMethod("getNativeView", &WebContents::GetNativeView)
.SetMethod("setWebRTCIPHandlingPolicy",
&WebContents::SetWebRTCIPHandlingPolicy)
.SetMethod("getWebRTCIPHandlingPolicy",
&WebContents::GetWebRTCIPHandlingPolicy)
.SetMethod("_grantOriginAccess", &WebContents::GrantOriginAccess)
.SetProperty("id", &WebContents::ID)
.SetProperty("session", &WebContents::Session)
.SetProperty("hostWebContents", &WebContents::HostWebContents)
@@ -1878,17 +2013,19 @@ AtomBrowserContext* WebContents::GetBrowserContext() const {
return static_cast<AtomBrowserContext*>(web_contents()->GetBrowserContext());
}
void WebContents::OnRendererMessage(const base::string16& channel,
void WebContents::OnRendererMessage(content::RenderFrameHost* frame_host,
const base::string16& channel,
const base::ListValue& args) {
// webContents.emit(channel, new Event(), args...);
Emit(base::UTF16ToUTF8(channel), args);
}
void WebContents::OnRendererMessageSync(const base::string16& channel,
void WebContents::OnRendererMessageSync(content::RenderFrameHost* frame_host,
const base::string16& channel,
const base::ListValue& args,
IPC::Message* message) {
// webContents.emit(channel, new Event(sender, message), args...);
EmitWithSender(base::UTF16ToUTF8(channel), web_contents(), message, args);
EmitWithSender(base::UTF16ToUTF8(channel), frame_host, message, args);
}
// static

View File

@@ -14,6 +14,8 @@
#include "atom/browser/common_web_contents_delegate.h"
#include "atom/browser/ui/autofill_popup.h"
#include "content/common/cursors/webcursor.h"
#include "content/public/browser/keyboard_event_processing_result.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_observer.h"
#include "content/public/common/favicon_url.h"
#include "native_mate/handle.h"
@@ -29,7 +31,7 @@ class InspectableWebContents;
}
namespace content {
class ResourceRequestBodyImpl;
class ResourceRequestBody;
}
namespace mate {
@@ -77,6 +79,8 @@ class WebContents : public mate::TrackableObject<WebContents>,
static void BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::FunctionTemplate> prototype);
static int64_t GetIDForContents(content::WebContents* web_contents);
// Notifies to destroy any guest web contents before destroying self.
void DestroyWebContents(bool async);
@@ -115,14 +119,18 @@ class WebContents : public mate::TrackableObject<WebContents>,
void DisableDeviceEmulation();
void InspectElement(int x, int y);
void InspectServiceWorker();
void HasServiceWorker(const base::Callback<void(bool)>&);
void HasServiceWorker(
const base::Callback<void(bool)>&);
void UnregisterServiceWorker(const base::Callback<void(bool)>&);
void SetIgnoreMenuShortcuts(bool ignore);
void SetAudioMuted(bool muted);
bool IsAudioMuted();
bool IsDOMReady() const;
void Print(mate::Arguments* args);
std::vector<printing::PrinterBasicInfo> GetPrinterList();
void SetEmbedder(const WebContents* embedder);
void SetDevToolsWebContents(const WebContents* devtools);
v8::Local<v8::Value> GetNativeView() const;
// Print current page as PDF.
void PrintToPDF(const base::DictionaryValue& setting,
@@ -179,7 +187,6 @@ class WebContents : public mate::TrackableObject<WebContents>,
// Methods for offscreen rendering
bool IsOffScreen() const;
bool IsOffScreenOrEmbedderOffscreen() const;
void OnPaint(const gfx::Rect& dirty_rect, const SkBitmap& bitmap);
void StartPainting();
void StopPainting();
@@ -206,14 +213,19 @@ class WebContents : public mate::TrackableObject<WebContents>,
const std::string& frame_name,
WindowOpenDisposition disposition,
const std::vector<std::string>& features,
const scoped_refptr<content::ResourceRequestBodyImpl>& body);
const scoped_refptr<content::ResourceRequestBody>& body);
// Returns the web preferences of current WebContents.
v8::Local<v8::Value> GetWebPreferences(v8::Isolate* isolate);
v8::Local<v8::Value> GetLastWebPreferences(v8::Isolate* isolate);
// Returns the owner window.
v8::Local<v8::Value> GetOwnerBrowserWindow();
// Grants the child process the capability to access URLs with the origin of
// the specified URL.
void GrantOriginAccess(const GURL& url);
// Properties.
int32_t ID() const;
v8::Local<v8::Value> Session(v8::Isolate* isolate);
@@ -241,12 +253,14 @@ class WebContents : public mate::TrackableObject<WebContents>,
const base::string16& message,
int32_t line_no,
const base::string16& source_id) override;
void WebContentsCreated(content::WebContents* source_contents,
int opener_render_process_id,
int opener_render_frame_id,
const std::string& frame_name,
const GURL& target_url,
content::WebContents* new_contents) override;
void WebContentsCreated(
content::WebContents* source_contents,
int opener_render_process_id,
int opener_render_frame_id,
const std::string& frame_name,
const GURL& target_url,
content::WebContents* new_contents)
override;
void AddNewContents(content::WebContents* source,
content::WebContents* new_contents,
WindowOpenDisposition disposition,
@@ -268,9 +282,9 @@ class WebContents : public mate::TrackableObject<WebContents>,
void HandleKeyboardEvent(
content::WebContents* source,
const content::NativeWebKeyboardEvent& event) override;
bool PreHandleKeyboardEvent(content::WebContents* source,
const content::NativeWebKeyboardEvent& event,
bool* is_keyboard_shortcut) override;
content::KeyboardEventProcessingResult PreHandleKeyboardEvent(
content::WebContents* source,
const content::NativeWebKeyboardEvent& event) override;
void EnterFullscreenModeForTab(content::WebContents* source,
const GURL& origin) override;
void ExitFullscreenModeForTab(content::WebContents* source) override;
@@ -351,7 +365,13 @@ class WebContents : public mate::TrackableObject<WebContents>,
void DevToolsOpened() override;
void DevToolsClosed() override;
void ShowAutofillPopup(content::RenderFrameHost* frame_host,
const gfx::RectF& bounds,
const std::vector<base::string16>& values,
const std::vector<base::string16>& labels);
private:
struct FrameDispatchHelper;
AtomBrowserContext* GetBrowserContext() const;
uint32_t GetNextRequestId() {
@@ -362,21 +382,29 @@ class WebContents : public mate::TrackableObject<WebContents>,
void OnCursorChange(const content::WebCursor& cursor);
// Called when received a message from renderer.
void OnRendererMessage(const base::string16& channel,
void OnRendererMessage(content::RenderFrameHost* frame_host,
const base::string16& channel,
const base::ListValue& args);
// Called when received a synchronous message from renderer.
void OnRendererMessageSync(const base::string16& channel,
void OnRendererMessageSync(content::RenderFrameHost* frame_host,
const base::string16& channel,
const base::ListValue& args,
IPC::Message* message);
// Called when received a synchronous message from renderer to
// set temporary zoom level.
void OnSetTemporaryZoomLevel(double level, IPC::Message* reply_msg);
void OnSetTemporaryZoomLevel(content::RenderFrameHost* frame_host,
double level,
IPC::Message* reply_msg);
// Called when received a synchronous message from renderer to
// get the zoom level.
void OnGetZoomLevel(IPC::Message* reply_msg);
void OnGetZoomLevel(content::RenderFrameHost* frame_host,
IPC::Message* reply_msg);
void InitZoomController(content::WebContents* web_contents,
const mate::Dictionary& options);
v8::Global<v8::Value> session_;
v8::Global<v8::Value> devtools_web_contents_;
@@ -403,6 +431,9 @@ class WebContents : public mate::TrackableObject<WebContents>,
// Whether to enable devtools.
bool enable_devtools_;
// Whether page's document is ready.
bool is_dom_ready_;
DISALLOW_COPY_AND_ASSIGN(WebContents);
};

View File

@@ -37,6 +37,26 @@ namespace atom {
namespace api {
namespace {
template<typename Method, typename Event, typename Listener>
void CallNetworkDelegateMethod(
brightray::URLRequestContextGetter* url_request_context_getter,
Method method,
Event type,
URLPatterns patterns,
Listener listener) {
// Force creating network delegate.
net::URLRequestContext* context =
url_request_context_getter->GetURLRequestContext();
// Then call the method.
AtomNetworkDelegate* network_delegate =
static_cast<AtomNetworkDelegate*>(context->network_delegate());
(network_delegate->*method)(type, std::move(patterns), std::move(listener));
}
} // namespace
WebRequest::WebRequest(v8::Isolate* isolate,
AtomBrowserContext* browser_context)
: browser_context_(browser_context) {
@@ -74,10 +94,15 @@ void WebRequest::SetListener(Method method, Event type, mate::Arguments* args) {
return;
}
auto delegate = browser_context_->network_delegate();
BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
base::Bind(method, base::Unretained(delegate), type,
patterns, listener));
brightray::URLRequestContextGetter* url_request_context_getter =
browser_context_->url_request_context_getter();
if (!url_request_context_getter)
return;
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
base::Bind(&CallNetworkDelegateMethod<Method, Event, Listener>,
base::RetainedRef(url_request_context_getter),
method, type, std::move(patterns), std::move(listener)));
}
// static

View File

@@ -7,10 +7,12 @@
#include "atom/browser/web_view_manager.h"
#include "atom/common/native_mate_converters/content_converter.h"
#include "atom/common/native_mate_converters/value_converter.h"
#include "atom/common/node_includes.h"
#include "atom/common/options_switches.h"
#include "content/public/browser/browser_context.h"
#include "native_mate/dictionary.h"
// Must be the last in the includes list.
// See https://github.com/electron/electron/issues/10363
#include "atom/common/node_includes.h"
using atom::WebContentsPreferences;

View File

@@ -3,7 +3,6 @@
// found in the LICENSE file.
#include "atom/browser/api/atom_api_window.h"
#include "atom/common/native_mate_converters/value_converter.h"
#include "atom/browser/api/atom_api_browser_view.h"
#include "atom/browser/api/atom_api_menu.h"
@@ -17,6 +16,7 @@
#include "atom/common/native_mate_converters/gurl_converter.h"
#include "atom/common/native_mate_converters/image_converter.h"
#include "atom/common/native_mate_converters/string16_converter.h"
#include "atom/common/native_mate_converters/value_converter.h"
#include "atom/common/options_switches.h"
#include "base/command_line.h"
#include "base/threading/thread_task_runner_handle.h"
@@ -101,7 +101,7 @@ Window::Window(v8::Isolate* isolate, v8::Local<v8::Object> wrapper,
}
#endif
if (options.Get("webContents", &web_contents)) {
if (options.Get("webContents", &web_contents) && !web_contents.IsEmpty()) {
// Set webPreferences from options if using an existing webContents.
// These preferences will be used when the webContent launches new
// render processes.
@@ -135,7 +135,7 @@ void Window::Init(v8::Isolate* isolate,
// The parent window.
mate::Handle<Window> parent;
if (options.Get("parent", &parent))
if (options.Get("parent", &parent) && !parent.IsEmpty())
parent_window_.Reset(isolate, parent.ToV8());
// Creates BrowserWindow.
@@ -144,11 +144,12 @@ void Window::Init(v8::Isolate* isolate,
options,
parent.IsEmpty() ? nullptr : parent->window_.get()));
web_contents->SetOwnerWindow(window_.get());
window_->set_is_offscreen_dummy(api_web_contents_->IsOffScreen());
#if defined(TOOLKIT_VIEWS)
// Sets the window icon.
mate::Handle<NativeImage> icon;
if (options.Get(options::kIcon, &icon))
if (options.Get(options::kIcon, &icon) && !icon.IsEmpty())
SetIcon(icon);
#endif
@@ -183,7 +184,7 @@ void Window::WillDestroyNativeObject() {
v8::HandleScope handle_scope(isolate());
for (v8::Local<v8::Value> value : child_windows_.Values(isolate())) {
mate::Handle<Window> child;
if (mate::ConvertFromV8(isolate(), value, &child))
if (mate::ConvertFromV8(isolate(), value, &child) && !child.IsEmpty())
child->window_->CloseImmediately();
}
}
@@ -392,6 +393,10 @@ bool Window::IsEnabled() {
return window_->IsEnabled();
}
void Window::SetEnabled(bool enable) {
window_->SetEnabled(enable);
}
void Window::Maximize() {
window_->Maximize();
}
@@ -445,9 +450,11 @@ gfx::Rect Window::GetContentBounds() {
}
void Window::SetSize(int width, int height, mate::Arguments* args) {
gfx::Size size = window_->GetMinimumSize();
size.SetToMax(gfx::Size(width, height));
bool animate = false;
args->GetNext(&animate);
window_->SetSize(gfx::Size(width, height), animate);
window_->SetSize(size, animate);
}
std::vector<int> Window::GetSize() {
@@ -603,6 +610,14 @@ void Window::SetSkipTaskbar(bool skip) {
window_->SetSkipTaskbar(skip);
}
void Window::SetSimpleFullScreen(bool simple_fullscreen) {
window_->SetSimpleFullScreen(simple_fullscreen);
}
bool Window::IsSimpleFullScreen() {
return window_->IsSimpleFullScreen();
}
void Window::SetKiosk(bool kiosk) {
window_->SetKiosk(kiosk);
}
@@ -623,6 +638,14 @@ bool Window::HasShadow() {
return window_->HasShadow();
}
void Window::SetOpacity(const double opacity) {
window_->SetOpacity(opacity);
}
double Window::GetOpacity() {
return window_->GetOpacity();
}
void Window::FocusOnWebView() {
window_->FocusOnWebView();
}
@@ -651,8 +674,11 @@ bool Window::IsDocumentEdited() {
return window_->IsDocumentEdited();
}
void Window::SetIgnoreMouseEvents(bool ignore) {
return window_->SetIgnoreMouseEvents(ignore);
void Window::SetIgnoreMouseEvents(bool ignore, mate::Arguments* args) {
mate::Dictionary options;
bool forward = false;
args->GetNext(&options) && options.Get("forward", &forward);
return window_->SetIgnoreMouseEvents(ignore, forward);
}
void Window::SetContentProtection(bool enable) {
@@ -707,7 +733,7 @@ void Window::SetMenu(v8::Isolate* isolate, v8::Local<v8::Value> value) {
mate::Handle<Menu> menu;
if (value->IsObject() &&
mate::V8ToString(value->ToObject()->GetConstructorName()) == "Menu" &&
mate::ConvertFromV8(isolate, value, &menu)) {
mate::ConvertFromV8(isolate, value, &menu) && !menu.IsEmpty()) {
menu_.Reset(isolate, menu.ToV8());
window_->SetMenu(menu->model());
} else if (value->IsNull()) {
@@ -827,7 +853,7 @@ void Window::SetParentWindow(v8::Local<v8::Value> value,
}
mate::Handle<Window> parent;
if (value->IsNull()) {
if (value->IsNull() || value->IsUndefined()) {
RemoveFromParentChildWindows();
parent_window_.Reset();
window_->SetParentWindow(nullptr);
@@ -863,12 +889,14 @@ void Window::SetBrowserView(v8::Local<v8::Value> value) {
ResetBrowserView();
mate::Handle<BrowserView> browser_view;
if (value->IsNull()) {
if (value->IsNull() || value->IsUndefined()) {
window_->SetBrowserView(nullptr);
} else if (mate::ConvertFromV8(isolate(), value, &browser_view)) {
window_->SetBrowserView(browser_view->view());
browser_view->web_contents()->SetOwnerWindow(window_.get());
browser_view_.Reset(isolate(), value);
window_->UpdateDraggableRegionViews();
}
}
@@ -878,7 +906,8 @@ void Window::ResetBrowserView() {
}
mate::Handle<BrowserView> browser_view;
if (mate::ConvertFromV8(isolate(), GetBrowserView(), &browser_view)) {
if (mate::ConvertFromV8(isolate(), GetBrowserView(), &browser_view)
&& !browser_view.IsEmpty()) {
browser_view->web_contents()->SetOwnerWindow(nullptr);
}
@@ -907,6 +936,33 @@ void Window::SetAutoHideCursor(bool auto_hide) {
window_->SetAutoHideCursor(auto_hide);
}
void Window::SelectPreviousTab() {
window_->SelectPreviousTab();
}
void Window::SelectNextTab() {
window_->SelectNextTab();
}
void Window::MergeAllWindows() {
window_->MergeAllWindows();
}
void Window::MoveTabToNewWindow() {
window_->MoveTabToNewWindow();
}
void Window::ToggleTabBar() {
window_->ToggleTabBar();
}
void Window::AddTabbedWindow(NativeWindow* window,
mate::Arguments* args) {
const bool windowAdded = window_->AddTabbedWindow(window);
if (!windowAdded)
args->ThrowError("AddTabbedWindow cannot be called by a window on itself.");
}
void Window::SetVibrancy(mate::Arguments* args) {
std::string type;
@@ -943,8 +999,10 @@ void Window::RemoveFromParentChildWindows() {
return;
mate::Handle<Window> parent;
if (!mate::ConvertFromV8(isolate(), GetParentWindow(), &parent))
if (!mate::ConvertFromV8(isolate(), GetParentWindow(), &parent)
|| parent.IsEmpty()) {
return;
}
parent->child_windows_.Remove(ID());
}
@@ -964,6 +1022,7 @@ void Window::BuildPrototype(v8::Isolate* isolate,
.SetMethod("hide", &Window::Hide)
.SetMethod("isVisible", &Window::IsVisible)
.SetMethod("isEnabled", &Window::IsEnabled)
.SetMethod("setEnabled", & Window::SetEnabled)
.SetMethod("maximize", &Window::Maximize)
.SetMethod("unmaximize", &Window::Unmaximize)
.SetMethod("isMaximized", &Window::IsMaximized)
@@ -1018,11 +1077,15 @@ void Window::BuildPrototype(v8::Isolate* isolate,
.SetMethod("getTitle", &Window::GetTitle)
.SetMethod("flashFrame", &Window::FlashFrame)
.SetMethod("setSkipTaskbar", &Window::SetSkipTaskbar)
.SetMethod("setSimpleFullScreen", &Window::SetSimpleFullScreen)
.SetMethod("isSimpleFullScreen", &Window::IsSimpleFullScreen)
.SetMethod("setKiosk", &Window::SetKiosk)
.SetMethod("isKiosk", &Window::IsKiosk)
.SetMethod("setBackgroundColor", &Window::SetBackgroundColor)
.SetMethod("setHasShadow", &Window::SetHasShadow)
.SetMethod("hasShadow", &Window::HasShadow)
.SetMethod("setOpacity", &Window::SetOpacity)
.SetMethod("getOpacity", &Window::GetOpacity)
.SetMethod("setRepresentedFilename", &Window::SetRepresentedFilename)
.SetMethod("getRepresentedFilename", &Window::GetRepresentedFilename)
.SetMethod("setDocumentEdited", &Window::SetDocumentEdited)
@@ -1047,6 +1110,12 @@ void Window::BuildPrototype(v8::Isolate* isolate,
&Window::IsVisibleOnAllWorkspaces)
#if defined(OS_MACOSX)
.SetMethod("setAutoHideCursor", &Window::SetAutoHideCursor)
.SetMethod("mergeAllWindows", &Window::MergeAllWindows)
.SetMethod("selectPreviousTab", &Window::SelectPreviousTab)
.SetMethod("selectNextTab", &Window::SelectNextTab)
.SetMethod("moveTabToNewWindow", &Window::MoveTabToNewWindow)
.SetMethod("toggleTabBar", &Window::ToggleTabBar)
.SetMethod("addTabbedWindow", &Window::AddTabbedWindow)
#endif
.SetMethod("setVibrancy", &Window::SetVibrancy)
.SetMethod("_setTouchBarItems", &Window::SetTouchBar)

View File

@@ -112,6 +112,7 @@ class Window : public mate::TrackableObject<Window>,
void Hide();
bool IsVisible();
bool IsEnabled();
void SetEnabled(bool enable);
void Maximize();
void Unmaximize();
bool IsMaximized();
@@ -154,11 +155,15 @@ class Window : public mate::TrackableObject<Window>,
std::string GetTitle();
void FlashFrame(bool flash);
void SetSkipTaskbar(bool skip);
void SetSimpleFullScreen(bool simple_fullscreen);
bool IsSimpleFullScreen();
void SetKiosk(bool kiosk);
bool IsKiosk();
void SetBackgroundColor(const std::string& color_name);
void SetHasShadow(bool has_shadow);
bool HasShadow();
void SetOpacity(const double opacity);
double GetOpacity();
void FocusOnWebView();
void BlurWebView();
bool IsWebViewFocused();
@@ -166,7 +171,7 @@ class Window : public mate::TrackableObject<Window>,
std::string GetRepresentedFilename();
void SetDocumentEdited(bool edited);
bool IsDocumentEdited();
void SetIgnoreMouseEvents(bool ignore);
void SetIgnoreMouseEvents(bool ignore, mate::Arguments* args);
void SetContentProtection(bool enable);
void SetFocusable(bool focusable);
void SetProgressBar(double progress, mate::Arguments* args);
@@ -212,6 +217,13 @@ class Window : public mate::TrackableObject<Window>,
void SetAutoHideCursor(bool auto_hide);
void SelectPreviousTab();
void SelectNextTab();
void MergeAllWindows();
void MoveTabToNewWindow();
void ToggleTabBar();
void AddTabbedWindow(NativeWindow* window, mate::Arguments* args);
void SetVibrancy(mate::Arguments* args);
void SetTouchBar(const std::vector<mate::PersistentDictionary>& items);
void RefreshTouchBarItem(const std::string& item_id);

View File

@@ -6,6 +6,7 @@
#include "atom/common/api/api_messages.h"
#include "atom/common/native_mate_converters/string16_converter.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/web_contents.h"
#include "native_mate/object_template_builder.h"
@@ -20,17 +21,32 @@ Event::Event(v8::Isolate* isolate)
Event::~Event() {
}
void Event::SetSenderAndMessage(content::WebContents* sender,
void Event::SetSenderAndMessage(content::RenderFrameHost* sender,
IPC::Message* message) {
DCHECK(!sender_);
DCHECK(!message_);
sender_ = sender;
message_ = message;
Observe(sender);
Observe(content::WebContents::FromRenderFrameHost(sender));
}
void Event::WebContentsDestroyed() {
void Event::RenderFrameDeleted(content::RenderFrameHost* rfh) {
if (sender_ != rfh)
return;
sender_ = nullptr;
message_ = nullptr;
}
void Event::RenderFrameHostChanged(content::RenderFrameHost* old_rfh,
content::RenderFrameHost* new_rfh) {
if (sender_ && sender_ == old_rfh)
sender_ = new_rfh;
}
void Event::FrameDeleted(content::RenderFrameHost* rfh) {
if (sender_ != rfh)
return;
sender_ = nullptr;
message_ = nullptr;
}
@@ -44,7 +60,7 @@ bool Event::SendReply(const base::string16& json) {
if (message_ == nullptr || sender_ == nullptr)
return false;
AtomViewHostMsg_Message_Sync::WriteReplyParams(message_, json);
AtomFrameHostMsg_Message_Sync::WriteReplyParams(message_, json);
bool success = sender_->Send(message_);
message_ = nullptr;
sender_ = nullptr;

View File

@@ -24,7 +24,8 @@ class Event : public Wrappable<Event>,
v8::Local<v8::FunctionTemplate> prototype);
// Pass the sender and message to be replied.
void SetSenderAndMessage(content::WebContents* sender, IPC::Message* message);
void SetSenderAndMessage(content::RenderFrameHost* sender,
IPC::Message* message);
// event.PreventDefault().
void PreventDefault(v8::Isolate* isolate);
@@ -37,11 +38,14 @@ class Event : public Wrappable<Event>,
~Event() override;
// content::WebContentsObserver implementations:
void WebContentsDestroyed() override;
void RenderFrameDeleted(content::RenderFrameHost* rfh) override;
void RenderFrameHostChanged(content::RenderFrameHost* old_rfh,
content::RenderFrameHost* new_rfh) override;
void FrameDeleted(content::RenderFrameHost* rfh) override;
private:
// Replyer for the synchronous messages.
content::WebContents* sender_;
content::RenderFrameHost* sender_;
IPC::Message* message_;
DISALLOW_COPY_AND_ASSIGN(Event);

View File

@@ -39,11 +39,10 @@ v8::Local<v8::Object> CreateEventObject(v8::Isolate* isolate) {
namespace internal {
v8::Local<v8::Object> CreateJSEvent(
v8::Isolate* isolate,
v8::Local<v8::Object> object,
content::WebContents* sender,
IPC::Message* message) {
v8::Local<v8::Object> CreateJSEvent(v8::Isolate* isolate,
v8::Local<v8::Object> object,
content::RenderFrameHost* sender,
IPC::Message* message) {
v8::Local<v8::Object> event;
bool use_native_event = sender && message;

View File

@@ -11,7 +11,7 @@
#include "native_mate/wrappable.h"
namespace content {
class WebContents;
class RenderFrameHost;
}
namespace IPC {
@@ -24,7 +24,7 @@ namespace internal {
v8::Local<v8::Object> CreateJSEvent(v8::Isolate* isolate,
v8::Local<v8::Object> object,
content::WebContents* sender,
content::RenderFrameHost* sender,
IPC::Message* message);
v8::Local<v8::Object> CreateCustomEvent(
v8::Isolate* isolate,
@@ -42,8 +42,10 @@ class EventEmitter : public Wrappable<T> {
// Make the convinient methods visible:
// https://isocpp.org/wiki/faq/templates#nondependent-name-lookup-members
v8::Local<v8::Object> GetWrapper() { return Wrappable<T>::GetWrapper(); }
v8::Isolate* isolate() const { return Wrappable<T>::isolate(); }
v8::Local<v8::Object> GetWrapper() const {
return Wrappable<T>::GetWrapper();
}
// this.emit(name, event, args...);
template<typename... Args>
@@ -72,15 +74,19 @@ class EventEmitter : public Wrappable<T> {
}
// this.emit(name, new Event(sender, message), args...);
template<typename... Args>
template <typename... Args>
bool EmitWithSender(const base::StringPiece& name,
content::WebContents* sender,
content::RenderFrameHost* sender,
IPC::Message* message,
const Args&... args) {
v8::Locker locker(isolate());
v8::HandleScope handle_scope(isolate());
v8::Local<v8::Object> wrapper = GetWrapper();
if (wrapper.IsEmpty()) {
return false;
}
v8::Local<v8::Object> event = internal::CreateJSEvent(
isolate(), GetWrapper(), sender, message);
isolate(), wrapper, sender, message);
return EmitWithEvent(name, event, args...);
}

View File

@@ -0,0 +1,121 @@
// Copyright (c) 2017 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include <string>
#include "atom/browser/api/event_subscriber.h"
#include "atom/common/native_mate_converters/callback.h"
namespace {
// A FunctionTemplate lifetime is bound to the v8 context, so it can be safely
// stored as a global here since there's only one for the main process.
v8::Global<v8::FunctionTemplate> g_cached_template;
struct JSHandlerData {
JSHandlerData(v8::Isolate* isolate,
mate::internal::EventSubscriberBase* subscriber)
: handle_(isolate, v8::External::New(isolate, this)),
subscriber_(subscriber) {
handle_.SetWeak(this, GC, v8::WeakCallbackType::kFinalizer);
}
static void GC(const v8::WeakCallbackInfo<JSHandlerData>& data) {
delete data.GetParameter();
}
v8::Global<v8::External> handle_;
mate::internal::EventSubscriberBase* subscriber_;
};
void InvokeCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::Locker locker(info.GetIsolate());
v8::HandleScope handle_scope(info.GetIsolate());
v8::Local<v8::Context> context = info.GetIsolate()->GetCurrentContext();
v8::Context::Scope context_scope(context);
mate::Arguments args(info);
v8::Local<v8::Value> handler, event;
args.GetNext(&handler);
args.GetNext(&event);
DCHECK(handler->IsExternal());
DCHECK(event->IsString());
JSHandlerData* handler_data = static_cast<JSHandlerData*>(
v8::Local<v8::External>::Cast(handler)->Value());
handler_data->subscriber_->EventEmitted(mate::V8ToString(event), &args);
}
} // namespace
namespace mate {
namespace internal {
EventSubscriberBase::EventSubscriberBase(v8::Isolate* isolate,
v8::Local<v8::Object> emitter)
: isolate_(isolate), emitter_(isolate, emitter) {
if (g_cached_template.IsEmpty()) {
g_cached_template = v8::Global<v8::FunctionTemplate>(
isolate_, v8::FunctionTemplate::New(isolate_, InvokeCallback));
}
}
EventSubscriberBase::~EventSubscriberBase() {
if (!isolate_) {
return;
}
RemoveAllListeners();
emitter_.Reset();
DCHECK_EQ(js_handlers_.size(), 0u);
}
void EventSubscriberBase::On(const std::string& event_name) {
DCHECK(js_handlers_.find(event_name) == js_handlers_.end());
v8::Locker locker(isolate_);
v8::Isolate::Scope isolate_scope(isolate_);
v8::HandleScope handle_scope(isolate_);
auto fn_template = g_cached_template.Get(isolate_);
auto event = mate::StringToV8(isolate_, event_name);
auto js_handler_data = new JSHandlerData(isolate_, this);
v8::Local<v8::Value> fn = internal::BindFunctionWith(
isolate_, isolate_->GetCurrentContext(), fn_template->GetFunction(),
js_handler_data->handle_.Get(isolate_), event);
js_handlers_.insert(
std::make_pair(event_name, v8::Global<v8::Value>(isolate_, fn)));
internal::ValueVector converted_args = {event, fn};
internal::CallMethodWithArgs(isolate_, emitter_.Get(isolate_), "on",
&converted_args);
}
void EventSubscriberBase::Off(const std::string& event_name) {
v8::Locker locker(isolate_);
v8::Isolate::Scope isolate_scope(isolate_);
v8::HandleScope handle_scope(isolate_);
auto js_handler = js_handlers_.find(event_name);
DCHECK(js_handler != js_handlers_.end());
RemoveListener(js_handler);
}
void EventSubscriberBase::RemoveAllListeners() {
v8::Locker locker(isolate_);
v8::Isolate::Scope isolate_scope(isolate_);
v8::HandleScope handle_scope(isolate_);
while (!js_handlers_.empty()) {
RemoveListener(js_handlers_.begin());
}
}
std::map<std::string, v8::Global<v8::Value>>::iterator
EventSubscriberBase::RemoveListener(
std::map<std::string, v8::Global<v8::Value>>::iterator it) {
internal::ValueVector args = {StringToV8(isolate_, it->first),
it->second.Get(isolate_)};
internal::CallMethodWithArgs(
isolate_, v8::Local<v8::Object>::Cast(emitter_.Get(isolate_)),
"removeListener", &args);
it->second.Reset();
return js_handlers_.erase(it);
}
} // namespace internal
} // namespace mate

View File

@@ -0,0 +1,139 @@
// Copyright (c) 2017 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef ATOM_BROWSER_API_EVENT_SUBSCRIBER_H_
#define ATOM_BROWSER_API_EVENT_SUBSCRIBER_H_
#include <map>
#include <string>
#include "atom/common/api/event_emitter_caller.h"
#include "base/synchronization/lock.h"
#include "content/public/browser/browser_thread.h"
#include "native_mate/native_mate/arguments.h"
namespace mate {
namespace internal {
class EventSubscriberBase {
public:
EventSubscriberBase(v8::Isolate* isolate, v8::Local<v8::Object> emitter);
virtual ~EventSubscriberBase();
virtual void EventEmitted(const std::string& event_name,
mate::Arguments* args) = 0;
protected:
void On(const std::string& event_name);
void Off(const std::string& event_name);
void RemoveAllListeners();
private:
std::map<std::string, v8::Global<v8::Value>>::iterator RemoveListener(
std::map<std::string, v8::Global<v8::Value>>::iterator it);
v8::Isolate* isolate_;
v8::Global<v8::Object> emitter_;
std::map<std::string, v8::Global<v8::Value>> js_handlers_;
DISALLOW_COPY_AND_ASSIGN(EventSubscriberBase);
};
} // namespace internal
template <typename HandlerType>
class EventSubscriber : internal::EventSubscriberBase {
public:
using EventCallback = void (HandlerType::*)(mate::Arguments* args);
// Alias to unique_ptr with deleter.
using unique_ptr = std::unique_ptr<EventSubscriber<HandlerType>,
void (*)(EventSubscriber<HandlerType>*)>;
// EventSubscriber should only be created/deleted in the main thread since it
// communicates with the V8 engine. This smart pointer makes it simpler to
// bind the lifetime of EventSubscriber with a class whose lifetime is managed
// by a non-UI thread.
class SafePtr : public unique_ptr {
public:
SafePtr() : SafePtr(nullptr) {}
explicit SafePtr(EventSubscriber<HandlerType>* ptr)
: unique_ptr(ptr, Deleter) {}
private:
// Custom deleter that schedules destructor invocation to the main thread.
static void Deleter(EventSubscriber<HandlerType>* ptr) {
DCHECK(
!::content::BrowserThread::CurrentlyOn(::content::BrowserThread::UI));
DCHECK(ptr);
// Acquire handler lock and reset handler_ to ensure that any new events
// emitted will be ignored after this function returns
base::AutoLock auto_lock(ptr->handler_lock_);
ptr->handler_ = nullptr;
content::BrowserThread::PostTask(
content::BrowserThread::UI, FROM_HERE,
base::Bind(
[](EventSubscriber<HandlerType>* subscriber) {
{
// It is possible that this function will execute in the UI
// thread before the outer function has returned and destroyed
// its auto_lock. We need to acquire the lock before deleting
// or risk a crash.
base::AutoLock auto_lock(subscriber->handler_lock_);
}
delete subscriber;
},
ptr));
}
};
EventSubscriber(HandlerType* handler,
v8::Isolate* isolate,
v8::Local<v8::Object> emitter)
: EventSubscriberBase(isolate, emitter), handler_(handler) {
DCHECK_CURRENTLY_ON(::content::BrowserThread::UI);
}
void On(const std::string& event, EventCallback callback) {
DCHECK_CURRENTLY_ON(::content::BrowserThread::UI);
EventSubscriberBase::On(event);
callbacks_.insert(std::make_pair(event, callback));
}
void Off(const std::string& event) {
DCHECK_CURRENTLY_ON(::content::BrowserThread::UI);
EventSubscriberBase::Off(event);
DCHECK(callbacks_.find(event) != callbacks_.end());
callbacks_.erase(callbacks_.find(event));
}
void RemoveAllListeners() {
DCHECK_CURRENTLY_ON(::content::BrowserThread::UI);
EventSubscriberBase::RemoveAllListeners();
callbacks_.clear();
}
private:
void EventEmitted(const std::string& event_name,
mate::Arguments* args) override {
DCHECK_CURRENTLY_ON(::content::BrowserThread::UI);
base::AutoLock auto_lock(handler_lock_);
if (!handler_) {
// handler_ was probably destroyed by another thread and we should not
// access it.
return;
}
auto it = callbacks_.find(event_name);
if (it != callbacks_.end()) {
auto method = it->second;
(handler_->*method)(args);
}
}
HandlerType* handler_;
base::Lock handler_lock_;
std::map<std::string, EventCallback> callbacks_;
};
} // namespace mate
#endif // ATOM_BROWSER_API_EVENT_SUBSCRIBER_H_

View File

@@ -45,9 +45,9 @@ bool FrameSubscriber::ShouldCaptureFrame(
gfx::Size view_size = rect.size();
gfx::Size bitmap_size = view_size;
const gfx::NativeView native_view = view_->GetNativeView();
gfx::NativeView native_view = view_->GetNativeView();
const float scale =
display::Screen::GetScreen()->GetDisplayNearestWindow(native_view)
display::Screen::GetScreen()->GetDisplayNearestView(native_view)
.device_scale_factor();
if (scale > 1.0f)
bitmap_size = gfx::ScaleToCeiledSize(view_size, scale);
@@ -78,20 +78,31 @@ void FrameSubscriber::OnFrameDelivered(const FrameCaptureCallback& callback,
v8::Locker locker(isolate_);
v8::HandleScope handle_scope(isolate_);
size_t rgb_arr_size = bitmap.width() * bitmap.height() *
bitmap.bytesPerPixel();
v8::MaybeLocal<v8::Object> buffer = node::Buffer::New(isolate_, rgb_arr_size);
size_t rgb_row_size = bitmap.width() * bitmap.bytesPerPixel();
v8::MaybeLocal<v8::Object> buffer =
node::Buffer::New(isolate_, rgb_row_size * bitmap.height());
if (buffer.IsEmpty())
return;
bitmap.copyPixelsTo(
reinterpret_cast<uint8_t*>(node::Buffer::Data(buffer.ToLocalChecked())),
rgb_arr_size);
auto local_buffer = buffer.ToLocalChecked();
{
auto source = static_cast<const unsigned char*>(bitmap.getPixels());
auto target = node::Buffer::Data(local_buffer);
for (int y = 0; y < bitmap.height(); ++y) {
memcpy(target, source, rgb_row_size);
source += bitmap.rowBytes();
target += rgb_row_size;
}
}
v8::Local<v8::Value> damage =
mate::Converter<gfx::Rect>::ToV8(isolate_, damage_rect);
callback_.Run(buffer.ToLocalChecked(), damage);
callback_.Run(local_buffer, damage);
}
} // namespace api

View File

@@ -6,6 +6,7 @@
#include "atom/browser/atom_browser_main_parts.h"
#include "base/bind.h"
#include "base/memory/ptr_util.h"
#include "base/supports_user_data.h"
namespace mate {
@@ -46,16 +47,19 @@ void TrackableObjectBase::Destroy() {
}
void TrackableObjectBase::AttachAsUserData(base::SupportsUserData* wrapped) {
wrapped->SetUserData(kTrackedObjectKey, new IDUserData(weak_map_id_));
wrapped->SetUserData(kTrackedObjectKey,
base::MakeUnique<IDUserData>(weak_map_id_));
}
// static
int32_t TrackableObjectBase::GetIDFromWrappedClass(base::SupportsUserData* w) {
auto id = static_cast<IDUserData*>(w->GetUserData(kTrackedObjectKey));
if (id)
return *id;
else
return 0;
int32_t TrackableObjectBase::GetIDFromWrappedClass(
base::SupportsUserData* wrapped) {
if (wrapped) {
auto id = static_cast<IDUserData*>(wrapped->GetUserData(kTrackedObjectKey));
if (id)
return *id;
}
return 0;
}
// static

View File

@@ -30,15 +30,15 @@ class TrackableObjectBase {
// Wrap TrackableObject into a class that SupportsUserData.
void AttachAsUserData(base::SupportsUserData* wrapped);
// Get the weak_map_id from SupportsUserData.
static int32_t GetIDFromWrappedClass(base::SupportsUserData* wrapped);
protected:
virtual ~TrackableObjectBase();
// Returns a closure that can destroy the native class.
base::Closure GetDestroyClosure();
// Get the weak_map_id from SupportsUserData.
static int32_t GetIDFromWrappedClass(base::SupportsUserData* wrapped);
// Register a callback that should be destroyed before JavaScript environment
// gets destroyed.
static base::Closure RegisterDestructionCallback(const base::Closure& c);
@@ -62,7 +62,10 @@ class TrackableObject : public TrackableObjectBase,
public:
// Mark the JS object as destroyed.
void MarkDestroyed() {
Wrappable<T>::GetWrapper()->SetAlignedPointerInInternalField(0, nullptr);
v8::Local<v8::Object> wrapper = Wrappable<T>::GetWrapper();
if (!wrapper.IsEmpty()) {
wrapper->SetAlignedPointerInInternalField(0, nullptr);
}
}
bool IsDestroyed() {

View File

@@ -29,8 +29,7 @@ class GeoURLRequestContextGetter : public net::URLRequestContextGetter {
net::URLRequestContextBuilder builder;
builder.set_proxy_config_service(
net::ProxyService::CreateSystemProxyConfigService(
BrowserThread::GetTaskRunnerForThread(BrowserThread::IO),
BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE)));
BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)));
url_request_context_ = builder.Build();
}
return url_request_context_.get();
@@ -55,7 +54,6 @@ class GeoURLRequestContextGetter : public net::URLRequestContextGetter {
AtomAccessTokenStore::AtomAccessTokenStore()
: request_context_getter_(new internal::GeoURLRequestContextGetter) {
device::GeolocationProvider::GetInstance()->UserDidOptIntoLocationServices();
}
AtomAccessTokenStore::~AtomAccessTokenStore() {

View File

@@ -72,8 +72,7 @@ void AtomBlobReader::StartReading(
}
auto blob_reader = blob_data_handle->CreateReader(
file_system_context_.get(),
BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE).get());
file_system_context_.get());
BlobReadHelper* blob_read_helper =
new BlobReadHelper(std::move(blob_reader), callback);
blob_read_helper->Read();

View File

@@ -10,6 +10,7 @@
#include "atom/browser/api/atom_api_app.h"
#include "atom/browser/api/atom_api_protocol.h"
#include "atom/browser/api/atom_api_web_contents.h"
#include "atom/browser/atom_browser_context.h"
#include "atom/browser/atom_browser_main_parts.h"
#include "atom/browser/atom_quota_permission_context.h"
@@ -17,6 +18,7 @@
#include "atom/browser/atom_speech_recognition_manager_delegate.h"
#include "atom/browser/child_web_contents_tracker.h"
#include "atom/browser/native_window.h"
#include "atom/browser/session_preferences.h"
#include "atom/browser/web_contents_permission_helper.h"
#include "atom/browser/web_contents_preferences.h"
#include "atom/browser/window_list.h"
@@ -30,7 +32,6 @@
#include "chrome/browser/renderer_host/pepper/chrome_browser_pepper_host_factory.h"
#include "chrome/browser/renderer_host/pepper/widevine_cdm_message_filter.h"
#include "chrome/browser/speech/tts_message_filter.h"
#include "content/common/resource_request_body_impl.h"
#include "content/public/browser/browser_ppapi_host.h"
#include "content/public/browser/client_certificate_delegate.h"
#include "content/public/browser/render_process_host.h"
@@ -38,7 +39,9 @@
#include "content/public/browser/resource_dispatcher_host.h"
#include "content/public/browser/site_instance.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/content_paths.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/resource_request_body.h"
#include "content/public/common/url_constants.h"
#include "content/public/common/web_preferences.h"
#include "net/ssl/ssl_cert_request_info.h"
@@ -165,11 +168,14 @@ void AtomBrowserClient::RenderProcessWillLaunch(
content::WebContents* web_contents = GetWebContentsFromProcessID(process_id);
ProcessPreferences process_prefs;
process_prefs.sandbox = WebContentsPreferences::IsSandboxed(web_contents);
process_prefs.native_window_open
= WebContentsPreferences::UsesNativeWindowOpen(web_contents);
process_prefs.disable_popups
= WebContentsPreferences::DisablePopups(web_contents);
process_prefs.sandbox =
WebContentsPreferences::IsPreferenceEnabled("sandbox", web_contents);
process_prefs.native_window_open =
WebContentsPreferences::IsPreferenceEnabled("nativeWindowOpen",
web_contents);
process_prefs.disable_popups =
WebContentsPreferences::IsPreferenceEnabled("disablePopups",
web_contents);
AddProcessPreferences(host->GetID(), process_prefs);
// ensure the ProcessPreferences is removed later
host->AddObserver(this);
@@ -184,7 +190,6 @@ void AtomBrowserClient::OverrideWebkitPrefs(
content::RenderViewHost* host, content::WebPreferences* prefs) {
prefs->javascript_enabled = true;
prefs->web_security_enabled = true;
prefs->javascript_can_open_windows_automatically = true;
prefs->plugins_enabled = true;
prefs->dom_paste_enabled = true;
prefs->allow_scripts_to_close_windows = true;
@@ -202,12 +207,8 @@ void AtomBrowserClient::OverrideWebkitPrefs(
WebContentsPreferences::OverrideWebkitPrefs(web_contents, prefs);
}
std::string AtomBrowserClient::GetApplicationLocale() {
return l10n_util::GetApplicationLocale("");
}
void AtomBrowserClient::OverrideSiteInstanceForNavigation(
content::RenderFrameHost* render_frame_host,
content::RenderFrameHost* rfh,
content::BrowserContext* browser_context,
content::SiteInstance* current_instance,
const GURL& url,
@@ -217,32 +218,67 @@ void AtomBrowserClient::OverrideSiteInstanceForNavigation(
return;
}
if (!ShouldCreateNewSiteInstance(render_frame_host, browser_context,
current_instance, url))
if (!ShouldCreateNewSiteInstance(rfh, browser_context, current_instance, url))
return;
scoped_refptr<content::SiteInstance> site_instance =
content::SiteInstance::CreateForURL(browser_context, url);
bool is_new_instance = true;
scoped_refptr<content::SiteInstance> site_instance;
// Do we have an affinity site to manage ?
std::string affinity;
auto* web_contents = content::WebContents::FromRenderFrameHost(rfh);
auto* web_preferences = web_contents ?
WebContentsPreferences::FromWebContents(web_contents) : nullptr;
if (web_preferences &&
web_preferences->web_preferences()->GetString("affinity", &affinity) &&
!affinity.empty()) {
affinity = base::ToLowerASCII(affinity);
auto iter = site_per_affinities.find(affinity);
if (iter != site_per_affinities.end()) {
site_instance = iter->second;
is_new_instance = false;
} else {
// We must not provide the url.
// This site is "isolated" and must not be taken into account
// when Chromium looking at a candidate for an url.
site_instance = content::SiteInstance::Create(
browser_context);
site_per_affinities[affinity] = site_instance.get();
}
} else {
site_instance = content::SiteInstance::CreateForURL(
browser_context,
url);
}
*new_instance = site_instance.get();
// Make sure the |site_instance| is not freed when this function returns.
// FIXME(zcbenz): We should adjust OverrideSiteInstanceForNavigation's
// interface to solve this.
content::BrowserThread::PostTask(
content::BrowserThread::UI, FROM_HERE,
base::Bind(&Noop, base::RetainedRef(site_instance)));
if (is_new_instance) {
// Make sure the |site_instance| is not freed
// when this function returns.
// FIXME(zcbenz): We should adjust
// OverrideSiteInstanceForNavigation's interface to solve this.
content::BrowserThread::PostTask(
content::BrowserThread::UI, FROM_HERE,
base::Bind(&Noop, base::RetainedRef(site_instance)));
// Remember the original web contents for the pending renderer process.
auto pending_process = (*new_instance)->GetProcess();
pending_processes_[pending_process->GetID()] =
content::WebContents::FromRenderFrameHost(render_frame_host);;
// Clear the entry in map when process ends.
pending_process->AddObserver(this);
// Remember the original web contents for the pending renderer process.
auto pending_process = site_instance->GetProcess();
pending_processes_[pending_process->GetID()] = web_contents;
}
}
void AtomBrowserClient::AppendExtraCommandLineSwitches(
base::CommandLine* command_line,
int process_id) {
// Make sure we're about to launch a known executable
{
base::FilePath child_path;
PathService::Get(content::CHILD_PROCESS_EXE, &child_path);
base::ThreadRestrictions::ScopedAllowIO allow_io;
CHECK(base::MakeAbsoluteFilePath(command_line->GetProgram()) == child_path);
}
std::string process_type =
command_line->GetSwitchValueASCII(::switches::kProcessType);
if (process_type != ::switches::kRendererProcess)
@@ -278,9 +314,17 @@ void AtomBrowserClient::AppendExtraCommandLineSwitches(
}
content::WebContents* web_contents = GetWebContentsFromProcessID(process_id);
if (web_contents)
if (web_contents) {
WebContentsPreferences::AppendExtraCommandLineSwitches(
web_contents, command_line);
SessionPreferences::AppendExtraCommandLineSwitches(
web_contents->GetBrowserContext(), command_line);
auto context_id = atom::api::WebContents::GetIDForContents(
web_contents);
command_line->AppendSwitchASCII(switches::kContextId,
base::IntToString(context_id));
}
}
void AtomBrowserClient::DidCreatePpapiPlugin(
@@ -316,10 +360,12 @@ void AtomBrowserClient::AllowCertificateError(
void AtomBrowserClient::SelectClientCertificate(
content::WebContents* web_contents,
net::SSLCertRequestInfo* cert_request_info,
net::ClientCertIdentityList client_certs,
std::unique_ptr<content::ClientCertificateDelegate> delegate) {
if (!cert_request_info->client_certs.empty() && delegate_) {
delegate_->SelectClientCertificate(
web_contents, cert_request_info, std::move(delegate));
if (!client_certs.empty() && delegate_) {
delegate_->SelectClientCertificate(web_contents, cert_request_info,
std::move(client_certs),
std::move(delegate));
}
}
@@ -331,8 +377,7 @@ void AtomBrowserClient::ResourceDispatcherHostCreated() {
}
bool AtomBrowserClient::CanCreateWindow(
int opener_render_process_id,
int opener_render_frame_id,
content::RenderFrameHost* opener,
const GURL& opener_url,
const GURL& opener_top_level_frame_url,
const GURL& source_origin,
@@ -343,12 +388,13 @@ bool AtomBrowserClient::CanCreateWindow(
WindowOpenDisposition disposition,
const blink::mojom::WindowFeatures& features,
const std::vector<std::string>& additional_features,
const scoped_refptr<content::ResourceRequestBodyImpl>& body,
const scoped_refptr<content::ResourceRequestBody>& body,
bool user_gesture,
bool opener_suppressed,
content::ResourceContext* context,
bool* no_javascript_access) {
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
int opener_render_process_id = opener->GetProcess()->GetID();
if (IsRendererSandboxed(opener_render_process_id)) {
*no_javascript_access = false;
@@ -367,16 +413,11 @@ bool AtomBrowserClient::CanCreateWindow(
}
if (delegate_) {
content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE,
base::Bind(&api::App::OnCreateWindow,
base::Unretained(static_cast<api::App*>(delegate_)),
target_url,
frame_name,
disposition,
additional_features,
body,
opener_render_process_id,
opener_render_frame_id));
return delegate_->CanCreateWindow(
opener, opener_url, opener_top_level_frame_url, source_origin,
container_type, target_url, referrer, frame_name, disposition, features,
additional_features, body, user_gesture, opener_suppressed,
no_javascript_access);
}
return false;
@@ -392,9 +433,21 @@ void AtomBrowserClient::GetAdditionalAllowedSchemesForFileSystem(
additional_schemes->push_back(content::kChromeDevToolsScheme);
}
void AtomBrowserClient::SiteInstanceDeleting(
content::SiteInstance* site_instance) {
// We are storing weak_ptr, is it fundamental to maintain the map up-to-date
// when an instance is destroyed.
for (auto iter = site_per_affinities.begin();
iter != site_per_affinities.end(); ++iter) {
if (iter->second == site_instance) {
site_per_affinities.erase(iter);
break;
}
}
}
brightray::BrowserMainParts* AtomBrowserClient::OverrideCreateBrowserMainParts(
const content::MainFunctionParams&) {
v8::V8::Initialize(); // Init V8 before creating main parts.
return new AtomBrowserMainParts;
}

View File

@@ -12,6 +12,7 @@
#include "brightray/browser/browser_client.h"
#include "content/public/browser/render_process_host_observer.h"
#include "net/ssl/client_cert_identity.h"
namespace content {
class QuotaPermissionContext;
@@ -52,7 +53,6 @@ class AtomBrowserClient : public brightray::BrowserClient,
CreateSpeechRecognitionManagerDelegate() override;
void OverrideWebkitPrefs(content::RenderViewHost* render_view_host,
content::WebPreferences* prefs) override;
std::string GetApplicationLocale() override;
void OverrideSiteInstanceForNavigation(
content::RenderFrameHost* render_frame_host,
content::BrowserContext* browser_context,
@@ -77,11 +77,11 @@ class AtomBrowserClient : public brightray::BrowserClient,
void SelectClientCertificate(
content::WebContents* web_contents,
net::SSLCertRequestInfo* cert_request_info,
net::ClientCertIdentityList client_certs,
std::unique_ptr<content::ClientCertificateDelegate> delegate) override;
void ResourceDispatcherHostCreated() override;
bool CanCreateWindow(
int opener_render_process_id,
int opener_render_frame_id,
content::RenderFrameHost* opener,
const GURL& opener_url,
const GURL& opener_top_level_frame_url,
const GURL& source_origin,
@@ -92,13 +92,13 @@ class AtomBrowserClient : public brightray::BrowserClient,
WindowOpenDisposition disposition,
const blink::mojom::WindowFeatures& features,
const std::vector<std::string>& additional_features,
const scoped_refptr<content::ResourceRequestBodyImpl>& body,
const scoped_refptr<content::ResourceRequestBody>& body,
bool user_gesture,
bool opener_suppressed,
content::ResourceContext* context,
bool* no_javascript_access) override;
void GetAdditionalAllowedSchemesForFileSystem(
std::vector<std::string>* schemes) override;
void SiteInstanceDeleting(content::SiteInstance* site_instance) override;
// brightray::BrowserClient:
brightray::BrowserMainParts* OverrideCreateBrowserMainParts(
@@ -120,9 +120,9 @@ class AtomBrowserClient : public brightray::BrowserClient,
content::SiteInstance* current_instance,
const GURL& dest_url);
struct ProcessPreferences {
bool sandbox;
bool native_window_open;
bool disable_popups;
bool sandbox = false;
bool native_window_open = false;
bool disable_popups = false;
};
void AddProcessPreferences(int process_id, ProcessPreferences prefs);
void RemoveProcessPreferences(int process_id);
@@ -135,6 +135,10 @@ class AtomBrowserClient : public brightray::BrowserClient,
std::map<int, ProcessPreferences> process_preferences_;
std::map<int, base::ProcessId> render_process_host_pids_;
// list of site per affinity. weak_ptr to prevent instance locking
std::map<std::string, content::SiteInstance*> site_per_affinities;
base::Lock process_preferences_lock_;
std::unique_ptr<AtomResourceDispatcherHostDelegate>

View File

@@ -13,10 +13,10 @@
#include "atom/browser/net/about_protocol_handler.h"
#include "atom/browser/net/asar/asar_protocol_handler.h"
#include "atom/browser/net/atom_cert_verifier.h"
#include "atom/browser/net/atom_ct_delegate.h"
#include "atom/browser/net/atom_network_delegate.h"
#include "atom/browser/net/atom_url_request_job_factory.h"
#include "atom/browser/net/http_protocol_handler.h"
#include "atom/browser/net/resolve_proxy_helper.h"
#include "atom/browser/web_view_manager.h"
#include "atom/common/atom_version.h"
#include "atom/common/chrome_version.h"
@@ -72,8 +72,6 @@ AtomBrowserContext::AtomBrowserContext(const std::string& partition,
bool in_memory,
const base::DictionaryValue& options)
: brightray::BrowserContext(partition, in_memory),
ct_delegate_(new AtomCTDelegate),
network_delegate_(new AtomNetworkDelegate),
cookie_delegate_(new AtomCookieDelegate) {
// Construct user agent string.
Browser* browser = Browser::Get();
@@ -106,8 +104,9 @@ void AtomBrowserContext::SetUserAgent(const std::string& user_agent) {
user_agent_ = user_agent;
}
net::NetworkDelegate* AtomBrowserContext::CreateNetworkDelegate() {
return network_delegate_;
std::unique_ptr<net::NetworkDelegate>
AtomBrowserContext::CreateNetworkDelegate() {
return base::MakeUnique<AtomNetworkDelegate>();
}
net::CookieMonsterDelegate* AtomBrowserContext::CreateCookieDelegate() {
@@ -192,8 +191,9 @@ content::PermissionManager* AtomBrowserContext::GetPermissionManager() {
return permission_manager_.get();
}
std::unique_ptr<net::CertVerifier> AtomBrowserContext::CreateCertVerifier() {
return base::WrapUnique(new AtomCertVerifier(ct_delegate_.get()));
std::unique_ptr<net::CertVerifier> AtomBrowserContext::CreateCertVerifier(
brightray::RequireCTDelegate* ct_delegate) {
return base::WrapUnique(new AtomCertVerifier(ct_delegate));
}
std::vector<std::string> AtomBrowserContext::GetCookieableSchemes() {
@@ -204,11 +204,6 @@ std::vector<std::string> AtomBrowserContext::GetCookieableSchemes() {
return default_schemes;
}
net::TransportSecurityState::RequireCTDelegate*
AtomBrowserContext::GetRequireCTDelegate() {
return ct_delegate_.get();
}
void AtomBrowserContext::RegisterPrefs(PrefRegistrySimple* pref_registry) {
pref_registry->RegisterFilePathPref(prefs::kSelectFileLastDirectory,
base::FilePath());
@@ -232,6 +227,14 @@ AtomBlobReader* AtomBrowserContext::GetBlobReader() {
return blob_reader_.get();
}
ResolveProxyHelper* AtomBrowserContext::GetResolveProxyHelper() {
if (!resolve_proxy_helper_.get()) {
resolve_proxy_helper_ =
base::MakeRefCounted<ResolveProxyHelper>(url_request_context_getter());
}
return resolve_proxy_helper_.get();
}
// static
scoped_refptr<AtomBrowserContext> AtomBrowserContext::From(
const std::string& partition, bool in_memory,

View File

@@ -15,10 +15,10 @@
namespace atom {
class AtomBlobReader;
class AtomCTDelegate;
class AtomDownloadManagerDelegate;
class AtomNetworkDelegate;
class AtomPermissionManager;
class ResolveProxyHelper;
class WebViewManager;
class AtomBrowserContext : public brightray::BrowserContext {
@@ -33,17 +33,16 @@ class AtomBrowserContext : public brightray::BrowserContext {
void SetUserAgent(const std::string& user_agent);
// brightray::URLRequestContextGetter::Delegate:
net::NetworkDelegate* CreateNetworkDelegate() override;
std::unique_ptr<net::NetworkDelegate> CreateNetworkDelegate() override;
net::CookieMonsterDelegate* CreateCookieDelegate() override;
std::string GetUserAgent() override;
std::unique_ptr<net::URLRequestJobFactory> CreateURLRequestJobFactory(
content::ProtocolHandlerMap* protocol_handlers) override;
net::HttpCache::BackendFactory* CreateHttpCacheBackendFactory(
const base::FilePath& base_path) override;
std::unique_ptr<net::CertVerifier> CreateCertVerifier() override;
std::unique_ptr<net::CertVerifier> CreateCertVerifier(
brightray::RequireCTDelegate* ct_delegate) override;
std::vector<std::string> GetCookieableSchemes() override;
net::TransportSecurityState::RequireCTDelegate* GetRequireCTDelegate()
override;
// content::BrowserContext:
content::DownloadManagerDelegate* GetDownloadManagerDelegate() override;
@@ -53,8 +52,9 @@ class AtomBrowserContext : public brightray::BrowserContext {
// brightray::BrowserContext:
void RegisterPrefs(PrefRegistrySimple* pref_registry) override;
ResolveProxyHelper* GetResolveProxyHelper();
AtomBlobReader* GetBlobReader();
AtomNetworkDelegate* network_delegate() const { return network_delegate_; }
AtomCookieDelegate* cookie_delegate() const {
return cookie_delegate_.get();
}
@@ -65,16 +65,14 @@ class AtomBrowserContext : public brightray::BrowserContext {
~AtomBrowserContext() override;
private:
scoped_refptr<ResolveProxyHelper> resolve_proxy_helper_;
std::unique_ptr<AtomDownloadManagerDelegate> download_manager_delegate_;
std::unique_ptr<WebViewManager> guest_manager_;
std::unique_ptr<AtomPermissionManager> permission_manager_;
std::unique_ptr<AtomBlobReader> blob_reader_;
std::unique_ptr<AtomCTDelegate> ct_delegate_;
std::string user_agent_;
bool use_cache_;
// Managed by brightray::BrowserContext.
AtomNetworkDelegate* network_delegate_;
scoped_refptr<AtomCookieDelegate> cookie_delegate_;
DISALLOW_COPY_AND_ASSIGN(AtomBrowserContext);

View File

@@ -4,6 +4,7 @@
#include "atom/browser/atom_browser_main_parts.h"
#include "atom/browser/api/atom_api_app.h"
#include "atom/browser/api/trackable_object.h"
#include "atom/browser/atom_access_token_store.h"
#include "atom/browser/atom_browser_client.h"
@@ -23,6 +24,7 @@
#include "content/public/browser/child_process_security_policy.h"
#include "device/geolocation/geolocation_delegate.h"
#include "device/geolocation/geolocation_provider.h"
#include "ui/base/l10n/l10n_util.h"
#include "v8/include/v8-debug.h"
#if defined(USE_X11)
@@ -37,7 +39,10 @@ namespace {
// A provider of Geolocation services to override AccessTokenStore.
class AtomGeolocationDelegate : public device::GeolocationDelegate {
public:
AtomGeolocationDelegate() = default;
AtomGeolocationDelegate() {
device::GeolocationProvider::GetInstance()
->UserDidOptIntoLocationServices();
}
scoped_refptr<device::AccessTokenStore> CreateAccessTokenStore() final {
return new AtomAccessTokenStore();
@@ -136,7 +141,7 @@ void AtomBrowserMainParts::PostEarlyInitialization() {
// Enable support for v8 inspector
node_debugger_.reset(new NodeDebugger(env));
node_debugger_->Start();
node_debugger_->Start(js_env_->platform());
// Add Electron extended APIs.
atom_bindings_->BindTo(js_env_->isolate(), env->process_object());
@@ -146,6 +151,23 @@ void AtomBrowserMainParts::PostEarlyInitialization() {
// Wrap the uv loop with global env.
node_bindings_->set_uv_env(env);
// We already initialized the feature list in
// brightray::BrowserMainParts::PreEarlyInitialization(), but
// the user JS script would not have had a chance to alter the command-line
// switches at that point. Lets reinitialize it here to pick up the
// command-line changes.
base::FeatureList::ClearInstanceForTesting();
brightray::BrowserMainParts::InitializeFeatureList();
}
int AtomBrowserMainParts::PreCreateThreads() {
const int result = brightray::BrowserMainParts::PreCreateThreads();
if (!result) {
fake_browser_process_->SetApplicationLocale(
brightray::BrowserClient::Get()->GetApplicationLocale());
}
return result;
}
void AtomBrowserMainParts::PreMainMessageLoopRun() {
@@ -183,6 +205,9 @@ void AtomBrowserMainParts::PreMainMessageLoopRun() {
std::unique_ptr<base::DictionaryValue> empty_info(new base::DictionaryValue);
Browser::Get()->DidFinishLaunching(*empty_info);
#endif
// Notify observers that main thread message loop was initialized.
Browser::Get()->PreMainMessageLoopRun();
}
bool AtomBrowserMainParts::MainMessageLoopRun(int* result_code) {

View File

@@ -49,6 +49,7 @@ class AtomBrowserMainParts : public brightray::BrowserMainParts {
// content::BrowserMainParts:
void PreEarlyInitialization() override;
void PostEarlyInitialization() override;
int PreCreateThreads() override;
void PreMainMessageLoopRun() override;
bool MainMessageLoopRun(int* result_code) override;
void PostMainMessageLoopStart() override;

View File

@@ -119,9 +119,8 @@ void ShutdownDetector::ThreadMain() {
int signal;
size_t bytes_read = 0;
ssize_t ret;
do {
ret = HANDLE_EINTR(
ssize_t ret = HANDLE_EINTR(
read(shutdown_fd_,
reinterpret_cast<char*>(&signal) + bytes_read,
sizeof(signal) - bytes_read));

View File

@@ -21,6 +21,32 @@
namespace atom {
namespace {
// Generate default file path to save the download.
void CreateDownloadPath(
const GURL& url,
const std::string& content_disposition,
const std::string& suggested_filename,
const std::string& mime_type,
const base::FilePath& default_download_path,
const AtomDownloadManagerDelegate::CreateDownloadPathCallback& callback) {
DCHECK_CURRENTLY_ON(content::BrowserThread::FILE);
auto generated_name =
net::GenerateFileName(url, content_disposition, std::string(),
suggested_filename, mime_type, "download");
if (!base::PathExists(default_download_path))
base::CreateDirectory(default_download_path);
base::FilePath path(default_download_path.Append(generated_name));
content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE,
base::Bind(callback, path));
}
} // namespace
AtomDownloadManagerDelegate::AtomDownloadManagerDelegate(
content::DownloadManager* manager)
: download_manager_(manager),
@@ -46,30 +72,6 @@ void AtomDownloadManagerDelegate::GetItemSavePath(content::DownloadItem* item,
*path = download->GetSavePath();
}
void AtomDownloadManagerDelegate::CreateDownloadPath(
const GURL& url,
const std::string& content_disposition,
const std::string& suggested_filename,
const std::string& mime_type,
const base::FilePath& default_download_path,
const CreateDownloadPathCallback& callback) {
DCHECK_CURRENTLY_ON(content::BrowserThread::FILE);
auto generated_name = net::GenerateFileName(url,
content_disposition,
std::string(),
suggested_filename,
mime_type,
"download");
if (!base::PathExists(default_download_path))
base::CreateDirectory(default_download_path);
base::FilePath path(default_download_path.Append(generated_name));
content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE,
base::Bind(callback, path));
}
void AtomDownloadManagerDelegate::OnDownloadPathGenerated(
uint32_t download_id,
const content::DownloadTargetCallback& callback,
@@ -92,6 +94,7 @@ void AtomDownloadManagerDelegate::OnDownloadPathGenerated(
// Show save dialog if save path was not set already on item
file_dialog::DialogSettings settings;
settings.parent_window = window;
settings.force_detached = window->is_offscreen_dummy();
settings.title = item->GetURL().spec();
settings.default_path = default_path;
if (path.empty() && file_dialog::ShowSaveDialog(settings, &path)) {
@@ -115,7 +118,10 @@ void AtomDownloadManagerDelegate::OnDownloadPathGenerated(
// If user cancels the file save dialog, run the callback with empty FilePath.
callback.Run(path,
content::DownloadItem::TARGET_DISPOSITION_PROMPT,
content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, path);
content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, path,
path.empty() ?
content::DOWNLOAD_INTERRUPT_REASON_USER_CANCELED :
content::DOWNLOAD_INTERRUPT_REASON_NONE);
}
void AtomDownloadManagerDelegate::Shutdown() {
@@ -132,7 +138,8 @@ bool AtomDownloadManagerDelegate::DetermineDownloadTarget(
callback.Run(download->GetForcedFilePath(),
content::DownloadItem::TARGET_DISPOSITION_OVERWRITE,
content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS,
download->GetForcedFilePath());
download->GetForcedFilePath(),
content::DOWNLOAD_INTERRUPT_REASON_NONE);
return true;
}
@@ -143,7 +150,7 @@ bool AtomDownloadManagerDelegate::DetermineDownloadTarget(
callback.Run(save_path,
content::DownloadItem::TARGET_DISPOSITION_OVERWRITE,
content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS,
save_path);
save_path, content::DOWNLOAD_INTERRUPT_REASON_NONE);
return true;
}
@@ -159,14 +166,10 @@ bool AtomDownloadManagerDelegate::DetermineDownloadTarget(
content::BrowserThread::PostTask(
content::BrowserThread::FILE, FROM_HERE,
base::Bind(&AtomDownloadManagerDelegate::CreateDownloadPath,
weak_ptr_factory_.GetWeakPtr(),
download->GetURL(),
base::Bind(&CreateDownloadPath, download->GetURL(),
download->GetContentDisposition(),
download->GetSuggestedFilename(),
download->GetMimeType(),
default_download_path,
download_path_callback));
download->GetSuggestedFilename(), download->GetMimeType(),
default_download_path, download_path_callback));
return true;
}

View File

@@ -24,13 +24,6 @@ class AtomDownloadManagerDelegate : public content::DownloadManagerDelegate {
explicit AtomDownloadManagerDelegate(content::DownloadManager* manager);
virtual ~AtomDownloadManagerDelegate();
// Generate default file path to save the download.
void CreateDownloadPath(const GURL& url,
const std::string& suggested_filename,
const std::string& content_disposition,
const std::string& mime_type,
const base::FilePath& path,
const CreateDownloadPathCallback& callback);
void OnDownloadPathGenerated(uint32_t download_id,
const content::DownloadTargetCallback& callback,
const base::FilePath& default_path);

View File

@@ -97,11 +97,28 @@ int AtomPermissionManager::RequestPermission(
const GURL& requesting_origin,
bool user_gesture,
const StatusCallback& response_callback) {
return RequestPermissions(
return RequestPermissionWithDetails(
permission,
render_frame_host,
requesting_origin,
user_gesture,
nullptr,
response_callback);
}
int AtomPermissionManager::RequestPermissionWithDetails(
content::PermissionType permission,
content::RenderFrameHost* render_frame_host,
const GURL& requesting_origin,
bool user_gesture,
const base::DictionaryValue* details,
const StatusCallback& response_callback) {
return RequestPermissionsWithDetails(
std::vector<content::PermissionType>(1, permission),
render_frame_host,
requesting_origin,
user_gesture,
details,
base::Bind(&PermissionRequestResponseCallbackWrapper, response_callback));
}
@@ -111,6 +128,18 @@ int AtomPermissionManager::RequestPermissions(
const GURL& requesting_origin,
bool user_gesture,
const StatusesCallback& response_callback) {
return RequestPermissionsWithDetails(
permissions, render_frame_host, requesting_origin,
user_gesture, nullptr, response_callback);
}
int AtomPermissionManager::RequestPermissionsWithDetails(
const std::vector<content::PermissionType>& permissions,
content::RenderFrameHost* render_frame_host,
const GURL& requesting_origin,
bool user_gesture,
const base::DictionaryValue* details,
const StatusesCallback& response_callback) {
if (permissions.empty()) {
response_callback.Run(std::vector<blink::mojom::PermissionStatus>());
return kNoPendingOperation;
@@ -143,7 +172,12 @@ int AtomPermissionManager::RequestPermissions(
const auto callback =
base::Bind(&AtomPermissionManager::OnPermissionResponse,
base::Unretained(this), request_id, i);
request_handler_.Run(web_contents, permission, callback);
if (details == nullptr) {
request_handler_.Run(web_contents, permission, callback,
base::DictionaryValue());
} else {
request_handler_.Run(web_contents, permission, callback, *details);
}
}
return request_id;

View File

@@ -10,6 +10,7 @@
#include "base/callback.h"
#include "base/id_map.h"
#include "base/values.h"
#include "content/public/browser/permission_manager.h"
namespace content {
@@ -30,7 +31,8 @@ class AtomPermissionManager : public content::PermissionManager {
using RequestHandler =
base::Callback<void(content::WebContents*,
content::PermissionType,
const StatusCallback&)>;
const StatusCallback&,
const base::DictionaryValue&)>;
// Handler to dispatch permission requests in JS.
void SetPermissionRequestHandler(const RequestHandler& handler);
@@ -43,6 +45,13 @@ class AtomPermissionManager : public content::PermissionManager {
bool user_gesture,
const base::Callback<void(blink::mojom::PermissionStatus)>& callback)
override;
int RequestPermissionWithDetails(
content::PermissionType permission,
content::RenderFrameHost* render_frame_host,
const GURL& requesting_origin,
bool user_gesture,
const base::DictionaryValue* details,
const base::Callback<void(blink::mojom::PermissionStatus)>& callback);
int RequestPermissions(
const std::vector<content::PermissionType>& permissions,
content::RenderFrameHost* render_frame_host,
@@ -51,6 +60,14 @@ class AtomPermissionManager : public content::PermissionManager {
const base::Callback<void(
const std::vector<blink::mojom::PermissionStatus>&)>& callback)
override;
int RequestPermissionsWithDetails(
const std::vector<content::PermissionType>& permissions,
content::RenderFrameHost* render_frame_host,
const GURL& requesting_origin,
bool user_gesture,
const base::DictionaryValue* details,
const base::Callback<void(
const std::vector<blink::mojom::PermissionStatus>&)>& callback);
protected:
void OnPermissionResponse(int request_id,

View File

@@ -14,6 +14,7 @@
#include "base/strings/utf_string_conversions.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/download_manager.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/stream_info.h"
#include "net/base/escape.h"
#include "net/ssl/client_cert_store.h"
@@ -34,8 +35,7 @@ namespace atom {
namespace {
void OnOpenExternal(const GURL& escaped_url,
bool allowed) {
void OnOpenExternal(const GURL& escaped_url, bool allowed) {
if (allowed)
platform_util::OpenExternal(
#if defined(OS_WIN)
@@ -61,51 +61,57 @@ void HandleExternalProtocolInUI(
GURL escaped_url(net::EscapeExternalHandlerValue(url.spec()));
auto callback = base::Bind(&OnOpenExternal, escaped_url);
permission_helper->RequestOpenExternalPermission(callback, has_user_gesture);
permission_helper->RequestOpenExternalPermission(callback, has_user_gesture,
url);
}
void OnPdfResourceIntercepted(
const GURL& original_url,
int render_process_host_id,
int render_frame_id,
const content::ResourceRequestInfo::WebContentsGetter&
web_contents_getter) {
content::WebContents* web_contents = web_contents_getter.Run();
if (!web_contents)
return;
if (!WebContentsPreferences::IsPluginsEnabled(web_contents)) {
if (!WebContentsPreferences::IsPreferenceEnabled("plugins", web_contents)) {
auto browser_context = web_contents->GetBrowserContext();
auto download_manager =
content::BrowserContext::GetDownloadManager(browser_context);
content::BrowserContext::GetDownloadManager(browser_context);
download_manager->DownloadUrl(
content::DownloadUrlParameters::CreateForWebContentsMainFrame(
web_contents, original_url));
web_contents, original_url, NO_TRAFFIC_ANNOTATION_YET));
return;
}
// The URL passes the original pdf resource url, that will be requested
// by the webui page.
// chrome://pdf-viewer/index.html?src=https://somepage/123.pdf
content::NavigationController::LoadURLParams params(
GURL(base::StringPrintf(
"%sindex.html?%s=%s",
kPdfViewerUIOrigin,
kPdfPluginSrc,
net::EscapeUrlEncodedData(original_url.spec(), false).c_str())));
content::NavigationController::LoadURLParams params(GURL(base::StringPrintf(
"%sindex.html?%s=%s", kPdfViewerUIOrigin, kPdfPluginSrc,
net::EscapeUrlEncodedData(original_url.spec(), false).c_str())));
content::RenderFrameHost* frame_host =
content::RenderFrameHost::FromID(render_process_host_id, render_frame_id);
if (!frame_host) {
return;
}
params.frame_tree_node_id = frame_host->GetFrameTreeNodeId();
web_contents->GetController().LoadURLWithParams(params);
}
} // namespace
AtomResourceDispatcherHostDelegate::AtomResourceDispatcherHostDelegate() {
}
AtomResourceDispatcherHostDelegate::AtomResourceDispatcherHostDelegate() {}
bool AtomResourceDispatcherHostDelegate::HandleExternalProtocol(
const GURL& url,
content::ResourceRequestInfo* info) {
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
base::Bind(&HandleExternalProtocolInUI,
url,
base::Bind(&HandleExternalProtocolInUI, url,
info->GetWebContentsGetterForRequest(),
info->HasUserGesture()));
return true;
@@ -121,16 +127,16 @@ AtomResourceDispatcherHostDelegate::CreateLoginDelegate(
std::unique_ptr<net::ClientCertStore>
AtomResourceDispatcherHostDelegate::CreateClientCertStore(
content::ResourceContext* resource_context) {
#if defined(USE_NSS_CERTS)
return std::unique_ptr<net::ClientCertStore>(new net::ClientCertStoreNSS(
net::ClientCertStoreNSS::PasswordDelegateFactory()));
#elif defined(OS_WIN)
return std::unique_ptr<net::ClientCertStore>(new net::ClientCertStoreWin());
#elif defined(OS_MACOSX)
return std::unique_ptr<net::ClientCertStore>(new net::ClientCertStoreMac());
#elif defined(USE_OPENSSL)
return std::unique_ptr<net::ClientCertStore>();
#endif
#if defined(USE_NSS_CERTS)
return std::unique_ptr<net::ClientCertStore>(new net::ClientCertStoreNSS(
net::ClientCertStoreNSS::PasswordDelegateFactory()));
#elif defined(OS_WIN)
return std::unique_ptr<net::ClientCertStore>(new net::ClientCertStoreWin());
#elif defined(OS_MACOSX)
return std::unique_ptr<net::ClientCertStore>(new net::ClientCertStoreMac());
#elif defined(USE_OPENSSL)
return std::unique_ptr<net::ClientCertStore>();
#endif
}
bool AtomResourceDispatcherHostDelegate::ShouldInterceptResourceAsStream(
@@ -141,11 +147,20 @@ bool AtomResourceDispatcherHostDelegate::ShouldInterceptResourceAsStream(
std::string* payload) {
const content::ResourceRequestInfo* info =
content::ResourceRequestInfo::ForRequest(request);
if (mime_type == "application/pdf" && info->IsMainFrame()) {
int render_process_host_id;
int render_frame_id;
if (!info->GetAssociatedRenderFrame(&render_process_host_id,
&render_frame_id)) {
return false;
}
if (mime_type == "application/pdf") {
*origin = GURL(kPdfViewerUIOrigin);
content::BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
base::Bind(&OnPdfResourceIntercepted, request->url(),
render_process_host_id, render_frame_id,
info->GetWebContentsGetterForRequest()));
return true;
}

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