Compare commits

...

2058 Commits

Author SHA1 Message Date
Kevin Sawicki
92092bed41 Bump v1.6.1 2017-02-21 08:49:50 -08:00
Kevin Sawicki
f80af6e3ed Merge pull request #8718 from demopark/master
add translations files for zh-CN
2017-02-21 08:48:15 -08:00
Kevin Sawicki
1dd37eaab7 Merge pull request #8717 from gerhardberger/vibrancy-version-fix
Fix OS version check of vibrancy
2017-02-21 08:45:10 -08:00
DemoPark
c78d7fc125 add translations files for zh-CN
add zh-CN translations file - debug-instructions-windows.md
add zh-CN translations file - debugging-instructions-macos.md
update zh-CN translations file - README.md
2017-02-19 21:38:37 +08:00
gellert
a1ede4a4b0 fixes os version check of vibrancy 2017-02-18 20:25:03 +01:00
Kevin Sawicki
1f75df0253 Merge pull request #8693 from electron/zoom_specs
webContents: add basic zoom specs
2017-02-17 12:50:26 -08:00
deepak1556
a57af31b99 add zoom specs based on standard protocols 2017-02-18 01:41:39 +05:30
deepak1556
0c022fdc36 set zoom changes for in page navigaitons 2017-02-18 01:34:32 +05:30
deepak1556
403e7681c1 add basic webview zoom specs 2017-02-18 01:34:32 +05:30
deepak1556
c71b44048c address review comments 2017-02-18 01:34:32 +05:30
deepak1556
dfc2e6c4a8 add temporary zoom api spec 2017-02-18 01:34:32 +05:30
deepak1556
71fd3e807c use sync zoom api with guest view manager webpreferences 2017-02-18 01:34:32 +05:30
deepak1556
763b9ab8d8 add zoom spec 2017-02-18 01:34:32 +05:30
deepak1556
203a920c64 fix signature of zoom getter apis 2017-02-18 01:34:32 +05:30
Kevin Sawicki
5e30ccd891 Merge pull request #8709 from electron/upgrade-native-mate
Upgrade native_mate
2017-02-17 10:57:39 -08:00
Kevin Sawicki
e60601898d Upgrade native_mate 2017-02-17 10:25:20 -08:00
Kevin Sawicki
440e48fe19 Merge pull request #8707 from demopark/master
add translations files for zh-CN
2017-02-17 08:22:05 -08:00
Kevin Sawicki
91677ade89 Merge pull request #8704 from YurySolovyov/update-icon-fetch-impl
Update icon loading API implementation
2017-02-17 08:21:10 -08:00
DemoPark
529b84ff9c add translations files for zh-CN
add zh-CN translations file - clang-format.md
add zh-CN translations file - styleguide.md
update zh-CN translations file - README.md
2017-02-17 17:28:55 +08:00
deepak1556
5687f8b3b7 Destroy icon manager after file thread is destroyed 2017-02-17 14:16:18 +05:30
Yury Solovyov
977abc6458 Update icon loading API implementation 2017-02-16 23:16:34 +03:00
Kevin Sawicki
8fe025d6c9 Merge pull request #8695 from ericbrumer/master
[Win] Allow favicon.png to be on the root of any drive letter
2017-02-16 11:56:52 -08:00
Eric Brumer
87e606627c Smaller regex now that it's case insensitive 2017-02-16 09:26:20 -08:00
Eric Brumer
7cb101b566 Case insensitive filepath 2017-02-16 09:17:37 -08:00
Kevin Sawicki
19b686c90b Merge pull request #8696 from demopark/master
add translations files for zh-CN
2017-02-16 08:12:18 -08:00
DemoPark
6dd18678a9 add translations files for zh-CN
add zh-CN translations file - security.md
add zh-CN translations file - repl.md
add zh-CN translations file - windows-store-guide.md
update zh-CN translations file - glossary.md
update zh-CN translations file - README.md
2017-02-16 16:31:55 +08:00
Eric Brumer
d97585d06d Allow favicon.png to be on the root of any drive letter 2017-02-15 19:02:11 -08:00
Kevin Sawicki
a00bb332ca Merge pull request #8686 from demopark/master
Optimize zh-CN language logic and grammar
2017-02-15 12:27:06 -08:00
Kevin Sawicki
9a7ac5326c Merge pull request #8676 from electron/focus-delegate
Prevent invisible windows from being activated
2017-02-15 11:22:00 -08:00
Kevin Sawicki
70849de8c4 Mark constructor as explicit 2017-02-15 08:28:55 -08:00
Kevin Sawicki
52801c4a41 Use internal IsVisible method 2017-02-15 08:28:55 -08:00
Kevin Sawicki
db79f4f450 Implement Activate instead of CanFocus 2017-02-15 08:28:55 -08:00
Kevin Sawicki
bda8af8dd3 Just use visible state in CanFocus delegate 2017-02-15 08:28:55 -08:00
Kevin Sawicki
86007fe61d Update blur parent window spec 2017-02-15 08:28:55 -08:00
Kevin Sawicki
35908ac398 Add webContents.focus() spec 2017-02-15 08:28:55 -08:00
Kevin Sawicki
be79417a03 Include CanFocus on Windows and map to state 2017-02-15 08:28:55 -08:00
Kevin Sawicki
0ac3969c6a Merge pull request #8682 from electron/use-electron-version-in-chromedriver-asset-name
Use electron version in Chromedriver asset name
2017-02-15 08:28:43 -08:00
Kevin Sawicki
a0fc5ae63d Use electron version in Chromedriver asset name 2017-02-15 08:17:40 -08:00
DemoPark
1170ecb269 add zh-CN translations for offscreen-rendering.md
add zh-CN translations for offscreen-rendering.md
2017-02-15 17:45:52 +08:00
DemoPark
f79ce38a57 add zh-CN translations for electron-versioning.md
add zh-CN translations for 'electron-versioning.md'
2017-02-15 17:21:20 +08:00
Jonas Zhang
20aeec7cf5 Merge pull request #1 from demopark/demopark-patch-1
Optimize zh-CN language logic and grammar
2017-02-15 14:21:37 +08:00
Jonas Zhang
b3ab426a5e Optimize zh-CN language logic and grammar
Optimize zh-CN language logic and grammar.
2017-02-15 14:20:48 +08:00
Cheng Zhao
c127ce3e46 Merge pull request #8679 from electron/disable-active-tracker
Disable the ActiveVerifier
2017-02-15 11:04:36 +09:00
Kevin Sawicki
fe59f413f6 Merge pull request #8684 from electron/compiler-error
Rename variable for compiler error
2017-02-14 12:40:21 -08:00
Kevin Sawicki
36e6501c44 Rename variable for compiler error 2017-02-14 12:30:23 -08:00
Kevin Sawicki
9be42db8d5 Merge pull request #8628 from Spacetech/master
Implement invalidate for non-offscreen mode
2017-02-14 11:41:16 -08:00
Kevin Sawicki
52d989f908 Update docs for non-offscreen invalidate 2017-02-14 11:17:39 -08:00
Kevin Sawicki
643cb5d6de Remove unused variable 2017-02-14 11:13:23 -08:00
Kevin Sawicki
5cb6648686 Use underscore variable name for consistency 2017-02-14 11:12:30 -08:00
Kevin Sawicki
82f452568c 🎨 Minor formatting tweaks 2017-02-14 11:09:15 -08:00
Kevin Sawicki
897d58bde1 Merge pull request #8648 from electron/set-extra-crash-reporter-data
Support updating crash reporter extra parameters
2017-02-14 10:09:02 -08:00
Kevin Sawicki
272a0824e8 Fix darwin platform name 2017-02-14 09:37:09 -08:00
Kevin Sawicki
af7702d0f2 🎨 2017-02-14 09:37:09 -08:00
Kevin Sawicki
07173cdd9d Tweak setExtraParameter description 2017-02-14 09:37:09 -08:00
Kevin Sawicki
b51adf8ae5 Add spec for updated extra parameters 2017-02-14 09:37:09 -08:00
Kevin Sawicki
a4bbad03c2 autoSubmit -> uploadToServer 2017-02-14 09:37:09 -08:00
Kevin Sawicki
f3756ccf29 Run crash reporter specs on all platforms 2017-02-14 09:37:09 -08:00
Kevin Sawicki
3b7207da9f Support removing extra parameters 2017-02-14 09:37:09 -08:00
Kevin Sawicki
41fef3999c Document setExtraParameter 2017-02-14 09:37:09 -08:00
Kevin Sawicki
9a434af03e Clear crash keys in InitBreakpad 2017-02-14 09:37:09 -08:00
Kevin Sawicki
ba975d552a Add setExtraParameter support on macOS 2017-02-14 09:37:09 -08:00
Kevin Sawicki
cfe3ae234b Correct , -> . typo 2017-02-14 09:37:09 -08:00
Kevin Sawicki
3e18d8baf5 Remove _ prefix on binding methods 2017-02-14 09:37:09 -08:00
Kevin Sawicki
e4c54fd0d8 Merge pull request #8662 from oukan/feature/translate-zh-CN
Modules for the Main Process to zh-CN
2017-02-14 09:33:27 -08:00
Kevin Sawicki
e9e8595605 Merge pull request #8673 from electron/scroll-touch-end
Call OnWindowScrollTouchEnd instead of Edge
2017-02-14 09:32:56 -08:00
Kevin Sawicki
c54ae66fb9 Call OnWindowScrollTouchEnd instead of Edge 2017-02-14 09:13:07 -08:00
Kevin Sawicki
624e44dd6f Merge pull request #8605 from electron/no-more-global-buffer
Delete Buffer global when node integration is disabled
2017-02-14 09:07:24 -08:00
Kevin Sawicki
fdc1d3d763 Add Buffer typeof assertion 2017-02-14 08:42:34 -08:00
Kevin Sawicki
8e09fcd2a9 Upgrade node for require wrapper Buffer change 2017-02-14 08:42:34 -08:00
Kevin Sawicki
2a18e3f9ea Remove Buffer global on load 2017-02-14 08:42:34 -08:00
Kevin Sawicki
1933a4fc9f Remove global Buffer mention now handled as require wrapper 2017-02-14 08:42:34 -08:00
Kevin Sawicki
7e138083ef Add declared const Buffer spec 2017-02-14 08:42:34 -08:00
Kevin Sawicki
70010fdb8e Add spec for Buffer global 2017-02-14 08:42:34 -08:00
Kevin Sawicki
80dad58a59 Merge pull request #8654 from electron/context-shutdown-crash
Upgrade brigthray for context crash fix
2017-02-14 08:41:55 -08:00
Kevin Sawicki
1f0bc7fe86 Upgrade brigthray for context crash fix 2017-02-14 08:25:27 -08:00
Cheng Zhao
bad6954911 Disable the ActiveVerifier 2017-02-14 17:23:20 +09:00
Gary Wilber
f19924bcb0 Add Invalidate method to NativeWindow and add Mac implementation 2017-02-13 19:41:24 -08:00
Kevin Sawicki
d3c967401d Merge pull request #8672 from electron/reorder-compiler-error-in-zoom-controller
Call content::WebContentsObserver first
2017-02-13 09:24:38 -08:00
Kevin Sawicki
d7ab142e10 Call content::WebContentsObserver first 2017-02-13 09:09:42 -08:00
Kevin Sawicki
8c2cf03f37 Merge pull request #8617 from electron/resolves-aliases-nsopen
Add resolvesAliases option to openDialog
2017-02-13 08:29:18 -08:00
Kevin Sawicki
a746651d1c Use dialog setter for consistency with other properties 2017-02-13 08:23:53 -08:00
Samuel Attard
17fe5efa13 Fix linting 2017-02-13 08:23:53 -08:00
Samuel Attard
7c33f3ee65 Document the noResolveAliases property 2017-02-13 08:23:53 -08:00
Samuel Attard
e45d8079b8 Add support for a noResolveAliases property 2017-02-13 08:23:53 -08:00
Kevin Sawicki
266c78b861 Merge pull request #8669 from poppinlp/patch-1
Fix typo
2017-02-13 08:18:19 -08:00
Kevin Sawicki
c9e5d7d1e2 Merge pull request #8660 from fab1an/patch-3
Update session.md
2017-02-13 08:17:23 -08:00
Kevin Sawicki
070cc40af4 Merge pull request #8659 from fab1an/patch-2
Update web-contents.md
2017-02-13 08:16:55 -08:00
Cheng Zhao
16382162f8 Update brightray for electron/brightray#275. 2017-02-13 19:27:21 +09:00
Cheng Zhao
7f7df5a6dd Merge pull request #8537 from deepak1556/webcontents_zoom_patch
webContents: manage zoom changes on the browser side with HostZoomMap
2017-02-13 17:24:33 +09:00
PoppinL
9b8e4eb6cb Fix typo
Fix typo
2017-02-13 16:14:49 +08:00
Cheng Zhao
593b7cc92a Merge pull request #8668 from electron/fix-mas
Update libchromiumcontent: fix usage of private API in MAS build
2017-02-13 17:03:37 +09:00
Cheng Zhao
51d5706b48 Update libchromiumcontent: fix usage of private API in MAS build 2017-02-13 16:45:43 +09:00
Weiqiang Lin
e262f6c63e webContents to zh-CN 2017-02-12 23:12:33 +08:00
Weiqiang Lin
b7551b5d84 Class: Tray to zh-CN 2017-02-12 22:51:36 +08:00
Weiqiang Lin
dddb6458da systemPreferences to zh-CN 2017-02-12 22:38:24 +08:00
Weiqiang Lin
c9dd59eb86 session to zh-CN 2017-02-12 22:36:08 +08:00
Weiqiang Lin
9fd9b39448 protocol to -zh-CN 2017-02-12 22:35:03 +08:00
Weiqiang Lin
6a0738aa88 powerSaveBlocker to zh-CN 2017-02-12 22:07:24 +08:00
Weiqiang Lin
50fbd5266a powerMonitor to zh-CN 2017-02-12 22:00:09 +08:00
Fabian Zeindl
46c65ae5fc Update session.md 2017-02-12 10:06:24 +01:00
Fabian Zeindl
5efa34ce6d Update web-contents.md 2017-02-12 10:03:33 +01:00
deepak1556
7a0aff2bae code cleanup 2017-02-12 01:48:24 +05:30
deepak1556
cbeaa6be87 simply handling temporary zoom levels of webview 2017-02-12 00:49:17 +05:30
deepak1556
e3fe3cc490 map webframe zoom api to use HostZoomMap 2017-02-12 00:49:17 +05:30
deepak1556
63c0e4cbb1 Add ZoomController to manager zoom changes for webcontents 2017-02-12 00:49:17 +05:30
deepak1556
07794a58aa use zoom factor webpreference option when required.
* When setzoomlevel is not called for the host.
* When there is no zoom preference for the host.
2017-02-12 00:49:17 +05:30
deepak1556
b27c94368d webContents: set zoom levels with HostZoomMap 2017-02-12 00:49:17 +05:30
Kevin Sawicki
5e78330c6d Merge pull request #8540 from electron/SECURITY.md
Add SECURITY.md
2017-02-10 13:27:50 -08:00
Kevin Sawicki
9b6b8752d4 Merge pull request #8655 from electron/thai-translations
Add Thai translations
2017-02-10 12:18:43 -08:00
Kevin Sawicki
4d7d72256d Remove doc linter warnings 2017-02-10 12:18:24 -08:00
Kevin Sawicki
9dd960fc97 Remove untranslated files 2017-02-10 12:06:06 -08:00
ThePooE
c49363f521 📝 Thai: translated accessibility.md 2017-02-10 11:54:51 -08:00
ThePooE
45a1ffef8f 📝 Thai: fix small line breaking, word warpping in glossary.md 2017-02-10 11:54:51 -08:00
ThePooE
43b09b7360 📝 Thai: translated glossary.md 2017-02-10 11:54:51 -08:00
ThePooE
d3bf36e12a 📝 Thai: translated styleguide.md 2017-02-10 11:54:51 -08:00
wit543
0f55468042 📝 Thai: translate the header ++
translate the header and opening statement
2017-02-10 11:54:51 -08:00
wit543
f4ea70d2c2 Update about.md 2017-02-10 11:54:51 -08:00
ThePooE
9ce93e6cac 📝 Thai: add English placeholders for files to be translated 2017-02-10 11:54:51 -08:00
ThePooE
a78cd79a58 📝 Thai: add link from README.md to the translated version 2017-02-10 11:54:51 -08:00
ThePooE
e008d86e76 📝 Thai: added electron-faq.md 2017-02-10 11:54:51 -08:00
ThePooE
7fdfaa13e7 📝 Thai: fully translated README.md 2017-02-10 11:54:51 -08:00
ThePooE
888dc5702f 📝 Thai: add prelude translation to README.md 2017-02-10 11:54:51 -08:00
Kevin Sawicki
b92c4f6ce5 Merge pull request #8651 from electron/new-window-docs
[ci skip] Improve docs for `new-window` event
2017-02-10 10:29:07 -08:00
Kevin Sawicki
e85d2f00dd Fix linting errors around spacing and semicolons 2017-02-10 08:49:13 -08:00
Kevin Sawicki
5d0da398bf Merge pull request #8650 from electron/will-attach-webview-docs
[ci skip] Improve docs for `will-attach-webview` event
2017-02-10 08:45:40 -08:00
Vadim Macagon
035d9df29b Fix example code 2017-02-10 18:02:03 +07:00
Vadim Macagon
197ad915b7 [ci skip] Improve docs for new-window event
This should help clarify the purpose of `event.newGuest` as per the recent discussion in #7407.
2017-02-10 17:57:55 +07:00
Cheng Zhao
e8f689ecd3 Merge pull request #8640 from electron/fix-debug-symbols
Update libchromiumcontent: Fix debug symbols not generated
2017-02-10 19:11:31 +09:00
Vadim Macagon
e8f0331aeb Improve docs for will-attach-webview event 2017-02-10 10:33:33 +07:00
Kevin Sawicki
acedc3e726 Merge pull request #8584 from electron/new-webview-event
Add will-attach-webview event
2017-02-09 12:40:11 -08:00
Kevin Sawicki
81addbdcbf Remove only call 2017-02-09 11:49:14 -08:00
Kevin Sawicki
941f6c63e3 🎨 Use embedder var for clarity 2017-02-09 11:48:45 -08:00
Kevin Sawicki
a7c050107b Remove guest from will-attach-webview event 2017-02-09 11:47:45 -08:00
Kevin Sawicki
acff2f6baf Adjust src from will-attach-webview 2017-02-09 11:45:07 -08:00
Kevin Sawicki
8b0d3a2567 Emit attach params as well in event 2017-02-09 11:45:07 -08:00
Kevin Sawicki
792f3c3030 Document will-attach-webview 2017-02-09 11:45:07 -08:00
Kevin Sawicki
46f1a49594 new-webview -> will-attach-webview 2017-02-09 11:45:07 -08:00
Kevin Sawicki
7eda8fbdfb Add new-webview event that can be prevented 2017-02-09 11:45:07 -08:00
Kevin Sawicki
706b9f6cbf Add new-webview specs 2017-02-09 11:45:07 -08:00
Kevin Sawicki
5bf60ad8e8 Merge pull request #8556 from yamgent/macos-open-save-panel
Support message, nameFieldLabel and showsTagField for macOS dialog
2017-02-09 11:34:19 -08:00
Kevin Sawicki
5130ad24eb 🎨 2017-02-09 11:30:17 -08:00
Kevin Sawicki
35654d872b Document new settings 2017-02-09 11:29:10 -08:00
Kevin Sawicki
f7f4de36af Merge remote-tracking branch 'origin/master' into macos-open-save-panel 2017-02-09 11:25:05 -08:00
Kevin Sawicki
c3f3a6f133 Merge pull request #8623 from electron/dialog-options-helper
Add DialogSettings helper
2017-02-09 11:07:02 -08:00
Kevin Sawicki
867bb5a94e Add DialogSettings helper struct 2017-02-09 10:13:11 -08:00
Kevin Sawicki
e7410976f0 Merge pull request #8590 from electron/showmessagebox-checkbox
Add support for checkbox with dialog.showMessageBox
2017-02-09 10:07:03 -08:00
Kevin Sawicki
7994acf0ea Use CHROMEGTK_CALLBACK_0 and ignore gpointer data 2017-02-09 09:49:09 -08:00
Birunthan Mohanathas
c8c11e68c6 Add support for checkbox with dialog.showMessageBox
This adds the `checkboxLabel` and `checkboxChecked` options to display a
checkbox in the message box. Fixes #6048.
2017-02-09 09:03:54 -08:00
Tan Wang Leng
347dc835b5 Fix code formatting 2017-02-09 21:51:11 +08:00
Tan Wang Leng
a4a71a1dc9 Change qualifier of ShowSaveDialog() parameter
The normal convention in the codebase is to not use references
or 'const' for primitives like 'bool' and 'int'.
2017-02-09 21:50:55 +08:00
Tan Wang Leng
72723646dd Add tests to check errors in parameters 2017-02-09 21:23:02 +08:00
Tan Wang Leng
9423143211 Change the default value of showsTagField to true
The default value of showsTagField in macOS's NSSavePanel is true.

Therefore, in order to follow the standard behavior and not break
backwards-compatibility, let's change the default value of
showsTagField to true.

Reference:
https://developer.apple.com/reference/appkit/nssavepanel/1525589-showstagfield?language=objc
2017-02-09 21:01:40 +08:00
Tan Wang Leng
b0487b7d84 Fix wrong signature for gtk's ShowSaveDialog() 2017-02-09 20:10:57 +08:00
Tan Wang Leng
1bf8270c0d 🏁 Fix dialog method calls for Windows 2017-02-09 20:10:57 +08:00
Tan Wang Leng
8843fef065 📝 Update docs for new attributes in showOpenDialog() 2017-02-09 20:10:57 +08:00
Tan Wang Leng
36209ddd90 🍎 Add additional options for Mac's open dialog
Support an additional attributes available in macOS's NSOpenPanel:
message.
2017-02-09 20:10:57 +08:00
Tan Wang Leng
cc22149beb 📝 Update docs for new attributes in showSaveDialog() 2017-02-09 20:10:57 +08:00
Tan Wang Leng
1d612a12a1 🍎 Add additional options for Mac's save dialog
Support additional attributes available in macOS's NSSavePanel: message,
nameFieldLabel and showsTagField
2017-02-09 20:10:57 +08:00
Weiqiang Lin
e267a0dd41 Class: MenuItem to zh-CN 2017-02-09 17:57:27 +08:00
Weiqiang Lin
eba65eb4d3 Class: Menu to zh-CN 2017-02-09 17:34:45 +08:00
Weiqiang Lin
c7b639e282 ipcMain to zh-CN 2017-02-09 17:16:27 +08:00
Weiqiang Lin
8f542b1d69 globalShortcut to zh-CN 2017-02-09 17:08:58 +08:00
Weiqiang Lin
4a78490a6a dialog to zh-CN 2017-02-09 17:01:30 +08:00
Weiqiang Lin
db4ad8c692 contentTracing to zh-CN 2017-02-09 16:57:41 +08:00
Weiqiang Lin
f949f83a57 BrowserWindow to zh-CN 2017-02-09 16:17:38 +08:00
Cheng Zhao
a3c5eafb16 Update libchromiumcontent to include debug symbols 2017-02-09 16:52:19 +09:00
Cheng Zhao
90492df1cb Fix exception when executing create-dist directly 2017-02-09 16:52:19 +09:00
Weiqiang Lin
6adf1640e5 autoUpdater to zh-CN 2017-02-09 15:51:48 +08:00
Weiqiang Lin
5d35d2476d window.open Function to zh-cn 2017-02-09 15:24:29 +08:00
Kevin Sawicki
9163b601a4 Merge pull request #8636 from electron/update-certificate-verifier-specs-for-linux-ci
Allow multiple verification results in specs
2017-02-08 13:56:59 -08:00
Kevin Sawicki
22b9c6e539 Allow multiple verification results 2017-02-08 13:33:07 -08:00
Kevin Sawicki
bad130f623 Merge pull request #7955 from deepak1556/veto-ssl-verify
session: provide chromium cert verification result to setCertificateVerifiy callback
2017-02-08 13:12:24 -08:00
Kevin Sawicki
18e15a1e53 Add spec for rejecting using old signature 2017-02-08 12:51:24 -08:00
Kevin Sawicki
1e581d6814 Use unique_ptr for passing VerifyRequestParams 2017-02-08 11:59:43 -08:00
Kevin Sawicki
70178adb6e Use object for verification request 2017-02-08 11:59:43 -08:00
Kevin Sawicki
5245d42d15 Only document deprecation for now 2017-02-08 11:59:43 -08:00
Kevin Sawicki
9c134e7bf3 Assert certificate error 2017-02-08 11:59:43 -08:00
Kevin Sawicki
6b56dfd94b Add spec for remote callback length 2017-02-08 11:59:43 -08:00
Kevin Sawicki
37db804099 Use NetLogWithSource since BoundNetLog no longer exists 2017-02-08 11:59:43 -08:00
Greg Nolle
e29b64a18a modify CertVerifier Class
* respond to multiple similar verification requests.
* accept net error result as callback response.
2017-02-08 11:59:43 -08:00
Kevin Sawicki
d00a96ce35 Merge pull request #8618 from electron/forward-this-in-require-wrapper
Forward `this` in require wrapper
2017-02-08 10:33:48 -08:00
Kevin Sawicki
e9226aa354 Assert test.coffee outside of doesNotThrow 2017-02-08 09:02:46 -08:00
Kevin Sawicki
c1773a2c94 Add coffee-script dependency to specs 2017-02-08 09:00:14 -08:00
Kevin Sawicki
090255c3f4 Upgrade node for require wrapper this fix 2017-02-08 09:00:14 -08:00
Kevin Sawicki
84f8bfbdef Add spec for registering/requiring Coffeescript 2017-02-08 09:00:14 -08:00
Kevin Sawicki
83d31cefeb Merge pull request #8626 from dengyaolong/master
complete download-item translation docs
2017-02-08 08:50:26 -08:00
Gary Wilber
11e1f6b56c Fix lint errors 2017-02-08 00:05:16 -08:00
Gary Wilber
ed44b32ff5 Convert indentation to spaces 2017-02-07 23:08:03 -08:00
Gary Wilber
148898fb75 Implement invalidate for non-offscreen mode 2017-02-07 23:03:42 -08:00
Cheng Zhao
5cd18fe32a Merge pull request #8619 from electron/mac-os-version-checks
Use IsAtLeastOS10_* version checks
2017-02-08 13:58:26 +09:00
dengyaolong
0748f4fef2 complete download-item translation docs 2017-02-08 12:38:08 +08:00
Kevin Sawicki
f9b319e4f8 Merge pull request #8624 from electron/disable-file-icon-specs-on-linux
Disable getFileIcon specs on Linux CI
2017-02-07 18:30:00 -08:00
Kevin Sawicki
ba03f04017 Disable getFileIcon specs on Linux CI 2017-02-07 18:24:35 -08:00
Cheng Zhao
0643d98d99 Merge pull request #8616 from electron/renew-symbol-trick
Simplify the trick used for referencing symbols
2017-02-08 07:56:28 +09:00
Kevin Sawicki
4630f4488e Merge pull request #7851 from YurySolovyov/image-from-icon
Add an API to fetch file icon
2017-02-07 11:37:06 -08:00
Kevin Sawicki
82ac4ddf19 Large is only 48x48 on Linux 2017-02-07 11:20:27 -08:00
Kevin Sawicki
fc1b7431c7 Tweak optional syntax 2017-02-07 10:35:31 -08:00
Kevin Sawicki
a4277bb616 Document sizes 2017-02-07 10:33:44 -08:00
Kevin Sawicki
dddc6aec49 Tweak spec descriptions 2017-02-07 10:21:20 -08:00
Kevin Sawicki
683a758dab Call done instead of skip 2017-02-07 10:16:09 -08:00
Kevin Sawicki
ee66776450 Update IconManager for Chrome 56 upgrade 2017-02-07 10:15:46 -08:00
Yury Solovyov
a9dae243b4 Fix large icon spec 2017-02-07 09:55:18 -08:00
Yury Solovyov
c810e64fda Fix doc lint 2017-02-07 09:55:18 -08:00
Yury Solovyov
bcf0964c61 Fix more review 2017-02-07 09:55:18 -08:00
Yury Solovyov
2b60df3d8b Fix some feedback 2017-02-07 09:55:18 -08:00
Yury Solovyov
29452364f3 Use isolate() method to get isolate 2017-02-07 09:54:22 -08:00
Yury Solovyov
c36cdb8580 Properly skip large size test on macOS 2017-02-07 09:54:22 -08:00
Yury Solovyov
1aa4fcae08 Lint tests 2017-02-07 09:54:22 -08:00
Yury Solovyov
00748889f9 Add tests 2017-02-07 09:54:22 -08:00
Yury Solovyov
c2bf5bb986 Put locker and handle scope to the top of the function. Remove unneeded header 2017-02-07 09:53:34 -08:00
Yury Solovyov
11ef2c539b Update docs 2017-02-07 09:53:34 -08:00
Yury Solovyov
5794138ed4 Normalize path 2017-02-07 09:53:34 -08:00
Yury
1b4ee6e0d8 Image from icon node-style callback (#2)
* Try implementing node-style callbacks

* Add locker and handle scope
2017-02-07 09:53:34 -08:00
deepak1556
2e85ff1f57 Fix code style 2017-02-07 09:53:34 -08:00
Yury Solovyov
3d47c9b71d Fix lint 2017-02-07 09:53:34 -08:00
Yury Solovyov
fe99b255c4 Add docs 2017-02-07 09:53:34 -08:00
Yury Solovyov
05cb26a174 Use object for options 2017-02-07 09:53:34 -08:00
Yury Solovyov
bec671bac8 Make size optional 2017-02-07 09:52:11 -08:00
deepak1556
ff3aaa55f7 define icon loader for liunx as separate target 2017-02-07 09:52:11 -08:00
Robo
b25b141642 create iconmanager as singleton class and cleanup code (#1)
* create iconmanager as singleton class and cleanup code
2017-02-07 09:52:11 -08:00
Yury Solovyov
1b3cd87fc9 Add icon manager to browser process 2017-02-07 09:50:17 -08:00
Yury Solovyov
602aba8723 Include proper header 2017-02-07 09:48:12 -08:00
Yury Solovyov
eb889b9b86 Get it compiling, linking till fails though 2017-02-07 09:48:12 -08:00
Yury Solovyov
d118fed5c2 Try my own class 2017-02-07 09:48:12 -08:00
Yury Solovyov
8e4ed664d9 Add icon fetching sources 2017-02-07 09:48:12 -08:00
Yury Solovyov
1d24a3a175 Add callback converters 2017-02-07 09:48:12 -08:00
Yury Solovyov
be5b907179 WIP 2017-02-07 09:48:12 -08:00
Kevin Sawicki
0f98c9d3fb Use at least OS version checks 2017-02-07 09:32:40 -08:00
Kevin Sawicki
c3c5470a7c Merge pull request #8542 from yamgent/webpref-numeric
Fix webpreferences not accepting numeric options
2017-02-07 09:15:55 -08:00
Kevin Sawicki
4de637779b Make int converter helper an instance method 2017-02-07 09:13:42 -08:00
Tan Wang Leng
7ec88d16a6 Use base::StringToInt() instead of std::stringstream 2017-02-07 09:05:55 -08:00
Tan Wang Leng
42f65c52fb 🐛 Fix webpreferences not accepting numeric options
The webpreferences attribute values are parsed as strings instead
of numbers. Therefore, a conversion is required.
2017-02-07 09:05:55 -08:00
Cheng Zhao
84c180ac69 Simplify the trick used for referencing symbols 2017-02-07 17:09:43 +09:00
Kevin Sawicki
852519a826 Bump v1.6.0 2017-02-06 16:42:00 -08:00
Kevin Sawicki
e6fe2a93f2 Merge pull request #8607 from electron/fix-win32-link
Fix missing of symbols when linking win32 build
2017-02-06 16:41:22 -08:00
Cheng Zhao
85e84cc0da Fix missing of symbols when linking win32 build 2017-02-07 09:14:50 +09:00
Kevin Sawicki
a2ecef26a2 Merge pull request #8606 from electron/fix-broken-link
Fix broken Squirrel.Windows link
2017-02-06 16:01:40 -08:00
Charlie Hess
a35424ef25 Fix broken Squirrel.Windows link. 2017-02-06 15:54:05 -08:00
Kevin Sawicki
8359c72347 Merge pull request #8501 from electron/chrome56
Upgrade to Chrome 56
2017-02-06 11:17:20 -08:00
Kevin Sawicki
dbb81e34e8 Upgrade node for modules version bump 2017-02-06 10:34:30 -08:00
Kevin Sawicki
997799ad68 Update libcc to e0da1e9 2017-02-06 10:34:30 -08:00
Cheng Zhao
ec650b3773 Update to Chrome 56.0.2924.87 2017-02-06 10:34:30 -08:00
Cheng Zhao
864a23f72b Fix print() not working 2017-02-06 10:34:30 -08:00
Cheng Zhao
86215d4300 Allow filter to use any scheme 2017-02-06 10:34:30 -08:00
Cheng Zhao
e0c021bfef Fix compilation waring on Mac 2017-02-06 10:34:29 -08:00
Cheng Zhao
1ed8743da8 Update Windows printing code to latest 2017-02-06 10:34:29 -08:00
Cheng Zhao
d483352f78 Fix PrintToPDF not receiving results 2017-02-06 10:34:29 -08:00
Cheng Zhao
3024d0563f There were new defaultPrintingSetting fields added 2017-02-06 10:34:29 -08:00
Cheng Zhao
ab783413a2 Update printing code to latest 2017-02-06 10:34:29 -08:00
Cheng Zhao
75627ba6ad Fix sync printing not working 2017-02-06 10:34:29 -08:00
Cheng Zhao
85961a0dd9 Update libchromiumcontent to fix duplicate main functions 2017-02-06 10:34:29 -08:00
Cheng Zhao
c69626336d Link with xcb on Linux 2017-02-06 10:34:29 -08:00
Cheng Zhao
82d796ded4 Fix missing of symbols issue on Release build 2017-02-06 10:34:29 -08:00
Cheng Zhao
41f356a94d icu's namespace has become icu_58 2017-02-06 10:34:29 -08:00
Cheng Zhao
a98e69a80d Work around the compilation error of v8_value_converter.cc
We should apply this patch in future:
0232f57400%5E%21/
2017-02-06 10:34:29 -08:00
Cheng Zhao
be29ea4dad libgtk2ui => libgtkui 2017-02-06 10:34:29 -08:00
Cheng Zhao
820c0827c0 Fix cpplint warnings 2017-02-06 10:34:29 -08:00
Cheng Zhao
55d4d44f02 Fix Debug building on Windows 2017-02-06 10:34:29 -08:00
Cheng Zhao
6165d36351 There is a new INSERTED type of ChangeCause
For the purpose of compatibility, we treat it as "explicit".
2017-02-06 10:34:29 -08:00
Cheng Zhao
09fcb7fb27 Fix crash when using webview 2017-02-06 10:34:29 -08:00
Cheng Zhao
c72438f09f WebInspector has been split up 2017-02-06 10:34:29 -08:00
Cheng Zhao
0a7c51b9aa Fix linking on Mac 2017-02-06 10:34:29 -08:00
Cheng Zhao
fa4b8cff45 Fix error due to search for openssl headers 2017-02-06 10:34:29 -08:00
Cheng Zhao
eb3b77f43b ScopedTempDir::path is replaced with GetPath 2017-02-06 10:34:29 -08:00
Cheng Zhao
6763977316 Update URLPattern to its latest version 2017-02-06 10:34:29 -08:00
Cheng Zhao
81784827ff PrintWebViewHelper is attached to RenderFrame 2017-02-06 10:34:29 -08:00
Cheng Zhao
234e1bb811 base::Bind now prevents the case with no arguments 2017-02-06 10:34:29 -08:00
Cheng Zhao
411696ca19 Clear is replaced with ClearEntriesAddedWithin 2017-02-06 10:34:29 -08:00
Cheng Zhao
8a6fd685e3 Interface of crashpad_client.StartHandler has changed
Refs:
7b9234c4b2%5E%21/
2017-02-06 10:34:29 -08:00
Cheng Zhao
4a14b17255 WindowOpenDisposition has become enum class 2017-02-06 10:34:29 -08:00
Cheng Zhao
6d5339b74e insertText is deprecated 2017-02-06 10:34:29 -08:00
Cheng Zhao
5e43ea227e purgedSize and purgeableSize are removed by Chrome 2017-02-06 10:34:29 -08:00
Cheng Zhao
6d323dd6fe web/WebInputEvent.h is moved to platform/WebInputEvent.h 2017-02-06 10:34:29 -08:00
Cheng Zhao
53bf82dd7c Update URLRequestFetchJob 2017-02-06 10:34:29 -08:00
Cheng Zhao
e7f3a25626 Update OffScreenRenderWidgetHostView 2017-02-06 10:34:29 -08:00
Cheng Zhao
2e0780308c allowDisplayingInsecureContent is removed by Chrome 2017-02-06 10:34:29 -08:00
Cheng Zhao
47c1bc9f66 Update ResponsePiper 2017-02-06 10:34:29 -08:00
Cheng Zhao
5cf2873b77 net::FtpProtocolHandler has changed its constructor 2017-02-06 10:34:29 -08:00
Cheng Zhao
5162905fe4 Update widevine_cdm_messages.h 2017-02-06 10:34:29 -08:00
Cheng Zhao
1a15b45736 --cipher-suite-blacklist is also removed 2017-02-06 10:34:29 -08:00
Cheng Zhao
dc9000f344 --ssl-version-fallback-min is removed by Chrome 2017-02-06 10:34:28 -08:00
Cheng Zhao
3ea6d88763 Update AtomCertVerifier 2017-02-06 10:34:28 -08:00
Cheng Zhao
c0697d8abe SetupFilter is replaced with SetUpSourceStream 2017-02-06 10:34:28 -08:00
Cheng Zhao
9882e87fbd Update OffScreenOutputDevice 2017-02-06 10:34:28 -08:00
Cheng Zhao
c2f3bbb3e6 Update OffScreenWebContentsView 2017-02-06 10:34:28 -08:00
Cheng Zhao
a95bd227c3 Update atom::Browser 2017-02-06 10:34:28 -08:00
Cheng Zhao
e91eed6758 FOR_EACH_OBSERVER is removed 2017-02-06 10:34:28 -08:00
Cheng Zhao
85749e4dbd Update AtomJavaScriptDialogManager 2017-02-06 10:34:28 -08:00
Cheng Zhao
6eaa30e94c Update AtomResourceDispatcherHostDelegate 2017-02-06 10:34:28 -08:00
Cheng Zhao
13a1d79ca6 Deperecate AtomSecurityStateModelClient with SecurityStateTabHelper 2017-02-06 10:34:28 -08:00
Cheng Zhao
3224c39371 Mac's version checking function has changed 2017-02-06 10:34:28 -08:00
Cheng Zhao
1d29b23662 Update api::WebContents 2017-02-06 10:34:28 -08:00
Cheng Zhao
231173aa90 Namespace of ChangeCause has changed 2017-02-06 10:34:28 -08:00
Cheng Zhao
d4e3dade39 WindowCapturer and ScreenCapturer are merged to DesktopCapturer 2017-02-06 10:34:28 -08:00
Cheng Zhao
7a7b72ce04 SimpleMenuModel::MenuClosed renamed to MenuWillClose 2017-02-06 10:34:28 -08:00
Cheng Zhao
c10eb73166 Signature of OnCreateWindow has changed 2017-02-06 10:34:28 -08:00
Cheng Zhao
d8e9432b0d contentTracing.setWatchEvent/cancelWatchEvent is removed 2017-02-06 10:34:28 -08:00
Cheng Zhao
0a91779dfa Node also defines LIKELY 2017-02-06 10:34:28 -08:00
Cheng Zhao
074cad9146 A few new V8 defines 2017-02-06 10:34:28 -08:00
Cheng Zhao
406224edff enable_pepper_cdms is now a feature flag
So we should not define it anymore.
2017-02-06 10:34:28 -08:00
Cheng Zhao
c1df762656 Update crashpad to 556c4e4 2017-02-06 10:34:28 -08:00
Cheng Zhao
b83676f9e9 Update to Chrome 56 2017-02-06 10:34:28 -08:00
Kevin Sawicki
1518ff5ddf Bump v1.5.1 2017-02-06 08:56:48 -08:00
Kevin Sawicki
18357512f3 Merge pull request #8515 from electron/auto-launch-squirrel-support
Support custom launch path in app.setLoginItemSettings
2017-02-06 08:55:32 -08:00
Kevin Sawicki
1b3d3b6b75 Use return value of GetProcessExecPath 2017-02-06 08:34:35 -08:00
CharlieHess
1178915f30 Ensure backwards compatibility with getLoginItemSettings.
We need to make sure the executable path is not quoted.
2017-02-06 08:34:35 -08:00
Kevin Sawicki
b7b200c874 Fix typo in getLoginItemSettings doc 2017-02-06 08:34:35 -08:00
Kevin Sawicki
1c6a07c68d Clear Update.exe login item settings in afterEach 2017-02-06 08:34:35 -08:00
Kevin Sawicki
3c2539eced Update example to use new option keys 2017-02-06 08:34:35 -08:00
Kevin Sawicki
e2501a80e4 Add path and args to LoginItemSettings struct 2017-02-06 08:34:35 -08:00
Charlie Hess
29d0a30d63 Oh, browser_linux is a thing too. 2017-02-06 08:34:35 -08:00
CharlieHess
25bc02f332 Don't append "%1" in the Run registry key.
It's only necessary for the protocol launch path.
2017-02-06 08:34:35 -08:00
Charlie Hess
d2ffd87668 I will never appreciate standard. 2017-02-06 08:34:35 -08:00
CharlieHess
852e158cc6 Make sure the spec takes arguments into account. 2017-02-06 08:34:35 -08:00
Charlie Hess
4fce00148d Add a spec for this behavior on Windows. 2017-02-06 08:34:35 -08:00
Charlie Hess
26d4a3b0ba Fix method signature on macOS. 2017-02-06 08:34:35 -08:00
CharlieHess
02dfdf75a0 Line Lengths! 2017-02-06 08:34:35 -08:00
CharlieHess
45e2f35eff Provide guidance in the docs. 2017-02-06 08:34:35 -08:00
CharlieHess
62c8a00347 This is rubbish let's pull the escape hatch.
Make all these arguments user-provided instead.
2017-02-06 08:34:35 -08:00
CharlieHess
0a6a8192b6 Close to a working Squirrel shortcut. 2017-02-06 08:34:35 -08:00
Charlie Hess
39b6bcb621 First pass at auto-launch supporting Squirrel. 2017-02-06 08:34:35 -08:00
Kevin Sawicki
093b844859 Merge pull request #8509 from electron/upgrading-chrome-doc
Add initial upgrading chrome checklist
2017-02-03 09:58:29 -08:00
Zeke Sikelianos
6df446baba Merge pull request #8583 from crowchirp/docs-typo-fixes
Docs typo fixes
2017-02-03 09:55:43 -08:00
Kevin Sawicki
de18f09588 Add initial upgrading chrome checklist 2017-02-03 09:54:34 -08:00
Kevin Sawicki
2f3578679f Merge pull request #8572 from electron/content-tracing-app-ready
Document using content tracing after app ready
2017-02-03 09:53:53 -08:00
Kevin Sawicki
7b3e998cc6 Use content tracing after app ready 2017-02-03 09:45:18 -08:00
Kevin Sawicki
cf694ef32b Merge pull request #8570 from electron/force-refresh-menu-role
Add forcereload menu item role
2017-02-03 09:44:57 -08:00
Kevin Sawicki
b1f260ac87 Add forcereload to MenuItem doc 2017-02-03 09:39:41 -08:00
Kevin Sawicki
fb08f56fc8 Add forcereload menu item role 2017-02-03 09:39:41 -08:00
Kevin Sawicki
555347e726 Merge pull request #8569 from electron/webview-default-node-integration
Mention presence of webview attributes enables them
2017-02-03 09:39:22 -08:00
Kevin Sawicki
50b9dfa61a Use querySelector to make examples more portable 2017-02-03 09:32:15 -08:00
Kevin Sawicki
4539a6f4d5 Change wording from on to present 2017-02-03 09:32:15 -08:00
Kevin Sawicki
4abbd65628 Merge pull request #8568 from electron/initialize-color-listener-after-app-is-ready
Initialize color listener after app is ready
2017-02-03 09:31:58 -08:00
Kevin Sawicki
5973aa36ad Initialize color listener after app is ready 2017-02-03 09:00:18 -08:00
Kevin Sawicki
62a400b7d6 Merge pull request #8566 from electron/prompt-to-create-property
Support returning non-existent file paths from Windows open dialog
2017-02-03 08:58:52 -08:00
Chandan Rai
75ec73d6fe Merge remote-tracking branch 'origin/patch-3' into docs-typo-fixes 2017-02-03 22:23:35 +05:30
Chandan Rai
1a3abb61ed Merge remote-tracking branch 'origin/patch-2' into docs-typo-fixes 2017-02-03 22:23:21 +05:30
Chandan Rai
4a6cbd76c8 corrected typo 2017-02-03 19:26:37 +05:30
Chandan Rai
9e7bcda07d corrected typo 2017-02-03 19:11:37 +05:30
Chandan Rai
93b0a2caa1 corrected typo 2017-02-03 18:58:21 +05:30
Kevin Sawicki
930a5c6de2 Merge pull request #8565 from electron/protocol-client-specs
Add protocol client specs on Windows
2017-02-02 12:48:19 -08:00
Kevin Sawicki
daff671afc Add protocol constant 2017-02-02 12:48:09 -08:00
Kevin Sawicki
a60f341968 Add procotol client specs on Windows 2017-02-02 12:48:09 -08:00
Kevin Sawicki
604c2470bc Merge pull request #8561 from liusy182/!-liusy182-br
add 'code' property in 'before-input-event''s 'input' argument
2017-02-02 10:33:20 -08:00
Kevin Sawicki
9fef6a1fd7 Add support for FOS_CREATEPROMPT option 2017-02-02 08:51:10 -08:00
liusy182
2cf6a026d8 fix linting error 2017-02-02 21:16:30 +08:00
liusi
87392ff046 'before-input-event' is missing the code property #8471 2017-02-02 16:23:07 +08:00
Kevin Sawicki
dc1c11a841 Merge pull request #8487 from leethomas/feature/osx-relative-window-levels
Feature/macOS relative window levels
2017-01-30 15:34:24 -08:00
Kevin Sawicki
9b2b6da3a3 Wrap params at 80 characters 2017-01-30 15:32:05 -08:00
Kevin Sawicki
2cacaa443a Indent relativeLevel docs 2017-01-30 15:27:51 -08:00
Zeke Sikelianos
f0882a5058 use consistent headings 2017-01-30 10:57:53 -08:00
Zeke Sikelianos
1945771f37 Add SECURITY.md 2017-01-30 10:49:17 -08:00
Kevin Sawicki
37eebb1dd0 Merge pull request #8539 from electron/require-wrapper
Update require wrapper to allow redefinition of process and global
2017-01-30 10:36:15 -08:00
Kevin Sawicki
94cb605993 Use strictEqual for global variable asserts 2017-01-30 10:08:12 -08:00
Kevin Sawicki
e99b1709d9 Redeclare process/global as strings 2017-01-30 09:58:44 -08:00
Kevin Sawicki
4e5b8ac3ee Remove throws and assert object directly 2017-01-30 09:38:15 -08:00
James Ide
0430380de1 Update the Node submodule to use the new module wrapper
See the fixed issue for the context. This pulls in a vendored copy of Node that includes the described patch.

Fixes #8358

Test Plan: Built Electron and verified it loaded the sample app correctly and that the module wrapper is the new one by viewing Node's source code in the Blink Inspector.

Added specs and tested with `npm test -- --grep "global variables"`
2017-01-30 09:37:14 -08:00
leethomas
edbb786fb4 use kCGMinimumWindowLevelKey to get the minimum level 2017-01-26 19:12:10 -08:00
Kevin Sawicki
6e2f977f7a Merge pull request #8511 from electron/start-drag-crash
Fix startDrag crash on macOS with empty image
2017-01-26 17:10:21 -08:00
Kevin Sawicki
76e5589a31 Schedule function after executeJavaScript completes 2017-01-26 16:15:10 -08:00
Kevin Sawicki
651ea7ef02 Merge pull request #8421 from oukan/feature/translate-zh-CN
translate zh cn
2017-01-26 15:48:57 -08:00
Kevin Sawicki
eb6d92d427 Mention image cannot be empty on macOS 2017-01-26 15:46:04 -08:00
Kevin Sawicki
e683f28e32 Require a non-empty drag image to prevent crash 2017-01-26 15:46:04 -08:00
Kevin Sawicki
8ce1930f0d Add specs for missing startDrag options 2017-01-26 15:46:04 -08:00
Kevin Sawicki
2ee5f6f358 Merge pull request #8507 from electron/fix-node-upgrade-patches
Redo node 7.4 error handling patch
2017-01-26 15:43:58 -08:00
Kevin Sawicki
06c025050e Fix typo in spec description 2017-01-26 14:46:51 -08:00
Kevin Sawicki
ff718b19db Upgrade node for new 7.4 patches and changes 2017-01-26 14:46:50 -08:00
Kevin Sawicki
1004d205d8 Add spec for unhandledRejection event in main process 2017-01-26 14:46:50 -08:00
Kevin Sawicki
24fb560a9d Add failing spec for uncaught main process errors 2017-01-26 14:46:50 -08:00
Kevin Sawicki
a4e25a8917 Merge pull request #8519 from electron/consolidate-panel-showing
Use helper function to show last dev tools panel
2017-01-26 14:44:45 -08:00
Kevin Sawicki
2cfa67bdff Remove linter warning 2017-01-26 09:59:07 -08:00
Kevin Sawicki
a851695bb9 Clear interval before setting new one 2017-01-26 09:57:53 -08:00
Kevin Sawicki
e2e33a8cf0 Guard against destroyed window or web contents 2017-01-26 09:57:00 -08:00
Kevin Sawicki
515f689814 Use helper function to show last dev tools panel 2017-01-26 09:42:45 -08:00
Kevin Sawicki
640b03f7d0 Merge pull request #8510 from electron/empty-image-crashes
Fix empty image crashes
2017-01-26 09:08:52 -08:00
leethomas
b67d515a76 fix signature for SetAlwaysOnTop in native window views 2017-01-26 07:24:20 -08:00
leethomas
9e189b9d2d fix js lint errors 2017-01-26 07:14:47 -08:00
leethomas
1234b61fa6 spec to ensure an error is thrown when relativeLevel is set out of bounds 2017-01-25 19:39:57 -08:00
Kevin Sawicki
104cae8f68 Only call getNativeHandle on macOS 2017-01-25 14:26:05 -08:00
Kevin Sawicki
e1281342f6 Return empty buffers when image is empty 2017-01-25 14:26:05 -08:00
Kevin Sawicki
2ad46f1842 Add failing spec for empty image crashes 2017-01-25 14:26:05 -08:00
Kevin Sawicki
8e69f94df0 Merge pull request #8357 from electron/remote-events-error-message
Don't crash when calling stale remote listeners
2017-01-25 14:23:57 -08:00
Kevin Sawicki
330ac5f266 Fix standard linting error 2017-01-25 12:36:55 -08:00
Kevin Sawicki
56a8eb3a94 Check that sender is a WebContents instance 2017-01-25 12:36:55 -08:00
Charlie Hess
ddedcf22d1 Move console.warn inside the helper method. 2017-01-25 12:36:55 -08:00
Charlie Hess
f6410d3b77 Assert that listener count decreases after a remove event. 2017-01-25 12:36:55 -08:00
Charlie Hess
c213971a2d Write a warning instead of crashing. 2017-01-25 12:36:55 -08:00
Charlie Hess
bc2f1e8199 Argh. 2017-01-25 12:36:55 -08:00
Charlie Hess
63d8137da2 Use EventEmitter public methods instead of _events. 2017-01-25 12:36:55 -08:00
Kevin Sawicki
45986405b8 Assert remote event names 2017-01-25 12:36:55 -08:00
Charlie Hess
b04db2e546 Add a spec for the "renderer window closed" error. 2017-01-25 12:36:55 -08:00
Charlie Hess
a0b24bd155 Simplify. 2017-01-25 12:36:55 -08:00
Charlie Hess
67f7a60524 Review CommentZ 2017-01-25 12:36:55 -08:00
Charlie Hess
41ea169784 L I N T I N G P T I I 2017-01-25 12:36:55 -08:00
Charlie Hess
49c6446267 L I N T I N G 2017-01-25 12:36:55 -08:00
Charlie Hess
26e3ad3c2e Display more information about remote event crashes.
If possible, we'll dig into the function args and print the ones that are attached remotely.
2017-01-25 12:36:55 -08:00
Kevin Sawicki
c13ea6eb36 Merge pull request #8497 from electron/enable-crash-reporter-specs-on-ci
Run crash reporter server specs on CI
2017-01-25 10:54:56 -08:00
Kevin Sawicki
f104e019be Run crash reporter server specs on CI 2017-01-25 10:36:16 -08:00
Kevin Sawicki
8e39aea34a Merge pull request #8478 from deepak1556/load_url_max_char_patch
WebContents: emit did-fail-load event when url exceeds character limit
2017-01-25 09:46:40 -08:00
deepak1556
d8a16a8ffb fix spec 2017-01-25 14:20:33 +05:30
leethomas
1f5518b91e throw an error for out of bounds window levels 2017-01-24 20:14:09 -08:00
Kevin Sawicki
90470617ab Merge pull request #8430 from ramya-rao-a/crash-for-children-docs
Updated docs for crash reporter to support child processes
2017-01-24 14:08:36 -08:00
Kevin Sawicki
ce6a46ee59 Use template strings 2017-01-24 14:08:10 -08:00
Kevin Sawicki
108a3473ed Use crashesDirectory in example 2017-01-24 14:07:00 -08:00
Kevin Sawicki
4985e073c4 Mention how to test 2017-01-24 14:04:56 -08:00
Kevin Sawicki
7b03c05b4e Capitalize Electron, fence as JS 2017-01-24 14:03:54 -08:00
Kevin Sawicki
ce472315f4 Merge pull request #8109 from ramya-rao-a/crash-for-children
Expose crash reporter start for child node processes
2017-01-24 14:02:47 -08:00
Kevin Sawicki
43ef4faf79 🎨 2017-01-24 14:00:03 -08:00
Kevin Sawicki
795b674996 Add StartInstance helper on CrashReporter 2017-01-24 13:54:46 -08:00
Kevin Sawicki
170c51ae85 Add spec for crashing node process 2017-01-24 13:49:45 -08:00
Ramya Achutha Rao
241773f2f0 Clean up testing code written for crash for children 2017-01-24 12:44:39 -08:00
Ramya Achutha Rao
d453dbdb40 Support crash reporting from child process in Windows 2017-01-24 12:44:39 -08:00
Ramya Achutha Rao
2814e04e7d Getting rid of linting errors 2017-01-24 12:44:39 -08:00
Kevin Sawicki
f1cd1c6dff Use mate::Dictionary::CreateEmpty 2017-01-24 12:44:39 -08:00
Kevin Sawicki
4107174cfd Group includes 2017-01-24 12:44:39 -08:00
Kevin Sawicki
91f8d6092b Take options object in process.crashReporter.start 2017-01-24 12:44:39 -08:00
Ramya Achutha Rao
1f07cf2545 Add crashReporter property to process 2017-01-24 12:44:39 -08:00
Ramya Achutha Rao
d4b44d8b69 Expose crash reporter start for child node processes 2017-01-24 12:44:39 -08:00
Kevin Sawicki
61aff5ed35 Merge pull request #8495 from electron/fullscreen-spec
Wait for window to transition before leaving full screen
2017-01-24 12:32:14 -08:00
Kevin Sawicki
6bb331356e Finish spec when full screen is left 2017-01-24 11:55:13 -08:00
Kevin Sawicki
284ca3114b Wait for window to transition before leaving full screen 2017-01-24 11:55:13 -08:00
Kevin Sawicki
e1fe5f4fbf Merge pull request #8496 from electron/upgrade-ffi
Upgrade to ffi@2.2.0
2017-01-24 11:54:59 -08:00
Kevin Sawicki
2762ead5a4 Upgrade to ffi@2.2.0 2017-01-24 11:25:21 -08:00
Kevin Sawicki
0ca5ad754e Merge pull request #8452 from electron/document-build
Document toolchains used for building official Electron releases
2017-01-24 10:53:33 -08:00
Kevin Sawicki
4f6750a460 Update build doc to Xcode 8.2.1 2017-01-24 10:49:42 -08:00
Kevin Sawicki
1960327918 Bump v1.5.0 2017-01-24 08:27:37 -08:00
Kevin Sawicki
8c9ebbeec2 Merge pull request #8483 from electron/upgrade-libcc
Upgrade libcc to b4dd78df
2017-01-24 08:26:42 -08:00
Kevin Sawicki
9f03a166f7 Upgrade libcc to b4dd78df 2017-01-24 08:01:22 -08:00
leethomas
fb741285c6 update documentation 2017-01-23 23:42:38 -08:00
leethomas
7a0a87a6f3 implement relative window levels, closes #8153 2017-01-23 23:42:33 -08:00
Kevin Sawicki
034230e2ae Merge pull request #8475 from milkit/fix-translation-jp
Fix Japanese translation
2017-01-23 09:35:01 -08:00
Kevin Sawicki
68ca873fa8 Merge pull request #8472 from javan/patch-1
Remove note in "did-fail-load" about redirect responses
2017-01-23 09:34:42 -08:00
Kevin Sawicki
3312f98121 Merge pull request #8467 from electron/upgrade-multiparty
Upgrade multiparty for os.tmpdir fix
2017-01-23 09:27:34 -08:00
Kevin Sawicki
33820ffb85 Upgrade multiparty for os.tmpdir fix 2017-01-23 09:22:08 -08:00
deepak1556
593a3de850 add spec 2017-01-23 19:57:47 +05:30
Shunki Tan
05b6f95ab8 Fix Japanese translation 2017-01-23 11:35:06 +09:00
Javan Makhmali
68eaf1fb9f Remove note in "did-fail-load" about redirect responses
ERR_ABORTED is suppressed now (https://github.com/electron/electron/pull/6201)
2017-01-22 16:39:42 -05:00
Weiqiang Lin
851a7578fa <webview> Tag to zh-CN 2017-01-22 14:18:34 +08:00
Weiqiang Lin
0d259a6eb0 File Object to zh-CN 2017-01-22 14:17:59 +08:00
Weiqiang Lin
86521f325b Synopsis to zh-CN 2017-01-22 14:17:29 +08:00
Weiqiang Lin
64a1b1c474 Supported Chrome Command Line Switches to zh-CN 2017-01-22 14:16:59 +08:00
Weiqiang Lin
cf54c4cbb2 testing-on-headless-ci.md to zh-CN 2017-01-22 14:15:51 +08:00
Kevin Sawicki
91ed9aeeee Merge pull request #8464 from schwalbe10/translation_jp
Fix a typo
2017-01-21 10:41:30 -08:00
Kevin Sawicki
bc001f8816 Merge pull request #8463 from electron/patch-about-md
Fixing missing link
2017-01-21 10:41:14 -08:00
schwalbe10
56882c31bd Fix a typo 2017-01-21 23:12:37 +09:00
Samuel Attard
8fe8dfa410 Fixing missing link 2017-01-22 00:12:43 +11:00
deepak1556
f9dc08baf6 emit did-fail-load event when the url char length exceeds limit 2017-01-21 14:59:20 +05:30
deepak1556
54559f99a0 Fix dereferencing nullptr
RenderWidgetHostView might not be available when
the navigator fails to load a url.
2017-01-21 14:56:58 +05:30
Kevin Sawicki
91c70a66cb Link to Xcode 7.3.1 DMG 2017-01-20 08:16:17 -08:00
Kevin Sawicki
edcea3e800 Merge pull request #8456 from yuya-oc/docs-security
Add to security checklist about permission requests
2017-01-20 08:04:01 -08:00
Yuya Ochiai
11f2574fda 📝 Add to security checklist about permission requests
If the handler is not set, remote content can access to user's
information without allowing the permission. e.g. UserMedia
[ci skip]
2017-01-20 23:58:21 +09:00
Yuya Ochiai
a7a3aa848e 📝 Fix typo
[ci skip]
2017-01-20 23:45:48 +09:00
Birunthan Mohanathas
b145131505 Mention VS2015 Update 3 to match CI environment 2017-01-20 07:19:43 +02:00
Birunthan Mohanathas
410f3c03d4 Document use of Xcode 7.3.1 with 10.10 SDK for release builds 2017-01-20 07:19:07 +02:00
Kevin Sawicki
8a22139d57 Merge pull request #8451 from electron/upgrade-clang
Upgrade to clang 278861
2017-01-19 15:56:38 -08:00
Kevin Sawicki
6a80cd2b7e Upgrade to clang 278861 2017-01-19 15:32:03 -08:00
Kevin Sawicki
22b21d04bd Merge pull request #8406 from electron/use_gn-chrome54
Use gn chrome54
2017-01-19 13:33:48 -08:00
Kevin Sawicki
2cddb5bb4e Bump v1.4.15 2017-01-19 08:32:42 -08:00
Birunthan Mohanathas
a560df3327 Update node to pick up Windows compilation fix 2017-01-19 09:05:59 +02:00
Kevin Sawicki
14d48e9653 Update .node-version to 7.4 2017-01-19 09:05:59 +02:00
Kevin Sawicki
c374e37cc4 Leak IsolateData since Environment is also leaked 2017-01-19 09:05:59 +02:00
Kevin Sawicki
54e2c480cb Upgrade to node 7.4 2017-01-19 09:05:59 +02:00
Kevin Sawicki
43067e01e9 Upgrade to latest libcc 2017-01-19 09:05:59 +02:00
Birunthan Mohanathas
ab4a055c05 Correct version in chrome_version.h 2017-01-19 09:05:59 +02:00
Cheng Zhao
c774bb47c5 Update to latest libchromiumcontent 2017-01-19 09:05:59 +02:00
Ales Pergl
a52d780e7a Update brightray and crashpad 2017-01-19 09:05:59 +02:00
Kevin Sawicki
b6d0201c73 Upgrade to Chrome 54.0.2840.101 2017-01-19 09:05:59 +02:00
Kevin Sawicki
1b036a284d Add basic inspectElement spec 2017-01-19 09:05:59 +02:00
Kevin Sawicki
602db2e04f 🎨 2017-01-19 09:05:59 +02:00
Kevin Sawicki
f0ceb4f065 Use SetNeedsBeginFrames from IPC handler 2017-01-19 09:05:59 +02:00
Kevin Sawicki
d71f10c5a3 Implement GetScreenInfo 2017-01-19 09:05:59 +02:00
Kevin Sawicki
39ddeff5c3 Implement SetNeedsBeginFrames 2017-01-19 09:05:59 +02:00
Kevin Sawicki
cc183524fd Only remove webview when non-null 2017-01-19 09:05:59 +02:00
Kevin Sawicki
b0ee46f862 Use === in specs 2017-01-19 09:05:59 +02:00
Kevin Sawicki
443040e8d7 Call InspectElement directly on InspectableWebContents 2017-01-19 09:05:59 +02:00
Kevin Sawicki
d6eb0d6629 Implement insertCSS on webFrame 2017-01-19 09:05:59 +02:00
Kevin Sawicki
017df93ffa Add failing spec for insertCSS 2017-01-19 09:05:59 +02:00
Kevin Sawicki
2f5acfedcd Add spec for denying perm requests when handler is cleared 2017-01-19 09:05:59 +02:00
Kevin Sawicki
18675cc6c1 Implement RequestPermissions using request handler 2017-01-19 09:05:59 +02:00
Kevin Sawicki
977680d00b Add spec for midi without sysex permission 2017-01-19 09:05:59 +02:00
Kevin Sawicki
2f26dbf39e Update type to level in debugger message spec 2017-01-19 09:05:59 +02:00
Kevin Sawicki
873e6e5e6b Append form to body before submitting 2017-01-19 09:05:59 +02:00
Cheng Zhao
20b70b367e Update to latest libchromiumcontent 2017-01-19 09:05:59 +02:00
Cheng Zhao
f2a30afcf1 Fix linking for arm build 2017-01-19 09:05:59 +02:00
Cheng Zhao
ec134e7536 Fix building error for arm linux 2017-01-19 09:05:59 +02:00
Cheng Zhao
0568fa30ca Fix linking for Windows 2017-01-19 09:05:59 +02:00
Cheng Zhao
6e0762a540 Fix building on Windows 2017-01-19 09:05:59 +02:00
Cheng Zhao
af212a9f67 Update libchromiumcontent for the rebase 2017-01-19 09:05:59 +02:00
Cheng Zhao
ebb4c93994 Fix linking error for x64 Linux build 2017-01-19 09:05:59 +02:00
Cheng Zhao
fd2fdb5475 Fix linking problem with libgtk2ui 2017-01-19 09:05:59 +02:00
Cheng Zhao
88f6f5d1b2 Fix compilation errors for Linux 2017-01-19 09:05:59 +02:00
Cheng Zhao
93a27fd3a9 Fix linking errors on Mac 2017-01-19 09:05:59 +02:00
Cheng Zhao
497f5a1199 Update files for Chrome 54 API changes 2017-01-19 09:05:59 +02:00
Cheng Zhao
bdc334d797 Update brightray and libchromiumcontent to Chrome 54 2017-01-19 09:05:59 +02:00
Jacob Groundwater
6520396466 update atom_browser_client.h 2017-01-19 09:05:44 +02:00
Jacob Groundwater
9716e2745b WIP: chrome 54 update 2017-01-19 09:05:44 +02:00
Ales Pergl
5b3d0f86f7 Adjustments after migrating libchromiumcontent to GN 2017-01-19 09:05:44 +02:00
Kevin Sawicki
b90e23306e Merge pull request #8428 from electron/upgrade-libcc-for-webm-muxer-fix
Upgrade libcc for webm muxer patch
2017-01-18 21:15:58 -08:00
Kevin Sawicki
8cc29c2e22 Upgrade libcc for webm muxer patch 2017-01-18 20:56:44 -08:00
Kevin Sawicki
a3af6bd9f5 Merge pull request #8441 from watilde/feature/tweak-kiosk
do not call SetFullScreen in SetKiosk if it's already fullscreen mode
2017-01-18 16:17:31 -08:00
Daijiro Wachi
a23d8ed702 do not call SetFullScreen in SetKiosk if it's already fullscreen mode 2017-01-19 00:40:34 +01:00
Kevin Sawicki
3766fb6652 Merge pull request #8437 from electron/set-version-for-electron-api-json
set version arg when creating electron-api.json
2017-01-18 15:13:30 -08:00
Kevin Sawicki
a7891e584a Merge pull request #8438 from electron/restore-thick-frame-fullscreen-handler
Restore thick frame full screen code path
2017-01-18 15:12:50 -08:00
Kevin Sawicki
e82b41724d Restore thick frame full screen case 2017-01-18 14:40:42 -08:00
Zeke Sikelianos
6af7cfff33 fix syntax and use relative path to electron-api.json target 2017-01-18 11:52:09 -08:00
Zeke Sikelianos
057fda5352 set version arg when creating electron-api.json 2017-01-18 11:00:13 -08:00
Kevin Sawicki
71512ad244 Merge pull request #8432 from hrubilov/patch-1
Typo fixed
2017-01-18 09:02:18 -08:00
hrubilov
edb3967a0f Typo fixed 2017-01-18 14:12:27 +03:00
Ramya Achutha Rao
dc5129f32e Updated docs for crash reporter to support child processes 2017-01-17 21:59:23 -08:00
Zeke Sikelianos
ade16a7823 Merge pull request #8365 from destan/patch-3
printToPDF: `landscape` ignored if `@page` is used
2017-01-17 13:50:37 -08:00
Kevin Sawicki
f7bdf5d04e Merge pull request #8399 from watilde/feature/fixes-8338
save a fullscreen state when Kiosk mode is called
2017-01-17 13:03:51 -08:00
Kevin Sawicki
dcbc10ac38 Merge pull request #8417 from electron/flaky-travis-specs
Disable flaky specs on Travis
2017-01-17 08:48:59 -08:00
Kevin Sawicki
feac8685f4 Merge pull request #8348 from electron/isolated-world
Add context isolation option to windows and webview tags
2017-01-17 08:47:44 -08:00
Weiqiang Lin
11259b0ea2 Online/Offline Event Detection to zh-CN 2017-01-17 17:50:16 +08:00
Weiqiang Lin
ac0ba74e87 Desktop Environment Integration to zh-CN 2017-01-17 17:49:18 +08:00
Weiqiang Lin
96b7d3653c Quick Start to zh-CN 2017-01-17 17:48:51 +08:00
Kevin Sawicki
9ccc78c62f Use options constants for keys 2017-01-16 13:09:38 -08:00
Kevin Sawicki
1d824d4645 Assert document visibility in main context 2017-01-16 13:03:38 -08:00
Kevin Sawicki
b26428c43c 🎨 2017-01-16 12:38:16 -08:00
Kevin Sawicki
815cb1b31c Include atom_natives after builtin includes 2017-01-16 12:38:16 -08:00
Kevin Sawicki
dcf9a395c2 Only create isolated context in main frame 2017-01-16 12:38:16 -08:00
Kevin Sawicki
2e62d81c24 Access getter instead of variable 2017-01-16 12:38:16 -08:00
Kevin Sawicki
13acf7a6a3 Mention accessing context in dev tools 2017-01-16 12:38:16 -08:00
Kevin Sawicki
f35224b0e4 🎨 2017-01-16 12:38:16 -08:00
Kevin Sawicki
6bcfd0630c Document implemented APIs at the top 2017-01-16 12:38:16 -08:00
Kevin Sawicki
f4f0174746 Parse guestInstanceId and opener as ints 2017-01-16 12:38:16 -08:00
Kevin Sawicki
37b7dda3c5 Remove use of now private guestId 2017-01-16 12:38:16 -08:00
Kevin Sawicki
fbcbfbda6a Add back BrowserWindowProxy location property 2017-01-16 12:38:16 -08:00
Kevin Sawicki
de4be56b09 Use internal open event name with fully parsed options 2017-01-16 12:38:16 -08:00
Kevin Sawicki
f3852c57fc Use empty string for comparison 2017-01-16 12:38:16 -08:00
Kevin Sawicki
2e6d08c652 Remove unneeded this prefix 2017-01-16 12:38:16 -08:00
Kevin Sawicki
bb260343de Move more functions to outer scope 2017-01-16 12:38:16 -08:00
Kevin Sawicki
3f7b3c4bd7 Implement window overrides in main context 2017-01-16 12:38:16 -08:00
Kevin Sawicki
95054f443f Enable context isolation on child windows 2017-01-16 12:38:16 -08:00
Kevin Sawicki
eef72647b4 Set human readable context name 2017-01-16 12:38:16 -08:00
Kevin Sawicki
33b6ab11f2 Assert context state after reload 2017-01-16 12:38:16 -08:00
Kevin Sawicki
dacfb2f596 Mention contextIsolation is experimental 2017-01-16 12:38:16 -08:00
Kevin Sawicki
3ac6019f42 Mention context isolation 2017-01-16 12:38:16 -08:00
Kevin Sawicki
0f7af8043a Upgrade libcc for world context patch 2017-01-16 12:38:16 -08:00
Kevin Sawicki
14a1e673c6 Add spec for webview context isolation 2017-01-16 12:38:16 -08:00
Kevin Sawicki
802ed62d5b Remove trailing comma 2017-01-16 12:38:16 -08:00
Kevin Sawicki
572fc058d3 Document contextIsolation option 2017-01-16 12:38:16 -08:00
Kevin Sawicki
b348cdeae8 Set page variable using webFrame.executeJavaScript 2017-01-16 12:38:16 -08:00
Kevin Sawicki
ea2273dde5 Assert built-in prototype isolation 2017-01-16 12:38:16 -08:00
Kevin Sawicki
ad3b837ad5 Rename option to contextIsolation 2017-01-16 12:38:16 -08:00
Kevin Sawicki
b56bdc83af 🎨 2017-01-16 12:38:16 -08:00
Kevin Sawicki
2e7dbe6c6b Use patch worldScriptContext to get isolated context 2017-01-16 12:38:16 -08:00
Kevin Sawicki
309ac75284 Upgrade libcc for worlds patch 2017-01-16 12:38:16 -08:00
Kevin Sawicki
4f5c725dde 🎨 Use enum for world ids 2017-01-16 12:38:16 -08:00
Kevin Sawicki
5b6397aaa6 Store context that API is running in to deliver IPC events 2017-01-16 12:38:16 -08:00
Kevin Sawicki
2928fe5c43 Add initial isolated world spec 2017-01-16 12:38:16 -08:00
Kevin Sawicki
5da4f032c3 Notify client each time main context is created 2017-01-16 12:38:16 -08:00
Kevin Sawicki
c5e68ec165 🎨 2017-01-16 12:38:16 -08:00
Kevin Sawicki
78e0b80dc7 Support IPC messages in isolated context 2017-01-16 12:38:16 -08:00
Kevin Sawicki
073d8c2177 Add world id constants 2017-01-16 12:38:16 -08:00
Kevin Sawicki
d194a84ae4 Setup isolated context from AtomRenderFrameObserver 2017-01-16 12:38:16 -08:00
Kevin Sawicki
4bca6fe672 Add isolated world web preference option 2017-01-16 12:38:15 -08:00
Kevin Sawicki
cdf33ff3dc Add null guards 2017-01-16 12:38:15 -08:00
Kevin Sawicki
08b203fed1 Match extension name to class name 2017-01-16 12:38:15 -08:00
Kevin Sawicki
736befe90f Add initial support for loading into isolated world 2017-01-16 12:38:15 -08:00
Kevin Sawicki
b6c5e9a126 Disable disableguestresize spec that times out on Travis 2017-01-16 11:48:20 -08:00
Kevin Sawicki
4ebe54043a Merge pull request #8395 from Arcath/patch-1
Add Squirrel Release Server to the update server list.
2017-01-16 11:41:43 -08:00
Kevin Sawicki
e6f5f60f3a Merge pull request #8355 from oukan/feature/translate-zh-CN
translate to zh-CN
2017-01-16 11:40:19 -08:00
Kevin Sawicki
48facf6343 Add space after // 2017-01-16 11:38:58 -08:00
Kevin Sawicki
170f2f61f9 Merge pull request #8404 from bsclifton/fix-dpi-borders
Properly handle borders on frameless window for DPI > 100% (Windows only)
2017-01-16 11:24:39 -08:00
Kevin Sawicki
0244a73c49 Fix cpp linter errors 2017-01-16 09:26:07 -08:00
Kevin Sawicki
9089d55342 Merge pull request #8409 from javan/add-context-menu-event-to-webview
Add "context-menu" DOM event to <webview>
2017-01-16 09:04:32 -08:00
Brian Clifton
9e0547b98f Fix the rendering for the rounded edges 2017-01-14 01:15:22 -08:00
Daijiro Wachi
b97db68f0c add tests to fullScreen and Kiosk 2017-01-14 00:05:04 +01:00
Daijiro Wachi
436a6d5c0f Save a fullScreen state for Kiosk mode 2017-01-14 00:04:51 +01:00
Javan Makhmali
a64bdbd306 Add "context-menu" DOM event to <webview> 2017-01-13 17:04:09 -05:00
Kevin Sawicki
ac6aeae915 Merge pull request #8390 from electron/upgrade-brightray-for-devtools-fix
Upgrade brightray for dev tools fix
2017-01-13 10:57:57 -08:00
Kevin Sawicki
f92f851f11 Upgrade brightray for dev tools fix 2017-01-13 09:19:17 -08:00
Kevin Sawicki
99e21a2235 Merge pull request #8401 from czipperz/BrowserProcess_constructor
Reorder BrowserProcess constructor to avoid invalid memory
2017-01-13 09:12:51 -08:00
Kevin Sawicki
f7d3dc742d Merge pull request #8400 from electron/keyboardevent-link
Switch to footer link syntax for keyboard event docs
2017-01-13 09:09:44 -08:00
Brian Clifton
cf6e215a66 Properly handle borders for DPI > 100% on Windows
Fixes https://github.com/electron/electron/issues/4573

cc: @zcbenz, @kevinsawicki, @zeke
2017-01-13 00:18:42 -07:00
Czipperz
e4688f1c5a Reorder BrowserProcess constructor to avoid invalid memory 2017-01-12 16:55:26 -08:00
Kevin Sawicki
315daf1a10 Switch to footer link syntax 2017-01-12 16:54:07 -08:00
Zeke Sikelianos
75e81f00e2 Merge pull request #8381 from electron/lint-without-side-effects
create electron-api.json in dist, not as a side-effect of linting
2017-01-12 14:58:55 -08:00
Kevin Sawicki
ec71440f09 Merge pull request #8391 from electron/read-only-versions
Make process.versions.electron/chrome read-only
2017-01-12 14:58:01 -08:00
Zeke Sikelianos
2a825310ea use one line 2017-01-12 14:37:18 -08:00
Kevin Sawicki
323edb9d53 Add read-only version to planned 2.0 API 2017-01-12 13:51:35 -08:00
Kevin Sawicki
726bab0293 Add specs for process.versions.electron/chrome 2017-01-12 13:50:19 -08:00
Kevin Sawicki
b52367e3b2 Update native-mate to electron org 2017-01-12 13:50:19 -08:00
Kevin Sawicki
9ff1f6bbde Merge pull request #8377 from electron/sandbox-open-crash
Destroy web contents if new-window event is prevented
2017-01-12 11:43:35 -08:00
Kevin Sawicki
97dd680b32 Remove linter errors 2017-01-12 10:28:08 -08:00
Kevin Sawicki
8098ca3b66 Remove unneeded nextTick and assert array 2017-01-12 10:28:08 -08:00
Kevin Sawicki
8f63fdb278 Destroy web contents when preventing default 2017-01-12 10:28:08 -08:00
Kevin Sawicki
c5da330cdf Add failing spec for sandboxed window.open 2017-01-12 10:28:08 -08:00
Adam Laycock
9e89ec041e Add Squirrel Release Server to the update server list. 2017-01-12 13:40:14 +00:00
Kevin Sawicki
070bbcfc3d Merge pull request #8380 from electron/auto-submit-rename
Rename autoSubmit to uploadToServer in example
2017-01-11 08:42:33 -08:00
Zeke Sikelianos
cef9cd3cfc create electron-api.json in dist, not as a side-effect of linting 2017-01-10 18:17:08 -08:00
Kevin Sawicki
ed4f4b3954 Rename autoSubmit to uploadToServer in example 2017-01-10 16:07:10 -08:00
Kevin Sawicki
cfb6069b83 Bump v1.4.14 2017-01-10 11:01:39 -08:00
Kevin Sawicki
caacc4580f Merge pull request #8376 from electron/revert-8354-vibrancy-corner-fix
Revert "Smooth corners for vibrancy view"
2017-01-10 10:36:47 -08:00
Kevin Sawicki
f3b03908f9 Revert "Smooth corners for vibrancy view" 2017-01-10 10:34:55 -08:00
Kevin Sawicki
c6ccf9f2b5 Merge pull request #8371 from electron/upgrade-brightray-for-emulation-fix
Upgrade brightray for network emulation fix
2017-01-09 11:22:10 -08:00
Kevin Sawicki
5204d6ce45 Merge pull request #8354 from gerhardberger/vibrancy-corner-fix
Smooth corners for vibrancy view
2017-01-09 11:12:02 -08:00
Kevin Sawicki
24b5abcc39 Upgrade brightray for network emulation fix 2017-01-09 10:42:48 -08:00
Kevin Sawicki
8ada7fe30b Merge pull request #8370 from electron/resizable-specs
Add spec for resizable frameless window
2017-01-09 10:41:51 -08:00
Kevin Sawicki
d8366115f5 Add spec for resizable frameless window 2017-01-09 10:01:38 -08:00
Kevin Sawicki
e5aad9857d Merge pull request #7765 from liusy182/maximize-fix
fix for Window hidden behind taskbar after maximize #7672
2017-01-09 09:47:39 -08:00
Kevin Sawicki
75a05c2814 Merge pull request #8369 from electron/start-executable
Make start script executable
2017-01-09 09:28:37 -08:00
Kevin Sawicki
64a36170a9 Make start script executable 2017-01-09 09:27:20 -08:00
Kevin Sawicki
871c3fc11e Merge pull request #8341 from electron/dialog-manager
Implement alert/confirm through Chrome's dialog manager
2017-01-09 09:17:40 -08:00
Kevin Sawicki
6ef1a9150c Add OK button to alert 2017-01-09 08:30:13 -08:00
Kevin Sawicki
222734b5f5 Use correct param ordering in header file 2017-01-09 08:30:13 -08:00
Kevin Sawicki
1f08634d62 Implement alert/confirm through dialog manager 2017-01-09 08:30:13 -08:00
Kevin Sawicki
52390120ae Merge pull request #8340 from electron/options-cycle
Handle cycles when merging browser window options
2017-01-09 08:29:56 -08:00
Destan Sarpkaya
fb35f06114 printToPDF: landscape ignored if @page is used
This is very frustrating to find out via debugging, I think it should be in docs.
2017-01-09 02:31:34 +02:00
gellert
bfafc6d5fd indentation fix 2017-01-06 23:54:24 +01:00
Kevin Sawicki
1f07977f09 Remove lint errors 2017-01-06 09:58:40 -08:00
Kevin Sawicki
fd23c7bf76 Assert duplicate objects are supported 2017-01-06 09:58:40 -08:00
Kevin Sawicki
1944fdc962 Track visited parents and null out cycles 2017-01-06 09:58:40 -08:00
Kevin Sawicki
12382f064b Add failing spec for cycle in options 2017-01-06 09:58:40 -08:00
Kevin Sawicki
b942c54bea Use closeWindow helper 2017-01-06 09:58:40 -08:00
Kevin Sawicki
0a7dccbad8 Merge pull request #8308 from electron/normalize-access-keys
Support normalizing access keys in dialog buttons
2017-01-06 09:55:06 -08:00
Kevin Sawicki
5f862effaa Access directly on options object 2017-01-06 09:17:32 -08:00
Kevin Sawicki
d200cf2e77 Document normalizeAccessKeys option 2017-01-06 08:56:24 -08:00
Kevin Sawicki
eb533e04b9 Add option to normalize dialog access keys 2017-01-06 08:56:24 -08:00
Weiqiang Lin
58fa8add31 Using Widevine CDM Plugin to zh-CN 2017-01-06 21:41:25 +08:00
Weiqiang Lin
34afa3b8a5 Using Pepper Flash Plugin to zh-CN 2017-01-06 21:40:36 +08:00
Weiqiang Lin
17ef05672b Using Selenium and WebDriver to zh-CN 2017-01-06 21:38:58 +08:00
gellert
c5fe173e47 adds autorelease to nsimage 2017-01-06 14:32:34 +01:00
gellert
456ea04683 adds mask image for smooth vibrant view corners 2017-01-06 14:26:16 +01:00
Haojian Wu
0e5fc9c4e4 Merge pull request #8343 from oukan/feature/translate-zh-CN
Debugging the Main Process to zh-CN
2017-01-06 08:32:42 +01:00
Weiqiang Lin
cf5689371a debugging-main-process-node-inspector to zh-CN 2017-01-06 10:02:44 +08:00
Kevin Sawicki
e788b9f959 Merge pull request #8258 from deepak1556/net_header_patch
net: disallow cookies from cookie store
2017-01-05 16:47:44 -08:00
Kevin Sawicki
d3d09ff25f Merge pull request #8347 from Rastaban/master
fix permissive C++ code (MSVC /permissive-)
2017-01-05 14:53:11 -08:00
Phil Christensen
2c259990da fix permissive C++ code (MSVC /permissive-)
These were found by the C++ compiler group when doing "Real world code"
build tests using /permissive-.  We are sharing these with you to help clean up
your code before the new version of the compiler comes out.  For more information on
/permissive- see https://blogs.msdn.microsoft.com/vcblog/2016/11/16/permissive-switch/.
In paticular, see the "Do not treat copy initialization as direct initialization"
section of the blog.
2017-01-05 09:38:41 -08:00
Weiqiang Lin
e2d60940a2 Debugging the Main Process to zh-CN 2017-01-05 14:49:07 +08:00
Weiqiang Lin
dc786996ef Debugging the Main Process in node-inspector to zh-CN 2017-01-05 14:47:39 +08:00
Weiqiang Lin
cc3ac9b1da Debugging the Main Process to zh-CN 2017-01-05 14:45:43 +08:00
Weiqiang Lin
431faf58ff Debugging the Main Process in VSCode to zh-CN 2017-01-05 14:43:17 +08:00
Weiqiang Lin
63ae55be2b Debugging the Main Process to zh-CN 2017-01-05 14:42:51 +08:00
Kevin Sawicki
14d6a70fa8 Merge pull request #8335 from liuderchi/i18n_zhTW_repl
translate repl.md into zh-TW
2017-01-04 09:00:06 -08:00
Kevin Sawicki
1ff6fc6491 Merge pull request #8326 from nicmitchell/copyright-year
Update copyright year in LICENSE file
2017-01-04 08:59:33 -08:00
Kevin Sawicki
a376d09be5 Merge pull request #8319 from oukan/feature/translate-zh-CN
application-distribution to zh-CN
2017-01-04 08:59:01 -08:00
liuderchi
02d7203b4f [ci skip] 📝 translate repl.md 2017-01-04 17:03:25 +08:00
liuderchi
e65cc8a245 [ci skip] 📝 copy repl.md source 2017-01-04 16:59:59 +08:00
Nic Mitchell
dc1eca14f0 Update copyright year in LICENSE file 2017-01-02 21:19:38 -08:00
Weiqiang Lin
0b7b2f5a57 Using Native Node Modules to zh-CN 2017-01-02 11:17:46 +08:00
Weiqiang Lin
6cff48112d application-distribution to zh-CN 2017-01-02 00:20:29 +08:00
Haojian Wu
fe0a577c8b Merge pull request #8318 from oukan/feature/translate-zh-CN
mac-app-store-submission-guide to zh-CN
2017-01-01 16:57:53 +01:00
Weiqiang Lin
91e93e6a5a mac-app-store-submission-guide to zh-CN 2017-01-01 20:44:06 +08:00
Weiqiang Lin
a1ef49c26f mac-app-store-submission-guide to zh-CN 2017-01-01 10:17:58 +08:00
Haojian Wu
339f4b8c31 Merge pull request #8313 from oukan/feature/translated-supported-platforms
translated supported platforms to zh-CN
2016-12-31 09:39:33 +01:00
Weiqiang Lin
406b0fdbcc no actual change 2016-12-31 16:36:20 +08:00
Zeke Sikelianos
349972368c Merge pull request #8312 from oukan/feature/translated-readme
add glossary page link to readme
2016-12-30 18:32:20 -08:00
Weiqiang Lin
4225524b6f . to 。 2016-12-31 09:50:41 +08:00
林伟强
aac916857d translated supported platforms to zh-CN 2016-12-30 23:58:54 +08:00
林伟强
25246c6db7 add glossary page link to readme 2016-12-30 23:51:25 +08:00
Haojian Wu
800689fc81 Merge pull request #8303 from ldehai/master
fix some expression
2016-12-30 16:00:34 +01:00
Andy
d9fbead8ca fix some expression 2016-12-30 22:50:44 +08:00
Haojian Wu
496c741513 Merge pull request #8311 from oukan/feature/process-translated
docs-translations API process Translated into zh-CN
2016-12-30 14:48:15 +01:00
林伟强
c392710802 s/./。 2016-12-30 17:48:48 +08:00
林伟强
b0886e2abf docs-translations API process Translated into zh-CN 2016-12-30 17:15:28 +08:00
林伟强
3d35f01bd1 docs-translations API process Translated into zh-CN 2016-12-30 10:45:39 +08:00
Kevin Sawicki
d86662cb80 Merge pull request #8309 from electron/optional-before-dash
Put optional label before dash
2016-12-29 15:51:39 -08:00
Kevin Sawicki
afa3bd2143 Put optional label before dash 2016-12-29 14:11:26 -08:00
Kevin Sawicki
196cb2dda4 Merge pull request #8306 from electron/link-to-offscreen-tutorial
Link to offscreen rendering tutorial
2016-12-29 13:33:06 -08:00
Kevin Sawicki
fc75080c28 Merge pull request #8298 from electron/configure-throttling-on-created-callback
Configure background throttling on RenderViewCreated callback
2016-12-29 13:31:09 -08:00
Kevin Sawicki
f8d41f1f68 Link to offscreen rendering tutorial 2016-12-29 09:15:28 -08:00
Kevin Sawicki
6ea1bacc73 Merge pull request #8250 from gerhardberger/osr-window-size-fix
Always create offscreen window frameless
2016-12-29 09:10:14 -08:00
Andy
6324270221 fix some expression 2016-12-29 21:53:53 +08:00
Kevin Sawicki
41afeb744a Configure background throttling on RenderViewCreated callback 2016-12-28 15:52:47 -08:00
Kevin Sawicki
219693d91f Merge pull request #8295 from electron/more-default-font-families
Support cursive/fantasy default font families
2016-12-28 13:42:35 -08:00
Kevin Sawicki
25c80f314b Merge pull request #8281 from abouthiroppy/fix-electron-jp-link
Fix electron-jp's link in README.md
2016-12-28 13:41:52 -08:00
Kevin Sawicki
5d505f9139 Support cursive/fantasy default font families 2016-12-28 13:40:53 -08:00
Kevin Sawicki
bc39964ece Merge pull request #8254 from electron/webcontents-will-navigate-crash
Don't load URL if web contents is destroyed
2016-12-28 13:40:31 -08:00
Kevin Sawicki
abea1196de Add spec for closing from will-navigate listener 2016-12-28 13:40:07 -08:00
Kevin Sawicki
1308f790ad Don't load URL if web contents is destroyed 2016-12-28 13:40:06 -08:00
Haojian Wu
095f304d7d Merge pull request #8284 from x-yao/zh-cn-docs
Add glossary.md in Simplified Chinese docs
2016-12-28 09:13:36 +01:00
x-yao
5a54d90d72 [ci skip]update glossary.md translation changes 2016-12-28 15:54:51 +08:00
x-yao
003fdd2382 Merge branch 'master' of github.com:electron/electron into zh-cn-docs 2016-12-28 15:47:24 +08:00
Zeke Sikelianos
5b9b33f32d Merge pull request #8285 from electron/update-glossary
📝 Fix a broken asar link.
2016-12-26 10:23:17 -08:00
x-yao
5ee3915c40 [ci skip]fixed glossary.md incorrect words 2016-12-26 17:57:20 +08:00
Haojian Wu
dcead89507 📝 Fix a broken asar link. 2016-12-26 10:28:08 +01:00
x-yao
6f2f3ed1ac Merge branch 'master' of github.com:electron/electron into zh-cn-docs 2016-12-26 12:03:00 +08:00
x-yao
738c8c047e [ci skip]add glossary.md in Simplified Chinese docs 2016-12-26 12:02:24 +08:00
abouthiroppy
d224f5d998 Fix electron-jp's link in README.md 2016-12-25 18:08:25 +09:00
Zeke Sikelianos
f8a9f628ae Merge pull request #7888 from electron/rename-webview-doc
Rename web-view to webview for consistency
2016-12-22 15:54:39 -08:00
Zeke Sikelianos
6995b51f2c set webview spec timeout to three minutes 2016-12-22 13:31:30 -08:00
Zeke Sikelianos
c989ea43f5 bump webview spec timeout to two minutes 2016-12-22 12:30:34 -08:00
Zeke Sikelianos
b0c4c79c49 remove unused webview fixture 2016-12-22 10:41:05 -08:00
Zeke Sikelianos
eb4038d626 more internal web-view reverting 2016-12-22 10:41:05 -08:00
Zeke Sikelianos
7562a8b662 revert renames of internal web-view stuff 2016-12-22 10:41:05 -08:00
Zeke Sikelianos
c75a1f08fd replace all web-view code with webview 2016-12-22 10:41:05 -08:00
Zeke Sikelianos
1085c28612 rename all web-view files to webview 2016-12-22 10:41:05 -08:00
Kevin Sawicki
eca9bffb01 Merge pull request #8269 from drewchandler/fix-clear-storage-data-docs
Use localstorage in clearStorageData docs
2016-12-22 10:07:31 -08:00
Drew Chandler
b28a865436 Use localstorage in clearStorageData docs
It won't work if you use include the space that is currently in the docs.
2016-12-22 09:51:39 -08:00
Kevin Sawicki
57d682a050 Merge pull request #8252 from electron/dialog-window-crash
Don't crash when window is closed by dialog callback
2016-12-22 09:34:07 -08:00
Kevin Sawicki
8c5f26373b Add override 2016-12-22 09:33:21 -08:00
Kevin Sawicki
87f09131aa Observe window and only use it when it is open 2016-12-22 09:33:21 -08:00
Kevin Sawicki
371b347ee9 Merge pull request #8268 from electron/update-production-variables
Move a couple env vars from development to production
2016-12-22 09:32:43 -08:00
Kevin Sawicki
ad2627b05a Move variables from development to production 2016-12-22 09:22:04 -08:00
Zeke Sikelianos
bb012c3db2 Merge pull request #8265 from thorbenegberts/patch-1
🐛 Fix link to Quick Start [ci skip]
2016-12-22 08:01:32 -08:00
x-yao
387dd67b60 [ci skip]fix chinese incorrect words 2016-12-22 17:10:27 +08:00
Thorben Egberts
b22eb0d65f Change Quick Start link from absolute to relative 2016-12-22 08:45:51 +01:00
Zeke Sikelianos
ec46d57816 Merge pull request #8267 from cesarandreu/patch-2
Fix a typo, there => their
2016-12-21 20:49:36 -08:00
Cesar Andreu
e296d4826f Fix a typo, there => their 2016-12-21 19:21:04 -08:00
Thorben Egberts
3cfe94c5ef Fixed link to Quick Start 2016-12-21 23:41:34 +01:00
gellert
7e82e12468 adds note to offscreen tutorial 2016-12-21 23:15:39 +01:00
gellert
f81908711b use only one if statement 2016-12-21 23:15:05 +01:00
Zeke Sikelianos
2b955a5ae1 Merge pull request #7878 from electron/glossary
Add a glossary of terms
2016-12-21 14:12:07 -08:00
Zeke Sikelianos
aeedd36168 see also 2016-12-21 13:47:40 -08:00
Zeke Sikelianos
e57cb713b2 link process annotations to glossary 2016-12-21 13:47:40 -08:00
Zeke Sikelianos
a098bf30d4 add DMG and NSIS to glossary 2016-12-21 13:47:40 -08:00
Zeke Sikelianos
f1692f3274 lint to glossary from docs readme 2016-12-21 13:47:40 -08:00
Zeke Sikelianos
a39dc1b78a 🎨 2016-12-21 13:47:40 -08:00
Zeke Sikelianos
ead5275d63 fix heading level 2016-12-21 13:47:40 -08:00
Zeke Sikelianos
4e8c21549b define process and webview 2016-12-21 13:47:40 -08:00
Zeke Sikelianos
ed081c8834 WIP 2016-12-21 13:47:40 -08:00
Kevin Sawicki
f99dabbac6 Merge pull request #8078 from electron/dts-docs-update-again
Update Docs
2016-12-21 13:39:53 -08:00
Kevin Sawicki
707b1d1b79 Merge pull request #8207 from philwyett-hemi/rpm_dev
Doc updates related to Fedora and RHEL / CentOS
2016-12-21 13:38:09 -08:00
Kevin Sawicki
026711e750 Merge pull request #8249 from electron/nsscreens-crash
Use firstObject instead of objectAtIndex:0
2016-12-21 10:58:14 -08:00
Kevin Sawicki
b9f569f7fb Merge pull request #8248 from electron/secure-options
Add options to protocol.registerStandardSchemes docs
2016-12-21 09:40:30 -08:00
Kevin Sawicki
0a5f51fd03 Merge pull request #8259 from mawie81/fix-screen-docs
[Docs] fix link in screen docs
2016-12-21 09:40:13 -08:00
mawie81
d20e2ec349 [ci skip] fix link in screen docs 2016-12-21 09:43:47 +01:00
deepak1556
f9417e3fcc net: disallow cookies from the cookie store 2016-12-21 11:54:48 +05:30
deepak1556
41c352c306 add failing spec 2016-12-21 11:52:27 +05:30
gellert
1ef0f6beff creates offscreen window frameless 2016-12-20 23:43:52 +01:00
Kevin Sawicki
c70eb81e32 Use firstObject instead of objectAtIndex:0 2016-12-20 13:49:35 -08:00
Kevin Sawicki
38681d0a2b Bump v1.4.13 2016-12-20 10:37:16 -08:00
Kevin Sawicki
c5097ae483 Add options to protocol.registerStandardSchemes docs 2016-12-20 09:44:58 -08:00
Kevin Sawicki
5bb196dce3 Merge pull request #8240 from electron/fix-structures-link
fix relative link to CertificatePrincipal doc
2016-12-20 09:13:01 -08:00
Kevin Sawicki
cb47de5eca Merge pull request #8225 from Golasowski/docs-translations-cz
Create Czech translate
2016-12-20 09:09:39 -08:00
Kevin Sawicki
56a8e17b21 Merge pull request #8243 from x-yao/zh-cn-docs
[DOC] Add systemPreferences API Simplified Chinese translation
2016-12-20 09:09:01 -08:00
x-yao
e3b23842dd [ci skip]add net API Simplified Chinese translation 2016-12-20 17:03:32 +08:00
Zeke Sikelianos
12cb35ef61 Merge pull request #8242 from DustinX/patch-1
Corrected some grammatical errors
2016-12-19 20:05:28 -08:00
longbotao
2fb8839d31 [ci skip]add systemPreferences API Simplified Chinese translation 2016-12-20 12:03:59 +08:00
Zeke Sikelianos
6578498e31 Merge pull request #8229 from electron/do-not-recommend-yarn
do not recommend yarn
2016-12-19 20:03:51 -08:00
Dustin
2e1feb63e4 Corrected some grammatical errors 2016-12-19 19:01:35 -08:00
Zeke Sikelianos
9e626c5fee fix relative link to CertificatePrincipal doc 2016-12-19 13:49:02 -08:00
Kevin Sawicki
78a89c666b Merge pull request #8238 from electron/doc-links
Link to return class type
2016-12-19 10:48:27 -08:00
Kevin Sawicki
6352afb07a Link to return class type 2016-12-19 09:40:07 -08:00
Kevin Sawicki
683d8033f0 Merge pull request #8235 from x-yao/zh-cn-docs
[DOC]update electron-faq.md in  Simplified Chinese docs
2016-12-19 09:22:24 -08:00
longbotao
e2bb8088d4 [ci skip]update electron-faq.md in Simplified Chinese docs and fix a little words 2016-12-19 15:01:50 +08:00
Zeke Sikelianos
64116e5d7c do not recommend yarn 2016-12-17 20:35:06 -08:00
O.G.olasowski
219a6b175b Create README.md 2016-12-17 00:31:37 +00:00
Kevin Sawicki
2a8b36c761 Merge pull request #8134 from deepak1556/empty_client_certificate_patch
app: select-client-certificate event callback can accept certificate optionally
2016-12-15 08:31:12 -08:00
liusi
b853671132 fix fullscreen, maximize, unmaximize 2016-12-15 14:01:03 +08:00
Phil Wyett
2fbf560668 Commit...
* Update build instructions to correctly reflect python version on CentOS
  that has Python 2.6.
* Correct Fedora package install command. Fedora now uses 'dnf' not 'yum'.
* Add RHEL / CentOS section that does use 'yum' for package install.
2016-12-15 03:05:24 +00:00
Kevin Sawicki
cd067bca37 Merge pull request #8175 from gerhardberger/createfrombuffer-bitmap
Add bitmap support to nativeImage.createFromBuffer
2016-12-14 13:24:45 -08:00
Kevin Sawicki
98d4e186e3 Move details next to params 2016-12-14 10:19:38 -08:00
Kevin Sawicki
8680a08a8d Add deprecated comment to scaleFactor parameter 2016-12-14 10:18:01 -08:00
Kevin Sawicki
3b259b4243 Add createFromBuffer to planned breaking changes 2016-12-14 10:12:37 -08:00
Kevin Sawicki
25feb9232d Merge pull request #8143 from poiru/webcontents-before-input-event
Add before-input-event event for webContents (fixes #7586)
2016-12-14 10:05:32 -08:00
Kevin Sawicki
590bde5e14 Remove unused include 2016-12-13 16:00:37 -08:00
Kevin Sawicki
88dac36c91 Move footer link to bottom 2016-12-13 15:58:03 -08:00
Kevin Sawicki
7842040d9d Add ToV8 converter for NativeWebKeyboardEvent 2016-12-13 15:54:13 -08:00
Kevin Sawicki
3237c6751a Use DCHECK instead of assert 2016-12-13 15:54:13 -08:00
Kevin Sawicki
7a5ec96d53 Prevent input event from main process 2016-12-13 15:54:13 -08:00
Kevin Sawicki
5ae80d541b Remove will-navigate spec 2016-12-13 15:54:13 -08:00
Kevin Sawicki
25ac23ab17 Upgrade brightray 2016-12-13 15:54:13 -08:00
Birunthan Mohanathas
a3b65ad481 Add before-input-event event for webContents (fixes #7586)
Embedding arbitrary web content is problematic when it comes to keyboard
shortcuts because:

* Web content can steal app shortcuts (see e.g. brave/browser-laptop#4408)

* Blocked web content (e.g. a focused <webview> performing expensive
computation) will also prevent app shortcuts from firing immediately

The new before-input-event event can be used to overcome these issues by
always handle certain keyboard events in the main process.

Note that this requires electron/brightray#261 to compile.
2016-12-13 15:54:13 -08:00
gellert
9d2c9df992 adds empty bitmap test for createFromBuffer 2016-12-14 00:24:57 +01:00
gellert
7ceb8d1ab8 additional tests for createFromBuffer 2016-12-14 00:18:24 +01:00
gellert
a609e52a14 moves bitmap parameters to options object 2016-12-13 21:32:17 +01:00
gellert
39875c90f1 adds bitmap support to createFromBuffer 2016-12-13 21:32:17 +01:00
Kevin Sawicki
3290c6b335 Merge pull request #8201 from electron/docs-lint
Remove trailing spaces
2016-12-13 10:43:05 -08:00
Kevin Sawicki
0f93515ede Remove trailing spaces 2016-12-13 10:42:13 -08:00
Kevin Sawicki
dfc25d0ca5 Merge pull request #8199 from Casimodo/patch-2
Create quick-start.md
2016-12-13 08:30:57 -08:00
Kevin Sawicki
db0beb6c36 Merge pull request #8192 from rhysd/patch-1
Fixed a broken link in dialog.md [ci skip]
2016-12-13 08:30:28 -08:00
Casimodo
7b240d82fd Create quick-start.md 2016-12-13 15:50:23 +01:00
Linda_pp
704433f3d6 Fix broken link in dialog.md [ci skip] 2016-12-13 17:48:49 +09:00
Kevin Sawicki
8ae7d01d1a Merge pull request #8189 from electron/undefined-browser-window-in-dialog
Undefined browser causes error in dialog APIs
2016-12-12 16:44:16 -08:00
Kevin Sawicki
2bd8ef83d1 Use != null to handle undefined 2016-12-12 16:25:56 -08:00
Kevin Sawicki
c108088110 Test with some null/undefined windows 2016-12-12 16:25:14 -08:00
Kevin Sawicki
cb7715a572 Merge pull request #8187 from electron/optional-buttons
Allow buttons to be optional in 'showMessageBox'
2016-12-12 13:52:17 -08:00
Kevin Sawicki
2e1e893675 Merge pull request #8159 from seanchas116/devtools
Record JavaScript calls in DevTools timeline on Node/ipc callback
2016-12-12 13:50:42 -08:00
Kevin Sawicki
3796d7a6a1 Use trace event with zero args 2016-12-12 13:49:58 -08:00
Kevin Sawicki
b08bc02cde Merge pull request #8137 from deepak1556/media_device_id_patch
session: reset media device id salt when cookies are cleared
2016-12-12 13:34:24 -08:00
Kevin Sawicki
04e873f78e Make deviceIds const 2016-12-12 13:33:18 -08:00
Kevin Sawicki
04da9257ef Catch any close window errors 2016-12-12 13:32:27 -08:00
Kevin Sawicki
cae601a682 Upgrade brightray for media device salt fix 2016-12-12 13:31:08 -08:00
Kevin Sawicki
f2aabeefd5 Merge pull request #8085 from deepak1556/protocol_http_session_patch
protocol: support custom session with interceptHttpProtocol
2016-12-12 13:07:14 -08:00
Kevin Sawicki
1d288b69e2 Merge pull request #7947 from beakerbrowser/register-standard-secure-schemes
Add {secure:} opt to protocol.registerStandardSchemes
2016-12-12 12:52:28 -08:00
Kevin Sawicki
cac85d2a12 Remove linter errors 2016-12-12 12:51:48 -08:00
Kevin Sawicki
381f55b3cb Remove unneeded empty checks 2016-12-12 12:51:48 -08:00
Paul Frazee
04fa85f67f removed unused iostream include 2016-12-12 12:51:48 -08:00
Paul Frazee
bacf6511a6 remove unneeded deprecations couts 2016-12-12 12:51:48 -08:00
Paul Frazee
4e01ab59c1 fix documentation for planned breaking changes 2016-12-12 12:51:48 -08:00
Paul Frazee
a46040a4fa log deprecation notices for webframe 2016-12-12 12:51:48 -08:00
Paul Frazee
b458201874 add deprecation notices to webframe 2016-12-12 12:51:48 -08:00
Paul Frazee
99ea50649a finish implementation of {secure:true} opt on protocol.registerStandardScehesm, and add working test 2016-12-12 12:49:57 -08:00
Paul Frazee
9d2e23413e add {secure:} opt to protocol.registerStandardSchemes 2016-12-12 12:49:57 -08:00
Daniel Pham
4b53cd9c3c 🐛 Allow buttons to be optional in 'showMessageBox' 2016-12-12 13:25:32 -05:00
Kevin Sawicki
ee88e0054b Merge pull request #8186 from devjin0617/devjin0617-docs-browser-window-proxy
[Docs] Add translations of broswer-window-proxy in korean docs
2016-12-12 10:06:28 -08:00
Kevin Sawicki
e77fa72d6d Merge pull request #8167 from seanchas116/fix-modal-corner
🍎 Make sure no round corners for modal windows
2016-12-12 10:05:47 -08:00
Kevin Sawicki
2fa9ca1f6d Merge pull request #8156 from sindresorhus/remove-dock-window-level
🍎 Document that the `dock` window level is deprecated
2016-12-12 09:39:08 -08:00
Kevin Sawicki
a2d1a5258b Merge pull request #8178 from lgeiger/native-modules-prebuild
Add instructions for native modules using prebuild
2016-12-12 09:29:27 -08:00
Kevin Sawicki
009c00cdc6 Merge pull request #8177 from Geo1088/patch-1
[Docs] Fix list item number rendering in distribution tutorial
2016-12-12 09:28:46 -08:00
Kevin Sawicki
1a0fbf84f9 Merge pull request #8165 from geoff-addepar/geoff/fix-sandbox-printing
Fix printing with the sandbox enabled
2016-12-12 09:26:52 -08:00
cheongjin.kim
9ea391e03d Add translations of broswer-window-proxy in korean docs 2016-12-13 00:11:16 +09:00
Lukas Geiger
6bcf4b1112 📝 Add instructions for native modules using prebuild 2016-12-10 20:23:33 +01:00
George
82bd1d98d5 Indent tree structure to fix Markdown list number rendering 2016-12-10 11:14:10 -05:00
Kevin Sawicki
de625bfb65 Bump v1.4.12 2016-12-09 21:43:27 -08:00
Kevin Sawicki
c751d42d1a Merge pull request #8176 from electron/upgrade-libcc-for-ct-timebomb-patch
Upgrade libcc for CT timebomb patch
2016-12-09 19:24:59 -08:00
Kevin Sawicki
198f5f237f Upgrade libcc for CT timebomb patch 2016-12-09 10:47:09 -08:00
Kevin Sawicki
dc5b27069a Merge pull request #8107 from deepak1556/clear_auth_cache_patch
session: add api to clear http auth cache
2016-12-09 10:08:02 -08:00
Kevin Sawicki
6a829e0179 Throw error when options object is invalid 2016-12-09 10:07:04 -08:00
deepak1556
4085ba309a fix spec 2016-12-09 09:56:16 -08:00
deepak1556
975d677f55 add docs 2016-12-09 09:56:16 -08:00
deepak1556
21be9a3309 add spec 2016-12-09 09:55:55 -08:00
deepak1556
7456b9ae17 net: add api to set request flags for testing 2016-12-09 09:54:30 -08:00
deepak1556
35349643af session: api to clear auth cache 2016-12-09 09:54:30 -08:00
Kevin Sawicki
952e3bac2c Merge pull request #8061 from deepak1556/resume_download_api
session: api to resume canceled downloads from previous session
2016-12-09 09:39:14 -08:00
Kevin Sawicki
d705f4cbac Fix issue where actual/expected was same variable 2016-12-09 09:37:46 -08:00
deepak1556
5d94221c61 fix code style 2016-12-09 09:37:46 -08:00
deepak1556
f124732431 add spec 2016-12-09 09:37:46 -08:00
deepak1556
d944219b28 add docs 2016-12-09 09:37:46 -08:00
deepak1556
86961d0f44 session: add api to create interrupted downloads 2016-12-09 09:37:46 -08:00
Sindre Sorhus
3dde669ee8 🍎 Remove deprecated dock window level
According to the Apple docs, the `NSDockWindowLevel` constant is deprecated: https://developer.apple.com/reference/appkit/nsdockwindowlevel?language=objc
2016-12-09 12:46:49 +01:00
Ryohei Ikegami
ccdeb915fa 🍎 Make sure no round corners for modal windows 2016-12-08 12:12:53 +09:00
Geoff Lywood
5345b08d24 Fix printing with the sandbox enabled
Closes #7984
2016-12-07 17:40:18 -08:00
Kevin Sawicki
54d27a390b Merge pull request #8155 from salomvary/explain-macos-modal-sheet
Clarify modal windows being sheets on macOS
2016-12-07 10:29:42 -08:00
Kevin Sawicki
ba44dca34a Merge pull request #8158 from jdfwarrior/master
Add detail for the browserWindow argument in dialog docs
2016-12-07 10:28:34 -08:00
Kevin Sawicki
61d91579df Merge pull request #8157 from electron/post-data-example
Add simple postData example to docs
2016-12-07 10:28:00 -08:00
Kevin Sawicki
ea2e2def55 Bump v1.4.11 2016-12-07 08:53:58 -08:00
Ryohei Ikegami
a7a06a483e Record JavaScript calls in DevTools timeline on Node/ipc callback 2016-12-07 20:22:13 +09:00
deepak1556
388b601503 URLRequestFetchJob should report start error 2016-12-07 16:34:28 +05:30
deepak1556
2b8b76a527 protocol: support custom session with interceptHttpProtocol 2016-12-07 16:22:34 +05:30
deepak1556
cbddbdb296 fix code style 2016-12-07 15:33:56 +05:30
deepak1556
06701786c4 update docs 2016-12-07 13:26:06 +05:30
deepak1556
1c45285fe3 add spec 2016-12-07 13:26:06 +05:30
deepak1556
18c0cfa6f5 app: optionally pass cert with select-client-certificate event 2016-12-07 13:26:06 +05:30
David Ferguson
32ae3a52b8 add detail for the browserWindow argument in dialog docs 2016-12-06 22:23:14 -06:00
Kevin Sawicki
e198b6945c Add simple postData example 2016-12-06 16:49:22 -08:00
Kevin Sawicki
f1f73eff04 Merge pull request #8152 from electron/dont-show-window
Don't show window in specs
2016-12-06 13:54:55 -08:00
Márton Salomváry
9adb232d99 Clarify modal windows being sheets on macOS 2016-12-06 22:47:26 +01:00
Kevin Sawicki
63bffbc460 Don't show window 2016-12-06 13:25:46 -08:00
Kevin Sawicki
3e128abb73 Merge pull request #8144 from electron/from-devtools-webcontents-fix
Guard against missing devToolsWebContents
2016-12-06 11:05:16 -08:00
Kevin Sawicki
820fb3b82b Guard against no devtools web contents 2016-12-06 10:36:59 -08:00
Kevin Sawicki
03263bb5b6 Add failing BrowserWindow.fromDevToolsWebContents spec 2016-12-06 10:36:59 -08:00
Kevin Sawicki
b0a1e2988b Add spec for BrowserWindow.fromWebContents 2016-12-06 10:36:59 -08:00
Kevin Sawicki
571592a5a4 Merge pull request #8147 from electron/upgrade-libcc-for-linux-keyevent-fix
Upgrade libcc for Chrome 56 Linux key event fix
2016-12-06 10:36:25 -08:00
Kevin Sawicki
d1da48ff0f Upgrade libcc for Chrome 56 Linux key event fix 2016-12-06 09:55:22 -08:00
Kevin Sawicki
6c214ed386 Merge pull request #8148 from electron/clear-interval-before-done
Clear interval before done
2016-12-06 09:54:48 -08:00
Kevin Sawicki
b29f7b9acb Clear interval before assert 2016-12-06 09:25:55 -08:00
Kevin Sawicki
c2f516067f Add missing r in variable name 2016-12-06 09:22:29 -08:00
Kevin Sawicki
58cae1d8de Clear interval before destroying window 2016-12-06 09:22:08 -08:00
Kevin Sawicki
a9d4d9ad85 Merge pull request #8120 from electron/implement-window-methods-in-main-process
Implement window methods in main process
2016-12-05 09:29:11 -08:00
deepak1556
e043dabcb8 add spec 2016-12-04 00:22:57 +05:30
deepak1556
3de3fb53bd session: reset media device id salt when cookies are cleared 2016-12-03 16:44:33 +05:30
Kevin Sawicki
d6d85ade8e 🎨 Assign binding as const 2016-12-02 13:40:31 -08:00
Kevin Sawicki
1278e8cebc Remove unused variable 2016-12-02 13:40:31 -08:00
Kevin Sawicki
de0ec9b33c Tweak cancelId docs 2016-12-02 13:40:31 -08:00
Kevin Sawicki
3b99827540 Coerce features to string 2016-12-02 13:40:31 -08:00
Kevin Sawicki
635c909aab Implement window.alert/confirm/close in main process 2016-12-02 13:40:31 -08:00
Kevin Sawicki
f894da13b0 Pass args array instead of arguments object 2016-12-02 13:40:31 -08:00
Kevin Sawicki
c27633dff4 Merge pull request #8110 from electron/track-render-view-by-process-id
Don't clear until render view is deleted for process id
2016-12-02 13:40:20 -08:00
Kevin Sawicki
c1a02d6556 Add spec for render-view-deleted issue 2016-12-02 10:42:09 -08:00
Kevin Sawicki
ec43dd067c Co-locate with other private methods 2016-12-02 10:41:42 -08:00
Kevin Sawicki
f3d391e3f2 Don't clear until render view is deleted for process id 2016-12-02 10:41:42 -08:00
Kevin Sawicki
851f490168 Merge pull request #8123 from electron/dont-write-back-to-passed-options
Don't write back to passed in options object
2016-12-02 09:10:02 -08:00
Kevin Sawicki
07f99c06ea Don't write back to passed in options object 2016-12-01 17:16:18 -08:00
Kevin Sawicki
d0643250f7 Merge pull request #8122 from electron/use-spread-instead-of-apply
Use spread syntax instead of apply
2016-12-01 17:15:22 -08:00
Kevin Sawicki
f56b00718b Remove unused method 2016-12-01 14:56:00 -08:00
Kevin Sawicki
af555bd879 Use spread syntax instead of apply 2016-12-01 14:56:00 -08:00
Kevin Sawicki
b61e1fd69f Add spec for error on removing all IPC listeners 2016-12-01 14:56:00 -08:00
Kevin Sawicki
c8ff67ab75 Use spread syntax instead of function apply 2016-12-01 14:56:00 -08:00
Kevin Sawicki
f72942bff1 Merge pull request #8121 from electron/add-basic-dialog-specs
Add basic dialog specs
2016-12-01 14:55:49 -08:00
Kevin Sawicki
36371357cd buttonLabel -> Button label for consistency 2016-12-01 14:16:33 -08:00
Kevin Sawicki
750bd9a88b Add initial dialog specs 2016-12-01 14:15:34 -08:00
Kevin Sawicki
5660b1e225 Merge pull request #8115 from ArisLittle/patch-1
fix typos
2016-12-01 08:25:39 -08:00
Zheng Guoli
acfded9687 fix typos
a more ‘允许’ word should be removed
2016-12-01 10:03:33 +08:00
Guerin
a9f4c208a0 Adding French translations for the documentation (#8097)
* Adding French translation of electron-versioning.md

* Adding French translation of security.md

* Fixing typos and rewriting some text

* Update security.md
2016-11-30 09:49:36 -08:00
Kevin Sawicki
bca7a6baa9 Merge pull request #8105 from electron/ci-build-scripts
Add Linux CI builds scripts
2016-11-30 09:44:46 -08:00
Kevin Sawicki
3cb3d8f981 Log build type 2016-11-30 09:32:20 -08:00
Kevin Sawicki
9904da9a48 Add initial arm specific cibuild script 2016-11-30 09:22:30 -08:00
Kevin Sawicki
8d9328fbee Merge pull request #8098 from electron/clean-up-specs
Unify spec timeouts
2016-11-30 09:06:37 -08:00
Kevin Sawicki
eaa5d071ef Remove unneeded timeout call 2016-11-29 16:27:18 -08:00
Kevin Sawicki
d86f0a1686 Add missing call to done 2016-11-29 14:52:47 -08:00
Kevin Sawicki
f0566f3790 isCi -> isCI 2016-11-29 14:48:28 -08:00
Kevin Sawicki
f5f790863d Use 1 or 2 minute timeout for long specs 2016-11-29 14:31:57 -08:00
Kevin Sawicki
10386edea5 Default timeout to 30 seconds on CI and 10 seconds locally 2016-11-29 14:29:35 -08:00
Kevin Sawicki
4ccc3d9fb3 Remove unneeded return 2016-11-29 14:19:20 -08:00
Kevin Sawicki
77fa7ce977 Run more crashReporter specs on CI 2016-11-29 14:18:42 -08:00
Kevin Sawicki
2c8ab72269 Merge pull request #8084 from poiru/systempreferences-setuserdefault
Add systemPreferences.setUserDefault for macOS
2016-11-29 14:07:35 -08:00
Kevin Sawicki
df179ed28d Merge pull request #8092 from poiru/setcursorautohide
Add BrowserWindow.setCursorAutoHide
2016-11-29 13:36:58 -08:00
Kevin Sawicki
3ec0e2f132 Add override to SetAutoHideCursor signature 2016-11-29 13:36:08 -08:00
Kevin Sawicki
477ac313ab Merge pull request #8086 from deepak1556/devtools_remove_workspace_patch
override window.confirm in devtools
2016-11-29 13:31:21 -08:00
Kevin Sawicki
72e559458f Inline buttons and cancelId values 2016-11-29 13:30:28 -08:00
Kevin Sawicki
21f0b2bd2a Merge pull request #8096 from electron/dont-use-skip
Don't use Mocha's skip method
2016-11-29 12:53:13 -08:00
Kevin Sawicki
cc2936cfdf closeWindow in an afterEach block 2016-11-29 12:30:40 -08:00
Kevin Sawicki
d20e664ea8 Close window in an afterEach 2016-11-29 12:13:33 -08:00
Kevin Sawicki
fee7683b86 Reuse window variable and only close from root afterEach 2016-11-29 11:52:31 -08:00
Kevin Sawicki
d7e7c2b17f Assert single window from closeWindow helper 2016-11-29 11:29:20 -08:00
Kevin Sawicki
1afa41477d Don't use this.skip() since after hooks won't be run 2016-11-29 10:56:58 -08:00
Kevin Sawicki
217848ca52 Assert windows are not leaking across tests 2016-11-29 10:56:17 -08:00
Birunthan Mohanathas
486b6b9096 Add systemPreferences.setUserDefault for macOS
This API can be used to e.g. enable key repeat by setting
`ApplePressAndHoldEnabled` to `false` (see also #47).
2016-11-29 09:46:32 -08:00
Birunthan Mohanathas
18c49285a8 Add BrowserWindow.setAutoHideCursor for macOS
The `disableAutoHideCursor` BrowserWindow option can be used to control
auto-hiding behavior when the window is created. This new API is needed
to dynamically change the behavior after the fact.
2016-11-29 09:46:00 -08:00
Kevin Sawicki
fb74f5576d Merge pull request #8082 from aaronang/doc-electron-resources
Clarify where Electron's resources directory can be found
2016-11-28 15:39:07 -08:00
Kevin Sawicki
4aa2b093ff Merge pull request #8072 from ramya-rao-a/doc-update
Clarifying crash reporter behviour in Mac
2016-11-28 15:37:21 -08:00
Kevin Sawicki
446065b88c Minor updates to crash reporter notes 2016-11-28 15:37:06 -08:00
Kevin Sawicki
594aaec7bb Merge pull request #7901 from electron/rename-auto-upload
Rename autoUpload to uploadToServer
2016-11-28 15:34:07 -08:00
Kevin Sawicki
07994f50f3 Remove include now included in parent header 2016-11-28 15:11:50 -08:00
Kevin Sawicki
1c6e166af5 Value should be true on non-macOS platforms 2016-11-28 15:08:28 -08:00
Kevin Sawicki
0b9a2f6be6 Add autoSubmit crashReporter option 2016-11-28 15:08:28 -08:00
Kevin Sawicki
0c73140b07 used -> called 2016-11-28 15:08:28 -08:00
Kevin Sawicki
02cbd24165 Mention setUploadToServer only has effect after start 2016-11-28 15:08:28 -08:00
Kevin Sawicki
f4be3782a2 Add spec for get/setUploadToServer 2016-11-28 15:08:28 -08:00
Kevin Sawicki
bb9876bd6e Remove deprecation warning for autoSubmit 2016-11-28 15:08:28 -08:00
Samuel Attard
2bf6f28152 shouldUpload --> uploadToServer 2016-11-28 15:08:28 -08:00
Samuel Attard
a7dedb3a13 Update crash_reporter.cc 2016-11-28 15:08:28 -08:00
Samuel Attard
4b61a4d3de Fix linting 2016-11-28 15:08:28 -08:00
Samuel Attard
285a36f9de Use GetUploadsEnabled to return GetShouldUpload 2016-11-28 15:08:28 -08:00
Samuel Attard
5a1a2616aa Fix build issues 2016-11-28 15:08:12 -08:00
Samuel Attard
0d1804b2a0 Fix issues and deprecate the old prop 2016-11-28 15:08:12 -08:00
Samuel Attard
0b9530efd7 shouldUpload API's are macOS only 2016-11-28 15:08:12 -08:00
Samuel Attard
6bbd92368f Add docs for getShouldUpload 2016-11-28 15:08:12 -08:00
Samuel Attard
7b8eb3e09c Rename autoUpload to shouldUpload 2016-11-28 15:08:12 -08:00
Kevin Sawicki
774b2f99f2 Merge pull request #8038 from electron/danhp/close-file-preview
Add 'win.closeFilePreview()'
2016-11-28 14:47:06 -08:00
Kevin Sawicki
a7395118af Merge pull request #7952 from the-ress/window-setappid
Added BrowserWindow.setAppDetails to set user model id, icon and relaunch command
2016-11-28 14:46:14 -08:00
Kevin Sawicki
3897a88082 Use skip for setAppDetails spec 2016-11-28 14:43:18 -08:00
Kevin Sawicki
0a61aad499 Add initial previewFile/closeFilePreview test 2016-11-28 14:32:15 -08:00
Kevin Sawicki
5abecadfd3 Tweak setAppDetails docs 2016-11-28 14:29:21 -08:00
Kevin Sawicki
fff59271af Initialize app icon index to 0 2016-11-28 14:26:30 -08:00
Daniel Pham
d5a0dd39a1 🎁 Add 'win.closeFilePreview()' 2016-11-28 14:25:11 -08:00
Kevin Sawicki
ccabee764b Bump v1.4.10 2016-11-28 12:50:12 -08:00
Kevin Sawicki
5283b94bf9 Merge branch 'access-url-through-web-contents' 2016-11-28 10:56:35 -08:00
Kevin Sawicki
6f6c5c07f0 Remove unintended returns 2016-11-28 10:56:23 -08:00
Kevin Sawicki
3a29555772 Access URL through webContents directly 2016-11-28 10:56:23 -08:00
Kevin Sawicki
145e40c2f6 Add more origin comparison specs 2016-11-28 10:56:23 -08:00
Kevin Sawicki
41dea03007 window.opener location should be webview src URL 2016-11-28 10:56:23 -08:00
deepak1556
3ac9858726 override window.confirm in devtools 2016-11-28 01:08:48 +05:30
Cheng Zhao
bbaab755e3 Merge pull request #8049 from electron/prevent-remove-all-ipc
Throw an error when users attempt to remove all listeners from the IPC modules
2016-11-27 14:29:49 +08:00
Cheng Zhao
8fd6463ab0 Merge pull request #8024 from pedro/handle-drop-mac-os-fix
Fix support for dragging urls in Mac
2016-11-27 14:24:35 +08:00
Aaron Ang
92fe82a208 📝 Clarify where Electron's resources directory can be found
[ci skip]
2016-11-26 00:44:08 +01:00
Samuel Attard
4ff7cf2bcc Update web-frame docs 2016-11-25 23:33:31 +11:00
Samuel Attard
f6a6ca8a22 Update cookies docs 2016-11-25 23:27:11 +11:00
Samuel Attard
c9615a201c Update app docs 2016-11-25 23:23:45 +11:00
Samuel Attard
921b474919 Fixup app and bw docs 2016-11-25 23:21:25 +11:00
Samuel Attard
06960704c4 Update docs for dts again 2016-11-25 23:17:31 +11:00
Ramya Achutha Rao
f8b738e6c2 Clarifying crash reporter behviour in Mac 2016-11-23 15:36:03 -08:00
Kevin Sawicki
b036fdfee0 Bump v1.4.9 2016-11-23 14:36:32 -08:00
Kevin Sawicki
3930f17d9d Merge pull request #8071 from electron/fix-doc-indentation
Fix indentation in menu template example
2016-11-23 14:36:18 -08:00
Kevin Sawicki
9eb521fb38 Fix indentation in menu template example 2016-11-23 14:34:55 -08:00
Kevin Sawicki
27625d2665 Merge pull request #8070 from electron/remove-unnecessary-escape-characters
Remove unnecessary escape characters
2016-11-23 14:31:32 -08:00
Kevin Sawicki
0593696344 Remove unnecessary escape characters 2016-11-23 14:27:54 -08:00
Kevin Sawicki
2cabfa5589 Merge branch 'check-sender-web-contents-access' 2016-11-23 12:30:25 -08:00
Kevin Sawicki
0134d62681 Always use guest contents for canAccessWindow check 2016-11-23 12:01:09 -08:00
Kevin Sawicki
0799317ff5 Add failing specs window.opener from <webview> opened window 2016-11-23 12:01:09 -08:00
Kevin Sawicki
686a26d948 Merge pull request #8065 from DanTheMan827/patch-1
Fixed language code for Aragonese
2016-11-23 09:10:48 -08:00
Kevin Sawicki
cd5bfbfead Sort by codes 2016-11-23 09:10:27 -08:00
Kevin Sawicki
9a7209d58e Merge pull request #8016 from the-ress/windows-lint
Fixed linting on Windows
2016-11-23 09:09:39 -08:00
DanTheMan827
f89a045605 Fixed language code to Aragonese 2016-11-23 09:21:27 -06:00
Zeke Sikelianos
a353a94b70 use new docs linter, remove cross-conf-env dep 2016-11-23 08:19:42 +01:00
Tereza Tomcova
5498a31493 Fixed linting on Windows 2016-11-23 08:18:46 +01:00
Zeke Sikelianos
6b34b97c29 Merge pull request #8057 from electron/fixup-docs-for-ts
Docs update
2016-11-22 19:18:37 -08:00
Samuel Attard
6a8ee19bf0 Docs update 2016-11-23 11:51:44 +11:00
Kevin Sawicki
cf690ae513 Merge pull request #7986 from salomvary/fix-before-quit-docs
Clarify docs on a `before-quit` behavior edge case
2016-11-22 16:51:26 -08:00
LuisHsu
cd8b7f5219 zh_TW translation of some tutorial document (#8054)
* 📝 zh_TW translation of tutorial

docs-translations/zh-TW/tutorial/debugging-main-process-
node-inspector.md

* 📝 zh_TW translation of tutorial

[ci skip]

debugging-main-process-vscode.md

* 📝 Translate zh_TW DE integration

desktop-environment-integration.md

* 📝 Translate zh_TW DE integration

[ci skip]
desktop-environment-integration.md
2016-11-22 15:59:28 -08:00
Kevin Sawicki
37b18243f4 Bump v1.4.8 2016-11-22 14:02:52 -08:00
Kevin Sawicki
e356168c9a Merge pull request #8047 from electron/fix-incorrect-window-size
Fix incorrect window size after restore on Windows
2016-11-22 14:01:50 -08:00
Kevin Sawicki
6f29d7211e Move restore/unmaximize specs near state ones 2016-11-22 13:32:39 -08:00
Kevin Sawicki
414db313c6 Merge pull request #8056 from electron/mocha-only-check
Check runner.hasOnly for focused spec check
2016-11-22 13:30:08 -08:00
Kevin Sawicki
63eec70350 Assert bounds when restoring 2016-11-22 13:22:30 -08:00
Kevin Sawicki
c0d9175bc3 Try specs without setTimeout calls 2016-11-22 13:14:17 -08:00
Kevin Sawicki
89965aa5db Check runner.hasOnly for focused spec check 2016-11-22 13:06:18 -08:00
Kevin Sawicki
238beb72ee Remove .only call 2016-11-22 11:41:02 -08:00
Zeke Sikelianos
6c046704c7 Merge pull request #8022 from electron/lint-required-and-optional-params
use updated docs linter with required param parsing
2016-11-22 10:47:32 -08:00
Zeke Sikelianos
5dc4b22d31 Merge pull request #7992 from electron/process-doc-followup
Process doc followup
2016-11-22 10:46:57 -08:00
Kevin Sawicki
95ab4815de Merge pull request #8041 from electron/webview-zoom-factor
Add new method to set layout-based zoom level limit
2016-11-22 09:08:00 -08:00
Kevin Sawicki
a7aed98d59 Add initial spec for zoom level limits 2016-11-22 08:43:14 -08:00
Kevin Sawicki
c4b68d88e9 Add setZoomLevelLimits to planned breaking changes 2016-11-22 08:11:14 -08:00
Kevin Sawicki
d4368fabb9 Add 2.0 comment about setZoomLevelLimits 2016-11-22 08:09:14 -08:00
Kevin Sawicki
9a5df9da41 Expose setVisualZoomLevelLimits on webContents and <web-view> 2016-11-22 08:07:55 -08:00
Kevin Sawicki
756a338b05 Document webFrame.setVisualZoomLevelLimits as public 2016-11-22 08:03:04 -08:00
Kevin Sawicki
e887fb69bd Export a setVisualZoomLevelLimits method 2016-11-22 07:53:02 -08:00
Kevin Sawicki
fb5bca8bc5 Merge pull request #8046 from electron/bengotow/url-schemes-docs-patch
Update open-url docs to mention NSPrincipalClass
2016-11-22 07:50:13 -08:00
Kevin Sawicki
0d317a2e49 Add backticks around Info.plist 2016-11-22 07:49:56 -08:00
Kevin Sawicki
77e317c1eb Merge pull request #8043 from electron/crash-reporter-docs
crash-reporter -> crashReporter
2016-11-22 07:49:11 -08:00
Samuel Attard
db729b5b52 Throw an error when users attempt to remove all listeners from the IPC modules 2016-11-22 18:30:58 +11:00
Samuel Attard
97b4f12112 Fix linting issues 2016-11-22 16:13:08 +11:00
Samuel Attard
926cabec78 Add spec for maximize restore positioning 2016-11-22 16:07:19 +11:00
Samuel Attard
621a934160 Fix maximize --> unmaximize positioning issue 2016-11-22 16:07:05 +11:00
Samuel Attard
c65033a13b Revert "incorrect position when restored from maximize-on-top-drag under Windows #7630"
This reverts commit a2b3abbf47.
2016-11-22 15:49:56 +11:00
Samuel Attard
67f33cdb60 Add failing spec for window size after restore 2016-11-22 15:49:47 +11:00
Ben Gotow
964c88a189 Update open-url docs to mention NSPrincipalClass
We got bit by a nasty bug today - if you change your app's info.plist `NSPrincipalClass` to something other to `AtomApplication` (We set it to NylasApplication via a bad find-replace), everything works except open-url is never fired. Add a small reference to the docs so folks know to check this key.
2016-11-21 16:55:18 -08:00
Kevin Sawicki
62b39d58ca crash-reporter -> crashReporter 2016-11-21 15:42:24 -08:00
Paul Betts
3e85d7759b 📝 2016-11-21 15:16:13 -05:00
Paul Betts
7445f9bdcc Lint 2016-11-21 15:13:34 -05:00
Paul Betts
e2649ce7d8 Add new method to set layout-based zoom level limit 2016-11-21 14:59:55 -05:00
Kevin Sawicki
71f94c7a3a Merge pull request #8030 from LuisHsu/master
zh_TW translation of tutorial docs
2016-11-21 09:53:25 -08:00
Kevin Sawicki
41d6207376 Merge pull request #8027 from bowbowbow/patch-1
Fix missed parameter in example.
2016-11-21 09:51:44 -08:00
Kevin Sawicki
82d17cb05d Merge pull request #7993 from electron/get-user-default-crash
Prevent systemPreferences.getUserDefault crash for missing arrays/dictionaries
2016-11-21 09:50:37 -08:00
Kevin Sawicki
26137977cd Fix crash when return value pointer is null 2016-11-21 09:22:30 -08:00
Kevin Sawicki
cbffd598f9 Add failing spec for unknown user defaults 2016-11-21 09:22:30 -08:00
Kevin Sawicki
2e35b1c855 Merge pull request #7776 from electron/zoom-to-web-contents-size
Add zoomToPageWidth window option
2016-11-21 09:21:55 -08:00
Kevin Sawicki
ea6b53578f Mention preferred size 2016-11-21 08:45:46 -08:00
Kevin Sawicki
2fc46f638f 🎨 2016-11-21 08:45:46 -08:00
Kevin Sawicki
a991570677 intrinsicWidth -> pageWidth 2016-11-21 08:45:46 -08:00
Kevin Sawicki
d4ba5b4638 Add spec for zoomToPageWidth 2016-11-21 08:45:46 -08:00
Kevin Sawicki
b02c0e6f46 Remove unneeded proportion calculation 2016-11-21 08:45:46 -08:00
Kevin Sawicki
7916981da2 zoomToContentSize -> zoomToPageWidth 2016-11-21 08:45:46 -08:00
Kevin Sawicki
7896ee23a2 Document zoomToContentSize 2016-11-21 08:45:46 -08:00
Kevin Sawicki
c5790e39dc Add support for zooming to content size 2016-11-21 08:45:46 -08:00
Zeke Sikelianos
8bc3dcd17a Merge pull request #8031 from muryoimpl/fix-broken-link-in-api-dialog
Fix typo in docs/api/dialog
2016-11-20 17:54:47 -08:00
muryoimpl
eab5376c25 Fix typo 2016-11-21 00:49:11 +09:00
LuisHsu
56b15eadea 📝 zh_TW of tutorial/accessibility.md
[ci skip]

 * Translate tutorial/about.md
2016-11-20 22:35:32 +08:00
LuisHsu
61c31f8e21 📝 zh_TW translation of tutorial/about.md
[ci skip]

1. Translate tutorial/about.md

2. Fix some broken links

3. Untranslated links are keep in English
2016-11-20 22:01:43 +08:00
bowbowbow
8918770892 I modified missed parameter in example.
Below example (in line 43 ~ 45) not working like comment. Because `ipcRenderer` callback function have two parameters (event, arg).

```javascript
ipcRenderer.on('asynchronous-reply', (arg) => {
  console.log(arg) // "pong" 출력
})
```
2016-11-20 21:30:50 +09:00
Pedro Belo
89e8ad4947 Fix support for dragging urls in Mac 2016-11-19 21:18:24 -08:00
Zeke Sikelianos
94988f89b0 use updated docs linter with required param parsing 2016-11-19 11:34:19 -08:00
Tereza Tomcova
b305020c1d Added documentation for BrowserWindow.setAppDetails 2016-11-18 21:43:03 +01:00
Tereza Tomcova
782417b1fa Added tests for BrowserWindow.setAppDetails 2016-11-18 21:34:01 +01:00
Tereza Tomcova
38b14fc912 Include shell.h only for Windows 2016-11-18 21:33:55 +01:00
Tereza Tomcova
ac9e0b458d Added BrowserWindow.setAppDetails to set user model id, icon and relaunch command 2016-11-18 21:33:55 +01:00
Zeke Sikelianos
d6e3360aef Merge pull request #8009 from deed02392/master
Update docs
2016-11-18 08:33:24 -08:00
deed02392
1ee0efbe5c Merge pull request #1 from deed02392/patch-1
Patch 1
2016-11-18 00:38:24 +00:00
George Hafiz
aac31159b8 Update formatting to prevent '[] ()' sequences (e.g. String[] (optional)), which breaks MD rendering on GitHub and hides the array indication 2016-11-18 00:34:48 +00:00
deed02392
0aa1c3c6c3 Update dialog.md
Fix syntax to support docs parser and MD.
2016-11-17 22:39:24 +00:00
Kevin Sawicki
02a95a3eba Merge pull request #7981 from electron/more-menu-item-roles
Add reload and toggledevtools menu item roles
2016-11-17 13:04:13 -08:00
Kevin Sawicki
996ddba715 Add rpc error for ELECTRON_BROWSER_MEMBER_GET 2016-11-17 12:29:23 -08:00
Kevin Sawicki
88809b0e0b Document reload and toggledevtools roles 2016-11-17 10:57:20 -08:00
Kevin Sawicki
88959079bd Add toggledevtools menu item role 2016-11-17 10:57:20 -08:00
Kevin Sawicki
0698b5f1be Add reload menu item role 2016-11-17 10:57:20 -08:00
Kevin Sawicki
28c39d5151 Merge pull request #8003 from electron/missing-remote-object-error
Throw custom error when remote object is missing from registry
2016-11-17 10:57:03 -08:00
Kevin Sawicki
5427ec4844 Negate code as per node docs 2016-11-17 10:22:29 -08:00
Kevin Sawicki
aef898ad93 Set errno on RPC error 2016-11-17 10:09:29 -08:00
Kevin Sawicki
c05ca68811 Throw custom error when remote object is missing from registry 2016-11-17 09:55:13 -08:00
deed02392
489d873306 Update dialog.md
Fix 'properties' type in documentation (was missing `[]` notation due to lack of Markdown escaping).
2016-11-17 07:36:37 +00:00
Cheng Zhao
3834f0c6a6 Merge pull request #7974 from electron/chrome-runtime-response-callback
Implement chrome.runtime.onMessage response callback
2016-11-17 13:01:38 +09:00
Samuel Attard
7c26ec8bd4 Remove semicolon 2016-11-17 14:56:44 +11:00
Cheng Zhao
eb63bea87c Merge branch 'gabriel-master' 2016-11-17 12:15:38 +09:00
Cheng Zhao
5639faf069 Also fix the Windows and Linux side of async openExternal 2016-11-17 12:13:07 +09:00
Cheng Zhao
090a5d9a61 platform_util code should not involve V8 code 2016-11-17 11:22:09 +09:00
Cheng Zhao
622bad1cff Simplify getting callback 2016-11-17 10:36:16 +09:00
Gabriel Handford
5b260dbee3 Fix win/linux compile (again) 2016-11-17 10:33:24 +09:00
Gabriel Handford
f0ca9dff81 Fix win/linux compile 2016-11-17 10:33:24 +09:00
Gabriel Handford
9382d48708 Update docs 2016-11-17 10:33:24 +09:00
Gabriel Handford
54222bdf28 More general string for OSStatus 2016-11-17 10:33:24 +09:00
Gabriel Handford
2931c27395 More readable 2016-11-17 10:33:24 +09:00
Gabriel Handford
31123f908d Fix ternary 2016-11-17 10:33:24 +09:00
Gabriel Handford
99a5258999 Callback uses (platform specific) error, with message 2016-11-17 10:33:24 +09:00
Gabriel Handford
5e8059e0fa Fix method names, move to anon namespace 2016-11-17 10:33:24 +09:00
Gabriel Handford
08a9af3a85 Linting 2016-11-17 10:33:24 +09:00
Gabriel Handford (linux)
d186fd78e3 Fix header 2016-11-17 10:33:23 +09:00
Gabriel Handford
6524a33ffc Include callback header 2016-11-17 10:33:23 +09:00
Gabriel Handford
21df08d536 Remove redundant comment 2016-11-17 10:33:23 +09:00
Gabriel Handford
cfd2a029ad Fix linting 2016-11-17 10:33:23 +09:00
Gabriel Handford
c78567aba6 Update shell openExternal docs (from review) 2016-11-17 10:33:23 +09:00
Gabriel Handford
9ca684d87f Remove redundant method 2016-11-17 10:33:23 +09:00
Gabriel Handford
128feb17cb Fix method call 2016-11-17 10:33:23 +09:00
Gabriel Handford
3eb5f8d521 Fix typo 2016-11-17 10:33:23 +09:00
Gabriel Handford
b266533dfc Shell openExternal can take optional callback (macOS) 2016-11-17 10:33:23 +09:00
Zeke Sikelianos
1b5b29901c Merge pull request #7969 from electron/one-file-per-api
move each API doc into its own file
2016-11-16 11:12:36 -08:00
Zeke Sikelianos
468d8b7707 reference node's process object 2016-11-16 09:54:29 -08:00
Zeke Sikelianos
1da97f729e process object is available in renderer processes too 2016-11-16 09:54:19 -08:00
Zeke Sikelianos
f9683ff99f use unreleased linter 2016-11-16 09:03:17 -08:00
Zeke Sikelianos
a7fdd04751 move menu constructor docs to top of file 2016-11-16 09:02:49 -08:00
Zeke Sikelianos
5979dab13c fix some class headings 2016-11-16 09:02:49 -08:00
Zeke Sikelianos
c9739abf7f add description and process for BrowserWindow class 2016-11-16 09:02:49 -08:00
Zeke Sikelianos
39330affda DownloadItem only needs one heading 2016-11-16 09:02:49 -08:00
Zeke Sikelianos
d6684c4dcd fix UploadBlob heading 2016-11-16 09:02:49 -08:00
Zeke Sikelianos
4770d2b526 returns an instance, not the module 2016-11-16 09:02:49 -08:00
Zeke Sikelianos
2b689a21e7 fix structure headings 2016-11-16 09:02:49 -08:00
Zeke Sikelianos
b084dc29ea move each API doc into its own file 2016-11-16 09:02:49 -08:00
Kevin Sawicki
c4d74c48e4 Bump v1.4.7 2016-11-16 08:11:28 -08:00
Kevin Sawicki
436775b1e4 Merge branch 'opener-origin-check' 2016-11-16 08:10:18 -08:00
Kevin Sawicki
aa2824621a Make scheme const 2016-11-16 08:03:07 -08:00
Kevin Sawicki
651eaec64f Use sender.id instead of sender.webContents.id 2016-11-16 07:50:30 -08:00
Kevin Sawicki
92577c37c8 Don't log blocked messages when guestWindow is null 2016-11-16 07:50:30 -08:00
Kevin Sawicki
04c68745db Always call done callback in before block 2016-11-16 07:50:30 -08:00
Cheng Zhao
81f2e76e36 Fix standard linting errors 2016-11-16 07:50:30 -08:00
Cheng Zhao
18fca785c4 Print error messages 2016-11-16 07:50:30 -08:00
Cheng Zhao
a1066617a8 Do permission check when calling guest window methods 2016-11-16 07:50:30 -08:00
Cheng Zhao
a1dfdbdde4 spec: Should check origin before accessing window.opener 2016-11-16 07:50:30 -08:00
Kevin Sawicki
63a138b6de Merge pull request #7980 from electron/guard-against-missing-members
Guard against missing members in setObjectMembers
2016-11-16 07:46:42 -08:00
Kevin Sawicki
5167ccd147 Guard against missing members in setObjectMembers 2016-11-16 07:45:34 -08:00
Kevin Sawicki
cb0845fc49 Merge pull request #7979 from electron/credits-attributed-string
Convert about credits to NSAttributedString
2016-11-16 07:45:07 -08:00
Kevin Sawicki
11449b2e8c Convert about credits to NSAttributedString 2016-11-16 07:42:24 -08:00
Kevin Sawicki
bee5ced8f4 Merge pull request #7978 from electron/memoize-no-asar-env-check
Memoize ELECTRON_NO_ASAR env var check
2016-11-16 07:41:48 -08:00
Kevin Sawicki
bea1a0643c Memoize ELECTRON_NO_ASAR env var check 2016-11-16 07:37:53 -08:00
Kevin Sawicki
f111bb4107 Merge pull request #7989 from electron/pin-electron-docs-linter
Pin electron-docs-linter version
2016-11-16 07:37:08 -08:00
Kevin Sawicki
f20ca63dd0 Pin electron-docs-linter to 1.14.1 2016-11-16 07:33:36 -08:00
Márton Salomváry
98e18a62e2 Clarify docs on a before-quit behavior edge case
See #7875
2016-11-16 10:38:57 +01:00
Kevin Sawicki
9624bc1403 Merge pull request #7917 from voidbridge/feature/expose-cert-chain
Expose whole certificate chain to verify proc
2016-11-15 16:37:58 -08:00
Kevin Sawicki
fc1ce3eeab Assert certs further up the chain 2016-11-15 16:32:12 -08:00
Kevin Sawicki
095d711848 Remove select-client-certificate issueCert assert 2016-11-15 16:24:50 -08:00
Kevin Sawicki
a1dca8afc9 🎨 Remove buildup asserts and just use assert.equal 2016-11-15 15:53:42 -08:00
Greg Nolle
86321a2c60 Fixed incorrect subject name of test client certificate. 2016-11-15 15:53:42 -08:00
Greg Nolle
2e5c92d41e Fix listing issues: remove semicolons. 2016-11-15 15:53:42 -08:00
Greg Nolle
f767f0f048 Remove unnecessary ConvertToV8 calls. 2016-11-15 15:53:42 -08:00
Greg Nolle
93ce2f7800 Add assertions for new fields in existing specs. 2016-11-15 15:53:42 -08:00
Greg Nolle
5d028f9163 Expose extra certificate information: full breakdown of issuer and subject principals, as well as full structure of intermediate issuer certificates. 2016-11-15 15:53:42 -08:00
Greg Nolle
446399c3c1 Expose whole certificate chain to verify proc and certificate-error event. 2016-11-15 15:53:42 -08:00
Kevin Sawicki
0ef6d4631d Merge pull request #7658 from figma/webview-manual-guest-resize
Allow webview guests to be resized manually
2016-11-15 14:21:56 -08:00
Kevin Sawicki
b87d86e9d5 Merge pull request #7982 from kirly-af/kirly-af-tray-example-fix
[ci skip] Correct Linux limitation example
2016-11-15 14:19:03 -08:00
Kevin Sawicki
35e000024c Minor doc updates to setSize/disableguestresize 2016-11-15 13:59:01 -08:00
Kevin Sawicki
9e51c779e1 Assert expected height 2016-11-15 13:54:25 -08:00
Alexandre
6f8eb282b7 [ci skip] Correct Linux limitation example 2016-11-15 21:53:54 +01:00
Kevin Sawicki
301b8ec39a Merge pull request #7962 from liusy182/disable-accelerator
disable accelerator when menu item is disabled
2016-11-15 11:05:36 -08:00
Birunthan Mohanathas
2986b7bc4a Allow webview guests to be resized manually
This adds the `disableguestresize` property for webviews to prevent the
webview guest from reacting to size changes of the webview element. This
also partially documents the `webContents.setSize` function in order to
manually control the webview guest size.

These two features can be combined to improve resize performance for
e.g. webviews that span the entire window. This greatly reduces the lag
described in #6905.
2016-11-15 11:00:09 -08:00
张树源
89feefac2c update app.md Chinese translation to latest version (#7973)
* Update Chinese translation to latest version.

* Update app.md translation

* update app.md Chinese translation to latest version.
2016-11-15 10:04:00 -08:00
Kevin Sawicki
68a6b39920 Merge pull request #7971 from electron/modify-install-docs
make npm install instructions more prominent
2016-11-15 10:03:23 -08:00
Kevin Sawicki
eeffa42513 Merge pull request #7923 from jhen0409/patch-1
Add support remove / clear for chrome.storage
2016-11-15 09:04:45 -08:00
Jhen
8b30439d7f Update devtools extension spec for chrome.storage 2016-11-15 19:58:08 +08:00
Samuel Attard
01005688b6 Implement chrome.runtime.onMessage response callback 2016-11-15 21:30:40 +11:00
liusi
00d9baa605 fix linting error 2016-11-15 13:23:59 +08:00
liusi
9e91f319c1 fix linting error 2016-11-15 13:19:34 +08:00
Kevin Sawicki
619bb31de2 Merge pull request #7972 from electron/macos-10-11-constants
Use visual effect values directly since enums are 10.11+
2016-11-14 17:04:55 -08:00
Kevin Sawicki
dcb3a13361 Use values directly since constants are 10.11+ 2016-11-14 16:43:05 -08:00
Kevin Sawicki
c2663e48c1 Merge pull request #7967 from veleek/patch-1
Update electron-squirrel-startup link
2016-11-14 15:46:34 -08:00
Zeke Sikelianos
621715e5e5 link to more relevant yarn doc 2016-11-14 13:57:12 -08:00
Zeke Sikelianos
b9991f0494 make npm install instructions more prominent 2016-11-14 13:52:07 -08:00
Ben Randall
c259b4294d Update electron-squirrel-startup link
The currently link points to a non-existent page.  I'm pointing it to another link that seems to be appropriate, but I'm not positive.
If someone else knows that this is the correct place to link that would be nice to hear.
2016-11-14 10:16:24 -08:00
Kevin Sawicki
4867475cee Merge pull request #7540 from deepak1556/form_post_new_window_patch
webContents: handle POST navigation for new windows
2016-11-14 07:39:54 -08:00
Kevin Sawicki
8822c7d87d Merge pull request #7958 from jhen0409/patch-2
Add Redux DevTools Extension to support list
2016-11-14 07:32:53 -08:00
liusi
06cfcd612d disable accelerator when menu item is disabled 2016-11-14 12:29:27 +08:00
Jhen
1404ea1c2c Add Redux DevTools Extension to support list 2016-11-14 00:32:31 +08:00
deepak1556
4deb7c6fa7 fix lint error 2016-11-12 07:16:48 +05:30
Kevin Sawicki
b9e950f5c7 Mark postData as optional 2016-11-12 07:15:21 +05:30
Kevin Sawicki
134f8afbe6 Add specs for content type on POST forms 2016-11-11 10:54:01 -08:00
Kevin Sawicki
50019f39e9 🎨 2016-11-11 10:54:01 -08:00
deepak1556
5f596b22c7 specify content type depending on post data 2016-11-11 10:54:01 -08:00
Kevin Sawicki
cbb68f6980 Remove quotes around key 2016-11-11 10:54:01 -08:00
deepak1556
61576c39be uploadData => uploadRawData 2016-11-11 10:54:01 -08:00
deepak1556
9536ebc0ad fix build error 2016-11-11 10:54:01 -08:00
deepak1556
723a3eda8b update docs 2016-11-11 10:54:01 -08:00
deepak1556
a5fd6507a9 set default values in converter 2016-11-11 10:54:01 -08:00
deepak1556
dbe57c4ad4 update docs 2016-11-11 10:54:01 -08:00
deepak1556
ad5f944185 add spec 2016-11-11 10:53:36 -08:00
deepak1556
2044208fd6 add docs 2016-11-11 10:53:36 -08:00
deepak1556
2d7ceae320 fix js lint error 2016-11-11 10:53:00 -08:00
deepak1556
0410a184ce webContents: handle POST navigation for new windows 2016-11-11 10:53:00 -08:00
Kevin Sawicki
7cfe1dd0af Merge pull request #7946 from electron/move-footer-links-to-bottom
Move footer links to bottom
2016-11-11 10:23:03 -08:00
Kevin Sawicki
4de2493d89 Move footer links to bottom 2016-11-11 10:22:27 -08:00
Jhen
b86dff45d7 Add support remove / clear for chrome.storage 2016-11-12 02:16:51 +08:00
Zeke Sikelianos
fb8339830e Merge pull request #7945 from electron/add-process-to-content-tracing-doc
add process to contentTracing doc
2016-11-11 10:09:07 -08:00
Zeke Sikelianos
ec7cae4a34 add process to contentTracing doc 2016-11-11 10:07:36 -08:00
Zeke Sikelianos
80a7835cdf Merge pull request #7884 from electron/optional-things
Update docs to correctly identify props and params that are optional
2016-11-11 09:47:31 -08:00
Zeke Sikelianos
50be8b65d1 update docs linter 2016-11-11 09:22:55 -08:00
Samuel Attard
174e51507d Update menu.md 2016-11-11 09:22:55 -08:00
Samuel Attard
494afec01d remote require could resolve to strings/numbers not just objects 2016-11-11 09:22:55 -08:00
Samuel Attard
aeefee7348 Fix the download-item doc so it correctly resembles a class 2016-11-11 09:22:55 -08:00
Samuel Attard
c1af62a3b3 Move crash-report object to it's own struct 2016-11-11 09:22:55 -08:00
Samuel Attard
11f8923c43 Fix tray and menu docs 2016-11-11 09:22:55 -08:00
Samuel Attard
63ebc41778 More docs updates 2016-11-11 09:22:55 -08:00
Samuel Attard
1a9b4b4671 First few docs made optional 2016-11-11 09:22:55 -08:00
Kevin Sawicki
8a29604f1e Merge pull request #7944 from electron/autorelease-effect-view
Autorelease NSVisualEffectView
2016-11-11 09:05:32 -08:00
Kevin Sawicki
483e007b69 🎨 2016-11-11 08:51:33 -08:00
Kevin Sawicki
2d8a61a775 autorelease NSVisualEffectView 2016-11-11 08:51:29 -08:00
gellert
5e62d28e50 adds test, adds view to AtomNSWindow and minor fixes 2016-11-11 08:49:57 -08:00
gellert
2cf30c0d63 remove method transferred to set with null 2016-11-11 08:49:57 -08:00
gellert
16253fe708 doc fixes 2016-11-11 08:49:57 -08:00
gellert
84a3fe50dc little fix in docs 2016-11-11 08:49:57 -08:00
gellert
8ad50d1e35 adds vibrancy effect for macos 2016-11-11 08:49:57 -08:00
Zeke Sikelianos
ad638097b6 Merge pull request #7933 from joshaber/patch-1
Update external frameworks version
2016-11-11 07:43:35 -08:00
liusi
356d0520ae fix linting error 2016-11-11 17:57:22 +08:00
joshaber
999b349e94 Docit 2016-11-10 13:35:56 -05:00
Kevin Sawicki
76375a83eb Merge pull request #7925 from mrxf/patch-5
Modify the error terms
2016-11-10 09:34:14 -08:00
Kevin Sawicki
ea534aa564 Merge pull request #7922 from mrxf/patch-4
Modify some translation errors
2016-11-10 09:33:55 -08:00
Kevin Sawicki
055e49ab9c Merge pull request #7921 from mrxf/patch-3
fix some translation problems
2016-11-10 09:33:04 -08:00
Josh Abernathy
0d43e239d4 Update to version 1.2.0 of external frameworks. 2016-11-10 11:33:01 -05:00
张树源
c04a0381dc Modify the error terms
There is an error in the translation of the last sentence.It may make reader confuse.
2016-11-10 14:42:41 +08:00
张树源
5cebe65310 Modify some translation errors 2016-11-10 11:13:54 +08:00
张树源
ab5a49b6ae fix some translation problems
update translation.
2016-11-10 10:29:43 +08:00
Kevin Sawicki
7b463297c6 Merge pull request #7908 from deepak1556/about_scheme_patch
protocol: register about scheme handler
2016-11-09 16:13:27 -08:00
Kevin Sawicki
debdce1e66 Bump v1.4.6 2016-11-09 11:59:25 -08:00
Kevin Sawicki
8a2706d2f4 Merge pull request #7906 from electron/upgrade-chrome-53
Upgrade to Chrome 53.0.2785.143
2016-11-09 11:49:33 -08:00
Kevin Sawicki
709dd0bf18 Upgrade to Chrome 53.0.2785.143 2016-11-09 11:03:44 -08:00
Kevin Sawicki
de78f3441e Merge pull request #7916 from thompsonemerson/patch-7
add link for powerSaveBlocker | pt-br
2016-11-09 08:28:21 -08:00
Emerson Thompson
f23624755e add link for powerSaveBlocker | pt-br 2016-11-09 13:25:24 -03:00
Kevin Sawicki
0c265f8ed4 Merge pull request #7912 from mrxf/patch-2
Update translation
2016-11-09 08:17:59 -08:00
Kevin Sawicki
c1f2e30c5a Merge pull request #7910 from mrxf/patch-1
update simplified Chinese translation
2016-11-09 08:17:31 -08:00
Kevin Sawicki
3b415b2e99 Merge pull request #7907 from thompsonemerson/patch-5
power-save-blocker.md file translation
2016-11-09 08:16:20 -08:00
张树源
bea9f78ddb Update translation
change link to a simple Chinese page.
2016-11-09 18:29:49 +08:00
张树源
95484a1b1a 修改翻译不完善部分
完善翻译内容
2016-11-09 16:53:53 +08:00
deepak1556
a0065e62fa add about: protocol handler 2016-11-09 13:22:58 +05:30
deepak1556
3aab713d24 add failing spec 2016-11-09 11:00:50 +05:30
Emerson Thompson
5d6f180413 power-save-blocker.md file translation 2016-11-08 14:51:53 -03:00
liusi
a69ee76705 fix review comments 2016-11-08 15:36:37 +08:00
Kevin Sawicki
7971ce0dd9 Merge pull request #7895 from electron/windows-symbol-server
Update Windows symbols server URL
2016-11-07 15:14:53 -08:00
Lee Dohm
4159a6a41d Merge pull request #7900 from electron/more-license-clarification
More license section clarification and update copyright year
2016-11-07 14:57:46 -08:00
Lee Dohm
e49af23a7d Add copyright range of 2013-2016 to LICENSE 2016-11-07 14:54:54 -08:00
Lee Dohm
30117816be More license section clarification 2016-11-07 14:26:21 -08:00
Kevin Sawicki
b6ece7d16c Merge pull request #7852 from electron/webview-guestinstance
Fix reload/destroy webview guestinstance issues
2016-11-07 13:48:01 -08:00
Kevin Sawicki
6fda4fc45c Guard against attachedCallback firing while handling detachedCallback 2016-11-07 13:42:36 -08:00
Kevin Sawicki
18e1de105f Add failing spec for deleted guestinstance when moving webview 2016-11-07 13:42:36 -08:00
Kevin Sawicki
133ad6e18b Only set size and load URL on first attach 2016-11-07 13:42:36 -08:00
Kevin Sawicki
b84fed5cb2 Add failing spec for hide/show reload issue 2016-11-07 13:42:36 -08:00
Kevin Sawicki
a737732521 Only remove guest from embedder when view id changes 2016-11-07 13:42:36 -08:00
Kevin Sawicki
f454cb3408 Add failing spec for hide/show webview issue 2016-11-07 13:42:36 -08:00
Lee Dohm
d18a9eaf65 Merge pull request #7897 from electron/logo-clarification
Add logo clarification and standardized licensing language
2016-11-07 12:23:08 -08:00
Lee Dohm
059433511c Add logo clarification and standardized licensing language 2016-11-07 12:08:11 -08:00
Kevin Sawicki
acacb3f551 Update symbols server URL 2016-11-07 10:58:27 -08:00
Kevin Sawicki
0008bc5f82 Merge pull request #7893 from tinydew4/translate-ko
Update the korean docs up to 'ef9d8fe' commit.
2016-11-07 08:55:22 -08:00
Kevin Sawicki
a3e10aba95 Merge pull request #7863 from electron/coffee-script-webview-cleanup
Clean up CoffeeScript leftovers in webview code
2016-11-07 08:53:08 -08:00
Kevin Sawicki
73774f21b7 🎨 2016-11-07 08:28:02 -08:00
Kevin Sawicki
3c18de9c5a Only return when guestInstance is non-null 2016-11-07 08:25:01 -08:00
Kevin Sawicki
19a5d2ba2b Use window close helper instead of destroying for coverage 2016-11-07 08:25:01 -08:00
Kevin Sawicki
16f57b219b Add resize event spec 2016-11-07 08:25:01 -08:00
Kevin Sawicki
0485069c7b Use spread operator 2016-11-07 08:25:01 -08:00
Kevin Sawicki
e4d6aa30a1 Do truthy check in if block 2016-11-07 08:25:01 -08:00
Kevin Sawicki
89a26684e5 Return webContents directly 2016-11-07 08:25:01 -08:00
Kevin Sawicki
0e1c2b0fcb Use for/of and remove loop variables 2016-11-07 08:25:01 -08:00
Kevin Sawicki
6eab14359c Use ES6 style class for WebViewImpl 2016-11-07 08:25:01 -08:00
Kevin Sawicki
76f96bd99c Destructure requires 2016-11-07 08:25:01 -08:00
Kevin Sawicki
48bcad87c2 Use template strings 2016-11-07 08:25:01 -08:00
Kevin Sawicki
712b15286c Use let/const instead of var 2016-11-07 08:25:01 -08:00
Kevin Sawicki
3053be345b Remove unneeded returns 2016-11-07 08:25:01 -08:00
Kevin Sawicki
8e834e9047 Merge pull request #7869 from electron/less-browserify-build-time
Only run browserify when sandbox files change
2016-11-07 08:20:20 -08:00
Kevin Sawicki
3e34760eef Run browserify with --silent 2016-11-07 08:19:59 -08:00
Kevin Sawicki
e0afb814aa Only call browserify when one of sandbox sources change 2016-11-07 08:19:59 -08:00
tinydew4
0fd35cf768 Update the korean docs up to 'ef9d8fe' commit. 2016-11-07 13:59:53 +00:00
Kevin Sawicki
0b86acfef4 Merge pull request #7881 from electron/node-headers-url
Update dist url to be electron instead of atom-shell
2016-11-04 16:22:34 -07:00
Kevin Sawicki
36ee417d3b Update more download URLs from atom-shell to electron 2016-11-04 16:21:30 -07:00
Kevin Sawicki
a1a07aed44 Add atom-shell URL to planned breaking changes 2016-11-04 16:21:30 -07:00
Kevin Sawicki
f0731be20b Update dist url to be electron instead of atom-shell 2016-11-04 16:21:30 -07:00
Zeke Sikelianos
58278ee095 Merge pull request #7867 from electron/update-issue-template
ask for more info in the issue template
2016-11-04 15:12:20 -07:00
Zeke Sikelianos
494a025fb8 🎨 2016-11-04 15:11:40 -07:00
Zeke Sikelianos
ade8401b5b add a preamble 2016-11-04 12:12:37 -07:00
Zeke Sikelianos
ef9d8fe9bd Merge pull request #7843 from electron/process-docs
document the process(es) in which APIs are available
2016-11-03 13:14:30 -07:00
Zeke Sikelianos
471b9980ec line up process annotations consistently 2016-11-03 13:13:21 -07:00
Zeke Sikelianos
9c65b9a9f2 ask for more info in the issue template 2016-11-03 12:58:31 -07:00
Zeke Sikelianos
21105271a4 document processes for APIs nested in parent docs 2016-11-03 11:50:00 -07:00
Kevin Sawicki
7e90bb47a5 Merge pull request #7533 from electron/async-executeJavaScript
Allow web frame methods to return async promises
2016-11-03 10:32:21 -07:00
Zeke Sikelianos
ac68de6215 document process(es) for all APIs 2016-11-03 10:26:00 -07:00
Kevin Sawicki
8e203592e2 🎨 Remove extra returns 2016-11-03 09:51:01 -07:00
Samuel Attard
9f18a6e65c Use ES6 template strings, fix docs and remove _ERROR_ IPC event 2016-11-03 09:33:47 -07:00
Samuel Attard
857e1da6a3 Make executeJavaScript return a Promise so that caught errors can be sent to the caller 2016-11-03 09:33:47 -07:00
Samuel Attard
75b010ce63 Add sync executeJavaScript test 2016-11-03 09:33:47 -07:00
Samuel Attard
124fbdbd74 Allow web frame methods to return async promises 2016-11-03 09:33:47 -07:00
Kevin Sawicki
cf0cd5b50b Merge pull request #7823 from kanemontreuil/consolidate-gitignore
Consolidate log files
2016-11-03 09:26:48 -07:00
liusi
0e9d973715 toggle thick_frame_ along with resizable change 2016-11-03 12:13:06 +08:00
Zeke Sikelianos
cc18670ae1 Merge pull request #7854 from electron/fix-ipc-docs
Fix the IPC docs so the docs-linter finds the methods
2016-11-02 20:14:47 -07:00
Samuel Attard
6228ce3f35 Fix the IPC docs so the docs-linter finds the methods 2016-11-03 14:04:03 +11:00
Kevin Sawicki
89511bb0cb Merge pull request #7847 from tinydew4/translate-ko
[ko] Add net document on README.md
2016-11-02 09:23:54 -07:00
Kevin Sawicki
11bc993344 Merge pull request #7846 from thomsonreuters/net-doc-samples
Documentation: Formatting JavaScript sample code.
2016-11-02 09:23:35 -07:00
tinydew4
9126ab6766 Add net document on README.md 2016-11-02 11:22:21 +00:00
ali.ibrahim
49cb675057 Fixing a trivial js lint issue. 2016-11-02 11:16:37 +01:00
ali.ibrahim
e8b119e636 Formatting JavaScript sample code. 2016-11-02 10:40:51 +01:00
Zeke Sikelianos
e8bb79310c document the process(es) in which APIs are available 2016-11-01 16:35:31 -07:00
Zeke Sikelianos
da3dbdcb9b Merge pull request #7837 from electron/lightweight-docs-linter
use docs linter with lots of stuff npmignored
2016-11-01 12:12:04 -07:00
Zeke Sikelianos
b400edcc88 use docs linter with lots of stuff npmignored 2016-11-01 10:45:29 -07:00
Kevin Sawicki
6580088574 Bump v1.4.5 2016-11-01 08:51:10 -07:00
Haojian Wu
794479519c Add missing net document entry. 2016-11-01 16:50:55 +01:00
Kevin Sawicki
97d468cf35 Merge pull request #7822 from tinydew4/translate-ko
Update the korean docs up to '379c347' commit.
2016-11-01 08:44:10 -07:00
Kevin Sawicki
af6a3b3173 Merge pull request #7821 from electron/lint-net-docs
use new docs linter with support for the new net APIs
2016-11-01 08:43:46 -07:00
Kevin Sawicki
0c8160bfe3 Merge pull request #7820 from tinydew4/trimming
Trim: docs/api/net.md
2016-11-01 08:43:28 -07:00
Kane Montreuil
a584acef46 Consolidate log files 2016-11-01 00:47:34 -04:00
tinydew4
691ad97abe Update the korean docs up to '379c347' commit.
Swap two debugging tutorials with each other.
2016-11-01 04:20:23 +00:00
tinydew4
836cd017a9 Trim: docs/api/net.md 2016-11-01 03:53:45 +00:00
Zeke Sikelianos
e70f8acf47 use new docs linter with support for the new net APIs 2016-10-31 20:53:13 -07:00
Zeke Sikelianos
721924b749 Merge pull request #7818 from electron/more-net-doc-fixes
fix formatting of new net API doc
2016-10-31 19:36:31 -07:00
liusi
7880d37d73 merge changes from master 2016-11-01 10:20:47 +08:00
Kevin Sawicki
ba6bb45f70 Merge pull request #7813 from electron/ready-to-show-spec
Add initial ready-to-show event spec
2016-10-31 16:28:09 -07:00
Zeke Sikelianos
379c3470c8 fix formatting of new net API doc 2016-10-31 15:48:06 -07:00
Kevin Sawicki
038718717c Add initial ready-to-show spec 2016-10-31 12:40:49 -07:00
Kevin Sawicki
b8f09ecf4f Merge pull request #7812 from electron/url-format-in-quick-start
Format URL passed to BrowserWindow.loadURL
2016-10-31 11:37:41 -07:00
Kevin Sawicki
e9a2792b55 Format URL passed to BrowserWindow.loadURL 2016-10-31 11:34:53 -07:00
Kevin Sawicki
aa3bc13ca3 Merge pull request #7788 from electron/notification-crash
Fix notification crash when using permission handler
2016-10-31 09:39:38 -07:00
Kevin Sawicki
ed3a2dae1b Merge pull request #7787 from julianengel/patch-1
Added example usage for the default port
2016-10-31 09:28:20 -07:00
Kevin Sawicki
48eaee0c0e Match example to node inspector doc 2016-10-31 09:27:42 -07:00
Kevin Sawicki
6b2848307d Merge pull request #7807 from electron/net-docs-fixup
Quick fix up of net docs
2016-10-31 09:23:07 -07:00
DaLun
651a2d4399 ZH_TW docs update (#7797)
* Update cookie.md

* Update cookie.md

* Update task.md

* ZH_TW docs /structures/cookie add

* Fix a word && add new docs

* Update task.md

* Update cookie.md

* new update
2016-10-31 09:21:56 -07:00
DaLun
7c48dd54e1 ZH_TW docs api/structures/cookie add (#7793)
* Update cookie.md

* Update cookie.md

* Update task.md

* ZH_TW docs /structures/cookie add

* Fix a word && add new docs

* Update task.md

* Update cookie.md
2016-10-31 09:21:43 -07:00
Zeke Sikelianos
5968346c1e Merge pull request #7809 from shiftkey/typos-for-net-docs
fixed a couple of typos
2016-10-31 09:16:32 -07:00
Zeke Sikelianos
266d3b553b Merge pull request #7745 from electron/inline-enums
update docs linter to add support for inline ENUM values
2016-10-31 09:05:05 -07:00
Kevin Sawicki
53ff706cd2 Upgrade brigthray for notification crash fix 2016-10-31 09:02:18 -07:00
Brendan Forster
651b0c0f82 fixed a couple of typos 2016-10-31 08:59:26 -07:00
Kevin Sawicki
3f8e173452 Call callback asynchronously to match original issue 2016-10-31 08:54:57 -07:00
Kevin Sawicki
078c924760 Upgrade brightray for notification crash fix 2016-10-31 08:54:57 -07:00
Kevin Sawicki
611614c649 Use equal/deepEqual for channel/args asserts 2016-10-31 08:54:57 -07:00
Kevin Sawicki
dda3fcef91 Add failing spec for notification permission crash 2016-10-31 08:54:56 -07:00
Cheng Zhao
92f8c105d9 Merge pull request #7766 from liusy182/window-size-restore
incorrect position when restored from maximize-on-top-drag under Windows #7630
2016-10-31 11:04:35 +09:00
Samuel Attard
4ee308fcc2 Quick fix up of net docs 2016-10-31 12:43:57 +11:00
Cheng Zhao
dfefa00a50 Merge pull request #7577 from thomsonreuters/net_module
net module
2016-10-31 10:31:56 +09:00
Zeke Sikelianos
44146009ad Merge pull request #7795 from LaurentLeVan/master
[docs-translations\fr-FR]Add section supported platforms
2016-10-30 09:40:22 -07:00
Laurent Le Van
b376c29937 [docs-translations/fr-FR]Correct some typos (double space deletion and 'de' to 'ne') in supported-platforms.md 2016-10-30 14:22:35 +02:00
liusy182
c657186920 address review comments 2016-10-30 09:50:22 +08:00
Laurent Le Van
f613d8d0d0 [docs-translations\fr-FR]Add of the tutorial folder and create supported-platforms.md in French 2016-10-29 18:10:57 +03:00
Kevin Sawicki
a506df4d25 Merge pull request #7791 from electron/io-doc-link-fix
Fix README link to Mac debug instructions
2016-10-28 14:49:43 -07:00
Ian Olsen
a0772dbbe9 fix link to Mac debug instructions 2016-10-28 14:32:48 -07:00
Kevin Sawicki
f603e47226 Merge pull request #7785 from tinydew4/translate-ko
[ko] Update the korean docs up to '2006d64' commit.
2016-10-28 09:46:28 -07:00
Julian Engel
4b0b875d6f Added example usage for the default port
According to Issue ##7756 I added the example usage.
2016-10-28 18:04:51 +03:00
tinydew4
d50cabddc0 [ko] Update the korean docs up to '2006d64' commit. 2016-10-28 08:42:57 +00:00
Kevin Sawicki
cbda2a3e60 Merge pull request #7770 from vitaliel/patch-1
Fixed typo in ru-RU/tutorial/application-distribution.md
2016-10-27 10:43:11 -07:00
Kevin Sawicki
2006d64939 Merge pull request #7757 from crilleengvall/master
Adding documentation about hidden-inset
2016-10-28 02:42:57 +09:00
Kevin Sawicki
d9f3355dea Remove excess newlines 2016-10-27 10:42:31 -07:00
Kevin Sawicki
c8263a9a18 Add newlines and backticks 2016-10-27 10:41:43 -07:00
Kevin Sawicki
6d2e9f5311 Merge pull request #7753 from tinydew4/translate-ko
[ko] Update the korean docs up to '02a7094' commit.
2016-10-28 02:40:08 +09:00
Kevin Sawicki
bb6d15ee10 Merge pull request #7750 from bheart/master
Document the fact that Accelerators are used by the globalShortcut module
2016-10-28 02:39:46 +09:00
Kevin Sawicki
56f7aceec7 Merge pull request #7743 from doraeric/trans-zhtw
add zh-tw docs
2016-10-28 02:38:00 +09:00
Vitalie Lazu
933e013e7e Fixed typo 2016-10-27 14:58:16 +03:00
liusi
a2b3abbf47 incorrect position when restored from maximize-on-top-drag under Windows #7630 2016-10-27 17:42:43 +08:00
liusi
c61414e11b fix for Window hidden behind taskbar after maximize #7672 2016-10-27 17:14:31 +08:00
Christian Engvall
29470dd018 Adding documentation about hidden-inset 2016-10-26 21:33:48 +02:00
Zeke Sikelianos
ed878b400e Merge pull request #7752 from tinydew4/clean-up
Clean unnecessary sentences on web-contents.md
2016-10-26 11:40:23 -07:00
tinydew4
fbe4394bbd Clean unnecessary sentences on web-contents.md 2016-10-26 15:41:47 +00:00
tinydew4
3e0d8841ea Update the korean docs up to '02a7094' commit. 2016-10-26 15:36:06 +00:00
Will Tange
aeb774730b Link Accelerator docs to globalShortcut module
Usage of Accelerators (i.e. `globalShortcut.register`) is now documented in the Accelerator docs themselves.
2016-10-26 14:48:09 +02:00
ali.ibrahim
6d92457095 Fixing code review issues: refactoring emit methods using CustomEmit. 2016-10-26 11:10:15 +02:00
Zeke Sikelianos
8fa3057e19 update docs linter to add support for inline ENUM values 2016-10-25 23:48:48 -07:00
Zeke Sikelianos
eed8f201e2 Merge pull request #7741 from electron/shuffle-bw-docs
Clean up nested objects and string ENUMS in the docs
2016-10-25 23:47:32 -07:00
Zeke Sikelianos
0add800240 Merge pull request #7715 from electron/docs-linter-function-param-types
update docs linter to support parsing of function parameter types
2016-10-25 23:42:50 -07:00
doraeric
9356843e27 add zh-tw docs 2016-10-26 14:09:36 +08:00
Samuel Attard
02a7094529 Follow docs style guide for string ENUMS 2016-10-26 16:19:41 +11:00
Samuel Attard
76da80c5e9 Further clean up 2016-10-26 16:18:55 +11:00
Samuel Attard
7078ed80fa Move webPreferences and titleBarStyle to the correct place in the docs
In their previous location `electron-docs-linter` would not output an Object structure for `webPreferences` (which is a key part of the constructor)
2016-10-26 14:31:30 +11:00
Cheng Zhao
e97d3c21a3 Merge pull request #7719 from electron/find-pasteboard
Add macOS find pasteboard support
2016-10-26 11:23:14 +09:00
Kevin Sawicki
9e266642f9 Merge pull request #7592 from frontapp/master
Preview file with QuickLook
2016-10-26 10:12:15 +09:00
Kevin Sawicki
0f5bfadd2b Merge pull request #7740 from mauriciofauth/pt-br/api/window-open
Update docs-translations/pt-BR/api/window-open.md
2016-10-26 09:58:48 +09:00
Kevin Sawicki
d85c4da11b Minor formatting tweaks 2016-10-26 09:55:34 +09:00
Kevin Sawicki
d982376fc4 filename -> displayName 2016-10-26 09:47:38 +09:00
Pierre Laurac
d26601f695 Convention naming 2016-10-26 09:07:38 +09:00
Pierre Laurac
0ec57cca32 last linter commit 2016-10-26 09:06:50 +09:00
Pierre Laurac
cf5fc3f922 more linter 2016-10-26 09:06:44 +09:00
Pierre Laurac
1f60aff73d linter 2016-10-26 09:06:39 +09:00
Pierre Laurac
9b19e6ee38 Changing names and memory leak fix 2016-10-26 09:05:42 +09:00
Pierre Laurac
6bac17fb9a Linter 2016-10-26 09:05:36 +09:00
Pierre Laurac
e759ce72b5 Using UTF8 String for filepath and filename 2016-10-26 09:05:27 +09:00
Pierre Laurac
b44371f4bf filename as Optional argument 2016-10-26 09:05:01 +09:00
Pierre Laurac
9736dc3115 Specifying macOS only method 2016-10-26 09:04:30 +09:00
Pierre Laurac
18ac4178fe Validation with linter 2016-10-26 09:04:22 +09:00
Pierre Laurac
2f7cceb11c Removing extra line break 2016-10-26 09:03:55 +09:00
Pierre Laurac
002462ce7b Removing unused header dependencies 2016-10-26 09:03:49 +09:00
Pierre Laurac
4d305b06d1 Adding documentation 2016-10-26 09:03:14 +09:00
Pierre Laurac
9673cee4d7 Using string from the std 2016-10-26 09:02:36 +09:00
Pierre Laurac
526debb5ab Adding easy way to preview files 2016-10-26 09:02:29 +09:00
Pierre Laurac
fb444f646b default template for PreviewFile 2016-10-26 09:02:21 +09:00
Kevin Sawicki
26f76f8d41 Merge pull request #7739 from electron/fix-incorrect-types-registerURLSchemeAsPrivileged
Update web-frame.md
2016-10-26 08:50:20 +09:00
Maurício Meneghini Fauth
9ae18c6194 📝 Update docs-translations/pt-BR/api/window-open.md [ci skip] 2016-10-25 21:48:22 -02:00
Samuel Attard
9e425cd01e Update web-frame.md 2016-10-26 10:04:18 +11:00
Zeke Sikelianos
171b901c61 Merge pull request #7736 from mauriciofauth/pt-br/readme
Fix links in docs-translations/pt-BR/README.md
2016-10-25 14:18:01 -07:00
Zeke Sikelianos
fbade9305c Merge pull request #7730 from tinydew4/translate-ko
[ko] Update the korean docs depend on the '1c7d5df' commit.
2016-10-25 13:55:42 -07:00
Maurício Meneghini Fauth
082cd9b72c 📝 Fix links in docs-translations/pt-BR/README.md [ci skip] 2016-10-25 15:53:33 -02:00
ali.ibrahim
e9db926b48 Fixing code review issues: fixing linter issues in spec file. 2016-10-25 16:55:17 +02:00
ali.ibrahim
bdb3f4d4cb Fixing code review issues: adding some test cases for partition/session options. 2016-10-25 16:19:26 +02:00
ali.ibrahim
b44d5290e2 Fixing code review issues: adding a partition options and making the session option only takes Session objects. 2016-10-25 15:47:54 +02:00
tinydew4
6a36deec3b Update the korean docs depend on the '1c7d5df' commit. 2016-10-25 13:34:48 +00:00
ali.ibrahim
6d7f179a9b Fixing code review issues: making delegate_ a raw pointer. 2016-10-25 15:02:35 +02:00
ali.ibrahim
61278f9ace Fixing code review issues. 2016-10-25 12:41:01 +02:00
Kevin Sawicki
7ffc1faf5b Document read/writeFindText 2016-10-25 14:16:40 +09:00
Kevin Sawicki
1c3b5835f4 Add spec for read/write find text 2016-10-25 14:15:54 +09:00
Kevin Sawicki
1718697ef0 Read/write find pasteboard text via IPC in renderer process 2016-10-25 14:15:54 +09:00
Kevin Sawicki
144a61c5a3 Add find text support to clipboard 2016-10-25 14:15:54 +09:00
Kevin Sawicki
f7bf8c4fdc Merge pull request #7718 from mike-engel/mengel/update-docs
Clarify the setMenuBarVisibility api
2016-10-25 13:08:37 +09:00
Mike Engel
6f64ad30cb Clarify the setMenuBarVisibility api
The setMenuBarVisibility api is only supported on Windows and Linux.
This adds some minor documentation to make that clearer. Fixes #7686
2016-10-24 22:04:45 -06:00
Kevin Sawicki
1c7d5df2fe Merge pull request #7717 from electron/doc-lists
Add newlines before lists
2016-10-25 12:40:32 +09:00
Kevin Sawicki
65e6da2673 Add newlines before lists 2016-10-25 12:38:08 +09:00
Kevin Sawicki
39a5c7dab9 Merge pull request #7631 from beakerbrowser/webview-policy-flags2
Add 'webpreferences' attribute to webview
2016-10-25 12:14:25 +09:00
Kevin Sawicki
b4cc3541a8 Minor tweaks to webpreferences docs 2016-10-25 12:08:19 +09:00
Kevin Sawicki
68c2c9825f Remove lint warnings 2016-10-25 10:36:43 +09:00
Kevin Sawicki
3aad6a0c99 Use forEach and destructuring for parsing features 2016-10-25 10:31:50 +09:00
Kevin Sawicki
2556ed8744 Add parse-features-strings.js 2016-10-25 10:28:36 +09:00
Paul Frazee
f35536bdc5 factor out parse-features-string.js 2016-10-24 20:21:42 -05:00
Cheng Zhao
775328d5d5 Merge pull request #7707 from electron/focus-window-on-menu-bar-click
Focus window on menu bar click
2016-10-25 09:09:45 +09:00
Zeke Sikelianos
1a03e62717 update docs linter to support parsing of function parameter types 2016-10-24 12:04:37 -07:00
Kevin Sawicki
31b4f61815 Merge pull request #7651 from deepak1556/session_cert_verifier_patch
session: exclude hosts from CT verification if they are handled by custom cert verifiers
2016-10-24 16:53:04 +09:00
Kevin Sawicki
076e033236 Merge pull request #7711 from tinydew4/translate-ko
[ko] Apply the changes till the 'a2a4462' commit.
2016-10-24 16:49:37 +09:00
tinydew4
2c50f14346 Apply the changes till the 'a2a4462' commit. 2016-10-24 07:41:15 +00:00
Kevin Sawicki
82e593b44f Merge pull request #7709 from tinydew4/translate-ko
[ko] 	Apply the changes till the 'b2559d7' commit.
2016-10-24 16:36:58 +09:00
Kevin Sawicki
224d2ca93c Merge pull request #7710 from electron/web-frame-lint
Remove RegisterURLSchemeAsPrivileged lint error
2016-10-24 16:29:10 +09:00
Kevin Sawicki
0841c4291a Remove RegisterURLSchemeAsPrivileged lint error 2016-10-24 16:27:54 +09:00
Kevin Sawicki
271733fc53 Add tests for ses.setCertificateVerifyProc 2016-10-24 16:12:49 +09:00
Kevin Sawicki
a2a44621fd Merge pull request #7708 from tinydew4/fix-typo
Fix typo, and trimming.
2016-10-24 16:12:29 +09:00
Cheng Zhao
ad48aeeea4 Merge pull request #7665 from beakerbrowser/privilegedschemeopts
Add options to webFrame.registerURLSchemeAsPrivileged
2016-10-24 15:56:18 +09:00
Kevin Sawicki
83f47bc980 Upgrade brighray for RequireCTDelegate 2016-10-24 15:44:21 +09:00
tinydew4
67a09d9fe0 Fix typo, and trimming. 2016-10-24 06:34:09 +00:00
tinydew4
189ae97732 Apply the changes till the 'b2559d7' commit. 2016-10-24 06:32:28 +00:00
Kevin Sawicki
632739ec6e Merge pull request #7590 from electron/docs-cleanup
Cleanup docs and standardize structs
2016-10-24 15:13:39 +09:00
Cheng Zhao
88ac376382 Merge pull request #7628 from deepak1556/geo_request_context_patch
browser: fix race in creation of default browser context by AtomAccessTokenStore
2016-10-24 14:57:37 +09:00
Kevin Sawicki
b2559d7d28 Merge pull request #7596 from electron/function-param-types
Function param types
2016-10-24 12:40:41 +09:00
Kevin Sawicki
98387e50cc Focus window on menu bar click 2016-10-24 11:49:51 +09:00
Constantin Dumitrescu
93464b8100 [ci skip] Update docs/README.md to point to the right location of styleguide.md (#7697) 2016-10-24 10:22:22 +09:00
kok liu
52783bb67f update the zh-CN docs README.md and find a error in en docs README.md (#7676)
* update the zh-CN readme and find a error in en readme

* fix a style problem
2016-10-24 10:21:02 +09:00
Kevin Sawicki
c90d4abcf0 Merge pull request #7654 from scotttrinh/flash-frame-doc
📝 Add flashFrame to desktop env integration
2016-10-24 10:20:08 +09:00
Kevin Sawicki
6f85d85c12 Minor tweaks to flash frame section 2016-10-24 10:19:51 +09:00
Kevin Sawicki
280235872b Add flashframe link 2016-10-24 10:14:52 +09:00
Kevin Sawicki
e93eaed5d0 Merge pull request #7666 from amtj/issue#6939
📝Remove ambiguous default value of nodeintegration Issue #6939
2016-10-24 09:54:46 +09:00
Kevin Sawicki
32cff67fd4 Merge pull request #7641 from rogerlista/master
📝 Link to README.md pt-br [ci skip]
2016-10-24 09:19:08 +09:00
Kevin Sawicki
d3f40212db Merge pull request #7622 from Haraldson/flash-trust
Add a note on Flash permissions to Troubleshooting
2016-10-24 09:16:07 +09:00
Zeke Sikelianos
11ad9e7f25 Merge pull request #7650 from davej/patch-3
Docs: Fix relative link to MAS builds tutorial
2016-10-22 23:51:59 +09:00
ali.ibrahim
0c44d19249 net module: documenting the session property. 2016-10-20 15:48:36 +02:00
ali.ibrahim
7c17aeb6da Documenting net module: fixing linter issues. 2016-10-20 14:42:15 +02:00
ali.ibrahim
8c19d3b210 Documenting net module: various fixes. 2016-10-20 13:57:08 +02:00
ali.ibrahim
9f15191280 Formatting net documentation. 2016-10-20 12:30:03 +02:00
ali.ibrahim
69790bd7ed Documenting ClientRequest constructor options. 2016-10-20 11:58:06 +02:00
ali.ibrahim
fdfa0f4a6d Documenting the login event. 2016-10-20 11:45:45 +02:00
ali.ibrahim
7f8b180f70 Fixing authentication cancel with null/undefined credentials. 2016-10-20 11:43:26 +02:00
tinydew4
43ae784a40 Translate releasing 2016-10-20 08:58:48 +00:00
Kevin Sawicki
6a4d9f8a87 Merge pull request #7674 from electron/tweak-releasing-doc
Push after bumping version
2016-10-20 16:12:33 +09:00
Kevin Sawicki
e2c646a14b Push after bumping 2016-10-20 11:34:51 +09:00
Kevin Sawicki
337db9fbb9 Merge pull request #7660 from electron/document-release-process
Document release process
2016-10-20 11:31:51 +09:00
Zeke Sikelianos
63267031e9 💲 2016-10-20 11:30:36 +09:00
Zeke Sikelianos
88b288502a Add note about Python HTTPS warning 2016-10-20 11:29:02 +09:00
Zeke Sikelianos
b0fb0c6492 Document S3 creds 2016-10-20 11:22:32 +09:00
Zeke Sikelianos
3a44663003 Add note about setting $ELECTRON_GITHUB_TOKEN 2016-10-20 11:19:18 +09:00
Zeke Sikelianos
147addbce1 Bump v1.4.4 2016-10-20 09:17:29 +09:00
ali.ibrahim
7549adcfce Documenting net module: various fixes. 2016-10-19 18:31:08 +02:00
ali.ibrahim
fddbde2fd5 Documenting net module: various fixes. 2016-10-19 18:19:28 +02:00
ali.ibrahim
6e5951b764 Documenting net module: formatting. 2016-10-19 18:11:07 +02:00
ali.ibrahim
3b620b8c0c Documenting net module: various fixes. 2016-10-19 18:05:38 +02:00
ali.ibrahim
0d82fbcf37 Documenting net.IncomingMessage. 2016-10-19 16:51:44 +02:00
ali.ibrahim
5cd20a8e5d Documenting net.ClientRequest 2016-10-19 15:34:21 +02:00
Amitoj
4ff73d8b56 📝 Small tweaks
[ci skip] Remove ambiguous default value of nodeintegration.
Issue #6939
2016-10-19 13:38:46 +05:30
ali.ibrahim
f651b21cda Fixing net doc file name. 2016-10-19 09:24:59 +02:00
Zeke Sikelianos
7a73c0189f bump-release -> bump-version 2016-10-19 11:40:40 +09:00
Paul Frazee
0345b62369 update webFrame.registerURLSchemeAsPrivileged docs to be more specific 2016-10-18 17:13:33 -05:00
Amitoj
3a31f28f27 📝Remove ambiguous default value of nodeintegration
Remove ambiguous default value for nodeintegration in webview.
Issue #6939
2016-10-19 02:38:29 +05:30
Paul Frazee
a5c62bb264 add options to webFrame.registerURLSchemeAsPrivileged 2016-10-18 15:52:41 -05:00
ali.ibrahim
9bddc2cbaa Adding net documentation skeleton. 2016-10-18 19:14:43 +02:00
ali.ibrahim
43113fcfb4 Fixing net response objects being piped into writable streams test. 2016-10-18 10:28:35 +02:00
Zeke Sikelianos
6b207d65bf update releasing 2016-10-18 14:04:52 +09:00
Samuel Attard
9d0d1c8341 Fix bd object name 2016-10-18 15:47:18 +11:00
Zeke Sikelianos
82a16ee41f document the electron release process 2016-10-18 13:41:57 +09:00
Kevin Sawicki
104f8d6057 Merge pull request #7659 from electron/jacob/ally
Fire a11y event on touch screens using screen readers
2016-10-18 13:41:48 +09:00
Jacob Groundwater
9c9ba80978 Fire a11y event on touch screens using screen readers 2016-10-18 13:28:32 +09:00
Scott Trinh
a06a1fa262 📝 Add flashFrame to desktop env integration 2016-10-17 16:22:45 -04:00
ali.ibrahim
c198828e58 Adding gc tests: fixing a memory leak with C++ URLRequest objects. 2016-10-17 19:02:25 +02:00
Cheng Zhao
cbe9768529 Merge pull request #7566 from electron/always-shorten-path
Shorten Socket path for makeSingleInstance in sandboxed apps
2016-10-17 20:43:51 +08:00
Cheng Zhao
ce847fc3ca Merge pull request #7578 from electron/windows-logging
Show console output from Windows when ELECTRON_RUN_AS_NODE is set
2016-10-17 20:22:39 +08:00
deepak1556
5cbbd6efe6 session: exclude hosts from CT verification if they are handled by custom cert verifiers 2016-10-17 16:35:28 +05:30
Dave Jeffery
00d641aaf7 Docs: Fix relative link to MAS builds tutorials
The link was 404'ing
2016-10-17 11:26:28 +01:00
ali.ibrahim
9b4e9c642a Making test code run directly in main browser context to avoid rpc persistent handles. 2016-10-17 11:51:20 +02:00
ali.ibrahim
c6ae27c7c9 Adding a stability test: non referenced, unused requests are collected without crash. 2016-10-17 10:38:10 +02:00
Rogério
9ead3ad0a0 📝 Link to README.md pt-br [ci skip] 2016-10-15 21:01:37 -03:00
Paul Frazee
e7962c7ba2 fixes and tests for webview 'webpreferences' attr 2016-10-14 18:04:33 -05:00
Paul Frazee
194b14100e add the 'webpreferences' attribute to webviews 2016-10-14 17:16:39 -05:00
Kevin Sawicki
3dd8377218 Merge pull request #7611 from electron/only-enable-msaa-if-needed
Check harder before enabling Accessibility support on Win32
2016-10-14 12:46:32 -07:00
deepak1556
bd34db256b browser: fix race in creation of default browser context by AtomAccessTokenStore 2016-10-15 01:00:54 +05:30
Paul Betts
6fdf40b038 Code Cleanup 2016-10-14 12:17:32 -07:00
Kevin Sawicki
988e2334f5 Merge pull request #7614 from tinydew4/translate-ko
[ko] Apply the changes till the '9367c76' commit.
2016-10-14 09:19:04 -07:00
ali.ibrahim
0e13b8dd01 making the net module usable only after the ready event. 2016-10-14 17:57:37 +02:00
ali.ibrahim
ac9e6eda95 Fixing a crash with pending URLRequests on shutdown. 2016-10-14 17:37:39 +02:00
Samuel Attard
ba91bbd397 Fix spaces 2016-10-14 22:54:04 +11:00
Hein Haraldson Berg
63e1b2fb46 Add a note on Flash permissions to Troubleshooting 2016-10-14 12:51:26 +02:00
ali.ibrahim
c0c9e3ac3d Formatting C++ code using ClangFormat. 2016-10-14 11:51:45 +02:00
ali.ibrahim
4347ce4a53 Formatting C++ code using ClangFormat. 2016-10-14 11:50:47 +02:00
ali.ibrahim
9cc8bfae1c fixing space formatting issues. 2016-10-14 10:58:16 +02:00
tinydew4
741ae488d5 Apply the changes till the '9367c76' commit. 2016-10-14 02:24:27 +00:00
Samuel Attard
10ef6749b3 Source -> DesktopCapturerSource 2016-10-14 13:10:37 +11:00
Samuel Attard
32c3f17f5a Rename dcs object 2016-10-14 13:00:03 +11:00
Samuel Attard
ad45c084cc Fix uploaddata naming 2016-10-14 11:37:36 +11:00
Kevin Sawicki
a13ed2a005 Merge pull request #7610 from LShun/patch-1
Word addition and revision for Readme,md
2016-10-13 14:18:56 -07:00
Kevin Sawicki
9367c764be Merge pull request #7608 from nabeelomer/master
Add further information to online-offline event documentation
2016-10-13 14:17:07 -07:00
Kevin Sawicki
4f57b685bd Add backticks around true/false values 2016-10-13 14:16:37 -07:00
Kevin Sawicki
902a8c57bd Merge pull request #7602 from danburzo/cli_switches_docs
Docs: Command-line switches -- note about node.js flags, added debug flags
2016-10-13 14:13:08 -07:00
Kevin Sawicki
21cfd330c0 Switch from node man to node --help 2016-10-13 14:11:56 -07:00
Long Nhat Nguyen
c017a7a1c7 Update url (#7598)
* Update EventEmitter URL

* Update EventEmitter URL

* Enable click

* Update EventEmitter URL

* Update EventEmitter URL

* Update URL

* Update URL

* Update EventEmitter URL

* Tweak sentence and add perios
2016-10-13 14:09:14 -07:00
Kevin Sawicki
0756aa663b Merge pull request #7587 from electron/update-standard
Update standard to v8 to be inline with standard-markdown
2016-10-13 14:04:24 -07:00
Kevin Sawicki
4ee94917a0 Merge pull request #7576 from tinydew4/translate-ko
Apply the changes of docs on ko-KR
2016-10-13 13:56:39 -07:00
Paul Betts
0df21afcdf Check harder before enabling Accessibility support 2016-10-13 11:46:55 -07:00
ali.ibrahim
de29f2dde5 Fixing build: removing constness on net::HttpResponseHeaders as otherwise we would need a change in libchromiumcontent. 2016-10-13 17:51:19 +02:00
ali.ibrahim
6f5b0a28c5 Fixing code review issues: function call formatting, renaming JS member variables, refactoring response headers conversion. 2016-10-13 17:14:23 +02:00
LShun
433a825006 Word addition and revision for Readme,md
I edited some words as well as added some information ( for example the License ) that was missing in the translation but found in the main site README.md,
2016-10-13 22:58:48 +08:00
Nabeel Omer
4f288e3ba2 Update 2016-10-13 20:22:40 +05:30
Nabeel Omer
392b59be4e Made relevant changes 2016-10-13 20:12:44 +05:30
Nabeel Omer
6d8d211631 Update online-offline-events.md 2016-10-13 19:45:39 +05:30
Dan Burzo
af17253a72 Changed link to Node docs in MD reference format 2016-10-13 13:03:29 +03:00
Dan Burzo
cfdea04c83 Added note about sending flags to Node.js, additional debug flags 2016-10-13 12:54:22 +03:00
Samuel Attard
5cf03e68d4 Fix missing type 2016-10-13 17:33:12 +11:00
Samuel Attard
20323e7032 Specifiy function param types in docs 2016-10-13 17:30:57 +11:00
Samuel Attard
78343a62b8 Cleanup docs and standardize structs 2016-10-13 14:38:06 +11:00
Zeke Sikelianos
7584e73d70 Merge pull request #7580 from electron/docs-linter-rectangle-rename
Update docs linter with Rectangle structure fixes
2016-10-12 19:06:44 -07:00
Samuel Attard
eac5ba4c56 Fix spec linting issues 2016-10-13 12:47:43 +11:00
Samuel Attard
a9d5699a52 Update standard to v8 to be inline with standard-markdown 2016-10-13 12:46:00 +11:00
tinydew4
4e08264522 Apply the changes on early Oct 13, 2016 2016-10-13 00:49:20 +00:00
tinydew4
6b39e4a210 Apply the changes about #7379 to ko_KR 2016-10-13 00:34:39 +00:00
tinydew4
4a1c8f6cb7 Apply the changes 2016-10-13 00:33:12 +00:00
tinydew4
468d5f6c7a Apply the changes on Oct 12, 2016 2016-10-13 00:32:05 +00:00
Kevin Sawicki
a8382d6794 Moving atom_bindings include to Windows block 2016-10-12 13:48:49 -07:00
Kevin Sawicki
e899050500 Add basic test of spawned ELECTRON_RUN_AS_NODE process 2016-10-12 13:48:49 -07:00
Kevin Sawicki
b01fd9715b Only expose process.log on Windows 2016-10-12 13:48:48 -07:00
Kevin Sawicki
0417a3e51e Upgrade node for process logging fix patch 2016-10-12 13:48:48 -07:00
Kevin Sawicki
0740b2f66b Reuse Log method 2016-10-12 13:48:48 -07:00
Kevin Sawicki
d686916fe2 Expose process.log when running as node 2016-10-12 13:48:48 -07:00
Kevin Sawicki
fefc7c23f9 Merge pull request #7479 from bpasero/process-no-asar
Introduce ELECTRON_NO_ASAR
2016-10-12 13:48:03 -07:00
Kevin Sawicki
cef7525d00 Merge pull request #7583 from torn4dom4n/master
Update devDependency Status URL
2016-10-12 13:20:16 -07:00
Long Nhat Nguyen
b448b0c796 Update devDependency Status URL
[ci skip]
2016-10-12 20:17:26 +00:00
Kevin Sawicki
a97dc6d17a Merge pull request #7570 from preco21/korean-docs-12
docs: Update Korean docs as upstream and small improves
2016-10-12 13:06:02 -07:00
Kevin Sawicki
fcfc13c1ea Merge pull request #7579 from electron/tweak-about-panel-key-names
Use lower-case about panel option keys
2016-10-12 11:32:01 -07:00
Kevin Sawicki
1e4ef195bb Use lower-case about panel option keys 2016-10-12 11:18:21 -07:00
Kevin Sawicki
566d76def2 Mention spawning with ELECTRON_RUN_AS_NODE 2016-10-12 11:11:27 -07:00
Kevin Sawicki
f553d16539 Only support ELECTRON_NO_ASAR in non browser/renderer processes 2016-10-12 11:11:27 -07:00
Kevin Sawicki
8897a7a926 Add specs for ELECTRON_NO_ASAR env var 2016-10-12 11:11:27 -07:00
Benjamin Pasero
656ee0d9c3 introduce ELECTRON_NO_ASAR 2016-10-12 11:11:27 -07:00
Zeke Sikelianos
ecc03fdd40 update docs linter with Rectangle structure fixes 2016-10-12 11:04:53 -07:00
ali.ibrahim
b290415bbd Fixing build on Mac OS 2016-10-12 19:41:13 +02:00
ali.ibrahim
16069cd477 Commenting some test code. 2016-10-12 17:13:06 +02:00
ali.ibrahim
ae1c33b863 fixing linter issues. 2016-10-12 14:54:32 +02:00
ali.ibrahim
d21def7b8d Fixing various issues in tests. 2016-10-12 14:54:32 +02:00
ali.ibrahim
bd5e622bec Adding request/response piping tests. 2016-10-12 14:54:31 +02:00
ali.ibrahim
a5c508d2d7 Adding abort, webRequest interception and creation tests. 2016-10-12 14:54:31 +02:00
ali.ibrahim
b731ca50bc Adding HTTP request headers manipulation tests. 2016-10-12 14:54:30 +02:00
ali.ibrahim
4eb9fc1bb6 Adding chunked uploading test. 2016-10-12 14:54:29 +02:00
ali.ibrahim
9b94dfcbdc Adding basic http tests, fixing issues in ClientRequest constructor. 2016-10-12 14:54:29 +02:00
Ali Ibrahim
046f48db51 Fixing build on Linux 2016-10-12 14:54:28 +02:00
ali.ibrahim
b57ffbf1ab Temporary fix for the post data test. 2016-10-12 14:54:28 +02:00
ali.ibrahim
42bae9d71d Making the HTTP response a full-fledged Readable stream. 2016-10-12 14:54:27 +02:00
ali.ibrahim
dcffb51e5e Adding net module spec file skeleton. 2016-10-12 14:54:26 +02:00
ali.ibrahim
8c5751e9f7 Adding systematic checks on the atom_request_ pointer as it may be reset to null. 2016-10-12 14:54:26 +02:00
ali.ibrahim
a655cca0a1 Request/Response state simplification. Removing redundant state flags. 2016-10-12 14:54:25 +02:00
ali.ibrahim
e472d11761 Caching response headers so that AtomURLRequest can be freed after the close event. 2016-10-12 14:54:25 +02:00
ali.ibrahim
ec1fc5a17b Implementing error, close, finish, abort events management. 2016-10-12 14:54:24 +02:00
ali.ibrahim
bde30b90e8 Adding some implementation comments. Enforcing Chromium coding conventions. 2016-10-12 14:54:23 +02:00
ali.ibrahim
42adb2afd4 Fixing lint-js issues. 2016-10-12 14:54:22 +02:00
ali.ibrahim
0588435882 Fixing cpplint issues. 2016-10-12 14:54:22 +02:00
ali.ibrahim
08947682b0 Implementing abort workflow, emitting error events. 2016-10-12 14:54:21 +02:00
ali.ibrahim
cbbc4376ca Adding support for upload chunked encoding. 2016-10-12 14:54:20 +02:00
ali.ibrahim
9498a5738a Refactoring net module, adding a ClientRequest and IncomingMessage classes. 2016-10-12 14:54:20 +02:00
ali.ibrahim
fcaf9cb031 Some code cleaning. 2016-10-12 14:54:19 +02:00
ali.ibrahim
f7525d7877 Adding support for POST requests. 2016-10-12 14:54:18 +02:00
ali.ibrahim
2b3b41d5f9 Implementing authentication callback. 2016-10-12 14:54:18 +02:00
ali.ibrahim
2d9d4af98d Implementing URLRequest API, getting response body. 2016-10-12 14:54:17 +02:00
ali.ibrahim
81eab9887b Adding URLResponse to emit response events, implementing status code. 2016-10-12 14:54:16 +02:00
ali.ibrahim
7521aeea09 Implement URLRequest::Delegate, handle thread sync. 2016-10-12 14:54:15 +02:00
ali.ibrahim
e8d4abe78f Adding net module and URLRequest class. 2016-10-12 14:54:15 +02:00
Cheng Zhao
46cd8708a4 Merge pull request #7561 from electron/windows-system-colors
Support retrieving Windows system colors
2016-10-12 15:35:18 +09:00
Zeke Sikelianos
27e1938e9f Merge pull request #7471 from electron/update-standard-markdown
Use standard style JavaScript in all docs translations
2016-10-11 22:37:54 -07:00
Zeke Sikelianos
17198c26d9 update standard-markdown 2016-10-11 22:37:32 -07:00
Zeke Sikelianos
eaeebd3ebd use newer function syntax 2016-10-11 22:37:32 -07:00
Zeke Sikelianos
253a383168 standardize docs-translations by hand 2016-10-11 22:37:32 -07:00
Zeke Sikelianos
3e4a0705e9 standardize docs 2016-10-11 22:37:32 -07:00
Zeke Sikelianos
7ef374477d lint docs-translations with standard-markdown 2016-10-11 22:36:11 -07:00
Zeke Sikelianos
4ae6103356 auto-standardize javascript in docs-translations 2016-10-11 22:36:11 -07:00
Zeke Sikelianos
2e4322c230 update to new standard-markdown with --fix feature 2016-10-11 22:36:11 -07:00
Zeke Sikelianos
6b7e375963 Merge pull request #7379 from electron/seperate-structs
Move reused object structures to a standard structures folder
2016-10-11 22:28:39 -07:00
Zeke Sikelianos
c46c1dbb1e Merge pull request #7505 from electron/testing-docs
Update test dependencies and documentation
2016-10-11 22:28:16 -07:00
Plusb Preco
af79f4793e 📝 Improve grammar
[ci skip]
2016-10-12 12:24:21 +09:00
Plusb Preco
774a15f4c8 📝 Improve grammar
[ci skip]

* Use `formal` tense.
* Small fixes.
2016-10-12 12:24:14 +09:00
Plusb Preco
b7c4cde11a 📝 Adjust line wrap to 80
[ci skip]
2016-10-12 12:13:59 +09:00
Plusb Preco
9857aa25a3 📝 Update Korean docs as upstream
[ci skip]
2016-10-12 12:02:04 +09:00
Zeke Sikelianos
d4a8a64ba7 Merge pull request #7498 from electron/custom-props-in-menu-item-constructor
Preserve custom properties passed to MenuItem constructor
2016-10-11 14:24:13 -07:00
Zeke Sikelianos
af0098f064 remove badge count after each setBadgeCount test 2016-10-11 14:22:48 -07:00
Zeke Sikelianos
37c53f2e09 clarify mocha test exclusion 2016-10-11 14:22:48 -07:00
Zeke Sikelianos
a8e59ccd3d fix links to testing docs 2016-10-11 14:22:48 -07:00
Zeke Sikelianos
57852366bb mention building before testing 2016-10-11 14:22:48 -07:00
Zeke Sikelianos
a4832c304e unify testing docs for all platforms 2016-10-11 14:22:48 -07:00
Zeke Sikelianos
156d823b7f remove badge after setBadgeCount test finishes 2016-10-11 14:22:48 -07:00
Zeke Sikelianos
45d9cc6405 update test dependencies 2016-10-11 14:22:48 -07:00
Zeke Sikelianos
0aeb53435e add tips for testing 2016-10-11 14:22:48 -07:00
Paul Betts
7dd1ebc734 Fix oops typos 2016-10-11 14:02:29 -07:00
Kevin Sawicki
ce694760bc Remove const since SkColor is an int 2016-10-11 13:15:27 -07:00
Kevin Sawicki
c8189046fe Emit color-changed event on Windows 2016-10-11 13:15:27 -07:00
Kevin Sawicki
2656812dea Doc systemPreferences.getColor 2016-10-11 13:15:27 -07:00
Kevin Sawicki
1978b39337 Remove duplicate colors 2016-10-11 13:15:27 -07:00
Kevin Sawicki
e7bfd1c959 Add systemPreferences.getColor specs 2016-10-11 13:15:26 -07:00
Kevin Sawicki
663f8f4b54 Add systemPreferences.getColor on Windows 2016-10-11 13:15:26 -07:00
Kevin Sawicki
9b0a32f62c Add ToRGBHex color helper 2016-10-11 13:15:26 -07:00
Paul Betts
06065d1c5d Instead of gating the path shortening to MAS_BUILD, figure it out at runtime 2016-10-11 13:06:29 -07:00
Paul Betts
e84ae6e2aa Add a method to determine whether we're in the Apple sandbox 2016-10-11 13:06:29 -07:00
Kevin Sawicki
13f9a6c273 Merge pull request #7563 from rogerlista/master
📝 Translation of security.md to pt-BR [ci skip]
2016-10-11 10:06:02 -07:00
Rogério
d89b23c120 📝 Translation of security.md to pt-BR [ci skip] 2016-10-11 14:01:07 -03:00
Kevin Sawicki
479451e7c7 Merge pull request #7562 from odedhb/patch-1
Update mac-app-store-submission-guide.md
2016-10-11 10:00:56 -07:00
Oded Breiner
ea8a4f2b51 Update mac-app-store-submission-guide.md 2016-10-11 19:58:53 +03:00
Kevin Sawicki
e26189ba87 Merge pull request #7560 from electron/upgrade-brigthray
Upgrade brightray for devtools dock state preference fix
2016-10-11 09:48:39 -07:00
Kevin Sawicki
003522d6f7 Merge pull request #7558 from danburzo/build_instructions
Adds link to PyObjC installation instructions
2016-10-11 09:48:20 -07:00
Kevin Sawicki
4db6ccd579 Merge pull request #7555 from tinydew4/translate-ko
Apply the changes of docs to ko-KR
2016-10-11 09:47:51 -07:00
Kevin Sawicki
39aa740c88 Merge pull request #7552 from electron/fix-menu-docs
fix Menu API example
2016-10-11 09:47:30 -07:00
Kevin Sawicki
66f825beb1 Upgrade brightray for devtools dock state preference fix 2016-10-11 08:45:42 -07:00
Dan Burzo
75feeca0f0 Small fix to grammar in Build instructions (macOS) 2016-10-11 17:41:28 +03:00
Dan Burzo
120aa1c9ce Adds link to PyObjC installation instructions 2016-10-11 17:34:35 +03:00
tinydew4
7fa2ffc2a7 Apply the changes on Oct 11, 2016 2016-10-11 12:25:34 +00:00
tinydew4
15fae91ac7 Apply changes about crash-reporter 2016-10-11 12:06:32 +00:00
Cheng Zhao
4ae190dab9 Merge pull request #7549 from electron/about-panel-options
Support setting about panel options
2016-10-11 20:18:23 +09:00
Cheng Zhao
0baa60caab Merge pull request #7528 from electron/key-and-code-on-sent-input-events
Set key and code on sendInputEvent keyboard events
2016-10-11 19:34:05 +09:00
Cheng Zhao
2a3bcdcaab Merge pull request #7518 from electron/inverted-color-scheme
Support detecting inverted color scheme on Windows
2016-10-11 19:31:34 +09:00
Zeke Sikelianos
619f74fa12 fix Menu example 2016-10-10 23:01:35 -07:00
Zeke Sikelianos
8aaf029e55 remove unused var 2016-10-10 15:38:27 -07:00
Zeke Sikelianos
bcce7aff18 test that overrideProperty is not overwritten 2016-10-10 15:25:56 -07:00
Zeke Sikelianos
b575055d7e inherit user-specific MenuItem properties more safely 2016-10-10 14:40:49 -07:00
Kevin Sawicki
d5b3ef5380 Merge pull request #7548 from malept/electron-packager-mas-doc-fix
Docs: clarify ignoring object files with electron-packager
2016-10-10 13:50:41 -07:00
Kevin Sawicki
58ef0bea17 Doc app.setAboutPanelOptions 2016-10-10 13:40:57 -07:00
Kevin Sawicki
7de6a06acf Support setting about panel options 2016-10-10 13:30:58 -07:00
Zeke Sikelianos
2cd10d339f remove duplicated prop copying 2016-10-10 11:07:01 -07:00
Kevin Sawicki
38281f3364 Implement SysColorChangeListener directly on Windows 2016-10-10 10:43:09 -07:00
Kevin Sawicki
25bcc2dd0d 🎨 2016-10-10 10:43:09 -07:00
Kevin Sawicki
af27c62b07 Doc inverted-color-scheme-changed event 2016-10-10 10:43:08 -07:00
Kevin Sawicki
8b16b82ce9 Add inverted-color-scheme-changed event 2016-10-10 10:43:08 -07:00
Kevin Sawicki
223e9d97a0 Doc systemPreferences.isInvertedColorScheme 2016-10-10 10:43:08 -07:00
Kevin Sawicki
7b49d94e9f Add systemPreferences.isInvertedColorScheme API 2016-10-10 10:43:08 -07:00
Mark Lee
a677eb0f95 📝 clarify ignoring object files with electron-packager
Note that Electron Packager 8.1.0 ignores object files by default.
2016-10-10 13:08:36 -04:00
Kevin Sawicki
987579d391 Send initial keyDown before char event 2016-10-10 09:35:44 -07:00
Kevin Sawicki
99414065a9 Add char/keypress event tests 2016-10-10 09:35:44 -07:00
Kevin Sawicki
e4b0577cb0 Assert key and code in keyup input event spec 2016-10-10 09:35:44 -07:00
Kevin Sawicki
424afd3faf Update expected key and code values 2016-10-10 09:35:43 -07:00
Kevin Sawicki
6fac14ad3f Set key and code on keyboard events 2016-10-10 09:35:43 -07:00
Kevin Sawicki
d69367aa9b Add keydown sendInputEvent specs 2016-10-10 09:35:43 -07:00
Kevin Sawicki
2efb7a12cb Merge pull request #7544 from tinydew4/fix-docs
Fix dot
2016-10-10 09:19:13 -07:00
Kevin Sawicki
9f616b934b Merge pull request #7542 from Menq/patch-1
update
2016-10-10 09:18:41 -07:00
Kevin Sawicki
c016e83eb3 Merge pull request #7541 from tinydew4/translate-ko
Translate clang-format
2016-10-10 09:18:23 -07:00
Kevin Sawicki
7015dbf0d2 Merge pull request #7536 from rogerlista/master
📝 Translation of faq.md to pt-BR [ci skip]
2016-10-10 09:18:02 -07:00
tinydew4
9f42c4c441 Fix dot 2016-10-10 14:31:05 +00:00
孟强
1841f826fe update
rename electron-prebuild to electron
2016-10-10 17:08:26 +08:00
Cheng Zhao
e24267d060 Update brightray for #7503 2016-10-10 11:35:59 +09:00
Cheng Zhao
91591f37e6 Merge pull request #7500 from electron/store-crashes-in-configured-temp-dir
Store crash reports in configured temp dir
2016-10-10 10:19:02 +09:00
tinydew4
8875296338 Translate clang-format.md 2016-10-10 00:53:13 +00:00
Rogério
98eb8cd3c1 📝 Translation of faq.md to pt-BR [ci skip] 2016-10-09 10:56:55 -03:00
Zeke Sikelianos
2acd7f4d12 fix NativeImage link path 2016-10-07 21:25:39 -07:00
Samuel Attard
4d49156dac Rename bounds -> rectangle 2016-10-08 13:09:31 +11:00
Kevin Sawicki
c147e72c8e Merge pull request #7499 from electron/clang-format
Add a guide to use clang-format
2016-10-07 14:06:18 -07:00
Kevin Sawicki
f872799f5c Minor edits to clang-format guide 2016-10-07 14:05:33 -07:00
Kevin Sawicki
913bc8e198 Merge pull request #7527 from electron/only-set-global-app-name-on-audio-manager-on-linux
Only call media::AudioManager::SetGlobalAppName on Linux
2016-10-07 14:04:03 -07:00
Kevin Sawicki
c37740273f Add linux guard for SetGlobalAppName call 2016-10-07 13:44:54 -07:00
Kevin Sawicki
f09ed4b677 Merge pull request #7524 from deepak1556/pa_app_name_patch
media: set the application name for audio streams shown in external apps
2016-10-07 10:15:35 -07:00
Kevin Sawicki
e52f5933a0 Merge pull request #7522 from tinydew4/translate-ko
Add REPL doc in ko-KR and apply other changes
2016-10-07 10:11:24 -07:00
Kevin Sawicki
9339853448 Merge pull request #7520 from electron/fix-undef-webprefs
Default webPreferences to empty object always
2016-10-07 10:10:40 -07:00
deepak1556
12fb9f1f18 media: set the application name for audio streams shown in external apps 2016-10-07 16:15:30 +05:30
tinydew4
f3b182606b Add REPL doc in ko-KR and apply other changes 2016-10-07 08:34:27 +00:00
Samuel Attard
a0284a9bc5 Add spec for window.open with webPreferences set to null 2016-10-07 12:13:04 +11:00
Samuel Attard
09e5035ab5 Default webPreferences to empty object always 2016-10-07 11:45:13 +11:00
Zeke Sikelianos
b7e078e98d sanitize MenuItem options 2016-10-06 14:37:13 -07:00
Zeke Sikelianos
f80e81bf9f standardize 2016-10-06 12:20:00 -07:00
Zeke Sikelianos
c34d868609 update docs-linter 2016-10-06 12:20:00 -07:00
Samuel Attard
2b05c61ae3 Update docs for parsing 2016-10-06 12:19:38 -07:00
Samuel Attard
b859afc118 Update docs to follow the 'link first instance' standard 2016-10-06 12:19:38 -07:00
Samuel Attard
03979936f3 Move reused object structures to a standard structures folder 2016-10-06 11:59:42 -07:00
Kevin Sawicki
4d7050553c Merge pull request #7449 from amtj/repl-docs
add REPL documentation
2016-10-06 11:38:48 -07:00
Kevin Sawicki
c104858079 Update Node.js docs link and Windows note 2016-10-06 11:38:09 -07:00
Kevin Sawicki
2c8781ed69 Merge pull request #7511 from tinydew4/translate-ko
Update korean docs
2016-10-06 11:12:26 -07:00
Kevin Sawicki
e38fc724f8 Merge pull request #7508 from miniak/docs-fix
Add missing documentation
2016-10-06 11:11:31 -07:00
Kevin Sawicki
3bbfc4d420 Merge pull request #7507 from toonborgers/translate-nl
Add link to dutch translation in CONTRIBUTING.md [ci skip]
2016-10-06 11:06:18 -07:00
Kevin Sawicki
217010a669 Merge pull request #7515 from electron/newline-before-list
Add newline before list
2016-10-06 11:03:52 -07:00
Kevin Sawicki
451cea4675 Add newline before list 2016-10-06 11:02:30 -07:00
Kevin Sawicki
d39182b41a Pass crashes directory instead of product name and temp dir 2016-10-06 10:55:11 -07:00
Zeke Sikelianos
2cda2bd718 Merge pull request #7502 from squarejaw/patch-1
Fix misspelling in docs/api/app.md
2016-10-06 10:44:11 -07:00
Kevin Sawicki
16e3991ffa Guard against app.getPath throwing with OS fallback 2016-10-06 10:07:40 -07:00
Kevin Sawicki
fbbffe03a5 Add getPath specs 2016-10-06 09:57:25 -07:00
Kevin Sawicki
f61ace74bb Sort includes 2016-10-06 09:50:06 -07:00
Kevin Sawicki
4a8dcec63a Wait for crash report to become available 2016-10-06 09:47:07 -07:00
Kevin Sawicki
30c6ca6751 Only call UTF8ToUTF16 on Windows 2016-10-06 09:14:16 -07:00
Kevin Sawicki
84b7bb29f0 Fix Windows compiler errors 2016-10-06 09:02:03 -07:00
Kevin Sawicki
9d1d1f21e9 Use FilePath for crash reporter temp directory 2016-10-06 09:02:03 -07:00
Kevin Sawicki
883c4b63d0 temp_path -> temp_dir 2016-10-06 09:02:02 -07:00
Kevin Sawicki
0380d3ae50 Pass crashes directory to crash service process 2016-10-06 09:02:02 -07:00
Kevin Sawicki
2fbb98a97c Remove directory assert 2016-10-06 09:02:02 -07:00
Kevin Sawicki
43702e0f8e Support calling getUploadedReports on unstarted crash reporter 2016-10-06 09:02:02 -07:00
Kevin Sawicki
56d9ce34e4 Use valid Linux report id 2016-10-06 09:02:02 -07:00
Kevin Sawicki
76abb2e18d Add missing temp_dir arg to override 2016-10-06 09:02:02 -07:00
Kevin Sawicki
a0db484510 Use app.getPath directly for temp path 2016-10-06 09:02:02 -07:00
Kevin Sawicki
b3b856f476 Set productName in main process on Linux 2016-10-06 09:02:02 -07:00
Kevin Sawicki
69a7025c96 Fix Linux compiler errors 2016-10-06 09:02:01 -07:00
Kevin Sawicki
773bfea386 Remove unused rimraf spec dependency 2016-10-06 09:02:01 -07:00
Kevin Sawicki
eafc694bba Mention crash report locations 2016-10-06 09:02:01 -07:00
Kevin Sawicki
81733a523e DRY up temp directory logging 2016-10-06 09:02:01 -07:00
Kevin Sawicki
1afe501a36 Add tests for crash reports in custom temp directory 2016-10-06 09:02:01 -07:00
Kevin Sawicki
f282b51c98 🎨 Use ES6 class, destructuring, and let/const 2016-10-06 09:02:01 -07:00
Kevin Sawicki
ac0658bbf1 Use PathService for temp dir path for crashes 2016-10-06 09:02:01 -07:00
tinydew4
116dbc0581 Update ko docs 2016-10-06 14:53:57 +00:00
tinydew4
6af8a0fae4 Update ko docs 2016-10-06 14:27:48 +00:00
tinydew4
79b5ae3d57 Modify docs to refelect the latest 2016-10-06 14:27:48 +00:00
Milan Burda
cb15181f43 Fix typo 2016-10-06 12:03:37 +02:00
Milan Burda
9f342ebbd1 Add missing documentation 2016-10-06 11:30:34 +02:00
Toon Borgers
27795015ff Add link to dutch translation in CONTRIBUTING.md 2016-10-06 10:56:59 +02:00
Cheng Zhao
79a5de3fd8 Bump v1.4.3 2016-10-06 17:12:07 +09:00
Cheng Zhao
2624738534 Lock the version of electron-docs-linter 2016-10-06 17:12:06 +09:00
Cheng Zhao
10b91b1291 Merge pull request #7488 from electron/native-image-resize-and-crop
Support resizing and cropping native images
2016-10-06 15:01:41 +09:00
Cheng Zhao
1781ceb25b Merge pull request #7494 from thomsonreuters/Update_Test_For_Missing_Additional_Features
Update BrowserWindow's test to check additional features upon window.open() call
2016-10-06 14:45:28 +09:00
Cheng Zhao
051e5c27b3 Update brightray for #7332 2016-10-06 14:42:14 +09:00
Cheng Zhao
5285b729be Merge pull request #7407 from thomsonreuters/New_Window_Handler_Can_Create_And_Return_Window
New-window event handler can return its own BrowserWindow instance
2016-10-06 14:37:48 +09:00
Bryan Bess
9bc6000cb5 📝 Fix misspelling in docs/api/app.md [ci skip] 2016-10-05 19:17:49 -05:00
Zeke Sikelianos
fdf3f6ce30 remove unneeded new keyword 2016-10-05 13:44:28 -07:00
Haojian Wu
0d930b65f1 📝 clang-format on Electron C++ code. 2016-10-05 22:12:48 +02:00
Zeke Sikelianos
16b3962b66 preserve custom properties passed to MenuItem constructor 2016-10-05 12:24:08 -07:00
Kevin Sawicki
4b95f3a462 Mark width/height as optional 2016-10-05 11:02:58 -07:00
Kevin Sawicki
4ffae1d563 Add spec for getAspectRatio 2016-10-05 11:02:58 -07:00
Kevin Sawicki
abffd98e29 Resize images with preserve aspect ratio 2016-10-05 11:02:58 -07:00
Kevin Sawicki
56f9cc683a bounds -> rect 2016-10-05 11:02:57 -07:00
Kevin Sawicki
49cc00dedf Add tests of resizing/cropping an empty image 2016-10-05 11:02:57 -07:00
Kevin Sawicki
9fa13710aa Document crop and resize 2016-10-05 11:02:57 -07:00
Kevin Sawicki
0eda33f057 Add tests for cropping native images 2016-10-05 11:02:57 -07:00
Kevin Sawicki
2b4fff70d5 Add initial crop method 2016-10-05 11:02:57 -07:00
Kevin Sawicki
a80f4c1605 Add specs for other create image helpers 2016-10-05 11:02:57 -07:00
Kevin Sawicki
6aba4e916a 🎨 Use deepEqual asserts 2016-10-05 11:02:57 -07:00
Kevin Sawicki
6a7f0d70fd Add native image resize tests 2016-10-05 11:02:56 -07:00
Kevin Sawicki
042684fb38 Add resize method to native image 2016-10-05 11:02:56 -07:00
Kevin Sawicki
018575de71 Merge pull request #7496 from electron/app-doc-fix
Add newline before return list
2016-10-05 09:36:01 -07:00
Kevin Sawicki
8c0588d4e0 Merge pull request #7495 from toonborgers/translate-nl
📝 Dutch translation for CONTRIBUTING.md [ci skip]
2016-10-05 09:34:08 -07:00
Kevin Sawicki
aaa8c56686 Merge pull request #7487 from fplucas/master
📝 Fix the link source-code-directory-structure.md on pt-br [ci skip]
2016-10-05 09:33:07 -07:00
Kevin Sawicki
5e936a24ac Add newline before list 2016-10-05 09:24:33 -07:00
Michael Vasseur
edd80d88a9 Update BrowserWindow's test to check additional features upon window.open() call 2016-10-05 13:45:15 +02:00
Toon Borgers
25659e482e Fix relative url 2016-10-05 12:28:36 +02:00
Toon Borgers
a097d17166 Fix relative link, added translation link for dutch 2016-10-05 12:28:08 +02:00
Toon Borgers
d4bbc24031 Translate CONTRIBUTING.md 2016-10-05 12:25:50 +02:00
Michael Vasseur
3dd41bc09a Fix errors 2016-10-05 11:46:55 +02:00
Michael Vasseur
9490ec7686 Fix JS Lint issues 2016-10-05 09:47:39 +02:00
Michael Vasseur
a2b3cf95a7 Sets correct openerId in mergeBrowserWindowOptions() to give correct options to 'new-window' event handler 2016-10-05 09:47:39 +02:00
Michael Vasseur
cc7f4fedf6 Rebase with recent changes 2016-10-05 09:47:39 +02:00
Michael Vasseur
22bd7c0271 Updated the related documentation 2016-10-05 09:47:38 +02:00
Michael Vasseur
3408c8038e Fix indentation 2016-10-05 09:47:38 +02:00
Michael Vasseur
5a4cdcfde1 'new-window' event handlers can return their window when default behavior is prevented 2016-10-05 09:46:54 +02:00
Toon Borgers
0babe4a5ed Add english version to start from 2016-10-05 09:27:20 +02:00
Toon Borgers
a538b37854 Create CONTRIBUTING.md 2016-10-05 09:16:34 +02:00
Cheng Zhao
ebaeec1677 Merge pull request #7491 from electron/initialize-direct-write-font-proxy
Enable emoji as fallback font on Windows 10
2016-10-05 14:15:55 +09:00
Kevin Sawicki
1f1d9cefca Update libchromiumcontent for #7334 2016-10-04 17:28:46 -07:00
Haojian Wu
a846088eac Add clang-format config file. 2016-10-04 22:42:49 +02:00
Kevin Sawicki
43f4eb76c4 Merge pull request #7489 from davej/patch-2
Docs: Correct image.getSize() type signature
2016-10-04 13:36:48 -07:00
Dave Jeffery
29b9fbcc9a Docs: Move buffer link to end of file 2016-10-04 21:34:24 +01:00
Dave Jeffery
4d10b9a31b Docs: Correct image.getSize() type signature 2016-10-04 21:20:42 +01:00
Lucas Pugliesi
0727102c5e 📝 Fix the link source-code-directory-structure.md on pt-br [ci skip] 2016-10-04 14:43:11 -03:00
Kevin Sawicki
4c2590ed92 Merge pull request #7486 from fplucas/master
📝 Translation of build-instructions-osx.md to pt-br [ci skip]
2016-10-04 10:31:08 -07:00
Lucas Pugliesi
66ce176b22 Merge remote-tracking branch 'upstream/master' 2016-10-04 14:27:00 -03:00
Lucas Pugliesi
a824ff479a 📝 Translation of build-instructions-osx.md to pt-br [ci skip] 2016-10-04 14:26:41 -03:00
Kevin Sawicki
c88c6b1323 Merge pull request #7481 from fplucas/master
📝 Translation of synopsis.md to pt-br [ci skip]
2016-10-04 09:11:16 -07:00
Kevin Sawicki
b459f00bd3 Merge pull request #7478 from tinydew4/translate-ko
Update the ko-KR docs related to the `additionalFeatures`.
2016-10-04 09:10:55 -07:00
Amitoj
00376c1d59 add note about windows
note "REPL is not available on Windows."
2016-10-04 19:32:46 +05:30
Lucas Pugliesi
85a8b149bb 📝 Translation of synopsis.md to pt-br [ci skip] 2016-10-04 09:37:18 -03:00
tinydew4
3fcb57559a Update the ko-KR docs related to the . 2016-10-04 08:35:07 +00:00
Cheng Zhao
bf21892cfa Merge pull request #7291 from thomsonreuters/Fix_Missing_Additional_Features_New_Popup_Windows
Fix for missing additional features fields when creating new popup windows
2016-10-04 15:42:36 +09:00
Cheng Zhao
c4576463e2 Format the docs according to style guide 2016-10-04 14:41:37 +09:00
Michael Vasseur
3af686daff Documented JavasScript API changes related to the fix for additional features processing 2016-10-04 14:38:32 +09:00
Michael Vasseur
c811188e22 Updated required code to handle missing additional features for popup windows 2016-10-04 14:38:32 +09:00
Cheng Zhao
ef88a06f08 Update libchromiumcontent for #7291 2016-10-04 14:30:59 +09:00
Cheng Zhao
cf050ff9e2 Merge pull request #7468 from electron/focus-window-when-menu-is-clicked
Focus window when menu button is pressed
2016-10-04 14:22:49 +09:00
Kevin Sawicki
bb04069e83 Merge pull request #7437 from fplucas/master
📝 Translation of CONTRIBUTING.md to pt-br [ci skip]
2016-10-03 15:37:52 -07:00
Amitoj
a938859eb8 repl-docs: move file to tutorials
also add note for renderer processes.
2016-10-04 00:12:25 +05:30
Lucas Pugliesi
8d35576a36 Merge CONTRIBUTING.md 2016-10-03 15:18:03 -03:00
Kevin Sawicki
9cae04edde Remove unused ButtonListener 2016-10-03 10:26:18 -07:00
Kevin Sawicki
11684c2c73 Focus submenu buttons when clicked 2016-10-03 10:13:41 -07:00
Kevin Sawicki
e258973490 Merge pull request #7434 from rafaelstz/patch-2
Update year in LICENSE file
2016-10-03 09:29:54 -07:00
Kevin Sawicki
00d57fa547 Merge pull request #7433 from rafaelstz/patch-1
Update license in README file
2016-10-03 09:29:26 -07:00
Kevin Sawicki
24106469c5 Merge pull request #7456 from amitmerchant1990/patch-1
Update accessibility.md
2016-10-03 09:28:22 -07:00
Kevin Sawicki
9c55280917 Merge pull request #7457 from josephfrazier/fix-findinpage-links
Fix webContents.findInPage links in docs
2016-10-03 09:22:53 -07:00
Cheng Zhao
98333049ec Merge pull request #7452 from enlight/node-buffer-safe-free
Prevent undefined behavior when some Node Buffer objects are destroyed
2016-10-03 21:57:37 +09:00
Cheng Zhao
63b45a873b Merge pull request #7451 from was4444/master
keep up with en version
2016-10-03 21:35:06 +09:00
Cheng Zhao
ec34bfde26 Merge pull request #7432 from electron/check-if-window-closed
Ignore already closed windows
2016-10-03 21:21:35 +09:00
Cheng Zhao
8ae91ea2ee Merge pull request #7444 from rogerlista/master
📝 Translation of CODE OF CONDUCT.md to pt-BR [ci skip]
2016-10-03 21:19:35 +09:00
Cheng Zhao
772c456513 Merge pull request #7335 from miniak/set-default-error-mode
Add process.setDefaultErrorMode()
2016-10-03 20:53:42 +09:00
Cheng Zhao
3a4cd19226 Merge pull request #7461 from electron/revert-7416-fix-windows-draggable-high-dpi
Revert "Fix for issues seen on frameless window (Windows) when at 200% resolution"
2016-10-03 20:42:44 +09:00
Cheng Zhao
4d8c1c61a5 Revert "Fix for issues seen on frameless window (Windows) when at 200% resolution" 2016-10-03 20:41:52 +09:00
Cheng Zhao
bee3abe334 Merge pull request #7416 from bsclifton/fix-windows-draggable-high-dpi
Fix for issues seen on frameless window (Windows) when at 200% resolution
2016-10-03 18:34:18 +09:00
Joseph Frazier
5d1c626a53 Fix webContents.findInPage links in docs 2016-10-03 02:07:52 -04:00
Amit Merchant
fb612075c4 Update accessibility.md 2016-10-03 11:13:25 +05:30
Vadim Macagon
7c5d3296e7 Prevent undefined behavior when some Node Buffer objects are destroyed
If node::Buffer::New() is used to wrap an existing chunk of memory
without providing a custom callback to release that memory then Node
will just use `free()`. In a couple of places Node buffer objects were
constructed from chunks of memory that were allocated with `new[]`, but
a custom callback to release that memory was omitted, this resulted in
undefined behavior when those buffers were destroyed because `free()`
was used to release memory allocated with `new[]`.

To avoid undefined behavior the aforementioned buffer objects are now
constructed with a custom callback that safely releases the underlying
chunk of memory.
2016-10-03 10:26:26 +07:00
Amitoj
002b9b5d4b add link to repl documentation 2016-10-02 23:47:11 +05:30
Amitoj
a0a23e04cf s/provides/provides a/ 2016-10-02 23:42:37 +05:30
wxf
763fdb4be1 keep up with en version 2016-10-02 21:45:22 +08:00
Amitoj
4d0cef5070 add REPL documentation 2016-10-02 18:20:29 +05:30
Rogério
18c7ba94f8 📝 Translation of accessibility.md to pt-BR [ci skip] 2016-10-01 21:28:17 -03:00
Rogério
5fb72b5e05 📝 Translation of README.md to pt-BR [ci_skip] 2016-10-01 20:55:12 -03:00
Rogério
960971b195 📝 Translation of CONTRIBUTING.md to pt-BR[ci skip] 2016-10-01 19:56:01 -03:00
Rogério
b10a6422d4 Translation of CODE OF CONDUCT.md to pt-BR [ci skip] 2016-10-01 17:59:30 -03:00
Lucas Pugliesi
2714f280f5 📝 Translation of file-object.md to pt-br [ci skip] 2016-10-01 09:07:49 -03:00
Lucas Pugliesi
9c53d241fa 📝 Translation of CONTRIBUTING.md to pt-br [ci skip] 2016-10-01 08:45:31 -03:00
Rafael Corrêa Gomes
f4d33e366d Update year in LICENSE file 2016-10-01 00:34:29 -03:00
Rafael Corrêa Gomes
73cdf35c98 Update license in README file 2016-10-01 00:33:51 -03:00
Kevin Sawicki
140651c258 Ignore already closed windows 2016-09-30 15:04:13 -07:00
Kevin Sawicki
ff6a8fac2a Merge pull request #7417 from electron/check-sheet-parent-before-beginning
Only begin sheet when no sheet parent
2016-09-30 13:08:35 -07:00
Kevin Sawicki
1807458c66 Only begin sheet when no sheet parent 2016-09-30 10:43:43 -07:00
Kevin Sawicki
fb41474555 Merge pull request #7429 from electron/webview-max-listeners
Ensure webviews get reset after spec finishes
2016-09-30 10:43:27 -07:00
Kevin Sawicki
3f390c6849 Ensure webviews get reset after spec finishes 2016-09-30 10:15:11 -07:00
Kevin Sawicki
4a186069d9 Merge pull request #7428 from electron/sandbox-specs
Explicitly close popup window from sandbox spec
2016-09-30 09:28:59 -07:00
Kevin Sawicki
d942694695 openedWindow -> popupWindow 2016-09-30 08:54:24 -07:00
Kevin Sawicki
766f5afabd Explicitly close popup window 2016-09-30 08:50:41 -07:00
Kevin Sawicki
e16fa08e61 🎨 2016-09-30 08:38:21 -07:00
Kevin Sawicki
b07d4eba11 Merge pull request #7427 from tinydew4/translate-ko
Update ko-KR/api/session.md
2016-09-30 08:14:46 -07:00
tinydew4
f1d1070baa Update ko-KR/api/session.md 2016-09-30 15:09:11 +00:00
Kevin Sawicki
0c146de7dd Merge pull request #7422 from tinydew4/translate-ko
Update korean CODE_OF_CONDUCT.md
2016-09-30 07:56:07 -07:00
Cheng Zhao
5a56de501a Bump v1.4.2 2016-09-30 17:39:27 +08:00
Cheng Zhao
11d16a7342 Merge pull request #7415 from electron/disable-tab-menu-on-sierra
Hide Show Tab Bar menu item on macOS Sierra
2016-09-30 17:23:54 +08:00
Cheng Zhao
1b5db42ec6 Merge pull request #7398 from electron/cookie-changed-event
Add cookie changed event
2016-09-30 17:10:44 +08:00
tinydew4
0b6b4ca50d Update CODE_OF_CONDUCT.md 2016-09-30 06:32:07 +00:00
tinydew4
e7e8b3fdb6 Remove BOM to korean docs 2016-09-30 00:03:29 +00:00
Milan Burda
5bfa898a02 Always drop SEM_NOGPFAULTERRORBOX flag from error mode (enables WER if crashReporter is not started) 2016-09-29 13:57:41 -07:00
Kevin Sawicki
770a3509cf Add forward declaration of NSWindow.allowsAutomaticWindowTabbing 2016-09-29 10:54:59 -07:00
Kevin Sawicki
b14870d9a1 Merge pull request #7413 from deepak1556/devtools_filesystemapi_patch
browser: allow filesystem access for devtools scheme
2016-09-29 10:52:47 -07:00
Brian Clifton
52340b43f5 Possible fix for issues seen on frameless window (Windows) when at 200% 2016-09-29 10:48:36 -07:00
deepak1556
1323542373 browser: allow filesystem access for devtools scheme 2016-09-29 22:54:39 +05:30
Kevin Sawicki
24b9313958 Disable Show Tab Bar menu item on macOS Sierrra 2016-09-29 10:18:15 -07:00
Kevin Sawicki
0e1290fc10 Upgrade brightray for merged cookie delegate support 2016-09-29 09:18:21 -07:00
Kevin Sawicki
8abe8fe01d Remove unneeded locker and handle scope 2016-09-29 09:16:35 -07:00
Kevin Sawicki
77b35ba7ab Use separate session for cookies change event test 2016-09-29 09:16:35 -07:00
Kevin Sawicki
96e48ac13c Document cookie changed event 2016-09-29 09:16:35 -07:00
Kevin Sawicki
d83534d513 Add specs for cookie changed event 2016-09-29 09:16:35 -07:00
Kevin Sawicki
19c7ee0932 Use scoped_refptr for cookie delegate 2016-09-29 09:16:35 -07:00
Kevin Sawicki
24bcf6ac16 Add initial cookie changed event support 2016-09-29 09:16:29 -07:00
Kevin Sawicki
5d23d165a9 Upgrade brigthray for cookie monster delegate 2016-09-29 09:16:29 -07:00
Kevin Sawicki
b3b9994ce8 Configure ink drops on menu bar buttons (#7397)
* Add ink drop to menu bar buttons

* Pass background color to submenu button

* Sort includes
2016-09-29 09:15:12 -07:00
Arus
df0bda058f Update korean docs, according to most recent changes and other missing. (#7400)
* Apply changes

* Apply changes

* Apply changes

* Apply changes

* Fix all JS standard syntax errors

* Apply of recent changes, #7374
2016-09-29 08:52:40 -07:00
Cheng Zhao
15b8449411 Merge pull request #7393 from electron/upgrade-brigthray-for-ct-fix
Upgrade Brightray for certificate transparency crash fix
2016-09-29 16:56:31 +08:00
Cheng Zhao
e1d68fa3cd Merge pull request #7374 from electron/fixup-return-values
Update docs to contain more specific return values
2016-09-29 16:44:08 +08:00
Cheng Zhao
2c9ce3f3e0 Merge pull request #7372 from electron/update-docs-linter
update electron-docs-linter
2016-09-29 16:43:22 +08:00
Cheng Zhao
734f42b5f9 Merge pull request #7319 from Menci/master
Workaround for electron/electron#5050
2016-09-29 16:42:30 +08:00
Kevin Sawicki
3cff64001d Upgrade brightray for CT crash fix 2016-09-28 16:02:48 -07:00
Kevin Sawicki
241297fb2e Merge pull request #7388 from electron/custom-window-level-test
Add test for BrowserWindow.setAlwaysOnTop
2016-09-28 15:47:29 -07:00
Kevin Sawicki
d4583006b3 Merge pull request #7391 from kiavashps/patch-1
docs: app.md - fix relaunch arg concat syntax
2016-09-28 10:30:59 -07:00
Kiavash Page
d42e51e33a app.md - fix relaunch arg concat syntax 2016-09-28 10:23:03 -07:00
Kevin Sawicki
3bed19d70d Add spec for BrowserWindow.setAlwaysOnTop 2016-09-28 09:23:52 -07:00
Kevin Sawicki
fd6ef6712f Link to window level macOS docs 2016-09-28 09:20:22 -07:00
Cheng Zhao
c51982a231 Merge pull request #7362 from bsclifton/fix-windows-draggable-high-dpi
Fixes mouse coordinates for Windows when display is set to a higher DPI
2016-09-28 19:42:17 +08:00
Cheng Zhao
53d4c36332 Merge pull request #7353 from electron/no-login-item-apis-on-mas
document lack of MAS support for login item APIs
2016-09-28 19:20:32 +08:00
Cheng Zhao
de76bf5f63 Merge pull request #7296 from adammeyer/custom-window-level
Allow custom window level when sending window to top
2016-09-28 19:18:12 +08:00
Samuel Attard
e0e47ea9a1 Update docs to contain more specific return values 2016-09-28 18:28:44 +13:00
Zeke Sikelianos
3989139378 update electron-docs-linter 2016-09-27 22:04:22 -07:00
Menci
ca68dfe097 🎨 Remove extra semicolon 2016-09-28 06:45:15 +08:00
Kevin Sawicki
5114d571df Merge pull request #7364 from tiagotol/patch-1
Update quick-start.md
2016-09-27 13:02:25 -07:00
tiagotol
08808664b6 Update quick-start.md 2016-09-27 14:29:35 -03:00
Brian Clifton
13de65d310 Fixes mouse coordinates for Windows when display is set to a higher DPI (ex: enlarged by 150% using display settings) 2016-09-27 08:23:48 -07:00
Zeke Sikelianos
6728efe87e Merge pull request #7339 from electron/document-return-values
Document the return values of all methods in the docs
2016-09-27 07:39:25 -07:00
Cheng Zhao
458c4dd129 Merge branch 'support-chromium-sandbox' of https://github.com/tarruda/electron into tarruda-support-chromium-sandbox 2016-09-27 20:02:23 +08:00
Menci
ef45b67dbf 🐧 🐛 Move the workaround to lib/browser/init.js 2016-09-27 19:19:52 +08:00
Cheng Zhao
604700187d Merge pull request #7327 from MaxWhere/osr-fixes
Small fixes for offscreen rendering
2016-09-27 19:17:10 +08:00
Cheng Zhao
7e1ae369ed Merge pull request #7356 from electron/fix-typo
fix typo
2016-09-27 19:05:06 +08:00
Cheng Zhao
9850af93c9 Merge pull request #7313 from electron/add-type-to-webview-style-tag
add type to webview style tag
2016-09-27 19:03:08 +08:00
Cheng Zhao
4c8d0ab804 Merge pull request #7298 from deepak1556/content_settings_patch
protocol: disable storage for non standard custom schemes
2016-09-27 18:52:36 +08:00
Thiago de Arruda
47fd41715f Add some tests for "sandbox" option 2016-09-27 06:01:47 -03:00
Thiago de Arruda
a64978b812 Use the routing id on api::WebContents::GetID
The sandbox option allows multiple webContents in one renderer process, so using
the only the renderer id to identify WebContents instances is no longer an
option.

WebContents::GetID now returns a 64-bit integer, which is composed of both the
process id(high 32), and the RenderViewHost routing id(low 32). Also add a
`GetProcessID` that retrieves the renderer process id, a requirement in some of
our javascript code.
2016-09-27 06:01:47 -03:00
Thiago de Arruda
524bab530a Improve AtomSandboxedRendererClient to support preload scripts.
Add RenderFrameObserver/RenderViewObserver subclasses that implement the
necessary support for preload scripts in sandboxed renderers.
2016-09-27 06:01:47 -03:00
Thiago de Arruda
72154b64ed Embed setup bundle for preload scripts in sandboxed renderers.
Add a gyp target that creates a browserify bundle starting with
`lib/sandboxed_renderer/init.js`, which is embedded into the executable using
the `atom_js2c` target.

The goal of this bundle is to provide a very basic environment for preload
scripts where a `require` function is available.
2016-09-27 06:01:47 -03:00
Thiago de Arruda
695509e267 Add browser side support for reading files from renderer. 2016-09-27 06:01:46 -03:00
Thiago de Arruda
0f7652dc85 Move code that defines ipcRenderer methods into another file. 2016-09-27 06:01:46 -03:00
Thiago de Arruda
1713200084 Refactor the atom_js2c target to include javascript from multiple dirs.
Before invoking js2c, copy all files that must be embedded into the shared
intermediate directory, and modify the js2c wrapper script to include all files
from that directory(which is passed as argument).

This allows the build system to embed files that don't share a common base
directory, such as javascript generated at build time.
2016-09-27 06:01:46 -03:00
Thiago de Arruda
6afe8aa7f2 Move EmitIPCEvent into AtomRenderViewObserver.
Refactor this function as a method so it is possible to inherit most behavior
from AtomRenderViewObserver and override EmitIPCEvent.
2016-09-27 06:01:46 -03:00
Thiago de Arruda
c8629019f5 Expose atom_api_renderer_ipc module API 2016-09-27 06:01:46 -03:00
Thiago de Arruda
a7b6332ed0 Add atom::AtomSandboxedRendererClient class 2016-09-27 06:01:46 -03:00
Thiago de Arruda
06cc9a44fe Add support for native chromium popups on sandboxed renderers.
- Allow `api::Window` instances to be created from existing `api::WebContents`.
- Override `WebContentsCreated` and `AddNewContents` to wrap renderer-created
  `content::WebContents` into `api::WebContents`.
- For `content::WebContents` that should be displayed in new windows, pass the
  wrapped `api::WebContents` object to window manager.
2016-09-27 06:01:46 -03:00
Thiago de Arruda
0b3b29938f Allow api::WebContents to fully wrap an existing content::WebContents.
- Add an overload to `WebContents::CreateFrom` that accepts a type parameter. If
  type is `REMOTE`, initialization is the same as before(a thin wrapper). If
  not, the `api::WebContents` will be fully initialized, as if it was created by
  `api::WebContents::Create`.
- Move common initialization code to `InitWithSessionAndOptions`.
2016-09-27 06:01:46 -03:00
Thiago de Arruda
1b1541fe1a Decouple api::Window initialization from api::WebContents construction. 2016-09-27 06:01:46 -03:00
Thiago de Arruda
1d228446db Expose --enable-sandbox command-line switch.
When `--enable-sandbox` is passed, electron will use chromium sandbox to spawn
all renderers, and every new BrowserWindow will automatically have "sandboxed"
passed as a web preference(since the renderer would not work properly
otherwise).
2016-09-27 06:01:46 -03:00
Thiago de Arruda
c783ec72bc Add "sandboxed" option to "webPreferences".
When "sandboxed" is passed as a web preference for `BrowserWindow`, the newly
created renderer won't run any node.js code/integration, only communicating with
the system via the IPC API of the content module. This is a requirement for
running the renderer under chrome OS-level sandbox.

Beyond that, certain behaviors of AtomBrowserClient are modified when dealing
with sandboxed renderers:

- `OverrideSiteInstanceNavigation` no longer create a new `SiteInstance` for
  every navigation. Instead, it reuses the source `SiteInstance` when not
  navigating to a different site.
- `CanCreateWindow` will return true and allow javascript access.
2016-09-27 06:01:46 -03:00
Zeke Sikelianos
90c5972fce Merge pull request #7342 from tinydew4/update-changes
Update changes to korean docs.
2016-09-26 22:19:45 -07:00
Zeke Sikelianos
1f677ed361 fix typo 2016-09-26 22:12:51 -07:00
Zeke Sikelianos
9c19b4e3d5 Merge pull request #7343 from tinydew4/translate-ko
Translate newest styleguide.md and update changes to system-preferences.md
2016-09-26 21:47:42 -07:00
Zeke Sikelianos
d4a1f396fb tweak wording about complex objects 2016-09-26 21:04:54 -07:00
arus
72e3816143 Change a word 2016-09-27 09:38:23 +09:00
arus
9dd181c206 Change some sentences after review 2016-09-27 09:34:59 +09:00
Zeke Sikelianos
9828926002 Merge pull request #7340 from tinydew4/fix-link
Fix broken link in original docs
2016-09-26 12:04:22 -07:00
Zeke Sikelianos
bb955b6202 document lack of MAS support for login item APIs 2016-09-26 11:00:13 -07:00
Cheng Zhao
1dd05ff520 Merge pull request #7338 from electron/fix-get-accent-color-docs
Fix getAccentColor() docs in system-preferences.md
2016-09-26 15:39:40 +08:00
Cheng Zhao
19bd5ea8ba Merge pull request #7316 from tinydew4/update-ko
Update debugging-main-process and Add planned-breaking-changes
2016-09-26 12:56:22 +08:00
arus
bcf7a86dc7 Update changes to ko-KR/api 2016-09-26 00:03:32 +09:00
arus
2fbdac1034 Update changes to ko-KR/api/app.md 2016-09-25 23:50:36 +09:00
arus
577585df63 Update changes to ko-KR/api/power-monitor.md 2016-09-25 23:48:09 +09:00
arus
f13bd655a1 Update changes to ko-KR/api/screen.md 2016-09-25 23:45:56 +09:00
arus
81de0518d9 Update changes to ko-KR/api/web-contents.md 2016-09-25 23:43:24 +09:00
arus
d93a86e8cc Remove some changes 2016-09-25 23:37:34 +09:00
arus
7e186cee55 Remove some changes 2016-09-25 23:28:59 +09:00
arus
97da066ae2 Update changes to ko-KR/api/web-contents.md 2016-09-25 23:25:05 +09:00
arus
b58f73b5c9 Update change to ko-KR/README.md 2016-09-25 23:18:18 +09:00
arus
ad1cb16a76 Update changes to web-view-tag.md 2016-09-25 22:58:41 +09:00
arus
cd4a66dca5 Update changes to browser-window.md 2016-09-25 22:40:05 +09:00
arus
cc282a1114 Update /ko-KR/api/system-preferences.md 2016-09-25 21:57:43 +09:00
arus
270d6f774a Update changes to browser-window and correct a word 2016-09-25 21:40:33 +09:00
Samuel Attard
987a2e173a Fix docs linting 2016-09-25 21:57:37 +13:00
arus
66efaa5e0f Update /ko-KR/styleguide.md 2016-09-25 17:04:34 +09:00
arus
27a9f960de Fix broken link 2016-09-25 16:15:16 +09:00
arus
74e03d285e Fix broken link 2016-09-25 16:13:34 +09:00
arus
123f2a8265 Update /ko-KR/styleguide.md 2016-09-25 16:05:45 +09:00
arus
d25c2d0f41 Update /ko-KR/api/system-preferences.md 2016-09-25 16:05:45 +09:00
Samuel Attard
d2a701a465 Document the return values of all methods in the docs 2016-09-25 12:59:30 +13:00
Vadim Macagon
1df30821db Fix getAccentColor() docs in system-preferences.md
Example was using a non-existent method.
2016-09-25 01:45:34 +07:00
Zeke Sikelianos
bf88fe32fd Merge pull request #7333 from tinydew4/translate-ko
Translate CODE_OF_CONDUCT and change a word as other docs, in korean
2016-09-24 10:04:04 -07:00
arus
e21d5bd380 Change some sentences more smoothly 2016-09-24 15:58:58 +09:00
arus
04bdc87283 Change some smoothly 2016-09-24 11:33:31 +09:00
arus
177ccbc014 Translate CODE_OF_CONDUCT and change a word as other docs, in korean 2016-09-24 10:37:17 +09:00
Zeke Sikelianos
d6cd9e3034 Merge pull request #7331 from tinydew4/fix-link
Fix broken links
2016-09-23 17:19:07 -07:00
Zeke Sikelianos
d391f1b527 Merge pull request #7330 from tinydew4/translate-ko
Translate accessibility and change some in korean
2016-09-23 17:07:40 -07:00
arus
8c7a4de27b Fix broken links 2016-09-24 08:26:25 +09:00
Arus
7cd7894878 Update accessibility.md 2016-09-24 08:23:36 +09:00
arus
d7fc7ef2ee Fix errata 2016-09-24 08:19:24 +09:00
arus
6aef061362 Translate accessibility.md in korean 2016-09-24 08:14:19 +09:00
arus
e4943b3ab3 Change more smoothly 2016-09-24 07:18:39 +09:00
arus
091136908d Replace changes as link of original docs 2016-09-24 06:51:28 +09:00
Zeke Sikelianos
c6390e71d9 Merge pull request #7314 from tinydew4/translate-ko
Translate ko, debug-instructions-macos.md
2016-09-23 11:53:45 -07:00
gellert
ab5e51c209 fixes software rendering on macos and small resizing addition 2016-09-23 20:27:05 +02:00
Menci
938b9e897a 🐧 🐛 Workaround for electron/electron#5050
Chromium only show the Tray icon with libappindicator when the env `XDG_CURRENT_DESKTOP`'s value is `Unity`. But under elementaryOS its value is 'Pantheon'.

Set it to `Unity` before app startup make the tray icon show under elementaryOS.
2016-09-23 18:07:43 +08:00
arus
924033c2ba Remove notice on top 2016-09-23 14:03:42 +09:00
arus
99e256f461 Translate debug-instructinos-macos.md in korean 2016-09-23 14:03:42 +09:00
arus
d2bcbafe73 Translate additonally 2016-09-23 12:56:21 +09:00
arus
5c07643d24 Apply debugging-main-process changes in korean 2016-09-23 12:51:28 +09:00
Zeke Sikelianos
56d62ff589 add html doctype 2016-09-22 14:47:20 -07:00
Zeke Sikelianos
62375663ab add type to webview style tag 2016-09-22 14:34:03 -07:00
Kevin Sawicki
f5694daeb7 Merge pull request #7299 from Gioggio/master
Docs: Start Italian translations
2016-09-22 12:21:09 -07:00
Gioggio
3a73625ece 📝 Update translation for faq.md
[ci skip]
2016-09-22 21:07:13 +02:00
Gioggio
3b45f5a8e9 📝 Add styleguide.md
[ci skip]
2016-09-22 21:07:13 +02:00
Gioggio
78791763cf 📝 Fix typos and improve translations in README.md
[ci skip]
2016-09-22 21:07:13 +02:00
Gioggio
81b55c1700 📝 Add faq.md
[ci skip]
2016-09-22 21:07:13 +02:00
Gioggio
39a3ffdb9d 📝 Add README.md
[ci skip]
2016-09-22 21:07:13 +02:00
Kevin Sawicki
df03c92249 Compare against NSNormalWindowLevel in IsAlwaysOnTop 2016-09-22 09:41:06 -07:00
Kevin Sawicki
c336cf59c1 Ignore level when calling SetAlwaysOnTop on Widget 2016-09-22 09:38:04 -07:00
Kevin Sawicki
fcd6fd9fd5 Merge pull request #7310 from BenV/patch-1
Add npm_config_target_arch to native module doc
2016-09-22 09:34:19 -07:00
Kevin Sawicki
1ec173ad81 Merge pull request #7308 from tinydew4/translate-ko
Apply docs changes to korean docs
2016-09-22 09:32:41 -07:00
Kevin Sawicki
bce62622bb Fix compiler errors 2016-09-22 09:22:28 -07:00
Ben Vinson
1290ddb5c9 Add npm_config_target_arch to native module doc
We ran into an issue when creating a 32-bit binary on 64-bit Windows where node-pre-gyp kept using the 64-bit library. Setting the `npm_config_target_arch` environment variable resolved the problem for us and caused the 32-bit binary to be built and used.
2016-09-22 09:46:31 -06:00
Kevin Sawicki
ea42722918 Merge pull request #7284 from enlight/debugging-with-electron-inspector
Split up debugging-main-process.md, add electron-inspector guide
2016-09-22 08:40:38 -07:00
arus
aac09e5234 Fix erratum 2016-09-22 22:56:19 +09:00
arus
df3896b143 Apply docs changes to korean docs 2016-09-22 22:53:11 +09:00
Cheng Zhao
903bf444d9 Bump v1.4.1 2016-09-22 19:05:58 +09:00
Cheng Zhao
3dad8734a0 Do not copy api.json on Windows 2016-09-22 19:05:58 +09:00
Vadim Macagon
762a5bbefa Split up debugging-main-process.md, add electron-inspector guide
- Move the debugging guides for VSCode and node-inspector into separate
  files.
- Add instructions for using electron-inspector to the node-inspector
  guide.
- Remove note in node-inspector guide about crashing when inspecting
  `process` (it was fixed a long time ago:
  https://github.com/nodejs/node-v0.x-archive/issues/8205)
2016-09-22 15:43:06 +07:00
Cheng Zhao
d3a175cea8 Merge pull request #7303 from electron/fix-out-dir
electron-api.json is under out/ instead of out/R/
2016-09-22 14:39:33 +09:00
Cheng Zhao
4e0f810148 electron-api.json is under out/ instead of out/R/ 2016-09-22 14:31:28 +09:00
Cheng Zhao
32543997d4 Merge pull request #7297 from electron/clean-docs
Mention build cleaning on all three platforms
2016-09-22 14:14:36 +09:00
Cheng Zhao
c9a3ab3a81 Merge pull request #7295 from electron/native-image-bad-path-docs
Mention createFromPath bad path return value
2016-09-22 14:14:15 +09:00
Cheng Zhao
3b4a071723 Merge pull request #7294 from electron/mutate-remote-array-docs
Mention mutating remote arrays and buffers
2016-09-22 14:13:49 +09:00
Cheng Zhao
de9b01409b Merge pull request #7293 from electron/bookmark-windows-docs
Mention using fallback text when writing bookmarks on Windows
2016-09-22 14:13:28 +09:00
Cheng Zhao
296a53536d Merge pull request #7292 from electron/ct-log-verifiers
Upgrade Brigthray for CT log verifier fix
2016-09-22 14:11:20 +09:00
adammeyer
783d47f78b custom window level as string 2016-09-21 22:49:06 -04:00
adammeyer
b35bde662a custom window level docs 2016-09-21 19:06:36 -04:00
deepak1556
ad783652c8 update docs 2016-09-22 00:20:34 +05:30
deepak1556
7ba947aee9 add spec 2016-09-22 00:15:25 +05:30
Kevin Sawicki
696e5e73bc Upgrade Brigthray for CT log verifier fix 2016-09-21 11:29:09 -07:00
Kevin Sawicki
a723d17f49 Mention cleaning on all three platforms 2016-09-21 11:10:52 -07:00
Kevin Sawicki
f8236c1a65 Add more failure asserts for nativeImage.createFromPath 2016-09-21 10:48:24 -07:00
Kevin Sawicki
546c0e7822 Mention createFromPath failure cases 2016-09-21 10:48:01 -07:00
Kevin Sawicki
e7c4d2523b Mention mutating remote arrays and buffers 2016-09-21 10:44:54 -07:00
adammeyer
fbb3a288ec Allow custom window level when sending window to top 2016-09-21 13:35:59 -04:00
Kevin Sawicki
cae15ad6b5 Mention using fallback text when writing bookmarks on Windows 2016-09-21 10:31:01 -07:00
deepak1556
ed465208a2 renderer: add content settings class for managing storage 2016-09-21 21:47:30 +05:30
Kevin Sawicki
c2c48c4079 Merge pull request #7290 from tinydew4/translate-ko
Translate tutorial/about.md
2016-09-21 09:04:20 -07:00
Kevin Sawicki
dc7d2dab68 Merge pull request #7287 from tinydew4/translate-update
Update windows-store-guide.md in ko-KR docs
2016-09-21 09:03:48 -07:00
arus
146970d29d Add missing sample codes 2016-09-22 00:35:27 +09:00
arus
ba2cb42f0d Remove incorrect letters 2016-09-22 00:30:20 +09:00
arus
7dfe1a59b1 Translate remains in about.md 2016-09-22 00:18:28 +09:00
arus
4343f762ac Translate some in about.md 2016-09-22 00:15:57 +09:00
arus
e2f53c6bcc Translate some in about.md 2016-09-22 00:13:44 +09:00
arus
5c22f2ca5d Translate some in about.md 2016-09-22 00:05:26 +09:00
arus
b6d4014bd5 Translate some in about.md 2016-09-22 00:04:24 +09:00
arus
6b8f5f5b7f Translate some in about.md 2016-09-22 00:01:21 +09:00
arus
b7e2f819a3 Translate Core Philosophy in about.md 2016-09-21 23:55:16 +09:00
arus
a8e0e8d7fd Translate LTS in about.md 2016-09-21 23:42:07 +09:00
arus
beea9a7c36 Translate Update dependencies and Versioning in about.md 2016-09-21 23:35:19 +09:00
arus
a44d7a3bc6 Translate some in aboud.md 2016-09-21 23:11:29 +09:00
arus
b45db70d21 Translate Releases in about.md 2016-09-21 23:08:32 +09:00
arus
8feff471ce Modify some in about.md 2016-09-21 23:04:41 +09:00
arus
00dec166e9 Translate Core Team and Contributors in about.md 2016-09-21 23:03:23 +09:00
arus
ebbbaf1ab0 Translate Core Team and Contributors in about.md 2016-09-21 23:03:02 +09:00
arus
29312186de Translate about/about electron in Korean 2016-09-21 22:38:17 +09:00
arus
e1d9e4ffcb Merge branch 'translate-update' of https://github.com/tinydew4/electron into translate-update 2016-09-21 22:01:54 +09:00
arus
b6c04c9e35 Update windows-store-guide.md in ko-KR docs 2016-09-21 22:00:48 +09:00
arus
405b411a29 Merge branch 'translate-update' of https://github.com/tinydew4/electron into translate-update 2016-09-21 21:44:07 +09:00
arus
582fc50cf6 Update windows-store-guide.md in ko-KR docs 2016-09-21 21:43:18 +09:00
arus
b74cfda7b9 Update windows-store-guide.md in ko-KR docs 2016-09-21 21:35:35 +09:00
Cheng Zhao
805ce0dee9 Merge pull request #7276 from electron/google-api-key-env2
allow GOOGLE_API_KEY to be set
2016-09-21 15:16:29 +09:00
Zeke Sikelianos
f4a8fb9eb4 🎨 standard 2016-09-20 14:55:45 -07:00
Kevin Sawicki
85702604c3 Merge pull request #7277 from electron/dictionary-to-object
Set parameter type to Object instead of Dictionary
2016-09-20 14:48:48 -07:00
Kevin Sawicki
98999f4850 Add missing s in progress 2016-09-20 14:46:17 -07:00
Kevin Sawicki
b5e1571204 Set parameter type to Object 2016-09-20 14:26:55 -07:00
Zeke Sikelianos
d7934e7525 add link to chromium API keys doc 2016-09-20 14:13:30 -07:00
Zeke Sikelianos
7fcba6ba0f document the GOOGLE_API_KEY env var 2016-09-20 13:58:39 -07:00
Kevin Sawicki
ea1927f428 Store api_key_ on TokenLoadingJob 2016-09-20 13:24:45 -07:00
Zeke Sikelianos
fa2aaa48b1 allow GOOGLE_API_KEY to be set in environment 2016-09-20 12:01:59 -07:00
Kevin Sawicki
dee383db07 Merge pull request #7273 from tinydew4/fix-links
Fix some bronken links
2016-09-20 09:00:08 -07:00
Kevin Sawicki
04a1dc8e1e Merge pull request #7272 from tinydew4/translate-ko
Translate "offscreen rendering" in Korean
2016-09-20 08:59:53 -07:00
Kevin Sawicki
ae31ded165 Merge pull request #7265 from octref/patch-1
Add instruction for debugging main process in VSCode
2016-09-20 08:59:37 -07:00
arus
402e977b40 Fix some bronken links 2016-09-20 23:36:20 +09:00
arus
a65c8cae63 modify some 2016-09-20 23:30:46 +09:00
arus
47a03d3ca1 modify some 2016-09-20 23:29:34 +09:00
arus
b4a13fda3a Translate offscreen rendering in Korean 2016-09-20 23:19:15 +09:00
Cheng Zhao
e11672d42b Merge pull request #7262 from tinydew4/patch-1
Update browser-window.md
2016-09-20 16:04:25 +09:00
Cheng Zhao
30a6b597a5 Merge pull request #7239 from darkdh/6873
Emit scroll-touch-edge event instead of changing the behavior of scrollll-touch-begin/end
2016-09-20 14:51:10 +09:00
Pine
c45ca254e3 Add instruction for debugging main process in VSCode
I hope you don't mind me putting the VSCode part before `node-inspector`, because VSCode seems easier to setup, and VSCode could inspect `process` without crashing.
2016-09-19 22:43:05 -07:00
Cheng Zhao
143d7ab98f Merge pull request #7264 from electron/docs-readme
Docs Readme
2016-09-20 14:31:31 +09:00
Cheng Zhao
e3e450613d Merge pull request #7157 from Mossop/moveguest
Allow moving a webcontents to a different webview
2016-09-20 14:28:42 +09:00
Cheng Zhao
77fdc67235 Merge pull request #7173 from electron/windows-system-color
Add an app API method to fetch the system ColorizationColor
2016-09-20 14:06:21 +09:00
Zeke Sikelianos
61e50046bd link to the documentation styleguide 2016-09-19 21:10:36 -07:00
Zeke Sikelianos
1cdf8bbc10 break up run-on sentence 2016-09-19 21:09:31 -07:00
Zeke Sikelianos
a3d2cdaa2c website doesn't display docs for old versions any more 2016-09-19 21:09:02 -07:00
Arus
159e2f2dab Update browser-window.md 2016-09-20 11:26:04 +09:00
Kevin Sawicki
e8f3cf164b Merge pull request #7227 from electron/felix-cmd-strings
Ensure correct types for commandLine
2016-09-19 10:22:28 -07:00
Samuel Attard
456f102cdc Fix k typo 2016-09-20 02:42:41 +10:00
Samuel Attard
ba98109d33 Remove semicolons from spec 2016-09-20 02:41:26 +10:00
Samuel Attard
9f94652792 Add basic spec for getAccentColor 2016-09-20 02:41:26 +10:00
Samuel Attard
1454510549 Alphabetical method ordering 2016-09-20 02:41:26 +10:00
Samuel Attard
c0f8b4895d Update docs 2016-09-20 02:41:26 +10:00
Samuel Attard
5dd5dbb3d8 Add a systemPreferences API method to fetch the system ColorizationColor
This is useful for automatical app theming

* Fetches the color from the registry
* Returns an empty string if the fetch fails (a falsey value)
2016-09-20 02:41:26 +10:00
Kevin Sawicki
48fd2bd35f binding -> bindings 2016-09-19 09:31:59 -07:00
Felix Rieseberg
29fa48d8c3 🔧 Ensure correct types for commandLine
This commit ensures that arguments passed to `appendSwitch` and `appendArgument` are turned into strings before passing them over to the binding.
2016-09-19 09:31:59 -07:00
Felix Rieseberg
90bff4d9de 🔧 Ensure correct types for commandLine
This commit ensures that arguments passed to `appendSwitch` and `appendArgument` are turned into strings before passing them over to the binding.
2016-09-19 09:31:59 -07:00
Cheng Zhao
b05254807b Merge pull request #7253 from electron/osr-crash
Unsubscribe observer when OffScreenRenderWidgetHostView is destroyed
2016-09-19 17:54:31 +09:00
Cheng Zhao
e504d82554 spec: Suppress the download.pdf test on AppVeyor 2016-09-19 17:12:33 +09:00
Cheng Zhao
5bf746700e Unsubscribe observer when OffScreenRenderWidgetHostView is destroyed 2016-09-19 16:51:03 +09:00
Cheng Zhao
07a08077a2 Revert electron/brightray#246 2016-09-19 16:31:00 +09:00
Cheng Zhao
26004f1a66 Merge pull request #7241 from miniak/crashed-killed
Add killed argument for webContents.on("crashed") and app.on("gpu-process-crashed") events
2016-09-19 16:02:52 +09:00
Cheng Zhao
1c6586c4b9 Merge pull request #7238 from electron/felix-windows-store-docs
Update Windows Store Language
2016-09-19 15:54:23 +09:00
Cheng Zhao
0ac4b89a0a Merge pull request #7236 from yuya-oc/accelerator-for-redo
Use Ctrl+Y as the accelerator of redo on Windows
2016-09-19 15:53:44 +09:00
Cheng Zhao
6de1eef078 Merge pull request #7234 from Mossop/testhistoryreplace
 Test that replacement history entries don't break forward navigation.
2016-09-19 15:47:30 +09:00
Cheng Zhao
1fd819e500 Merge pull request #7231 from miniak/default-error-mode
Fix ELECTRON_DEFAULT_ERROR_MODE
2016-09-19 15:44:52 +09:00
Cheng Zhao
a260647b4f Merge pull request #7062 from MaxWhere/osr-sizing-fix
Offscreen invalidate and sizing fix
2016-09-19 15:38:11 +09:00
Cheng Zhao
ffe931bde7 Merge pull request #7226 from electron/power-monitor-error
Rethrow caught errors from process.binding
2016-09-19 15:25:18 +09:00
Cheng Zhao
27bc6c7883 Merge pull request #7233 from electron/deprecate-atom-shell-version
Deprecate process.versions['atom-shell']
2016-09-19 15:24:10 +09:00
Cheng Zhao
6c340cece8 Merge pull request #7229 from electron/update-clang
Update clang to r274142.
2016-09-19 15:23:57 +09:00
Cheng Zhao
64718173ef Merge pull request #7230 from electron/windows-x64-link-crypt32
Link against crypt32.lib
2016-09-19 15:23:41 +09:00
Yuya Ochiai
43f955194e 🏁 Use Ctrl+Y as the accelerator of redo on Windows 2016-09-18 17:07:34 +09:00
Milan Burda
8567f79e67 Add killed argument for webContents.on("crashed") and app.on("gpu-process-crashed") events 2016-09-17 17:02:36 -07:00
Anthony Tseng
269a87b26f Emit scroll-touch-edge event instead of changing the behavior of scroll-touch-begin/end
fix #6873
2016-09-17 22:50:10 +08:00
Felix Rieseberg
084110c56f 📝 Update Windows Store Language 2016-09-17 04:19:55 -07:00
Dave Townsend
47df447e4f Test that replacement history entries don't break forward navigation.
This is a test for #7175
2016-09-16 17:08:54 -07:00
Kevin Sawicki
1072519488 Mark atom-shell version as deprecated 2016-09-16 15:59:00 -07:00
gellert
37de2301f7 moves setsize call to osr renderwidgethostview 2016-09-16 23:28:51 +02:00
gellert
fec5a7d67a removes extra header 2016-09-16 23:27:51 +02:00
gellert
8baaad4e0d cleanup and adds docs 2016-09-16 23:27:51 +02:00
gellert
10ea0268e5 calling setsize only on osr windows 2016-09-16 23:27:11 +02:00
gellert
b4c220613f adds invalidate method and proper resizing 2016-09-16 23:27:11 +02:00
Zeke Sikelianos
d4b204799d Merge pull request #7120 from electron/lint-docs
Publish the public API as a JSON object
2016-09-16 14:05:32 -07:00
Milan Burda
12a2b144f3 Only drop the SEM_NOGPFAULTERRORBOX flag when calling SetErrorMode (ELECTRON_DEFAULT_ERROR_MODE) 2016-09-16 14:01:33 -07:00
Kevin Sawicki
7df86c48fa Link against crypt32.lib 2016-09-16 13:17:58 -07:00
Kevin Sawicki
0c3ad527e3 initialize -> require 2016-09-16 13:09:06 -07:00
Haojian Wu
37e30cef60 Update clang to r274142. 2016-09-16 21:59:25 +02:00
Kevin Sawicki
0fda86f79a Mention not requiring module until app is ready 2016-09-16 11:42:02 -07:00
Kevin Sawicki
e77d7e7f62 🎨 2016-09-16 11:41:53 -07:00
Kevin Sawicki
5d0f3534eb Rethrow binding errors 2016-09-16 11:34:52 -07:00
Kevin Sawicki
577394442b power-monitor -> powerMonitor 2016-09-16 09:58:27 -07:00
Cheng Zhao
d1274bb79f Update brightray for #7073 2016-09-16 21:28:24 +09:00
Cheng Zhao
da677b683b Merge pull request #7163 from MaxWhere/frame-sub-scale-fix
Frame subscriber improvements
2016-09-16 21:24:53 +09:00
Cheng Zhao
9dad9478fa Merge pull request #7169 from deepak1556/download_defaultname_patch
browser: provide a default filename when unable to generate from download data
2016-09-16 21:19:21 +09:00
Cheng Zhao
ea244a5188 Merge pull request #7209 from electron/remote-function-missing-properties
Guard against missing remote function properties
2016-09-16 21:11:12 +09:00
Cheng Zhao
69d4cac760 Merge branch 'release' 2016-09-16 21:03:54 +09:00
deepak1556
e7f1265b64 add save-to-disk disposition for new-window event 2016-09-16 16:30:26 +05:30
deepak1556
94faaf7d58 provide a default file name for downloads 2016-09-16 16:02:57 +05:30
deepak1556
d426d4ad90 add failing spec 2016-09-16 16:02:57 +05:30
gellert
64e53a17bd reverts subscriber api 2016-09-16 11:18:15 +02:00
Cheng Zhao
20d5a50ac9 Merge pull request #7178 from aichingm/master
🐧 Add support for different trash implementations
2016-09-16 17:43:09 +09:00
Cheng Zhao
9714348260 Merge pull request #6941 from deepak1556/blob_data_patch
protocol: provide blob uuid with uploadData
2016-09-16 17:01:15 +09:00
Plusb Preco
787bc85703 docs: Update Korean docs as upstream (#7211)
* 📝 Update `README-ko.md`

* Remove Korean readme specified header.
* Add Indonesia community link.

* 📝 Update Korean docs as upstream

* 📝 Update Korean docs as upstream

* 📝 Update Korean docs as upstream

* 📝 Update Korean docs as upstream

* 📝 Update Korean docs as upstream

* 📝 Mark untranslated docs

* 📝 Update Korean docs as upstream

[ci skip]

* 📝 Update Korean docs as upstream

[ci skip]

* 📝 Add untranslated files

[ci skip]

* 📝 Update Korean docs as upstream

[ci skip]

* 📝 Update Korean docs as upstream

* 📝 Update `README-ko.md`

* Remove Korean readme specified header.
* Add Indonesia community link.

* 📝 Update Korean docs as upstream

* 📝 Update Korean docs as upstream

* 📝 Update Korean docs as upstream

* 📝 Update Korean docs as upstream

* 📝 Update Korean docs as upstream

* 📝 Mark untranslated docs

* 📝 Update Korean docs as upstream

[ci skip]

* 📝 Update Korean docs as upstream

[ci skip]

* 📝 Add untranslated files

[ci skip]

* 📝 Update Korean docs as upstream

[ci skip]

* 📝 Update Korean docs as upstream

* 📝 Correct readme name

[ci skip]

* 📝 Update Korean docs as upstream

[ci skip]
2016-09-15 09:27:10 -07:00
Cheng Zhao
e62e62292a Bump v1.4.0 2016-09-15 14:44:38 +09:00
Cheng Zhao
b84d29fb32 Merge pull request #7213 from electron/chrome-update
Update to Chrome 53.0.2785.113
2016-09-15 14:44:10 +09:00
Cheng Zhao
5be8104104 Update to Chrome 53.0.2785.113 2016-09-15 14:27:56 +09:00
Kevin Sawicki
eef42770c6 Don't load remote properties until they are accessed 2016-09-14 13:29:49 -07:00
Kevin Sawicki
f792c720f4 Allow spec to be run multiple times in same runner 2016-09-14 11:16:44 -07:00
Kevin Sawicki
359ab2f9b3 Only set members when members exist 2016-09-14 10:54:23 -07:00
Kevin Sawicki
bc13536208 Add failing spec for missing remote properties 2016-09-14 10:53:25 -07:00
Kevin Sawicki
0d4872755c Merge pull request #7195 from Joshua-Anderson/update-node-req
Update nodejs requirement for building on linux
2016-09-14 09:52:23 -07:00
Cheng Zhao
4627311c34 Merge pull request #7104 from electron/chrome53
Upgrade to Chrome 53 and Node 6.5.0
2016-09-14 22:18:08 +09:00
Cheng Zhao
dc2ced14b8 Node module version should be 50 2016-09-14 17:08:13 +09:00
deepak1556
eafb6307d5 fix crash when using geolocation api with enableHighAccuracy option 2016-09-14 16:23:01 +09:00
Cheng Zhao
fbac635687 Only emit finalUpdate found-in-page events
Since Chrome 53 all meaningful results of found-in-page are finalUpdate.
2016-09-14 16:23:01 +09:00
Cheng Zhao
5ccd0a24e9 Fix compatibility with canScroll 2016-09-14 16:23:01 +09:00
Cheng Zhao
f8bdc7437d module search paths have changed 2016-09-14 16:23:01 +09:00
Cheng Zhao
1de2b77ee4 Update to Node 6.5.0 2016-09-14 16:23:00 +09:00
Cheng Zhao
18fd3e0329 Fix js linting error 2016-09-14 16:23:00 +09:00
Cheng Zhao
a510642a25 finalUpdate can be false 2016-09-14 16:23:00 +09:00
Cheng Zhao
30dd65e3a9 Fix failing spec when refreshing test window 2016-09-14 16:23:00 +09:00
Cheng Zhao
5708e86a05 Fix API change of findInPage API 2016-09-14 16:23:00 +09:00
Cheng Zhao
937ae7ef8f Fix crash caused by new network parameters 2016-09-14 16:23:00 +09:00
Cheng Zhao
4c56c1c2b2 Fix crash in offscreen renderer 2016-09-14 16:22:59 +09:00
Cheng Zhao
6d8f900916 Fix building on Windows 2016-09-14 16:22:43 +09:00
Cheng Zhao
4aa292c7cd Fix building on Linux 2016-09-14 16:22:43 +09:00
Cheng Zhao
f28e8d7168 Fix API changes of Chrome 53 2016-09-14 16:22:43 +09:00
Cheng Zhao
2e0a1a8a64 Upgrade to Chrome 53 2016-09-14 16:22:41 +09:00
Joshua Anderson
56b40ae6d2 Update nodejs requirement for building on linux 2016-09-13 19:41:53 -07:00
Zeke Sikelianos
9e8b0953f3 fix indentation 2016-09-12 10:47:36 -07:00
Mario Aichinger
893fc2cd53 🐧 Add support for different trash implementations
Make the trash implemantation in MoveItemToTrash selectable via an environment variable
2016-09-12 10:41:23 +02:00
gellert
2435f1b660 lint fix 2016-09-09 23:50:01 +02:00
gellert
afb551e94a updates tests 2016-09-09 23:40:10 +02:00
gellert
5754f3aea0 update docs 2016-09-09 23:26:14 +02:00
gellert
d3dc66e308 adds scale factor check and simplifies frame subscription 2016-09-09 23:17:17 +02:00
Dave Townsend
313b2faa3c Add a guestinstance attribute to webviews reflecting their current guest
instance ID and allowing moving a guest instance to a new webview.
2016-09-09 10:32:05 -07:00
Zeke Sikelianos
18585204b7 wrap line to stay under 80 chars 2016-09-09 10:07:22 -07:00
Zeke Sikelianos
3d40c720dd fix indentation and rename function 2016-09-09 10:07:22 -07:00
Zeke Sikelianos
8d201ae1ad generate electron-api.json and upload with release 2016-09-09 10:07:22 -07:00
Zeke Sikelianos
67c89b68d3 use new electron-docs-linter with node 4 support 2016-09-09 10:07:22 -07:00
Zeke Sikelianos
5937d37fc5 move linting work to electron-docs-linter's new CLI 2016-09-09 10:07:22 -07:00
Zeke Sikelianos
56a644d49f move electron.json to docs/api.json 2016-09-09 10:07:22 -07:00
Zeke Sikelianos
0c54700b16 add electron.json (compiled to target 1.2.7 release) 2016-09-09 10:07:22 -07:00
Zeke Sikelianos
3a5bf51d1d add lint-docs script 2016-09-09 10:07:22 -07:00
deepak1556
7b85ca0301 create helper class to read blob data 2016-09-01 08:52:44 +05:30
deepak1556
5cbc8d5c71 fix ambiguous constructor call 2016-09-01 01:01:52 +05:30
deepak1556
be4bc6b7ef fix docs and update specs 2016-09-01 01:01:52 +05:30
deepak1556
d2e40d4fc1 update api to work on public url and uuid 2016-09-01 01:01:52 +05:30
deepak1556
a23e7ecf8f add docs 2016-09-01 01:01:52 +05:30
deepak1556
0fb2339e3d session: api to retrieve blob data from uuid 2016-09-01 01:01:52 +05:30
deepak1556
2b0f632d51 provide blob uuid from upload data 2016-09-01 01:01:52 +05:30
808 changed files with 35335 additions and 11370 deletions

35
.clang-format Normal file
View File

@@ -0,0 +1,35 @@
# Defines the Chromium style for automatic reformatting.
# http://clang.llvm.org/docs/ClangFormatStyleOptions.html
BasedOnStyle: Chromium
# This defaults to 'Auto'. Explicitly set it for a while, so that
# 'vector<vector<int> >' in existing files gets formatted to
# 'vector<vector<int>>'. ('Auto' means that clang-format will only use
# 'int>>' if the file already contains at least one such instance.)
Standard: Cpp11
# Make sure code like:
# IPC_BEGIN_MESSAGE_MAP()
# IPC_MESSAGE_HANDLER(WidgetHostViewHost_Update, OnUpdate)
# IPC_END_MESSAGE_MAP()
# gets correctly indented.
MacroBlockBegin: "^\
BEGIN_MSG_MAP|\
BEGIN_MSG_MAP_EX|\
BEGIN_SAFE_MSG_MAP_EX|\
CR_BEGIN_MSG_MAP_EX|\
IPC_BEGIN_MESSAGE_MAP|\
IPC_BEGIN_MESSAGE_MAP_WITH_PARAM|\
IPC_PROTOBUF_MESSAGE_TRAITS_BEGIN|\
IPC_STRUCT_BEGIN|\
IPC_STRUCT_BEGIN_WITH_PARENT|\
IPC_STRUCT_TRAITS_BEGIN|\
POLPARAMS_BEGIN|\
PPAPI_BEGIN_MESSAGE_MAP$"
MacroBlockEnd: "^\
CR_END_MSG_MAP|\
END_MSG_MAP|\
IPC_END_MESSAGE_MAP|\
IPC_PROTOBUF_MESSAGE_TRAITS_END|\
IPC_STRUCT_END|\
IPC_STRUCT_TRAITS_END|\
POLPARAMS_END|\
PPAPI_END_MESSAGE_MAP$"

3
.gitignore vendored
View File

@@ -26,5 +26,4 @@ node_modules/
*.vcxproj.user
*.vcxproj.filters
*.sln
debug.log
npm-debug.log
*.log

2
.gitmodules vendored
View File

@@ -12,7 +12,7 @@
url = https://github.com/electron/chromium-breakpad.git
[submodule "vendor/native_mate"]
path = vendor/native_mate
url = https://github.com/zcbenz/native-mate.git
url = https://github.com/electron/native-mate.git
[submodule "vendor/crashpad"]
path = vendor/crashpad
url = https://github.com/electron/crashpad.git

View File

@@ -1 +1 @@
v6.3.0
v7.4.0

View File

@@ -1,6 +1,6 @@
# 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)
: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:

View File

@@ -1,2 +1,23 @@
<!--
Thanks for opening an issue! A few things to keep in mind:
- The issue tracker is only for bugs and feature requests.
- Before reporting a bug, please try reproducing your issue against
the latest version of Electron.
- If you need general advice, join our Slack: http://atom-slack.herokuapp.com
-->
* Electron version:
* Operating system:
### Expected behavior
<!-- What do you think should happen? -->
### Actual behavior
<!-- What actually happens? -->
### How to reproduce
<!-- For bugs, provide sample code or a repo URL that demos the problem -->

View File

@@ -1,4 +1,4 @@
Copyright (c) 2014 GitHub Inc.
Copyright (c) 2013-2017 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

@@ -2,10 +2,10 @@
[![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/kvxe4byi7jcxbe26/branch/master?svg=true)](https://ci.appveyor.com/project/Atom/electron)
[![devDependency Status](https://david-dm.org/electron/electron/dev-status.svg)](https://david-dm.org/electron/electron#info=devDependencies)
[![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/)
: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)
: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)
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
@@ -21,20 +21,20 @@ behavior to electron@github.com.
## Downloads
Prebuilt binaries and debug symbols of Electron for Linux, Windows and macOS can
be found on the [releases](https://github.com/electron/electron/releases) page.
You can also use [`npm`](https://docs.npmjs.com/) to install prebuilt electron
binaries:
To install prebuilt Electron binaries, use
[`npm`](https://docs.npmjs.com/):
```sh
# Install the `electron` command globally in your $PATH
npm install electron -g
# Install as a development dependency
npm install electron --save-dev
# Install the `electron` command globally in your $PATH
npm install electron -g
```
See the [releases page](https://github.com/electron/electron/releases) for
prebuilt binaries, debug symbols, and more.
### Mirrors
- [China](https://npm.taobao.org/mirrors/electron)
@@ -54,6 +54,7 @@ contains documents describing how to build and contribute to Electron.
- [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)
@@ -73,9 +74,15 @@ forums
- [`Atom`](http://atom-slack.herokuapp.com/) channel on Slack
- [`electron-br`](https://electron-br.slack.com) *(Brazilian Portuguese)*
- [`electron-kr`](http://www.meetup.com/electron-kr/) *(Korean)*
- [`electron-jp`](https://electron-jp-slackin.herokuapp.com/) *(Japanese)*
- [`electron-jp`](https://electron-jp.slack.com) *(Japanese)*
- [`electron-tr`](http://www.meetup.com/Electron-JS-Istanbul/) *(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.
## License
[MIT](https://github.com/electron/electron/blob/master/LICENSE)
When using the Electron or other GitHub logos, be sure to follow the [GitHub logo guidelines](https://github.com/logos).

9
SECURITY.md Normal file
View File

@@ -0,0 +1,9 @@
# Reporting Security Issues
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.
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).

View File

@@ -23,7 +23,7 @@
#include "ui/base/l10n/l10n_util.h"
#include "url/url_constants.h"
#if defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS)
#if defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_PEPPER_CDMS)
#include "chrome/common/widevine_cdm_constants.h"
#endif
@@ -71,7 +71,7 @@ content::PepperPluginInfo CreatePepperFlashInfo(const base::FilePath& path,
return plugin;
}
#if defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS)
#if defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_PEPPER_CDMS)
content::PepperPluginInfo CreateWidevineCdmInfo(const base::FilePath& path,
const std::string& version) {
content::PepperPluginInfo widevine_cdm;
@@ -135,7 +135,7 @@ void AddPepperFlashFromCommandLine(
plugins->push_back(CreatePepperFlashInfo(flash_path, flash_version));
}
#if defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS)
#if defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_PEPPER_CDMS)
void AddWidevineCdmFromCommandLine(
std::vector<content::PepperPluginInfo>* plugins) {
auto command_line = base::CommandLine::ForCurrentProcess();
@@ -187,7 +187,7 @@ void AtomContentClient::AddAdditionalSchemes(
void AtomContentClient::AddPepperPlugins(
std::vector<content::PepperPluginInfo>* plugins) {
AddPepperFlashFromCommandLine(plugins);
#if defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS)
#if defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_PEPPER_CDMS)
AddWidevineCdmFromCommandLine(plugins);
#endif
}
@@ -197,11 +197,20 @@ void AtomContentClient::AddServiceWorkerSchemes(
std::vector<std::string> schemes;
ConvertStringWithSeparatorToVector(&schemes, ",",
switches::kRegisterServiceWorkerSchemes);
if (!schemes.empty()) {
for (const std::string& scheme : schemes)
service_worker_schemes->insert(scheme);
}
for (const std::string& scheme : schemes)
service_worker_schemes->insert(scheme);
service_worker_schemes->insert(url::kFileScheme);
}
void AtomContentClient::AddSecureSchemesAndOrigins(
std::set<std::string>* secure_schemes,
std::set<GURL>* secure_origins) {
std::vector<std::string> schemes;
ConvertStringWithSeparatorToVector(&schemes, ",", switches::kSecureSchemes);
for (const std::string& scheme : schemes)
secure_schemes->insert(scheme);
}
} // namespace atom

View File

@@ -31,6 +31,9 @@ class AtomContentClient : public brightray::ContentClient {
std::vector<content::PepperPluginInfo>* plugins) override;
void AddServiceWorkerSchemes(
std::set<std::string>* service_worker_schemes) override;
void AddSecureSchemesAndOrigins(
std::set<std::string>* secure_schemes,
std::set<GURL>* secure_origins) override;
private:
DISALLOW_COPY_AND_ASSIGN(AtomContentClient);

View File

@@ -11,7 +11,9 @@
#include "atom/browser/atom_browser_client.h"
#include "atom/browser/relauncher.h"
#include "atom/common/google_api_key.h"
#include "atom/common/options_switches.h"
#include "atom/renderer/atom_renderer_client.h"
#include "atom/renderer/atom_sandboxed_renderer_client.h"
#include "atom/utility/atom_content_utility_client.h"
#include "base/command_line.h"
#include "base/debug/stack_trace.h"
@@ -29,7 +31,7 @@ namespace {
const char* kRelauncherProcess = "relauncher";
bool IsBrowserProcess(base::CommandLine* cmd) {
std::string process_type = cmd->GetSwitchValueASCII(switches::kProcessType);
std::string process_type = cmd->GetSwitchValueASCII(::switches::kProcessType);
return process_type.empty();
}
@@ -72,7 +74,7 @@ bool AtomMainDelegate::BasicStartupComplete(int* exit_code) {
// Only enable logging when --enable-logging is specified.
std::unique_ptr<base::Environment> env(base::Environment::Create());
if (!command_line->HasSwitch(switches::kEnableLogging) &&
if (!command_line->HasSwitch(::switches::kEnableLogging) &&
!env->HasVar("ELECTRON_ENABLE_LOGGING")) {
settings.logging_dest = logging::LOG_NONE;
logging::SetMinLogLevel(logging::LOG_NUM_SEVERITIES);
@@ -100,6 +102,9 @@ bool AtomMainDelegate::BasicStartupComplete(int* exit_code) {
#if defined(OS_WIN)
// Ignore invalid parameter errors.
_set_invalid_parameter_handler(InvalidParameterHandler);
// Disable the ActiveVerifier, which is used by Chrome to track possible
// bugs, but no use in Electron.
base::win::DisableHandleVerifier();
#endif
return brightray::MainDelegate::BasicStartupComplete(exit_code);
@@ -115,17 +120,23 @@ void AtomMainDelegate::PreSandboxStartup() {
auto command_line = base::CommandLine::ForCurrentProcess();
std::string process_type = command_line->GetSwitchValueASCII(
switches::kProcessType);
::switches::kProcessType);
// Only append arguments for browser process.
if (!IsBrowserProcess(command_line))
return;
// Disable renderer sandbox for most of node's functions.
command_line->AppendSwitch(switches::kNoSandbox);
if (command_line->HasSwitch(switches::kEnableSandbox)) {
// Disable setuid sandbox since it is not longer required on linux(namespace
// sandbox is available on most distros).
command_line->AppendSwitch(::switches::kDisableSetuidSandbox);
} else {
// Disable renderer sandbox for most of node's functions.
command_line->AppendSwitch(::switches::kNoSandbox);
}
// Allow file:// URIs to read other file:// URIs by default.
command_line->AppendSwitch(switches::kAllowFileAccessFromFiles);
command_line->AppendSwitch(::switches::kAllowFileAccessFromFiles);
#if defined(OS_MACOSX)
// Enable AVFoundation.
@@ -140,7 +151,13 @@ content::ContentBrowserClient* AtomMainDelegate::CreateContentBrowserClient() {
content::ContentRendererClient*
AtomMainDelegate::CreateContentRendererClient() {
renderer_client_.reset(new AtomRendererClient);
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableSandbox)) {
renderer_client_.reset(new AtomSandboxedRendererClient);
} else {
renderer_client_.reset(new AtomRendererClient);
}
return renderer_client_.get();
}

View File

@@ -7,12 +7,16 @@
#include "atom/app/uv_task_runner.h"
#include "atom/browser/javascript_environment.h"
#include "atom/browser/node_debugger.h"
#include "atom/common/api/atom_bindings.h"
#include "atom/common/crash_reporter/crash_reporter.h"
#include "atom/common/native_mate_converters/string16_converter.h"
#include "base/command_line.h"
#include "base/feature_list.h"
#include "base/threading/thread_task_runner_handle.h"
#include "gin/array_buffer.h"
#include "gin/public/isolate_holder.h"
#include "gin/v8_initializer.h"
#include "native_mate/dictionary.h"
#include "atom/common/node_includes.h"
@@ -42,14 +46,26 @@ int NodeMain(int argc, char *argv[]) {
const char** exec_argv;
node::Init(&argc, const_cast<const char**>(argv), &exec_argc, &exec_argv);
node::IsolateData isolate_data(gin_env.isolate(), loop);
node::Environment* env = node::CreateEnvironment(
gin_env.isolate(), loop, gin_env.context(), argc, argv,
&isolate_data, gin_env.context(), argc, argv,
exec_argc, exec_argv);
// Start our custom debugger implementation.
NodeDebugger node_debugger(gin_env.isolate());
if (node_debugger.IsRunning())
env->AssignToContext(v8::Debug::GetDebugContext());
env->AssignToContext(v8::Debug::GetDebugContext(gin_env.isolate()));
mate::Dictionary process(gin_env.isolate(), env->process_object());
#if defined(OS_WIN)
process.SetMethod("log", &AtomBindings::Log);
#endif
process.SetMethod("crash", &AtomBindings::Crash);
// Setup process.crashReporter.start in child node processes
auto reporter = mate::Dictionary::CreateEmpty(gin_env.isolate());
reporter.SetMethod("start", &crash_reporter::CrashReporter::StartInstance);
process.Set("crashReporter", reporter);
node::LoadEnvironment(env);

View File

@@ -12,7 +12,6 @@
#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/browser.h"
#include "atom/browser/login_handler.h"
#include "atom/browser/relauncher.h"
#include "atom/common/atom_command_line.h"
@@ -31,12 +30,15 @@
#include "base/path_service.h"
#include "base/strings/string_util.h"
#include "brightray/browser/brightray_paths.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/icon_manager.h"
#include "chrome/common/chrome_paths.h"
#include "content/public/browser/browser_accessibility_state.h"
#include "content/public/browser/client_certificate_delegate.h"
#include "content/public/browser/gpu_data_manager.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/common/content_switches.h"
#include "media/audio/audio_manager.h"
#include "native_mate/dictionary.h"
#include "native_mate/object_template_builder.h"
#include "net/ssl/ssl_cert_request_info.h"
@@ -297,6 +299,8 @@ struct Converter<Browser::LoginItemSettings> {
dict.Get("openAtLogin", &(out->open_at_login));
dict.Get("openAsHidden", &(out->open_as_hidden));
dict.Get("path", &(out->path));
dict.Get("args", &(out->args));
return true;
}
@@ -311,8 +315,21 @@ struct Converter<Browser::LoginItemSettings> {
return dict.GetHandle();
}
};
} // namespace mate
template<>
struct Converter<content::CertificateRequestResultType> {
static bool FromV8(v8::Isolate* isolate, v8::Local<v8::Value> val,
content::CertificateRequestResultType* out) {
bool b;
if (!ConvertFromV8(isolate, val, &b))
return false;
*out = b ? content::CERTIFICATE_REQUEST_RESULT_TYPE_CONTINUE :
content::CERTIFICATE_REQUEST_RESULT_TYPE_CANCEL;
return true;
}
};
} // namespace mate
namespace atom {
@@ -320,6 +337,15 @@ namespace api {
namespace {
IconLoader::IconSize GetIconSizeByString(const std::string& size) {
if (size == "small") {
return IconLoader::IconSize::SMALL;
} else if (size == "large") {
return IconLoader::IconSize::LARGE;
}
return IconLoader::IconSize::NORMAL;
}
// Return the path constant from string.
int GetPathConstant(const std::string& name) {
if (name == "appData")
@@ -377,9 +403,21 @@ void OnClientCertificateSelected(
v8::Isolate* isolate,
std::shared_ptr<content::ClientCertificateDelegate> delegate,
mate::Arguments* args) {
if (args->Length() == 2) {
delegate->ContinueWithCertificate(nullptr);
return;
}
v8::Local<v8::Value> val;
args->GetNext(&val);
if (val->IsNull()) {
delegate->ContinueWithCertificate(nullptr);
return;
}
mate::Dictionary cert_data;
if (!args->GetNext(&cert_data)) {
args->ThrowError();
if (!mate::ConvertFromV8(isolate, val, &cert_data)) {
args->ThrowError("Must pass valid certificate object.");
return;
}
@@ -435,6 +473,21 @@ int ImportIntoCertStore(
}
#endif
void OnIconDataAvailable(v8::Isolate* isolate,
const App::FileIconCallback& callback,
gfx::Image* icon) {
v8::Locker locker(isolate);
v8::HandleScope handle_scope(isolate);
if (icon && !icon->IsEmpty()) {
callback.Run(v8::Null(isolate), *icon);
} else {
v8::Local<v8::String> error_message =
v8::String::NewFromUtf8(isolate, "Failed to get file icon.");
callback.Run(v8::Exception::Error(error_message), gfx::Image());
}
}
} // namespace
App::App(v8::Isolate* isolate) {
@@ -490,6 +543,11 @@ void App::OnWillFinishLaunching() {
}
void App::OnFinishLaunching(const base::DictionaryValue& launch_info) {
#if defined(OS_LINUX)
// Set the application name for audio streams shown in external
// applications. Only affects pulseaudio currently.
media::AudioManager::SetGlobalAppName(Browser::Get()->GetName());
#endif
Emit("ready", launch_info);
}
@@ -522,11 +580,14 @@ void App::OnLogin(LoginHandler* login_handler,
login_handler->CancelAuth();
}
void App::OnCreateWindow(const GURL& target_url,
const std::string& frame_name,
WindowOpenDisposition disposition,
int render_process_id,
int render_frame_id) {
void App::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) {
v8::Locker locker(isolate());
v8::HandleScope handle_scope(isolate());
content::RenderFrameHost* rfh =
@@ -535,7 +596,11 @@ void App::OnCreateWindow(const GURL& target_url,
content::WebContents::FromRenderFrameHost(rfh);
if (web_contents) {
auto api_web_contents = WebContents::CreateFrom(isolate(), web_contents);
api_web_contents->OnCreateWindow(target_url, frame_name, disposition);
api_web_contents->OnCreateWindow(target_url,
frame_name,
disposition,
features,
body);
}
}
@@ -548,8 +613,8 @@ void App::AllowCertificateError(
bool overridable,
bool strict_enforcement,
bool expired_previous_decision,
const base::Callback<void(bool)>& callback,
content::CertificateRequestResultType* request) {
const base::Callback<void(content::CertificateRequestResultType)>&
callback) {
v8::Locker locker(isolate());
v8::HandleScope handle_scope(isolate());
bool prevent_default = Emit("certificate-error",
@@ -561,7 +626,7 @@ void App::AllowCertificateError(
// Deny the certificate by default.
if (!prevent_default)
*request = content::CERTIFICATE_REQUEST_RESULT_TYPE_DENY;
callback.Run(content::CERTIFICATE_REQUEST_RESULT_TYPE_DENY);
}
void App::SelectClientCertificate(
@@ -585,8 +650,9 @@ void App::SelectClientCertificate(
cert_request_info->client_certs[0].get());
}
void App::OnGpuProcessCrashed(base::TerminationStatus exit_code) {
Emit("gpu-process-crashed");
void App::OnGpuProcessCrashed(base::TerminationStatus status) {
Emit("gpu-process-crashed",
status == base::TERMINATION_STATUS_PROCESS_WAS_KILLED);
}
base::FilePath App::GetPath(mate::Arguments* args, const std::string& name) {
@@ -596,7 +662,7 @@ base::FilePath App::GetPath(mate::Arguments* args, const std::string& name) {
if (key >= 0)
succeed = PathService::Get(key, &path);
if (!succeed)
args->ThrowError("Failed to get path");
args->ThrowError("Failed to get '" + name + "' path");
return path;
}
@@ -604,7 +670,7 @@ void App::SetPath(mate::Arguments* args,
const std::string& name,
const base::FilePath& path) {
if (!path.IsAbsolute()) {
args->ThrowError("path must be absolute");
args->ThrowError("Path must be absolute");
return;
}
@@ -707,6 +773,12 @@ bool App::IsAccessibilitySupportEnabled() {
return ax_state->IsAccessibleBrowser();
}
Browser::LoginItemSettings App::GetLoginItemSettings(mate::Arguments* args) {
Browser::LoginItemSettings options;
args->GetNext(&options);
return Browser::Get()->GetLoginItemSettings(options);
}
#if defined(USE_NSS_CERTS)
void App::ImportCertificate(
const base::DictionaryValue& options,
@@ -795,6 +867,43 @@ JumpListResult App::SetJumpList(v8::Local<v8::Value> val,
}
#endif // defined(OS_WIN)
void App::GetFileIcon(const base::FilePath& path,
mate::Arguments* args) {
mate::Dictionary options;
IconLoader::IconSize icon_size;
FileIconCallback callback;
v8::Locker locker(isolate());
v8::HandleScope handle_scope(isolate());
base::FilePath normalized_path = path.NormalizePathSeparators();
if (!args->GetNext(&options)) {
icon_size = IconLoader::IconSize::NORMAL;
} else {
std::string icon_size_string;
options.Get("size", &icon_size_string);
icon_size = GetIconSizeByString(icon_size_string);
}
if (!args->GetNext(&callback)) {
args->ThrowError("Missing required callback function");
return;
}
auto icon_manager = g_browser_process->GetIconManager();
gfx::Image* icon =
icon_manager->LookupIconFromFilepath(normalized_path, icon_size);
if (icon) {
callback.Run(v8::Null(isolate()), *icon);
} else {
icon_manager->LoadIcon(
normalized_path, icon_size,
base::Bind(&OnIconDataAvailable, isolate(), callback),
&cancelable_task_tracker_);
}
}
// static
mate::Handle<App> App::Create(v8::Isolate* isolate) {
return mate::CreateHandle(isolate, new App(isolate));
@@ -828,8 +937,7 @@ void App::BuildPrototype(
base::Bind(&Browser::RemoveAsDefaultProtocolClient, browser))
.SetMethod("setBadgeCount", base::Bind(&Browser::SetBadgeCount, browser))
.SetMethod("getBadgeCount", base::Bind(&Browser::GetBadgeCount, browser))
.SetMethod("getLoginItemSettings",
base::Bind(&Browser::GetLoginItemSettings, browser))
.SetMethod("getLoginItemSettings", &App::GetLoginItemSettings)
.SetMethod("setLoginItemSettings",
base::Bind(&Browser::SetLoginItemSettings, browser))
#if defined(OS_MACOSX)
@@ -839,6 +947,8 @@ void App::BuildPrototype(
base::Bind(&Browser::SetUserActivity, browser))
.SetMethod("getCurrentActivityType",
base::Bind(&Browser::GetCurrentActivityType, browser))
.SetMethod("setAboutPanelOptions",
base::Bind(&Browser::SetAboutPanelOptions, browser))
#endif
#if defined(OS_WIN)
.SetMethod("setUserTasks", base::Bind(&Browser::SetUserTasks, browser))
@@ -862,7 +972,8 @@ void App::BuildPrototype(
.SetMethod("isAccessibilitySupportEnabled",
&App::IsAccessibilitySupportEnabled)
.SetMethod("disableHardwareAcceleration",
&App::DisableHardwareAcceleration);
&App::DisableHardwareAcceleration)
.SetMethod("getFileIcon", &App::GetFileIcon);
}
} // namespace api

View File

@@ -6,11 +6,15 @@
#define ATOM_BROWSER_API_ATOM_API_APP_H_
#include <string>
#include <vector>
#include "atom/browser/api/event_emitter.h"
#include "atom/browser/atom_browser_client.h"
#include "atom/browser/browser.h"
#include "atom/browser/browser_observer.h"
#include "atom/common/native_mate_converters/callback.h"
#include "base/task/cancelable_task_tracker.h"
#include "chrome/browser/icon_manager.h"
#include "chrome/browser/process_singleton.h"
#include "content/public/browser/gpu_data_manager_observer.h"
#include "native_mate/handle.h"
@@ -41,17 +45,23 @@ class App : public AtomBrowserClient::Delegate,
public BrowserObserver,
public content::GpuDataManagerObserver {
public:
using FileIconCallback = base::Callback<void(v8::Local<v8::Value>,
const gfx::Image&)>;
static mate::Handle<App> Create(v8::Isolate* isolate);
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,
int render_process_id,
int render_frame_id);
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(
@@ -94,15 +104,15 @@ class App : public AtomBrowserClient::Delegate,
bool overridable,
bool strict_enforcement,
bool expired_previous_decision,
const base::Callback<void(bool)>& callback,
content::CertificateRequestResultType* request) override;
const base::Callback<void(content::CertificateRequestResultType)>&
callback) override;
void SelectClientCertificate(
content::WebContents* web_contents,
net::SSLCertRequestInfo* cert_request_info,
std::unique_ptr<content::ClientCertificateDelegate> delegate) override;
// content::GpuDataManagerObserver:
void OnGpuProcessCrashed(base::TerminationStatus exit_code) override;
void OnGpuProcessCrashed(base::TerminationStatus status) override;
private:
// Get/Set the pre-defined path in PathService.
@@ -119,10 +129,13 @@ class App : public AtomBrowserClient::Delegate,
bool Relaunch(mate::Arguments* args);
void DisableHardwareAcceleration(mate::Arguments* args);
bool IsAccessibilitySupportEnabled();
Browser::LoginItemSettings GetLoginItemSettings(mate::Arguments* args);
#if defined(USE_NSS_CERTS)
void ImportCertificate(const base::DictionaryValue& options,
const net::CompletionCallback& callback);
#endif
void GetFileIcon(const base::FilePath& path,
mate::Arguments* args);
#if defined(OS_WIN)
// Get the current Jump List settings.
@@ -138,6 +151,9 @@ class App : public AtomBrowserClient::Delegate,
std::unique_ptr<CertificateManagerModel> certificate_manager_model_;
#endif
// Tracks tasks requesting file icons.
base::CancelableTaskTracker cancelable_task_tracker_;
DISALLOW_COPY_AND_ASSIGN(App);
};

View File

@@ -7,12 +7,13 @@
#include "atom/common/native_mate_converters/callback.h"
#include "atom/common/native_mate_converters/file_path_converter.h"
#include "atom/common/node_includes.h"
#include "base/bind.h"
#include "base/files/file_util.h"
#include "content/public/browser/tracing_controller.h"
#include "native_mate/dictionary.h"
#include "atom/common/node_includes.h"
using content::TracingController;
namespace mate {
@@ -68,10 +69,6 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
dict.SetMethod("stopRecording", &StopRecording);
dict.SetMethod("getTraceBufferUsage", base::Bind(
&TracingController::GetTraceBufferUsage, controller));
dict.SetMethod("setWatchEvent", base::Bind(
&TracingController::SetWatchEvent, controller));
dict.SetMethod("cancelWatchEvent", base::Bind(
&TracingController::CancelWatchEvent, controller));
}
} // namespace

View File

@@ -20,6 +20,7 @@
#include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_context_getter.h"
using atom::AtomCookieDelegate;
using content::BrowserThread;
namespace mate {
@@ -54,6 +55,28 @@ struct Converter<net::CanonicalCookie> {
}
};
template<>
struct Converter<net::CookieStore::ChangeCause> {
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate,
const net::CookieStore::ChangeCause& val) {
switch (val) {
case net::CookieStore::ChangeCause::INSERTED:
case net::CookieStore::ChangeCause::EXPLICIT:
return mate::StringToV8(isolate, "explicit");
case net::CookieStore::ChangeCause::OVERWRITE:
return mate::StringToV8(isolate, "overwrite");
case net::CookieStore::ChangeCause::EXPIRED:
return mate::StringToV8(isolate, "expired");
case net::CookieStore::ChangeCause::EVICTED:
return mate::StringToV8(isolate, "evicted");
case net::CookieStore::ChangeCause::EXPIRED_OVERWRITE:
return mate::StringToV8(isolate, "expired-overwrite");
default:
return mate::StringToV8(isolate, "unknown");
}
}
};
} // namespace mate
namespace atom {
@@ -206,11 +229,14 @@ void SetCookieOnIO(scoped_refptr<net::URLRequestContextGetter> getter,
Cookies::Cookies(v8::Isolate* isolate,
AtomBrowserContext* browser_context)
: request_context_getter_(browser_context->url_request_context_getter()) {
: request_context_getter_(browser_context->url_request_context_getter()),
cookie_delegate_(browser_context->cookie_delegate()) {
Init(isolate);
cookie_delegate_->AddObserver(this);
}
Cookies::~Cookies() {
cookie_delegate_->RemoveObserver(this);
}
void Cookies::Get(const base::DictionaryValue& filter,
@@ -239,6 +265,13 @@ void Cookies::Set(const base::DictionaryValue& details,
base::Bind(SetCookieOnIO, getter, Passed(&copied), callback));
}
void Cookies::OnCookieChanged(const net::CanonicalCookie& cookie,
bool removed,
net::CookieStore::ChangeCause cause) {
Emit("changed", cookie, cause, removed);
}
// static
mate::Handle<Cookies> Cookies::Create(
v8::Isolate* isolate,

View File

@@ -8,6 +8,7 @@
#include <string>
#include "atom/browser/api/trackable_object.h"
#include "atom/browser/net/atom_cookie_delegate.h"
#include "base/callback.h"
#include "native_mate/handle.h"
#include "net/cookies/canonical_cookie.h"
@@ -26,7 +27,8 @@ class AtomBrowserContext;
namespace api {
class Cookies : public mate::TrackableObject<Cookies> {
class Cookies : public mate::TrackableObject<Cookies>,
public AtomCookieDelegate::Observer {
public:
enum Error {
SUCCESS,
@@ -52,8 +54,14 @@ class Cookies : public mate::TrackableObject<Cookies> {
const base::Closure& callback);
void Set(const base::DictionaryValue& details, const SetCallback& callback);
// AtomCookieDelegate::Observer:
void OnCookieChanged(const net::CanonicalCookie& cookie,
bool removed,
net::CookieStore::ChangeCause cause) override;
private:
net::URLRequestContextGetter* request_context_getter_;
scoped_refptr<AtomCookieDelegate> cookie_delegate_;
DISALLOW_COPY_AND_ASSIGN(Cookies);
};

View File

@@ -9,7 +9,6 @@
#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 "atom/common/node_includes.h"
#include "base/json/json_reader.h"
#include "base/json/json_writer.h"
#include "content/public/browser/devtools_agent_host.h"
@@ -17,6 +16,8 @@
#include "native_mate/dictionary.h"
#include "native_mate/object_template_builder.h"
#include "atom/common/node_includes.h"
using content::DevToolsAgentHost;
namespace atom {
@@ -107,7 +108,7 @@ bool Debugger::IsAttached() {
void Debugger::Detach() {
if (!agent_host_.get())
return;
agent_host_->DetachClient();
agent_host_->DetachClient(this);
AgentHostClosed(agent_host_.get(), false);
agent_host_ = nullptr;
}
@@ -136,7 +137,7 @@ void Debugger::SendCommand(mate::Arguments* args) {
std::string json_args;
base::JSONWriter::Write(request, &json_args);
agent_host_->DispatchProtocolMessage(json_args);
agent_host_->DispatchProtocolMessage(this, json_args);
}
// static

View File

@@ -10,8 +10,7 @@
#include "chrome/browser/media/desktop_media_list.h"
#include "native_mate/dictionary.h"
#include "third_party/webrtc/modules/desktop_capture/desktop_capture_options.h"
#include "third_party/webrtc/modules/desktop_capture/screen_capturer.h"
#include "third_party/webrtc/modules/desktop_capture/window_capturer.h"
#include "third_party/webrtc/modules/desktop_capture/desktop_capturer.h"
#include "atom/common/node_includes.h"
@@ -61,10 +60,12 @@ void DesktopCapturer::StartHandling(bool capture_window,
options.set_disable_effects(false);
#endif
std::unique_ptr<webrtc::ScreenCapturer> screen_capturer(
capture_screen ? webrtc::ScreenCapturer::Create(options) : nullptr);
std::unique_ptr<webrtc::WindowCapturer> window_capturer(
capture_window ? webrtc::WindowCapturer::Create(options) : nullptr);
std::unique_ptr<webrtc::DesktopCapturer> screen_capturer(
capture_screen ? webrtc::DesktopCapturer::CreateScreenCapturer(options)
: nullptr);
std::unique_ptr<webrtc::DesktopCapturer> window_capturer(
capture_window ? webrtc::DesktopCapturer::CreateWindowCapturer(options)
: nullptr);
media_list_.reset(new NativeDesktopMediaList(
std::move(screen_capturer), std::move(window_capturer)));

View File

@@ -35,6 +35,27 @@ struct Converter<file_dialog::Filter> {
}
};
template<>
struct Converter<file_dialog::DialogSettings> {
static bool FromV8(v8::Isolate* isolate,
v8::Local<v8::Value> val,
file_dialog::DialogSettings* out) {
mate::Dictionary dict;
if (!ConvertFromV8(isolate, val, &dict))
return false;
dict.Get("window", &(out->parent_window));
dict.Get("title", &(out->title));
dict.Get("message", &(out->message));
dict.Get("buttonLabel", &(out->button_label));
dict.Get("nameFieldLabel", &(out->name_field_label));
dict.Get("defaultPath", &(out->default_path));
dict.Get("filters", &(out->filters));
dict.Get("properties", &(out->properties));
dict.Get("showsTagField", &(out->shows_tag_field));
return true;
}
};
} // namespace mate
namespace {
@@ -47,6 +68,8 @@ void ShowMessageBox(int type,
const std::string& title,
const std::string& message,
const std::string& detail,
const std::string& checkbox_label,
bool checkbox_checked,
const gfx::ImageSkia& icon,
atom::NativeWindow* window,
mate::Arguments* args) {
@@ -56,8 +79,8 @@ void ShowMessageBox(int type,
peek,
&callback)) {
atom::ShowMessageBox(window, (atom::MessageBoxType)type, buttons,
default_id, cancel_id, options, title,
message, detail, icon, callback);
default_id, cancel_id, options, title, message, detail,
checkbox_label, checkbox_checked, icon, callback);
} else {
int chosen = atom::ShowMessageBox(window, (atom::MessageBoxType)type,
buttons, default_id, cancel_id,
@@ -66,45 +89,32 @@ void ShowMessageBox(int type,
}
}
void ShowOpenDialog(const std::string& title,
const std::string& button_label,
const base::FilePath& default_path,
const file_dialog::Filters& filters,
int properties,
atom::NativeWindow* window,
void ShowOpenDialog(const file_dialog::DialogSettings& settings,
mate::Arguments* args) {
v8::Local<v8::Value> peek = args->PeekNext();
file_dialog::OpenDialogCallback callback;
if (mate::Converter<file_dialog::OpenDialogCallback>::FromV8(args->isolate(),
peek,
&callback)) {
file_dialog::ShowOpenDialog(window, title, button_label, default_path,
filters, properties, callback);
file_dialog::ShowOpenDialog(settings, callback);
} else {
std::vector<base::FilePath> paths;
if (file_dialog::ShowOpenDialog(window, title, button_label, default_path,
filters, properties, &paths))
if (file_dialog::ShowOpenDialog(settings, &paths))
args->Return(paths);
}
}
void ShowSaveDialog(const std::string& title,
const std::string& button_label,
const base::FilePath& default_path,
const file_dialog::Filters& filters,
atom::NativeWindow* window,
void ShowSaveDialog(const file_dialog::DialogSettings& settings,
mate::Arguments* args) {
v8::Local<v8::Value> peek = args->PeekNext();
file_dialog::SaveDialogCallback callback;
if (mate::Converter<file_dialog::SaveDialogCallback>::FromV8(args->isolate(),
peek,
&callback)) {
file_dialog::ShowSaveDialog(window, title, button_label, default_path,
filters, callback);
file_dialog::ShowSaveDialog(settings, callback);
} else {
base::FilePath path;
if (file_dialog::ShowSaveDialog(window, title, button_label, default_path,
filters, &path))
if (file_dialog::ShowSaveDialog(settings, &path))
args->Return(path);
}
}

View File

@@ -10,12 +10,13 @@
#include "atom/common/native_mate_converters/callback.h"
#include "atom/common/native_mate_converters/file_path_converter.h"
#include "atom/common/native_mate_converters/gurl_converter.h"
#include "atom/common/node_includes.h"
#include "base/message_loop/message_loop.h"
#include "base/strings/utf_string_conversions.h"
#include "base/threading/thread_task_runner_handle.h"
#include "native_mate/dictionary.h"
#include "net/base/filename_util.h"
#include "atom/common/node_includes.h"
namespace mate {
template<>
@@ -79,7 +80,8 @@ void DownloadItem::OnDownloadUpdated(content::DownloadItem* item) {
Emit("done", item->GetState());
// Destroy the item once item is downloaded.
base::MessageLoop::current()->PostTask(FROM_HERE, GetDestroyClosure());
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, GetDestroyClosure());
} else {
Emit("updated", item->GetState());
}
@@ -134,7 +136,7 @@ std::string DownloadItem::GetFilename() const {
std::string(),
download_item_->GetSuggestedFilename(),
GetMimeType(),
std::string()).LossyDisplayName());
"download").LossyDisplayName());
}
std::string DownloadItem::GetContentDisposition() const {
@@ -145,6 +147,10 @@ const GURL& DownloadItem::GetURL() const {
return download_item_->GetURL();
}
const std::vector<GURL>& DownloadItem::GetURLChain() const {
return download_item_->GetUrlChain();
}
content::DownloadItem::DownloadState DownloadItem::GetState() const {
return download_item_->GetState();
}
@@ -161,6 +167,18 @@ base::FilePath DownloadItem::GetSavePath() const {
return save_path_;
}
std::string DownloadItem::GetLastModifiedTime() const {
return download_item_->GetLastModifiedTime();
}
std::string DownloadItem::GetETag() const {
return download_item_->GetETag();
}
double DownloadItem::GetStartTime() const {
return download_item_->GetStartTime().ToDoubleT();
}
// static
void DownloadItem::BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::FunctionTemplate> prototype) {
@@ -179,10 +197,14 @@ void DownloadItem::BuildPrototype(v8::Isolate* isolate,
.SetMethod("getFilename", &DownloadItem::GetFilename)
.SetMethod("getContentDisposition", &DownloadItem::GetContentDisposition)
.SetMethod("getURL", &DownloadItem::GetURL)
.SetMethod("getURLChain", &DownloadItem::GetURLChain)
.SetMethod("getState", &DownloadItem::GetState)
.SetMethod("isDone", &DownloadItem::IsDone)
.SetMethod("setSavePath", &DownloadItem::SetSavePath)
.SetMethod("getSavePath", &DownloadItem::GetSavePath);
.SetMethod("getSavePath", &DownloadItem::GetSavePath)
.SetMethod("getLastModifiedTime", &DownloadItem::GetLastModifiedTime)
.SetMethod("getETag", &DownloadItem::GetETag)
.SetMethod("getStartTime", &DownloadItem::GetStartTime);
}
// static

View File

@@ -6,6 +6,7 @@
#define ATOM_BROWSER_API_ATOM_API_DOWNLOAD_ITEM_H_
#include <string>
#include <vector>
#include "atom/browser/api/trackable_object.h"
#include "base/files/file_path.h"
@@ -38,10 +39,14 @@ class DownloadItem : public mate::TrackableObject<DownloadItem>,
std::string GetFilename() const;
std::string GetContentDisposition() const;
const GURL& GetURL() const;
const std::vector<GURL>& GetURLChain() const;
content::DownloadItem::DownloadState GetState() const;
bool IsDone() const;
void SetSavePath(const base::FilePath& path);
base::FilePath GetSavePath() const;
std::string GetLastModifiedTime() const;
std::string GetETag() const;
double GetStartTime() const;
protected:
DownloadItem(v8::Isolate* isolate, content::DownloadItem* download_item);

View File

@@ -0,0 +1,61 @@
// Copyright (c) 2016 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_net.h"
#include "atom/browser/api/atom_api_url_request.h"
#include "atom/common/node_includes.h"
#include "native_mate/dictionary.h"
namespace atom {
namespace api {
Net::Net(v8::Isolate* isolate) {
Init(isolate);
}
Net::~Net() {}
// static
v8::Local<v8::Value> Net::Create(v8::Isolate* isolate) {
return mate::CreateHandle(isolate, new Net(isolate)).ToV8();
}
// static
void Net::BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::FunctionTemplate> prototype) {
prototype->SetClassName(mate::StringToV8(isolate, "Net"));
mate::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
.SetProperty("URLRequest", &Net::URLRequest);
}
v8::Local<v8::Value> Net::URLRequest(v8::Isolate* isolate) {
return URLRequest::GetConstructor(isolate)->GetFunction();
}
} // namespace api
} // namespace atom
namespace {
using atom::api::Net;
using atom::api::URLRequest;
void Initialize(v8::Local<v8::Object> exports,
v8::Local<v8::Value> unused,
v8::Local<v8::Context> context,
void* priv) {
v8::Isolate* isolate = context->GetIsolate();
URLRequest::SetConstructor(isolate, base::Bind(URLRequest::New));
mate::Dictionary dict(isolate, exports);
dict.Set("net", Net::Create(isolate));
dict.Set("Net", Net::GetConstructor(isolate)->GetFunction());
}
} // namespace
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_browser_net, Initialize)

View File

@@ -0,0 +1,35 @@
// Copyright (c) 2016 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_ATOM_API_NET_H_
#define ATOM_BROWSER_API_ATOM_API_NET_H_
#include "atom/browser/api/event_emitter.h"
namespace atom {
namespace api {
class Net : public mate::EventEmitter<Net> {
public:
static v8::Local<v8::Value> Create(v8::Isolate* isolate);
static void BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::FunctionTemplate> prototype);
v8::Local<v8::Value> URLRequest(v8::Isolate* isolate);
protected:
explicit Net(v8::Isolate* isolate);
~Net() override;
private:
DISALLOW_COPY_AND_ASSIGN(Net);
};
} // namespace api
} // namespace atom
#endif // ATOM_BROWSER_API_ATOM_API_NET_H_

View File

@@ -5,11 +5,12 @@
#include "atom/browser/api/atom_api_power_monitor.h"
#include "atom/browser/browser.h"
#include "atom/common/node_includes.h"
#include "base/power_monitor/power_monitor.h"
#include "base/power_monitor/power_monitor_device_source.h"
#include "native_mate/dictionary.h"
#include "atom/common/node_includes.h"
namespace atom {
namespace api {
@@ -43,7 +44,7 @@ v8::Local<v8::Value> PowerMonitor::Create(v8::Isolate* isolate) {
if (!Browser::Get()->is_ready()) {
isolate->ThrowException(v8::Exception::Error(mate::StringToV8(
isolate,
"Cannot initialize \"power-monitor\" module before app is ready")));
"Cannot require \"powerMonitor\" module before app is ready")));
return v8::Null(isolate);
}

View File

@@ -6,18 +6,21 @@
#include <string>
#include "atom/common/node_includes.h"
#include "content/public/browser/power_save_blocker.h"
#include "content/public/browser/browser_thread.h"
#include "native_mate/dictionary.h"
#include "atom/common/node_includes.h"
using content::BrowserThread;
namespace mate {
template<>
struct Converter<content::PowerSaveBlocker::PowerSaveBlockerType> {
struct Converter<device::PowerSaveBlocker::PowerSaveBlockerType> {
static bool FromV8(v8::Isolate* isolate,
v8::Local<v8::Value> val,
content::PowerSaveBlocker::PowerSaveBlockerType* out) {
using content::PowerSaveBlocker;
device::PowerSaveBlocker::PowerSaveBlockerType* out) {
using device::PowerSaveBlocker;
std::string type;
if (!ConvertFromV8(isolate, val, &type))
return false;
@@ -39,7 +42,7 @@ namespace api {
PowerSaveBlocker::PowerSaveBlocker(v8::Isolate* isolate)
: current_blocker_type_(
content::PowerSaveBlocker::kPowerSaveBlockPreventAppSuspension) {
device::PowerSaveBlocker::kPowerSaveBlockPreventAppSuspension) {
Init(isolate);
}
@@ -58,30 +61,32 @@ void PowerSaveBlocker::UpdatePowerSaveBlocker() {
// higher precedence level than |kPowerSaveBlockPreventAppSuspension|.
//
// Only the highest-precedence blocker type takes effect.
content::PowerSaveBlocker::PowerSaveBlockerType new_blocker_type =
content::PowerSaveBlocker::kPowerSaveBlockPreventAppSuspension;
device::PowerSaveBlocker::PowerSaveBlockerType new_blocker_type =
device::PowerSaveBlocker::kPowerSaveBlockPreventAppSuspension;
for (const auto& element : power_save_blocker_types_) {
if (element.second ==
content::PowerSaveBlocker::kPowerSaveBlockPreventDisplaySleep) {
device::PowerSaveBlocker::kPowerSaveBlockPreventDisplaySleep) {
new_blocker_type =
content::PowerSaveBlocker::kPowerSaveBlockPreventDisplaySleep;
device::PowerSaveBlocker::kPowerSaveBlockPreventDisplaySleep;
break;
}
}
if (!power_save_blocker_ || new_blocker_type != current_blocker_type_) {
std::unique_ptr<content::PowerSaveBlocker> new_blocker =
content::PowerSaveBlocker::Create(
std::unique_ptr<device::PowerSaveBlocker> new_blocker(
new device::PowerSaveBlocker(
new_blocker_type,
content::PowerSaveBlocker::kReasonOther,
ATOM_PRODUCT_NAME);
device::PowerSaveBlocker::kReasonOther,
ATOM_PRODUCT_NAME,
BrowserThread::GetTaskRunnerForThread(BrowserThread::UI),
BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE)));
power_save_blocker_.swap(new_blocker);
current_blocker_type_ = new_blocker_type;
}
}
int PowerSaveBlocker::Start(
content::PowerSaveBlocker::PowerSaveBlockerType type) {
device::PowerSaveBlocker::PowerSaveBlockerType type) {
static int count = 0;
power_save_blocker_types_[count] = type;
UpdatePowerSaveBlocker();

View File

@@ -9,7 +9,7 @@
#include <memory>
#include "atom/browser/api/trackable_object.h"
#include "content/public/browser/power_save_blocker.h"
#include "device/power_save_blocker/power_save_blocker.h"
#include "native_mate/handle.h"
namespace mate {
@@ -33,18 +33,18 @@ class PowerSaveBlocker : public mate::TrackableObject<PowerSaveBlocker> {
private:
void UpdatePowerSaveBlocker();
int Start(content::PowerSaveBlocker::PowerSaveBlockerType type);
int Start(device::PowerSaveBlocker::PowerSaveBlockerType type);
bool Stop(int id);
bool IsStarted(int id);
std::unique_ptr<content::PowerSaveBlocker> power_save_blocker_;
std::unique_ptr<device::PowerSaveBlocker> power_save_blocker_;
// Currnet blocker type used by |power_save_blocker_|
content::PowerSaveBlocker::PowerSaveBlockerType current_blocker_type_;
device::PowerSaveBlocker::PowerSaveBlockerType current_blocker_type_;
// Map from id to the corresponding blocker type for each request.
using PowerSaveBlockerTypeMap =
std::map<int, content::PowerSaveBlocker::PowerSaveBlockerType>;
std::map<int, device::PowerSaveBlocker::PowerSaveBlockerType>;
PowerSaveBlockerTypeMap power_save_blocker_types_;
DISALLOW_COPY_AND_ASSIGN(PowerSaveBlocker);

View File

@@ -46,7 +46,8 @@ std::vector<std::string> GetStandardSchemes() {
return g_standard_schemes;
}
void RegisterStandardSchemes(const std::vector<std::string>& schemes) {
void RegisterStandardSchemes(const std::vector<std::string>& schemes,
mate::Arguments* args) {
g_standard_schemes = schemes;
auto* policy = content::ChildProcessSecurityPolicy::GetInstance();
@@ -55,8 +56,17 @@ void RegisterStandardSchemes(const std::vector<std::string>& schemes) {
policy->RegisterWebSafeScheme(scheme);
}
// add switches to register as standard
base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
atom::switches::kStandardSchemes, base::JoinString(schemes, ","));
mate::Dictionary opts;
bool secure = false;
if (args->GetNext(&opts) && opts.Get("secure", &secure) && secure) {
// add switches to register as secure
base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
atom::switches::kSecureSchemes, base::JoinString(schemes, ","));
}
}
Protocol::Protocol(v8::Isolate* isolate, AtomBrowserContext* browser_context)
@@ -220,7 +230,7 @@ void RegisterStandardSchemes(
return;
}
atom::api::RegisterStandardSchemes(schemes);
atom::api::RegisterStandardSchemes(schemes, args);
}
void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,

View File

@@ -29,7 +29,8 @@ namespace atom {
namespace api {
std::vector<std::string> GetStandardSchemes();
void RegisterStandardSchemes(const std::vector<std::string>& schemes);
void RegisterStandardSchemes(const std::vector<std::string>& schemes,
mate::Arguments* args);
class Protocol : public mate::TrackableObject<Protocol> {
public:

View File

@@ -7,11 +7,12 @@
#include "atom/browser/api/atom_api_web_contents.h"
#include "atom/browser/atom_browser_client.h"
#include "atom/common/native_mate_converters/value_converter.h"
#include "atom/common/node_includes.h"
#include "content/public/browser/render_process_host.h"
#include "native_mate/dictionary.h"
#include "native_mate/object_template_builder.h"
#include "atom/common/node_includes.h"
namespace atom {
namespace api {

View File

@@ -97,7 +97,7 @@ v8::Local<v8::Value> Screen::Create(v8::Isolate* isolate) {
if (!Browser::Get()->is_ready()) {
isolate->ThrowException(v8::Exception::Error(mate::StringToV8(
isolate,
"Cannot initialize \"screen\" module before app is ready")));
"Cannot require \"screen\" module before app is ready")));
return v8::Null(isolate);
}

View File

@@ -29,11 +29,13 @@
#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/common/pref_names.h"
#include "components/prefs/pref_service.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/download_manager_delegate.h"
#include "content/public/browser/storage_partition.h"
#include "native_mate/dictionary.h"
#include "native_mate/object_template_builder.h"
@@ -49,6 +51,7 @@
#include "net/url_request/url_request_context_getter.h"
#include "ui/base/l10n/l10n_util.h"
using atom::api::Cookies;
using content::BrowserThread;
using content::StoragePartition;
@@ -60,6 +63,15 @@ struct ClearStorageDataOptions {
uint32_t quota_types = StoragePartition::QUOTA_MANAGED_STORAGE_MASK_ALL;
};
struct ClearAuthCacheOptions {
std::string type;
GURL origin;
std::string realm;
base::string16 username;
base::string16 password;
net::HttpAuth::Scheme auth_scheme;
};
uint32_t GetStorageMask(const std::vector<std::string>& storage_types) {
uint32_t storage_mask = 0;
for (const auto& it : storage_types) {
@@ -98,6 +110,18 @@ uint32_t GetQuotaMask(const std::vector<std::string>& quota_types) {
return quota_mask;
}
net::HttpAuth::Scheme GetAuthSchemeFromString(const std::string& scheme) {
if (scheme == "basic")
return net::HttpAuth::AUTH_SCHEME_BASIC;
if (scheme == "digest")
return net::HttpAuth::AUTH_SCHEME_DIGEST;
if (scheme == "ntlm")
return net::HttpAuth::AUTH_SCHEME_NTLM;
if (scheme == "negotiate")
return net::HttpAuth::AUTH_SCHEME_NEGOTIATE;
return net::HttpAuth::AUTH_SCHEME_MAX;
}
void SetUserAgentInIO(scoped_refptr<net::URLRequestContextGetter> getter,
const std::string& accept_lang,
const std::string& user_agent) {
@@ -129,7 +153,27 @@ struct Converter<ClearStorageDataOptions> {
}
};
template<>
template <>
struct Converter<ClearAuthCacheOptions> {
static bool FromV8(v8::Isolate* isolate,
v8::Local<v8::Value> val,
ClearAuthCacheOptions* out) {
mate::Dictionary options;
if (!ConvertFromV8(isolate, val, &options))
return false;
options.Get("type", &out->type);
options.Get("origin", &out->origin);
options.Get("realm", &out->realm);
options.Get("username", &out->username);
options.Get("password", &out->password);
std::string scheme;
if (options.Get("scheme", &scheme))
out->auth_scheme = GetAuthSchemeFromString(scheme);
return true;
}
};
template <>
struct Converter<net::ProxyConfig> {
static bool FromV8(v8::Isolate* isolate,
v8::Local<v8::Value> val,
@@ -160,6 +204,18 @@ struct Converter<net::ProxyConfig> {
}
};
template<>
struct Converter<atom::VerifyRequestParams> {
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate,
atom::VerifyRequestParams val) {
mate::Dictionary dict = mate::Dictionary::CreateEmpty(isolate);
dict.Set("hostname", val.hostname);
dict.Set("certificate", val.certificate);
dict.Set("verificationResult", val.default_result);
return dict.GetHandle();
}
};
} // namespace mate
namespace atom {
@@ -210,8 +266,8 @@ class ResolveProxyHelper {
// Start the request.
int result = proxy_service->ResolveProxy(
url, "GET", net::LOAD_NORMAL, &proxy_info_, completion_callback,
&pac_req_, nullptr, net::BoundNetLog());
url, "GET", &proxy_info_, completion_callback, &pac_req_, nullptr,
net::NetLogWithSource());
// Completed synchronously.
if (result != net::ERR_IO_PENDING)
@@ -227,6 +283,9 @@ class ResolveProxyHelper {
};
// Runs the callback in UI thread.
void RunCallbackInUI(const base::Callback<void()>& callback) {
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, callback);
}
template<typename ...T>
void RunCallbackInUI(const base::Callback<void(T...)>& callback, T... result) {
BrowserThread::PostTask(
@@ -312,6 +371,33 @@ void ClearHostResolverCacheInIO(
}
}
void ClearAuthCacheInIO(
const scoped_refptr<net::URLRequestContextGetter>& context_getter,
const ClearAuthCacheOptions& options,
const base::Closure& callback) {
auto request_context = context_getter->GetURLRequestContext();
auto network_session =
request_context->http_transaction_factory()->GetSession();
if (network_session) {
if (options.type == "password") {
auto auth_cache = network_session->http_auth_cache();
if (!options.origin.is_empty()) {
auth_cache->Remove(
options.origin, options.realm, options.auth_scheme,
net::AuthCredentials(options.username, options.password));
} else {
auth_cache->ClearEntriesAddedWithin(base::TimeDelta::Max());
}
} else if (options.type == "clientCertificate") {
auto client_auth_cache = network_session->ssl_client_auth_cache();
client_auth_cache->Remove(net::HostPortPair::FromURL(options.origin));
}
network_session->CloseAllConnections();
}
if (!callback.is_null())
RunCallbackInUI(callback);
}
void AllowNTLMCredentialsForDomainsInIO(
const scoped_refptr<net::URLRequestContextGetter>& context_getter,
const std::string& domains) {
@@ -330,12 +416,31 @@ void OnClearStorageDataDone(const base::Closure& callback) {
callback.Run();
}
void DownloadIdCallback(content::DownloadManager* download_manager,
const base::FilePath& path,
const std::vector<GURL>& url_chain,
const std::string& mime_type,
int64_t offset,
int64_t length,
const std::string& last_modified,
const std::string& etag,
const base::Time& start_time,
uint32_t id) {
download_manager->CreateDownloadItem(
base::GenerateGUID(), id, path, path, url_chain, GURL(), GURL(), GURL(),
GURL(), mime_type, mime_type, start_time, base::Time(), etag,
last_modified, offset, length, std::string(),
content::DownloadItem::INTERRUPTED,
content::DownloadDangerType::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS,
content::DOWNLOAD_INTERRUPT_REASON_NETWORK_TIMEOUT, false);
}
} // namespace
Session::Session(v8::Isolate* isolate, AtomBrowserContext* browser_context)
: devtools_network_emulation_client_id_(base::GenerateGUID()),
browser_context_(browser_context) {
// Observe DownloadManger to get download notifications.
// Observe DownloadManager to get download notifications.
content::BrowserContext::GetDownloadManager(browser_context)->
AddObserver(this);
@@ -356,10 +461,10 @@ void Session::OnDownloadCreated(content::DownloadManager* manager,
v8::Locker locker(isolate());
v8::HandleScope handle_scope(isolate());
bool prevent_default = Emit(
"will-download",
DownloadItem::Create(isolate(), item),
item->GetWebContents());
auto handle = DownloadItem::Create(isolate(), item);
if (item->GetState() == content::DownloadItem::INTERRUPTED)
handle->SetSavePath(item->GetTargetFilePath());
bool prevent_default = Emit("will-download", handle, item->GetWebContents());
if (prevent_default) {
item->Cancel(true);
item->Remove();
@@ -388,6 +493,11 @@ void Session::ClearStorageData(mate::Arguments* args) {
auto storage_partition =
content::BrowserContext::GetStoragePartition(browser_context(), nullptr);
if (options.storage_types & StoragePartition::REMOVE_DATA_MASK_COOKIES) {
// Reset media device id salt when cookies are cleared.
// https://w3c.github.io/mediacapture-main/#dom-mediadeviceinfo-deviceid
brightray::MediaDeviceIDSalt::Reset(browser_context()->prefs());
}
storage_partition->ClearData(
options.storage_types, options.quota_types, options.origin,
content::StoragePartition::OriginMatcherFunction(),
@@ -480,6 +590,22 @@ void Session::ClearHostResolverCache(mate::Arguments* args) {
callback));
}
void Session::ClearAuthCache(mate::Arguments* args) {
ClearAuthCacheOptions options;
if (!args->GetNext(&options)) {
args->ThrowError("Must specify options object");
return;
}
base::Closure callback;
args->GetNext(&callback);
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
base::Bind(&ClearAuthCacheInIO,
make_scoped_refptr(browser_context_->GetRequestContext()),
options, callback));
}
void Session::AllowNTLMCredentialsForDomains(const std::string& domains) {
BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
base::Bind(&AllowNTLMCredentialsForDomainsInIO,
@@ -504,9 +630,55 @@ std::string Session::GetUserAgent() {
return browser_context_->GetUserAgent();
}
void Session::GetBlobData(
const std::string& uuid,
const AtomBlobReader::CompletionCallback& callback) {
if (callback.is_null())
return;
AtomBlobReader* blob_reader =
browser_context()->GetBlobReader();
BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
base::Bind(&AtomBlobReader::StartReading,
base::Unretained(blob_reader),
uuid,
callback));
}
void Session::CreateInterruptedDownload(const mate::Dictionary& options) {
int64_t offset = 0, length = 0;
double start_time = 0.0;
std::string mime_type, last_modified, etag;
base::FilePath path;
std::vector<GURL> url_chain;
options.Get("path", &path);
options.Get("urlChain", &url_chain);
options.Get("mimeType", &mime_type);
options.Get("offset", &offset);
options.Get("length", &length);
options.Get("lastModified", &last_modified);
options.Get("eTag", &etag);
options.Get("startTime", &start_time);
if (path.empty() || url_chain.empty() || length == 0) {
isolate()->ThrowException(v8::Exception::Error(mate::StringToV8(
isolate(), "Must pass non-empty path, urlChain and length.")));
return;
}
if (offset >= length) {
isolate()->ThrowException(v8::Exception::Error(mate::StringToV8(
isolate(), "Must pass an offset value less than length.")));
return;
}
auto download_manager =
content::BrowserContext::GetDownloadManager(browser_context());
download_manager->GetDelegate()->GetNextId(base::Bind(
&DownloadIdCallback, download_manager, path, url_chain, mime_type, offset,
length, last_modified, etag, base::Time::FromDoubleT(start_time)));
}
v8::Local<v8::Value> Session::Cookies(v8::Isolate* isolate) {
if (cookies_.IsEmpty()) {
auto handle = atom::api::Cookies::Create(isolate, browser_context());
auto handle = Cookies::Create(isolate, browser_context());
cookies_.Reset(isolate, handle.ToV8());
}
return v8::Local<v8::Value>::New(isolate, cookies_);
@@ -578,14 +750,18 @@ void Session::BuildPrototype(v8::Isolate* isolate,
.SetMethod("setDownloadPath", &Session::SetDownloadPath)
.SetMethod("enableNetworkEmulation", &Session::EnableNetworkEmulation)
.SetMethod("disableNetworkEmulation", &Session::DisableNetworkEmulation)
.SetMethod("setCertificateVerifyProc", &Session::SetCertVerifyProc)
.SetMethod("_setCertificateVerifyProc", &Session::SetCertVerifyProc)
.SetMethod("setPermissionRequestHandler",
&Session::SetPermissionRequestHandler)
.SetMethod("clearHostResolverCache", &Session::ClearHostResolverCache)
.SetMethod("clearAuthCache", &Session::ClearAuthCache)
.SetMethod("allowNTLMCredentialsForDomains",
&Session::AllowNTLMCredentialsForDomains)
.SetMethod("setUserAgent", &Session::SetUserAgent)
.SetMethod("getUserAgent", &Session::GetUserAgent)
.SetMethod("getBlobData", &Session::GetBlobData)
.SetMethod("createInterruptedDownload",
&Session::CreateInterruptedDownload)
.SetProperty("cookies", &Session::Cookies)
.SetProperty("protocol", &Session::Protocol)
.SetProperty("webRequest", &Session::WebRequest);
@@ -615,6 +791,7 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
v8::Isolate* isolate = context->GetIsolate();
mate::Dictionary dict(isolate, exports);
dict.Set("Session", Session::GetConstructor(isolate)->GetFunction());
dict.Set("Cookies", Cookies::GetConstructor(isolate)->GetFunction());
dict.SetMethod("fromPartition", &FromPartition);
}

View File

@@ -8,6 +8,7 @@
#include <string>
#include "atom/browser/api/trackable_object.h"
#include "atom/browser/atom_blob_reader.h"
#include "base/values.h"
#include "content/public/browser/download_manager.h"
#include "native_mate/handle.h"
@@ -73,9 +74,13 @@ class Session: public mate::TrackableObject<Session>,
void SetPermissionRequestHandler(v8::Local<v8::Value> val,
mate::Arguments* args);
void ClearHostResolverCache(mate::Arguments* args);
void ClearAuthCache(mate::Arguments* args);
void AllowNTLMCredentialsForDomains(const std::string& domains);
void SetUserAgent(const std::string& user_agent, mate::Arguments* args);
std::string GetUserAgent();
void GetBlobData(const std::string& uuid,
const AtomBlobReader::CompletionCallback& callback);
void CreateInterruptedDownload(const mate::Dictionary& options);
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

@@ -8,10 +8,7 @@
#include "atom/common/native_mate_converters/value_converter.h"
#include "atom/common/node_includes.h"
#include "native_mate/dictionary.h"
#if defined(OS_WIN)
#include "ui/base/win/shell.h"
#endif
#include "ui/gfx/color_utils.h"
namespace atom {
@@ -19,16 +16,16 @@ namespace api {
SystemPreferences::SystemPreferences(v8::Isolate* isolate) {
Init(isolate);
#if defined(OS_WIN)
InitializeWindow();
#endif
}
SystemPreferences::~SystemPreferences() {
}
#if defined(OS_WIN)
bool SystemPreferences::IsAeroGlassEnabled() {
return ui::win::IsAeroGlassEnabled();
}
Browser::Get()->RemoveObserver(this);
#endif
}
#if !defined(OS_MACOSX)
bool SystemPreferences::IsDarkMode() {
@@ -36,6 +33,10 @@ bool SystemPreferences::IsDarkMode() {
}
#endif
bool SystemPreferences::IsInvertedColorScheme() {
return color_utils::IsInvertedColorScheme();
}
// static
mate::Handle<SystemPreferences> SystemPreferences::Create(
v8::Isolate* isolate) {
@@ -48,7 +49,9 @@ void SystemPreferences::BuildPrototype(
prototype->SetClassName(mate::StringToV8(isolate, "SystemPreferences"));
mate::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
#if defined(OS_WIN)
.SetMethod("getAccentColor", &SystemPreferences::GetAccentColor)
.SetMethod("isAeroGlassEnabled", &SystemPreferences::IsAeroGlassEnabled)
.SetMethod("getColor", &SystemPreferences::GetColor)
#elif defined(OS_MACOSX)
.SetMethod("postNotification",
&SystemPreferences::PostNotification)
@@ -63,9 +66,12 @@ void SystemPreferences::BuildPrototype(
.SetMethod("unsubscribeLocalNotification",
&SystemPreferences::UnsubscribeLocalNotification)
.SetMethod("getUserDefault", &SystemPreferences::GetUserDefault)
.SetMethod("setUserDefault", &SystemPreferences::SetUserDefault)
.SetMethod("isSwipeTrackingFromScrollEventsEnabled",
&SystemPreferences::IsSwipeTrackingFromScrollEventsEnabled)
#endif
.SetMethod("isInvertedColorScheme",
&SystemPreferences::IsInvertedColorScheme)
.SetMethod("isDarkMode", &SystemPreferences::IsDarkMode);
}

View File

@@ -12,6 +12,12 @@
#include "base/values.h"
#include "native_mate/handle.h"
#if defined(OS_WIN)
#include "atom/browser/browser.h"
#include "atom/browser/browser_observer.h"
#include "ui/gfx/sys_color_change_listener.h"
#endif
namespace base {
class DictionaryValue;
}
@@ -20,7 +26,12 @@ namespace atom {
namespace api {
class SystemPreferences : public mate::EventEmitter<SystemPreferences> {
class SystemPreferences : public mate::EventEmitter<SystemPreferences>
#if defined(OS_WIN)
, public BrowserObserver
, public gfx::SysColorChangeListener
#endif
{
public:
static mate::Handle<SystemPreferences> Create(v8::Isolate* isolate);
@@ -29,6 +40,23 @@ class SystemPreferences : public mate::EventEmitter<SystemPreferences> {
#if defined(OS_WIN)
bool IsAeroGlassEnabled();
typedef HRESULT (STDAPICALLTYPE *DwmGetColorizationColor)(DWORD *, BOOL *);
DwmGetColorizationColor dwmGetColorizationColor =
(DwmGetColorizationColor) GetProcAddress(LoadLibraryW(L"dwmapi.dll"),
"DwmGetColorizationColor");
std::string GetAccentColor();
std::string GetColor(const std::string& color, mate::Arguments* args);
void InitializeWindow();
// gfx::SysColorChangeListener:
void OnSysColorChange() override;
// BrowserObserver:
void OnFinishLaunching(const base::DictionaryValue& launch_info) override;
#elif defined(OS_MACOSX)
using NotificationCallback = base::Callback<
void(const std::string&, const base::DictionaryValue&)>;
@@ -45,9 +73,13 @@ 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 SetUserDefault(const std::string& name,
const std::string& type,
mate::Arguments* args);
bool IsSwipeTrackingFromScrollEventsEnabled();
#endif
bool IsDarkMode();
bool IsInvertedColorScheme();
protected:
explicit SystemPreferences(v8::Isolate* isolate);
@@ -64,6 +96,29 @@ class SystemPreferences : public mate::EventEmitter<SystemPreferences> {
#endif
private:
#if defined(OS_WIN)
// Static callback invoked when a message comes in to our messaging window.
static LRESULT CALLBACK
WndProcStatic(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam);
LRESULT CALLBACK
WndProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam);
// The window class of |window_|.
ATOM atom_;
// The handle of the module that contains the window procedure of |window_|.
HMODULE instance_;
// The window used for processing events.
HWND window_;
std::string current_color_;
bool invertered_color_scheme_;
std::unique_ptr<gfx::ScopedSysColorChangeListener> color_change_listener_;
#endif
DISALLOW_COPY_AND_ASSIGN(SystemPreferences);
};

View File

@@ -28,17 +28,17 @@ std::map<int, id> g_id_map;
} // namespace
void SystemPreferences::PostNotification(const std::string& name,
void SystemPreferences::PostNotification(const std::string& name,
const base::DictionaryValue& user_info) {
DoPostNotification(name, user_info, false);
}
void SystemPreferences::PostLocalNotification(const std::string& name,
void SystemPreferences::PostLocalNotification(const std::string& name,
const base::DictionaryValue& user_info) {
DoPostNotification(name, user_info, true);
}
void SystemPreferences::DoPostNotification(const std::string& name,
void SystemPreferences::DoPostNotification(const std::string& name,
const base::DictionaryValue& user_info, bool is_local) {
NSNotificationCenter* center = is_local ?
[NSNotificationCenter defaultCenter] :
@@ -128,16 +128,107 @@ v8::Local<v8::Value> SystemPreferences::GetUserDefault(
return mate::ConvertToV8(isolate(),
net::GURLWithNSURL([defaults URLForKey:key]));
} else if (type == "array") {
return mate::ConvertToV8(isolate(),
*NSArrayToListValue([defaults arrayForKey:key]));
std::unique_ptr<base::ListValue> list =
NSArrayToListValue([defaults arrayForKey:key]);
if (list == nullptr)
list.reset(new base::ListValue());
return mate::ConvertToV8(isolate(), *list);
} else if (type == "dictionary") {
return mate::ConvertToV8(isolate(),
*NSDictionaryToDictionaryValue([defaults dictionaryForKey:key]));
std::unique_ptr<base::DictionaryValue> dictionary =
NSDictionaryToDictionaryValue([defaults dictionaryForKey:key]);
if (dictionary == nullptr)
dictionary.reset(new base::DictionaryValue());
return mate::ConvertToV8(isolate(), *dictionary);
} else {
return v8::Undefined(isolate());
}
}
void SystemPreferences::SetUserDefault(const std::string& name,
const std::string& type,
mate::Arguments* args) {
const auto throwConversionError = [&] {
args->ThrowError("Unable to convert value to: " + type);
};
NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
NSString* key = base::SysUTF8ToNSString(name);
if (type == "string") {
std::string value;
if (!args->GetNext(&value)) {
throwConversionError();
return;
}
[defaults setObject:base::SysUTF8ToNSString(value) forKey:key];
} else if (type == "boolean") {
bool value;
if (!args->GetNext(&value)) {
throwConversionError();
return;
}
[defaults setBool:value forKey:key];
} else if (type == "float") {
float value;
if (!args->GetNext(&value)) {
throwConversionError();
return;
}
[defaults setFloat:value forKey:key];
} else if (type == "integer") {
int value;
if (!args->GetNext(&value)) {
throwConversionError();
return;
}
[defaults setInteger:value forKey:key];
} else if (type == "double") {
double value;
if (!args->GetNext(&value)) {
throwConversionError();
return;
}
[defaults setDouble:value forKey:key];
} else if (type == "url") {
GURL value;
if (!args->GetNext(&value)) {
throwConversionError();
return;
}
if (NSURL* url = net::NSURLWithGURL(value)) {
[defaults setURL:url forKey:key];
}
} else if (type == "array") {
base::ListValue value;
if (!args->GetNext(&value)) {
throwConversionError();
return;
}
if (NSArray* array = ListValueToNSArray(value)) {
[defaults setObject:array forKey:key];
}
} else if (type == "dictionary") {
base::DictionaryValue value;
if (!args->GetNext(&value)) {
throwConversionError();
return;
}
if (NSDictionary* dict = DictionaryValueToNSDictionary(value)) {
[defaults setObject:dict forKey:key];
}
} else {
args->ThrowError("Invalid type: " + type);
return;
}
}
bool SystemPreferences::IsDarkMode() {
NSString* mode = [[NSUserDefaults standardUserDefaults]
stringForKey:@"AppleInterfaceStyle"];

View File

@@ -0,0 +1,190 @@
// Copyright (c) 2014 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_system_preferences.h"
#include "atom/common/color_util.h"
#include "base/win/wrapped_window_proc.h"
#include "ui/base/win/shell.h"
#include "ui/gfx/color_utils.h"
#include "ui/gfx/win/hwnd_util.h"
namespace atom {
namespace {
const wchar_t kSystemPreferencesWindowClass[] =
L"Electron_SystemPreferencesHostWindow";
} // namespace
namespace api {
bool SystemPreferences::IsAeroGlassEnabled() {
return ui::win::IsAeroGlassEnabled();
}
std::string hexColorDWORDToRGBA(DWORD color) {
std::ostringstream stream;
stream << std::hex << color;
std::string hexColor = stream.str();
return hexColor.substr(2) + hexColor.substr(0, 2);
}
std::string SystemPreferences::GetAccentColor() {
DWORD color = 0;
BOOL opaque = FALSE;
if (FAILED(dwmGetColorizationColor(&color, &opaque))) {
return "";
}
return hexColorDWORDToRGBA(color);
}
std::string SystemPreferences::GetColor(const std::string& color,
mate::Arguments* args) {
int id;
if (color == "3d-dark-shadow") {
id = COLOR_3DDKSHADOW;
} else if (color == "3d-face") {
id = COLOR_3DFACE;
} else if (color == "3d-highlight") {
id = COLOR_3DHIGHLIGHT;
} else if (color == "3d-light") {
id = COLOR_3DLIGHT;
} else if (color == "3d-shadow") {
id = COLOR_3DSHADOW;
} else if (color == "active-border") {
id = COLOR_ACTIVEBORDER;
} else if (color == "active-caption") {
id = COLOR_ACTIVECAPTION;
} else if (color == "active-caption-gradient") {
id = COLOR_GRADIENTACTIVECAPTION;
} else if (color == "app-workspace") {
id = COLOR_APPWORKSPACE;
} else if (color == "button-text") {
id = COLOR_BTNTEXT;
} else if (color == "caption-text") {
id = COLOR_CAPTIONTEXT;
} else if (color == "desktop") {
id = COLOR_DESKTOP;
} else if (color == "disabled-text") {
id = COLOR_GRAYTEXT;
} else if (color == "highlight") {
id = COLOR_HIGHLIGHT;
} else if (color == "highlight-text") {
id = COLOR_HIGHLIGHTTEXT;
} else if (color == "hotlight") {
id = COLOR_HOTLIGHT;
} else if (color == "inactive-border") {
id = COLOR_INACTIVEBORDER;
} else if (color == "inactive-caption") {
id = COLOR_INACTIVECAPTION;
} else if (color == "inactive-caption-gradient") {
id = COLOR_GRADIENTINACTIVECAPTION;
} else if (color == "inactive-caption-text") {
id = COLOR_INACTIVECAPTIONTEXT;
} else if (color == "info-background") {
id = COLOR_INFOBK;
} else if (color == "info-text") {
id = COLOR_INFOTEXT;
} else if (color == "menu") {
id = COLOR_MENU;
} else if (color == "menu-highlight") {
id = COLOR_MENUHILIGHT;
} else if (color == "menubar") {
id = COLOR_MENUBAR;
} else if (color == "menu-text") {
id = COLOR_MENUTEXT;
} else if (color == "scrollbar") {
id = COLOR_SCROLLBAR;
} else if (color == "window") {
id = COLOR_WINDOW;
} else if (color == "window-frame") {
id = COLOR_WINDOWFRAME;
} else if (color == "window-text") {
id = COLOR_WINDOWTEXT;
} else {
args->ThrowError("Unknown color: " + color);
return "";
}
return ToRGBHex(color_utils::GetSysSkColor(id));
}
void SystemPreferences::InitializeWindow() {
invertered_color_scheme_ = IsInvertedColorScheme();
// Wait until app is ready before creating sys color listener
// Creating this listener before the app is ready causes global shortcuts
// to not fire
if (Browser::Get()->is_ready())
color_change_listener_.reset(new gfx::ScopedSysColorChangeListener(this));
else
Browser::Get()->AddObserver(this);
WNDCLASSEX window_class;
base::win::InitializeWindowClass(
kSystemPreferencesWindowClass,
&base::win::WrappedWindowProc<SystemPreferences::WndProcStatic>,
0, 0, 0, NULL, NULL, NULL, NULL, NULL,
&window_class);
instance_ = window_class.hInstance;
atom_ = RegisterClassEx(&window_class);
// Create an offscreen window for receiving broadcast messages for the system
// colorization color. Create a hidden WS_POPUP window instead of an
// HWND_MESSAGE window, because only top-level windows such as popups can
// receive broadcast messages like "WM_DWMCOLORIZATIONCOLORCHANGED".
window_ = CreateWindow(MAKEINTATOM(atom_),
0, WS_POPUP, 0, 0, 0, 0, 0, 0, instance_, 0);
gfx::CheckWindowCreated(window_);
gfx::SetWindowUserData(window_, this);
}
LRESULT CALLBACK SystemPreferences::WndProcStatic(HWND hwnd,
UINT message,
WPARAM wparam,
LPARAM lparam) {
SystemPreferences* msg_wnd = reinterpret_cast<SystemPreferences*>(
GetWindowLongPtr(hwnd, GWLP_USERDATA));
if (msg_wnd)
return msg_wnd->WndProc(hwnd, message, wparam, lparam);
else
return ::DefWindowProc(hwnd, message, wparam, lparam);
}
LRESULT CALLBACK SystemPreferences::WndProc(HWND hwnd,
UINT message,
WPARAM wparam,
LPARAM lparam) {
if (message == WM_DWMCOLORIZATIONCOLORCHANGED) {
DWORD new_color = (DWORD) wparam;
std::string new_color_string = hexColorDWORDToRGBA(new_color);
if (new_color_string != current_color_) {
Emit("accent-color-changed", hexColorDWORDToRGBA(new_color));
current_color_ = new_color_string;
}
}
return ::DefWindowProc(hwnd, message, wparam, lparam);
}
void SystemPreferences::OnSysColorChange() {
bool new_invertered_color_scheme = IsInvertedColorScheme();
if (new_invertered_color_scheme != invertered_color_scheme_) {
invertered_color_scheme_ = new_invertered_color_scheme;
Emit("inverted-color-scheme-changed", new_invertered_color_scheme);
}
Emit("color-changed");
}
void SystemPreferences::OnFinishLaunching(
const base::DictionaryValue& launch_info) {
color_change_listener_.reset(new gfx::ScopedSysColorChangeListener(this));
}
} // namespace api
} // namespace atom

View File

@@ -13,6 +13,7 @@
#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/threading/thread_task_runner_handle.h"
#include "native_mate/constructor.h"
#include "native_mate/dictionary.h"
#include "ui/gfx/image/image.h"
@@ -71,7 +72,8 @@ Tray::Tray(v8::Isolate* isolate, v8::Local<v8::Object> wrapper,
Tray::~Tray() {
// Destroy the native tray in next tick.
base::MessageLoop::current()->DeleteSoon(FROM_HERE, tray_icon_.release());
base::ThreadTaskRunnerHandle::Get()->DeleteSoon(
FROM_HERE, tray_icon_.release());
}
// static

View File

@@ -0,0 +1,448 @@
// Copyright (c) 2016 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_url_request.h"
#include <string>
#include "atom/browser/api/atom_api_session.h"
#include "atom/browser/net/atom_url_request.h"
#include "atom/common/api/event_emitter_caller.h"
#include "atom/common/native_mate_converters/callback.h"
#include "atom/common/native_mate_converters/net_converter.h"
#include "atom/common/native_mate_converters/string16_converter.h"
#include "atom/common/node_includes.h"
#include "native_mate/dictionary.h"
namespace mate {
template <>
struct Converter<scoped_refptr<const net::IOBufferWithSize>> {
static v8::Local<v8::Value> ToV8(
v8::Isolate* isolate,
scoped_refptr<const net::IOBufferWithSize> buffer) {
return node::Buffer::Copy(isolate, buffer->data(), buffer->size())
.ToLocalChecked();
}
static bool FromV8(v8::Isolate* isolate,
v8::Local<v8::Value> val,
scoped_refptr<const net::IOBufferWithSize>* out) {
auto size = node::Buffer::Length(val);
if (size == 0) {
// Support conversion from empty buffer. A use case is
// a GET request without body.
// Since zero-sized IOBuffer(s) are not supported, we set the
// out pointer to null.
*out = nullptr;
return true;
}
auto data = node::Buffer::Data(val);
if (!data) {
// This is an error as size is positive but data is null.
return false;
}
*out = new net::IOBufferWithSize(size);
// We do a deep copy. We could have used Buffer's internal memory
// but that is much more complicated to be properly handled.
memcpy((*out)->data(), data, size);
return true;
}
};
} // namespace mate
namespace atom {
namespace api {
template <typename Flags>
URLRequest::StateBase<Flags>::StateBase(Flags initialState)
: state_(initialState) {}
template <typename Flags>
void URLRequest::StateBase<Flags>::SetFlag(Flags flag) {
state_ =
static_cast<Flags>(static_cast<int>(state_) | static_cast<int>(flag));
}
template <typename Flags>
bool URLRequest::StateBase<Flags>::operator==(Flags flag) const {
return state_ == flag;
}
template <typename Flags>
bool URLRequest::StateBase<Flags>::IsFlagSet(Flags flag) const {
return static_cast<int>(state_) & static_cast<int>(flag);
}
URLRequest::RequestState::RequestState()
: StateBase(RequestStateFlags::kNotStarted) {}
bool URLRequest::RequestState::NotStarted() const {
return *this == RequestStateFlags::kNotStarted;
}
bool URLRequest::RequestState::Started() const {
return IsFlagSet(RequestStateFlags::kStarted);
}
bool URLRequest::RequestState::Finished() const {
return IsFlagSet(RequestStateFlags::kFinished);
}
bool URLRequest::RequestState::Canceled() const {
return IsFlagSet(RequestStateFlags::kCanceled);
}
bool URLRequest::RequestState::Failed() const {
return IsFlagSet(RequestStateFlags::kFailed);
}
bool URLRequest::RequestState::Closed() const {
return IsFlagSet(RequestStateFlags::kClosed);
}
URLRequest::ResponseState::ResponseState()
: StateBase(ResponseStateFlags::kNotStarted) {}
bool URLRequest::ResponseState::NotStarted() const {
return *this == ResponseStateFlags::kNotStarted;
}
bool URLRequest::ResponseState::Started() const {
return IsFlagSet(ResponseStateFlags::kStarted);
}
bool URLRequest::ResponseState::Ended() const {
return IsFlagSet(ResponseStateFlags::kEnded);
}
bool URLRequest::ResponseState::Failed() const {
return IsFlagSet(ResponseStateFlags::kFailed);
}
URLRequest::URLRequest(v8::Isolate* isolate, v8::Local<v8::Object> wrapper) {
InitWith(isolate, wrapper);
}
URLRequest::~URLRequest() {
// A request has been created in JS, it was not used and then
// it got collected, no close event to cleanup, only destructor
// is called.
if (atom_request_) {
atom_request_->Terminate();
}
}
// static
mate::WrappableBase* URLRequest::New(mate::Arguments* args) {
auto isolate = args->isolate();
v8::Local<v8::Object> options;
args->GetNext(&options);
mate::Dictionary dict(isolate, options);
std::string method;
dict.Get("method", &method);
std::string url;
dict.Get("url", &url);
std::string partition;
mate::Handle<api::Session> session;
if (dict.Get("session", &session)) {
} else if (dict.Get("partition", &partition)) {
session = Session::FromPartition(isolate, partition);
} else {
// Use the default session if not specified.
session = Session::FromPartition(isolate, "");
}
auto browser_context = session->browser_context();
auto api_url_request = new URLRequest(args->isolate(), args->GetThis());
auto atom_url_request =
AtomURLRequest::Create(browser_context, method, url, api_url_request);
api_url_request->atom_request_ = atom_url_request;
return api_url_request;
}
// static
void URLRequest::BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::FunctionTemplate> prototype) {
prototype->SetClassName(mate::StringToV8(isolate, "URLRequest"));
mate::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
// Request API
.MakeDestroyable()
.SetMethod("write", &URLRequest::Write)
.SetMethod("cancel", &URLRequest::Cancel)
.SetMethod("setExtraHeader", &URLRequest::SetExtraHeader)
.SetMethod("removeExtraHeader", &URLRequest::RemoveExtraHeader)
.SetMethod("setChunkedUpload", &URLRequest::SetChunkedUpload)
.SetMethod("_setLoadFlags", &URLRequest::SetLoadFlags)
.SetProperty("notStarted", &URLRequest::NotStarted)
.SetProperty("finished", &URLRequest::Finished)
// Response APi
.SetProperty("statusCode", &URLRequest::StatusCode)
.SetProperty("statusMessage", &URLRequest::StatusMessage)
.SetProperty("rawResponseHeaders", &URLRequest::RawResponseHeaders)
.SetProperty("httpVersionMajor", &URLRequest::ResponseHttpVersionMajor)
.SetProperty("httpVersionMinor", &URLRequest::ResponseHttpVersionMinor);
}
bool URLRequest::NotStarted() const {
return request_state_.NotStarted();
}
bool URLRequest::Finished() const {
return request_state_.Finished();
}
bool URLRequest::Canceled() const {
return request_state_.Canceled();
}
bool URLRequest::Write(scoped_refptr<const net::IOBufferWithSize> buffer,
bool is_last) {
if (request_state_.Canceled() || request_state_.Failed() ||
request_state_.Finished() || request_state_.Closed()) {
return false;
}
if (request_state_.NotStarted()) {
request_state_.SetFlag(RequestStateFlags::kStarted);
// Pin on first write.
Pin();
}
if (is_last) {
request_state_.SetFlag(RequestStateFlags::kFinished);
EmitRequestEvent(true, "finish");
}
DCHECK(atom_request_);
if (atom_request_) {
return atom_request_->Write(buffer, is_last);
}
return false;
}
void URLRequest::Cancel() {
if (request_state_.Canceled() || request_state_.Closed()) {
// Cancel only once.
return;
}
// Mark as canceled.
request_state_.SetFlag(RequestStateFlags::kCanceled);
DCHECK(atom_request_);
if (atom_request_ && request_state_.Started()) {
// Really cancel if it was started.
atom_request_->Cancel();
}
EmitRequestEvent(true, "abort");
if (response_state_.Started() && !response_state_.Ended()) {
EmitResponseEvent(true, "aborted");
}
Close();
}
bool URLRequest::SetExtraHeader(const std::string& name,
const std::string& value) {
// Request state must be in the initial non started state.
if (!request_state_.NotStarted()) {
// Cannot change headers after send.
return false;
}
if (!net::HttpUtil::IsValidHeaderName(name)) {
return false;
}
if (!net::HttpUtil::IsValidHeaderValue(value)) {
return false;
}
DCHECK(atom_request_);
if (atom_request_) {
atom_request_->SetExtraHeader(name, value);
}
return true;
}
void URLRequest::RemoveExtraHeader(const std::string& name) {
// State must be equal to not started.
if (!request_state_.NotStarted()) {
// Cannot change headers after send.
return;
}
DCHECK(atom_request_);
if (atom_request_) {
atom_request_->RemoveExtraHeader(name);
}
}
void URLRequest::SetChunkedUpload(bool is_chunked_upload) {
// State must be equal to not started.
if (!request_state_.NotStarted()) {
// Cannot change headers after send.
return;
}
DCHECK(atom_request_);
if (atom_request_) {
atom_request_->SetChunkedUpload(is_chunked_upload);
}
}
void URLRequest::SetLoadFlags(int flags) {
// State must be equal to not started.
if (!request_state_.NotStarted()) {
// Cannot change load flags after start.
return;
}
DCHECK(atom_request_);
if (atom_request_) {
atom_request_->SetLoadFlags(flags);
}
}
void URLRequest::OnAuthenticationRequired(
scoped_refptr<const net::AuthChallengeInfo> auth_info) {
if (request_state_.Canceled() || request_state_.Closed()) {
return;
}
DCHECK(atom_request_);
if (!atom_request_) {
return;
}
Emit("login", auth_info.get(),
base::Bind(&AtomURLRequest::PassLoginInformation, atom_request_));
}
void URLRequest::OnResponseStarted(
scoped_refptr<net::HttpResponseHeaders> response_headers) {
if (request_state_.Canceled() || request_state_.Failed() ||
request_state_.Closed()) {
// Don't emit any event after request cancel.
return;
}
response_headers_ = response_headers;
response_state_.SetFlag(ResponseStateFlags::kStarted);
Emit("response");
}
void URLRequest::OnResponseData(
scoped_refptr<const net::IOBufferWithSize> buffer) {
if (request_state_.Canceled() || request_state_.Closed() ||
request_state_.Failed() || response_state_.Failed()) {
// In case we received an unexpected event from Chromium net,
// don't emit any data event after request cancel/error/close.
return;
}
if (!buffer || !buffer->data() || !buffer->size()) {
return;
}
Emit("data", buffer);
}
void URLRequest::OnResponseCompleted() {
if (request_state_.Canceled() || request_state_.Closed() ||
request_state_.Failed() || response_state_.Failed()) {
// In case we received an unexpected event from Chromium net,
// don't emit any data event after request cancel/error/close.
return;
}
response_state_.SetFlag(ResponseStateFlags::kEnded);
Emit("end");
Close();
}
void URLRequest::OnError(const std::string& error, bool isRequestError) {
auto error_object = v8::Exception::Error(mate::StringToV8(isolate(), error));
if (isRequestError) {
request_state_.SetFlag(RequestStateFlags::kFailed);
EmitRequestEvent(false, "error", error_object);
} else {
response_state_.SetFlag(ResponseStateFlags::kFailed);
EmitResponseEvent(false, "error", error_object);
}
Close();
}
int URLRequest::StatusCode() const {
if (response_headers_) {
return response_headers_->response_code();
}
return -1;
}
std::string URLRequest::StatusMessage() const {
std::string result;
if (response_headers_) {
result = response_headers_->GetStatusText();
}
return result;
}
net::HttpResponseHeaders* URLRequest::RawResponseHeaders() const {
return response_headers_.get();
}
uint32_t URLRequest::ResponseHttpVersionMajor() const {
if (response_headers_) {
return response_headers_->GetHttpVersion().major_value();
}
return 0;
}
uint32_t URLRequest::ResponseHttpVersionMinor() const {
if (response_headers_) {
return response_headers_->GetHttpVersion().minor_value();
}
return 0;
}
void URLRequest::Close() {
if (!request_state_.Closed()) {
request_state_.SetFlag(RequestStateFlags::kClosed);
if (response_state_.Started()) {
// Emit a close event if we really have a response object.
EmitResponseEvent(true, "close");
}
EmitRequestEvent(true, "close");
}
Unpin();
if (atom_request_) {
// A request has been created in JS, used and then it ended.
// We release unneeded net resources.
atom_request_->Terminate();
}
atom_request_ = nullptr;
}
void URLRequest::Pin() {
if (wrapper_.IsEmpty()) {
wrapper_.Reset(isolate(), GetWrapper());
}
}
void URLRequest::Unpin() {
wrapper_.Reset();
}
template <typename... Args>
void URLRequest::EmitRequestEvent(Args... args) {
v8::HandleScope handle_scope(isolate());
mate::CustomEmit(isolate(), GetWrapper(), "_emitRequestEvent", args...);
}
template <typename... Args>
void URLRequest::EmitResponseEvent(Args... args) {
v8::HandleScope handle_scope(isolate());
mate::CustomEmit(isolate(), GetWrapper(), "_emitResponseEvent", args...);
}
} // namespace api
} // namespace atom

View File

@@ -0,0 +1,207 @@
// Copyright (c) 2016 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_ATOM_API_URL_REQUEST_H_
#define ATOM_BROWSER_API_ATOM_API_URL_REQUEST_H_
#include <array>
#include <string>
#include "atom/browser/api/event_emitter.h"
#include "atom/browser/api/trackable_object.h"
#include "base/memory/weak_ptr.h"
#include "native_mate/dictionary.h"
#include "native_mate/handle.h"
#include "native_mate/wrappable_base.h"
#include "net/base/auth.h"
#include "net/base/io_buffer.h"
#include "net/http/http_response_headers.h"
#include "net/url_request/url_request_context.h"
namespace atom {
class AtomURLRequest;
namespace api {
//
// The URLRequest class implements the V8 binding between the JavaScript API
// and Chromium native net library. It is responsible for handling HTTP/HTTPS
// requests.
//
// The current class provides only the binding layer. Two other JavaScript
// classes (ClientRequest and IncomingMessage) in the net module provide the
// final API, including some state management and arguments validation.
//
// URLRequest's methods fall into two main categories: command and event
// methods. They are always executed on the Browser's UI thread.
// Command methods are called directly from JavaScript code via the API defined
// in BuildPrototype. A command method is generally implemented by forwarding
// the call to a corresponding method on AtomURLRequest which does the
// synchronization on the Browser IO thread. The latter then calls into Chromium
// net library. On the other hand, net library events originate on the IO
// thread in AtomURLRequest and are synchronized back on the UI thread, then
// forwarded to a corresponding event method in URLRequest and then to
// JavaScript via the EmitRequestEvent/EmitResponseEvent helpers.
//
// URLRequest lifetime management: we followed the Wrapper/Wrappable pattern
// defined in native_mate. However, we augment that pattern with a pin/unpin
// mechanism. The main reason is that we want the JS API to provide a similar
// lifetime guarantees as the XMLHttpRequest.
// https://xhr.spec.whatwg.org/#garbage-collection
//
// The primary motivation is to not garbage collect a URLInstance as long as the
// object is emitting network events. For instance, in the following JS code
//
// (function() {
// let request = new URLRequest(...);
// request.on('response', (response)=>{
// response.on('data', (data) = > {
// console.log(data.toString());
// });
// });
// })();
//
// we still want data to be logged even if the response/request objects are n
// more referenced in JavaScript.
//
// Binding by simply following the native_mate Wrapper/Wrappable pattern will
// delete the URLRequest object when the corresponding JS object is collected.
// The v8 handle is a private member in WrappableBase and it is always weak,
// there is no way to make it strong without changing native_mate.
// The solution we implement consists of maintaining some kind of state that
// prevents collection of JS wrappers as long as the request is emitting network
// events. At initialization, the object is unpinned. When the request starts,
// it is pinned. When no more events would be emitted, the object is unpinned
// and lifetime is again managed by the standard native mate Wrapper/Wrappable
// pattern.
//
// pin/unpin: are implemented by constructing/reseting a V8 strong persistent
// handle.
//
// The URLRequest/AtmURLRequest interaction could have been implemented in a
// single class. However, it implies that the resulting class lifetime will be
// managed by two conflicting mechanisms: JavaScript garbage collection and
// Chromium reference counting. Reasoning about lifetime issues become much
// more complex.
//
// We chose to split the implementation into two classes linked via a
// reference counted/raw pointers. A URLRequest instance is deleted if it is
// unpinned and the corresponding JS wrapper object is garbage collected. On the
// other hand, an AtmURLRequest instance lifetime is totally governed by
// reference counting.
//
class URLRequest : public mate::EventEmitter<URLRequest> {
public:
static mate::WrappableBase* New(mate::Arguments* args);
static void BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::FunctionTemplate> prototype);
// Methods for reporting events into JavaScript.
void OnAuthenticationRequired(
scoped_refptr<const net::AuthChallengeInfo> auth_info);
void OnResponseStarted(
scoped_refptr<net::HttpResponseHeaders> response_headers);
void OnResponseData(scoped_refptr<const net::IOBufferWithSize> data);
void OnResponseCompleted();
void OnError(const std::string& error, bool isRequestError);
protected:
explicit URLRequest(v8::Isolate* isolate, v8::Local<v8::Object> wrapper);
~URLRequest() override;
private:
template <typename Flags>
class StateBase {
public:
void SetFlag(Flags flag);
protected:
explicit StateBase(Flags initialState);
bool operator==(Flags flag) const;
bool IsFlagSet(Flags flag) const;
private:
Flags state_;
};
enum class RequestStateFlags {
kNotStarted = 0x0,
kStarted = 0x1,
kFinished = 0x2,
kCanceled = 0x4,
kFailed = 0x8,
kClosed = 0x10
};
class RequestState : public StateBase<RequestStateFlags> {
public:
RequestState();
bool NotStarted() const;
bool Started() const;
bool Finished() const;
bool Canceled() const;
bool Failed() const;
bool Closed() const;
};
enum class ResponseStateFlags {
kNotStarted = 0x0,
kStarted = 0x1,
kEnded = 0x2,
kFailed = 0x4
};
class ResponseState : public StateBase<ResponseStateFlags> {
public:
ResponseState();
bool NotStarted() const;
bool Started() const;
bool Ended() const;
bool Canceled() const;
bool Failed() const;
bool Closed() const;
};
bool NotStarted() const;
bool Finished() const;
bool Canceled() const;
bool Failed() const;
bool Write(scoped_refptr<const net::IOBufferWithSize> buffer, bool is_last);
void Cancel();
bool SetExtraHeader(const std::string& name, const std::string& value);
void RemoveExtraHeader(const std::string& name);
void SetChunkedUpload(bool is_chunked_upload);
void SetLoadFlags(int flags);
int StatusCode() const;
std::string StatusMessage() const;
net::HttpResponseHeaders* RawResponseHeaders() const;
uint32_t ResponseHttpVersionMajor() const;
uint32_t ResponseHttpVersionMinor() const;
void Close();
void Pin();
void Unpin();
template <typename... Args>
void EmitRequestEvent(Args... args);
template <typename... Args>
void EmitResponseEvent(Args... args);
scoped_refptr<AtomURLRequest> atom_request_;
RequestState request_state_;
ResponseState response_state_;
// Used to implement pin/unpin.
v8::Global<v8::Object> wrapper_;
scoped_refptr<net::HttpResponseHeaders> response_headers_;
DISALLOW_COPY_AND_ASSIGN(URLRequest);
};
} // namespace api
} // namespace atom
#endif // ATOM_BROWSER_API_ATOM_API_URL_REQUEST_H_

View File

@@ -13,7 +13,6 @@
#include "atom/browser/atom_browser_client.h"
#include "atom/browser/atom_browser_context.h"
#include "atom/browser/atom_browser_main_parts.h"
#include "atom/browser/atom_security_state_model_client.h"
#include "atom/browser/lib/bluetooth_chooser.h"
#include "atom/browser/native_window.h"
#include "atom/browser/net/atom_network_delegate.h"
@@ -23,6 +22,7 @@
#include "atom/browser/ui/drag_util.h"
#include "atom/browser/web_contents_permission_helper.h"
#include "atom/browser/web_contents_preferences.h"
#include "atom/browser/web_contents_zoom_controller.h"
#include "atom/browser/web_view_guest_delegate.h"
#include "atom/common/api/api_messages.h"
#include "atom/common/api/event_emitter_caller.h"
@@ -35,16 +35,17 @@
#include "atom/common/native_mate_converters/gfx_converter.h"
#include "atom/common/native_mate_converters/gurl_converter.h"
#include "atom/common/native_mate_converters/image_converter.h"
#include "atom/common/native_mate_converters/net_converter.h"
#include "atom/common/native_mate_converters/string16_converter.h"
#include "atom/common/native_mate_converters/value_converter.h"
#include "atom/common/node_includes.h"
#include "atom/common/options_switches.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/threading/thread_task_runner_handle.h"
#include "brightray/browser/inspectable_web_contents.h"
#include "brightray/browser/inspectable_web_contents_view.h"
#include "chrome/browser/printing/print_preview_message_handler.h"
#include "chrome/browser/printing/print_view_manager_basic.h"
#include "chrome/browser/ssl/security_state_tab_helper.h"
#include "content/browser/renderer_host/render_widget_host_impl.h"
#include "content/browser/web_contents/web_contents_impl.h"
#include "content/common/view_messages.h"
@@ -67,16 +68,17 @@
#include "content/public/common/context_menu_params.h"
#include "native_mate/dictionary.h"
#include "native_mate/object_template_builder.h"
#include "net/http/http_response_headers.h"
#include "net/url_request/url_request_context.h"
#include "third_party/WebKit/public/platform/WebInputEvent.h"
#include "third_party/WebKit/public/web/WebFindOptions.h"
#include "third_party/WebKit/public/web/WebInputEvent.h"
#include "ui/display/screen.h"
#if !defined(OS_MACOSX)
#include "ui/aura/window.h"
#endif
#include "atom/common/node_includes.h"
namespace {
struct PrintSettings {
@@ -129,42 +131,29 @@ struct Converter<WindowOpenDisposition> {
WindowOpenDisposition val) {
std::string disposition = "other";
switch (val) {
case CURRENT_TAB: disposition = "default"; break;
case NEW_FOREGROUND_TAB: disposition = "foreground-tab"; break;
case NEW_BACKGROUND_TAB: disposition = "background-tab"; break;
case NEW_POPUP: case NEW_WINDOW: disposition = "new-window"; break;
default: break;
case WindowOpenDisposition::CURRENT_TAB:
disposition = "default";
break;
case WindowOpenDisposition::NEW_FOREGROUND_TAB:
disposition = "foreground-tab";
break;
case WindowOpenDisposition::NEW_BACKGROUND_TAB:
disposition = "background-tab";
break;
case WindowOpenDisposition::NEW_POPUP:
case WindowOpenDisposition::NEW_WINDOW:
disposition = "new-window";
break;
case WindowOpenDisposition::SAVE_TO_DISK:
disposition = "save-to-disk";
break;
default:
break;
}
return mate::ConvertToV8(isolate, disposition);
}
};
template<>
struct Converter<net::HttpResponseHeaders*> {
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate,
net::HttpResponseHeaders* headers) {
base::DictionaryValue response_headers;
if (headers) {
size_t iter = 0;
std::string key;
std::string value;
while (headers->EnumerateHeaderLines(&iter, &key, &value)) {
key = base::ToLowerASCII(key);
if (response_headers.HasKey(key)) {
base::ListValue* values = nullptr;
if (response_headers.GetList(key, &values))
values->AppendString(value);
} else {
std::unique_ptr<base::ListValue> values(new base::ListValue());
values->AppendString(value);
response_headers.Set(key, std::move(values));
}
}
}
return ConvertToV8(isolate, response_headers);
}
};
template<>
struct Converter<content::SavePageType> {
static bool FromV8(v8::Isolate* isolate, v8::Local<v8::Value> val,
@@ -256,22 +245,30 @@ void OnCapturePageDone(base::Callback<void(const gfx::Image&)> callback,
} // namespace
WebContents::WebContents(v8::Isolate* isolate,
content::WebContents* web_contents)
content::WebContents* web_contents,
Type type)
: content::WebContentsObserver(web_contents),
embedder_(nullptr),
type_(REMOTE),
zoom_controller_(nullptr),
type_(type),
request_id_(0),
background_throttling_(true),
enable_devtools_(true) {
web_contents->SetUserAgentOverride(GetBrowserContext()->GetUserAgent());
Init(isolate);
AttachAsUserData(web_contents);
if (type == REMOTE) {
web_contents->SetUserAgentOverride(GetBrowserContext()->GetUserAgent());
Init(isolate);
AttachAsUserData(web_contents);
} 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);
}
}
WebContents::WebContents(v8::Isolate* isolate,
const mate::Dictionary& options)
WebContents::WebContents(v8::Isolate* isolate, const mate::Dictionary& options)
: embedder_(nullptr),
zoom_controller_(nullptr),
type_(BROWSER_WINDOW),
request_id_(0),
background_throttling_(true),
@@ -334,6 +331,13 @@ WebContents::WebContents(v8::Isolate* isolate,
web_contents = content::WebContents::Create(params);
}
InitWithSessionAndOptions(isolate, web_contents, session, options);
}
void WebContents::InitWithSessionAndOptions(v8::Isolate* isolate,
content::WebContents *web_contents,
mate::Handle<api::Session> session,
const mate::Dictionary& options) {
Observe(web_contents);
InitWithWebContents(web_contents, session->browser_context());
@@ -342,10 +346,16 @@ WebContents::WebContents(v8::Isolate* isolate,
// Save the preferences in C++.
new WebContentsPreferences(web_contents, options);
// Intialize permission helper.
// Initialize permission helper.
WebContentsPermissionHelper::CreateForWebContents(web_contents);
// Intialize security state client.
AtomSecurityStateModelClient::CreateForWebContents(web_contents);
// 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);
web_contents->SetUserAgentOverride(GetBrowserContext()->GetUserAgent());
@@ -384,11 +394,11 @@ WebContents::~WebContents() {
}
}
bool WebContents::AddMessageToConsole(content::WebContents* source,
int32_t level,
const base::string16& message,
int32_t line_no,
const base::string16& source_id) {
bool WebContents::DidAddMessageToConsole(content::WebContents* source,
int32_t level,
const base::string16& message,
int32_t line_no,
const base::string16& source_id) {
if (type_ == BROWSER_WINDOW || type_ == OFF_SCREEN) {
return false;
} else {
@@ -397,19 +407,50 @@ bool WebContents::AddMessageToConsole(content::WebContents* source,
}
}
void WebContents::OnCreateWindow(const GURL& target_url,
const std::string& frame_name,
WindowOpenDisposition disposition) {
void WebContents::OnCreateWindow(
const GURL& target_url,
const std::string& frame_name,
WindowOpenDisposition disposition,
const std::vector<std::string>& features,
const scoped_refptr<content::ResourceRequestBodyImpl>& body) {
if (type_ == BROWSER_WINDOW || type_ == OFF_SCREEN)
Emit("-new-window", target_url, frame_name, disposition);
Emit("-new-window", target_url, frame_name, disposition, features, body);
else
Emit("new-window", target_url, frame_name, disposition);
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) {
v8::Locker locker(isolate());
v8::HandleScope handle_scope(isolate());
auto api_web_contents = CreateFrom(isolate(), new_contents, BROWSER_WINDOW);
Emit("-web-contents-created", api_web_contents, target_url, frame_name);
}
void WebContents::AddNewContents(content::WebContents* source,
content::WebContents* new_contents,
WindowOpenDisposition disposition,
const gfx::Rect& initial_rect,
bool user_gesture,
bool* was_blocked) {
v8::Locker locker(isolate());
v8::HandleScope handle_scope(isolate());
auto api_web_contents = CreateFrom(isolate(), new_contents);
if (Emit("-add-new-contents", api_web_contents, disposition, user_gesture,
initial_rect.x(), initial_rect.y(), initial_rect.width(),
initial_rect.height())) {
api_web_contents->DestroyWebContents();
}
}
content::WebContents* WebContents::OpenURLFromTab(
content::WebContents* source,
const content::OpenURLParams& params) {
if (params.disposition != CURRENT_TAB) {
if (params.disposition != WindowOpenDisposition::CURRENT_TAB) {
if (type_ == BROWSER_WINDOW || type_ == OFF_SCREEN)
Emit("-new-window", params.url, "", params.disposition);
else
@@ -421,6 +462,11 @@ content::WebContents* WebContents::OpenURLFromTab(
if (Emit("will-navigate", params.url))
return nullptr;
// Don't load the URL if the web contents was marked as destroyed from a
// will-navigate event listener
if (IsDestroyed())
return nullptr;
return CommonWebContentsDelegate::OpenURLFromTab(source, params);
}
@@ -470,6 +516,17 @@ void WebContents::HandleKeyboardEvent(
}
}
bool 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;
}
void WebContents::EnterFullscreenModeForTab(content::WebContents* source,
const GURL& origin) {
auto permission_helper =
@@ -493,7 +550,9 @@ void WebContents::ExitFullscreenModeForTab(content::WebContents* source) {
Emit("leave-html-full-screen");
}
void WebContents::RendererUnresponsive(content::WebContents* source) {
void WebContents::RendererUnresponsive(
content::WebContents* source,
const content::WebContentsUnresponsiveState& unresponsive_state) {
Emit("unresponsive");
if ((type_ == BROWSER_WINDOW || type_ == OFF_SCREEN) && owner_window())
owner_window()->RendererUnresponsive(source);
@@ -527,22 +586,18 @@ void WebContents::FindReply(content::WebContents* web_contents,
const gfx::Rect& selection_rect,
int active_match_ordinal,
bool final_update) {
if (!final_update)
return;
v8::Locker locker(isolate());
v8::HandleScope handle_scope(isolate());
mate::Dictionary result = mate::Dictionary::CreateEmpty(isolate());
if (number_of_matches == -1) {
result.Set("requestId", request_id);
result.Set("selectionArea", selection_rect);
result.Set("finalUpdate", final_update);
result.Set("activeMatchOrdinal", active_match_ordinal);
Emit("found-in-page", result);
} else if (final_update) {
result.Set("requestId", request_id);
result.Set("matches", number_of_matches);
result.Set("finalUpdate", final_update);
Emit("found-in-page", result);
}
result.Set("requestId", request_id);
result.Set("matches", number_of_matches);
result.Set("selectionArea", selection_rect);
result.Set("activeMatchOrdinal", active_match_ordinal);
result.Set("finalUpdate", final_update); // Deprecate after 2.0
Emit("found-in-page", result);
}
bool WebContents::CheckMediaAccessPermission(
@@ -583,12 +638,20 @@ void WebContents::BeforeUnloadFired(const base::TimeTicks& proceed_time) {
// there are two virtual functions named BeforeUnloadFired.
}
void WebContents::RenderViewCreated(content::RenderViewHost* render_view_host) {
const auto impl = content::RenderWidgetHostImpl::FromID(
render_view_host->GetProcess()->GetID(),
render_view_host->GetRoutingID());
if (impl)
impl->disable_hidden_ = !background_throttling_;
}
void WebContents::RenderViewDeleted(content::RenderViewHost* render_view_host) {
Emit("render-view-deleted", render_view_host->GetProcess()->GetID());
}
void WebContents::RenderProcessGone(base::TerminationStatus status) {
Emit("crashed");
Emit("crashed", status == base::TERMINATION_STATUS_PROCESS_WAS_KILLED);
}
void WebContents::PluginCrashed(const base::FilePath& plugin_path,
@@ -599,20 +662,18 @@ void WebContents::PluginCrashed(const base::FilePath& plugin_path,
Emit("plugin-crashed", info.name, info.version);
}
void WebContents::MediaStartedPlaying(const MediaPlayerId& id) {
void WebContents::MediaStartedPlaying(const MediaPlayerInfo& video_type,
const MediaPlayerId& id) {
Emit("media-started-playing");
}
void WebContents::MediaStoppedPlaying(const MediaPlayerId& id) {
void WebContents::MediaStoppedPlaying(const MediaPlayerInfo& video_type,
const MediaPlayerId& id) {
Emit("media-paused");
}
void WebContents::DidChangeThemeColor(SkColor theme_color) {
std::string hex_theme_color = base::StringPrintf("#%02X%02X%02X",
SkColorGetR(theme_color),
SkColorGetG(theme_color),
SkColorGetB(theme_color));
Emit("did-change-theme-color", hex_theme_color);
Emit("did-change-theme-color", atom::ToRGBHex(theme_color));
}
void WebContents::DocumentLoadedInFrame(
@@ -661,7 +722,6 @@ void WebContents::DidGetResourceResponseStart(
}
void WebContents::DidGetRedirectForResourceRequest(
content::RenderFrameHost* render_frame_host,
const content::ResourceRedirectDetails& details) {
Emit("did-get-redirect-request",
details.url,
@@ -759,6 +819,10 @@ bool WebContents::OnMessageReceived(const IPC::Message& 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)
@@ -794,7 +858,8 @@ void WebContents::WebContentsDestroyed() {
Emit("destroyed");
// Destroy the native class in next tick.
base::MessageLoop::current()->PostTask(FROM_HERE, GetDestroyClosure());
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, GetDestroyClosure());
}
void WebContents::NavigationEntryCommitted(
@@ -803,7 +868,14 @@ void WebContents::NavigationEntryCommitted(
details.is_in_page, details.did_replace_entry);
}
int WebContents::GetID() const {
int64_t WebContents::GetID() const {
int64_t process_id = web_contents()->GetRenderProcessHost()->GetID();
int64_t routing_id = web_contents()->GetRoutingID();
int64_t rv = (process_id << 32) + routing_id;
return rv;
}
int WebContents::GetProcessID() const {
return web_contents()->GetRenderProcessHost()->GetID();
}
@@ -816,7 +888,7 @@ bool WebContents::Equal(const WebContents* web_contents) const {
}
void WebContents::LoadURL(const GURL& url, const mate::Dictionary& options) {
if (!url.is_valid()) {
if (!url.is_valid() || url.spec().size() > url::kMaxURLChars) {
Emit("did-fail-load",
static_cast<int>(net::ERR_INVALID_URL),
net::ErrorToShortString(net::ERR_INVALID_URL),
@@ -840,6 +912,12 @@ 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;
if (options.Get("postData", &body)) {
params.post_data = body;
params.load_type = content::NavigationController::LOAD_TYPE_HTTP_POST;
}
params.transition_type = ui::PAGE_TRANSITION_TYPED;
params.should_clear_history_list = true;
params.override_user_agent = content::NavigationController::UA_OVERRIDE_TRUE;
@@ -849,20 +927,17 @@ void WebContents::LoadURL(const GURL& url, const mate::Dictionary& options) {
// We have to call it right after LoadURL because the RenderViewHost is only
// created after loading a page.
const auto view = web_contents()->GetRenderWidgetHostView();
WebContentsPreferences* web_preferences =
WebContentsPreferences::FromWebContents(web_contents());
std::string color_name;
if (web_preferences->web_preferences()->GetString(options::kBackgroundColor,
&color_name)) {
view->SetBackgroundColor(ParseHexColor(color_name));
} else {
view->SetBackgroundColor(SK_ColorTRANSPARENT);
if (view) {
WebContentsPreferences* web_preferences =
WebContentsPreferences::FromWebContents(web_contents());
std::string color_name;
if (web_preferences->web_preferences()->GetString(options::kBackgroundColor,
&color_name)) {
view->SetBackgroundColor(ParseHexColor(color_name));
} else {
view->SetBackgroundColor(SK_ColorTRANSPARENT);
}
}
// For the same reason we can only disable hidden here.
const auto host = static_cast<content::RenderWidgetHostImpl*>(
view->GetRenderWidgetHost());
host->disable_hidden_ = !background_throttling_;
}
void WebContents::DownloadURL(const GURL& url) {
@@ -871,7 +946,8 @@ void WebContents::DownloadURL(const GURL& url) {
content::BrowserContext::GetDownloadManager(browser_context);
download_manager->DownloadUrl(
content::DownloadUrlParameters::FromWebContents(web_contents(), url));
content::DownloadUrlParameters::CreateForWebContentsMainFrame(
web_contents(), url));
}
GURL WebContents::GetURL() const {
@@ -930,10 +1006,6 @@ std::string WebContents::GetUserAgent() {
return web_contents()->GetUserAgentOverride();
}
void WebContents::InsertCSS(const std::string& css) {
web_contents()->InsertCSS(css);
}
bool WebContents::SavePage(const base::FilePath& full_file_path,
const content::SavePageType& save_type,
const SavePageHandler::SavePageCallback& callback) {
@@ -1019,9 +1091,7 @@ void WebContents::InspectElement(int x, int y) {
if (!managed_web_contents()->GetDevToolsWebContents())
OpenDevTools(nullptr);
scoped_refptr<content::DevToolsAgentHost> agent(
content::DevToolsAgentHost::GetOrCreateFor(web_contents()));
agent->InspectElement(x, y);
managed_web_contents()->InspectElement(x, y);
}
void WebContents::InspectServiceWorker() {
@@ -1033,7 +1103,7 @@ void WebContents::InspectServiceWorker() {
for (const auto& agent_host : content::DevToolsAgentHost::GetOrCreateAll()) {
if (agent_host->GetType() ==
content::DevToolsAgentHost::TYPE_SERVICE_WORKER) {
content::DevToolsAgentHost::kTypeServiceWorker) {
OpenDevTools(nullptr);
managed_web_contents()->AttachTo(agent_host);
break;
@@ -1078,7 +1148,9 @@ void WebContents::Print(mate::Arguments* args) {
}
printing::PrintViewManagerBasic::FromWebContents(web_contents())->
PrintNow(settings.silent, settings.print_background);
PrintNow(web_contents()->GetMainFrame(),
settings.silent,
settings.print_background);
}
void WebContents::PrintToPDF(const base::DictionaryValue& setting,
@@ -1177,7 +1249,7 @@ void WebContents::ShowDefinitionForSelection() {
}
void WebContents::CopyImageAt(int x, int y) {
const auto host = web_contents()->GetRenderViewHost();
const auto host = web_contents()->GetMainFrame();
if (host)
host->CopyImageAt(x, y);
}
@@ -1284,17 +1356,25 @@ void WebContents::StartDrag(const mate::Dictionary& item,
// Error checking.
if (icon.IsEmpty()) {
args->ThrowError("icon must be set");
args->ThrowError("Must specify 'icon' option");
return;
}
#if defined(OS_MACOSX)
// NSWindow.dragImage requires a non-empty NSImage
if (icon->image().IsEmpty()) {
args->ThrowError("Must specify non-empty 'icon' option");
return;
}
#endif
// Start dragging.
if (!files.empty()) {
base::MessageLoop::ScopedNestableTaskAllower allow(
base::MessageLoop::current());
DragFileItems(files, icon->image(), web_contents()->GetNativeView());
} else {
args->ThrowError("There is nothing to drag");
args->ThrowError("Must specify either 'file' or 'files' option");
}
}
@@ -1419,6 +1499,49 @@ int WebContents::GetFrameRate() const {
return osr_rwhv ? osr_rwhv->GetFrameRate() : 0;
}
void WebContents::Invalidate() {
if (IsOffScreen()) {
auto* osr_rwhv = static_cast<OffScreenRenderWidgetHostView*>(
web_contents()->GetRenderWidgetHostView());
if (osr_rwhv)
osr_rwhv->Invalidate();
} else {
const auto window = owner_window();
if (window)
window->Invalidate();
}
}
void WebContents::SetZoomLevel(double level) {
zoom_controller_->SetZoomLevel(level);
}
double WebContents::GetZoomLevel() {
return zoom_controller_->GetZoomLevel();
}
void WebContents::SetZoomFactor(double factor) {
auto level = content::ZoomFactorToZoomLevel(factor);
SetZoomLevel(level);
}
double WebContents::GetZoomFactor() {
auto level = GetZoomLevel();
return content::ZoomLevelToZoomFactor(level);
}
void WebContents::OnSetTemporaryZoomLevel(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);
}
void WebContents::OnGetZoomLevel(IPC::Message* reply_msg) {
AtomViewHostMsg_GetZoomLevel::WriteReplyParams(reply_msg, GetZoomLevel());
Send(reply_msg);
}
v8::Local<v8::Value> WebContents::GetWebPreferences(v8::Isolate* isolate) {
WebContentsPreferences* web_preferences =
@@ -1447,6 +1570,25 @@ content::WebContents* WebContents::HostWebContents() {
return embedder_->web_contents();
}
void WebContents::SetEmbedder(const WebContents* embedder) {
if (embedder) {
NativeWindow* owner_window = nullptr;
auto relay = NativeWindowRelay::FromWebContents(embedder->web_contents());
if (relay) {
owner_window = relay->window.get();
}
if (owner_window)
SetOwnerWindow(owner_window);
content::RenderWidgetHostView* rwhv =
web_contents()->GetRenderWidgetHostView();
if (rwhv) {
rwhv->Hide();
rwhv->Show();
}
}
}
v8::Local<v8::Value> WebContents::DevToolsWebContents(v8::Isolate* isolate) {
if (devtools_web_contents_.IsEmpty())
return v8::Null(isolate);
@@ -1469,6 +1611,7 @@ void WebContents::BuildPrototype(v8::Isolate* isolate,
mate::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
.MakeDestroyable()
.SetMethod("getId", &WebContents::GetID)
.SetMethod("getProcessId", &WebContents::GetProcessID)
.SetMethod("equal", &WebContents::Equal)
.SetMethod("_loadURL", &WebContents::LoadURL)
.SetMethod("downloadURL", &WebContents::DownloadURL)
@@ -1484,7 +1627,6 @@ void WebContents::BuildPrototype(v8::Isolate* isolate,
.SetMethod("isCrashed", &WebContents::IsCrashed)
.SetMethod("setUserAgent", &WebContents::SetUserAgent)
.SetMethod("getUserAgent", &WebContents::GetUserAgent)
.SetMethod("insertCSS", &WebContents::InsertCSS)
.SetMethod("savePage", &WebContents::SavePage)
.SetMethod("openDevTools", &WebContents::OpenDevTools)
.SetMethod("closeDevTools", &WebContents::CloseDevTools)
@@ -1528,6 +1670,11 @@ void WebContents::BuildPrototype(v8::Isolate* isolate,
.SetMethod("isPainting", &WebContents::IsPainting)
.SetMethod("setFrameRate", &WebContents::SetFrameRate)
.SetMethod("getFrameRate", &WebContents::GetFrameRate)
.SetMethod("invalidate", &WebContents::Invalidate)
.SetMethod("setZoomLevel", &WebContents::SetZoomLevel)
.SetMethod("_getZoomLevel", &WebContents::GetZoomLevel)
.SetMethod("setZoomFactor", &WebContents::SetZoomFactor)
.SetMethod("_getZoomFactor", &WebContents::GetZoomFactor)
.SetMethod("getType", &WebContents::GetType)
.SetMethod("getWebPreferences", &WebContents::GetWebPreferences)
.SetMethod("getOwnerBrowserWindow", &WebContents::GetOwnerBrowserWindow)
@@ -1543,6 +1690,7 @@ void WebContents::BuildPrototype(v8::Isolate* isolate,
&WebContents::ShowDefinitionForSelection)
.SetMethod("copyImageAt", &WebContents::CopyImageAt)
.SetMethod("capturePage", &WebContents::CapturePage)
.SetMethod("setEmbedder", &WebContents::SetEmbedder)
.SetProperty("id", &WebContents::ID)
.SetProperty("session", &WebContents::Session)
.SetProperty("hostWebContents", &WebContents::HostWebContents)
@@ -1576,7 +1724,15 @@ mate::Handle<WebContents> WebContents::CreateFrom(
return mate::CreateHandle(isolate, static_cast<WebContents*>(existing));
// Otherwise create a new WebContents wrapper object.
return mate::CreateHandle(isolate, new WebContents(isolate, web_contents));
return mate::CreateHandle(isolate, new WebContents(isolate, web_contents,
REMOTE));
}
mate::Handle<WebContents> WebContents::CreateFrom(
v8::Isolate* isolate, content::WebContents* web_contents, Type type) {
// Otherwise create a new WebContents wrapper object.
return mate::CreateHandle(isolate, new WebContents(isolate, web_contents,
type));
}
// static

View File

@@ -26,6 +26,10 @@ namespace brightray {
class InspectableWebContents;
}
namespace content {
class ResourceRequestBodyImpl;
}
namespace mate {
class Arguments;
class Dictionary;
@@ -35,6 +39,7 @@ namespace atom {
struct SetSizeParams;
class AtomBrowserContext;
class WebContentsZoomController;
class WebViewGuestDelegate;
namespace api {
@@ -58,6 +63,8 @@ class WebContents : public mate::TrackableObject<WebContents>,
// Create from an existing WebContents.
static mate::Handle<WebContents> CreateFrom(
v8::Isolate* isolate, content::WebContents* web_contents);
static mate::Handle<WebContents> CreateFrom(
v8::Isolate* isolate, content::WebContents* web_contents, Type type);
// Create a new WebContents.
static mate::Handle<WebContents> Create(
@@ -66,7 +73,8 @@ class WebContents : public mate::TrackableObject<WebContents>,
static void BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::FunctionTemplate> prototype);
int GetID() const;
int64_t GetID() const;
int GetProcessID() const;
Type GetType() const;
bool Equal(const WebContents* web_contents) const;
void LoadURL(const GURL& url, const mate::Dictionary& options);
@@ -102,6 +110,7 @@ class WebContents : public mate::TrackableObject<WebContents>,
void SetAudioMuted(bool muted);
bool IsAudioMuted();
void Print(mate::Arguments* args);
void SetEmbedder(const WebContents* embedder);
// Print current page as PDF.
void PrintToPDF(const base::DictionaryValue& setting,
@@ -164,6 +173,13 @@ class WebContents : public mate::TrackableObject<WebContents>,
bool IsPainting() const;
void SetFrameRate(int frame_rate);
int GetFrameRate() const;
void Invalidate();
// Methods for zoom handling.
void SetZoomLevel(double level);
double GetZoomLevel();
void SetZoomFactor(double factor);
double GetZoomFactor();
// Callback triggered on permission response.
void OnEnterFullscreenModeForTab(content::WebContents* source,
@@ -171,9 +187,12 @@ class WebContents : public mate::TrackableObject<WebContents>,
bool allowed);
// Create window with the given disposition.
void OnCreateWindow(const GURL& target_url,
const std::string& frame_name,
WindowOpenDisposition disposition);
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);
// Returns the web preferences of current WebContents.
v8::Local<v8::Value> GetWebPreferences(v8::Isolate* isolate);
@@ -188,17 +207,38 @@ class WebContents : public mate::TrackableObject<WebContents>,
v8::Local<v8::Value> DevToolsWebContents(v8::Isolate* isolate);
v8::Local<v8::Value> Debugger(v8::Isolate* isolate);
WebContentsZoomController* GetZoomController() { return zoom_controller_; }
protected:
WebContents(v8::Isolate* isolate, content::WebContents* web_contents);
WebContents(v8::Isolate* isolate,
content::WebContents* web_contents,
Type type);
WebContents(v8::Isolate* isolate, const mate::Dictionary& options);
~WebContents();
void InitWithSessionAndOptions(v8::Isolate* isolate,
content::WebContents *web_contents,
mate::Handle<class Session> session,
const mate::Dictionary& options);
// content::WebContentsDelegate:
bool AddMessageToConsole(content::WebContents* source,
int32_t level,
const base::string16& message,
int32_t line_no,
const base::string16& source_id) override;
bool DidAddMessageToConsole(content::WebContents* source,
int32_t level,
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 AddNewContents(content::WebContents* source,
content::WebContents* new_contents,
WindowOpenDisposition disposition,
const gfx::Rect& initial_rect,
bool user_gesture,
bool* was_blocked) override;
content::WebContents* OpenURLFromTab(
content::WebContents* source,
const content::OpenURLParams& params) override;
@@ -214,10 +254,15 @@ 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;
void EnterFullscreenModeForTab(content::WebContents* source,
const GURL& origin) override;
void ExitFullscreenModeForTab(content::WebContents* source) override;
void RendererUnresponsive(content::WebContents* source) override;
void RendererUnresponsive(
content::WebContents* source,
const content::WebContentsUnresponsiveState& unresponsive_state) override;
void RendererResponsive(content::WebContents* source) override;
bool HandleContextMenu(const content::ContextMenuParams& params) override;
bool OnGoToEntryOffset(int offset) override;
@@ -245,6 +290,7 @@ class WebContents : public mate::TrackableObject<WebContents>,
// content::WebContentsObserver:
void BeforeUnloadFired(const base::TimeTicks& proceed_time) override;
void RenderViewCreated(content::RenderViewHost*) override;
void RenderViewDeleted(content::RenderViewHost*) override;
void RenderProcessGone(base::TerminationStatus status) override;
void DocumentLoadedInFrame(
@@ -261,7 +307,6 @@ class WebContents : public mate::TrackableObject<WebContents>,
void DidGetResourceResponseStart(
const content::ResourceRequestDetails& details) override;
void DidGetRedirectForResourceRequest(
content::RenderFrameHost* render_frame_host,
const content::ResourceRedirectDetails& details) override;
void DidFinishNavigation(
content::NavigationHandle* navigation_handle) override;
@@ -274,8 +319,10 @@ class WebContents : public mate::TrackableObject<WebContents>,
const std::vector<content::FaviconURL>& urls) override;
void PluginCrashed(const base::FilePath& plugin_path,
base::ProcessId plugin_pid) override;
void MediaStartedPlaying(const MediaPlayerId& id) override;
void MediaStoppedPlaying(const MediaPlayerId& id) override;
void MediaStartedPlaying(const MediaPlayerInfo& video_type,
const MediaPlayerId& id) override;
void MediaStoppedPlaying(const MediaPlayerInfo& video_type,
const MediaPlayerId& id) override;
void DidChangeThemeColor(SkColor theme_color) override;
// brightray::InspectableWebContentsDelegate:
@@ -305,6 +352,14 @@ class WebContents : public mate::TrackableObject<WebContents>,
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);
// Called when received a synchronous message from renderer to
// get the zoom level.
void OnGetZoomLevel(IPC::Message* reply_msg);
v8::Global<v8::Value> session_;
v8::Global<v8::Value> devtools_web_contents_;
v8::Global<v8::Value> debugger_;
@@ -314,6 +369,9 @@ class WebContents : public mate::TrackableObject<WebContents>,
// The host webcontents that may contain this webcontents.
WebContents* embedder_;
// The zoom controller for this webContents.
WebContentsZoomController* zoom_controller_;
// The type of current WebContents.
Type type_;

View File

@@ -20,13 +20,14 @@ using content::BrowserThread;
namespace mate {
template<>
struct Converter<extensions::URLPattern> {
struct Converter<URLPattern> {
static bool FromV8(v8::Isolate* isolate, v8::Local<v8::Value> val,
extensions::URLPattern* out) {
URLPattern* out) {
std::string pattern;
if (!ConvertFromV8(isolate, val, &pattern))
return false;
return out->Parse(pattern) == extensions::URLPattern::PARSE_SUCCESS;
*out = URLPattern(URLPattern::SCHEME_ALL);
return out->Parse(pattern) == URLPattern::PARSE_SUCCESS;
}
};

View File

@@ -3,10 +3,12 @@
// found in the LICENSE file.
#include "atom/browser/web_contents_preferences.h"
#include "atom/browser/web_contents_zoom_controller.h"
#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"
@@ -24,6 +26,12 @@ void AddGuest(int guest_instance_id,
manager->AddGuest(guest_instance_id, element_instance_id, embedder,
guest_web_contents);
double zoom_factor;
if (options.GetDouble(atom::options::kZoomFactor, &zoom_factor)) {
atom::WebContentsZoomController::FromWebContents(guest_web_contents)
->SetDefaultZoomFactor(zoom_factor);
}
WebContentsPreferences::FromWebContents(guest_web_contents)->Merge(options);
}

View File

@@ -10,13 +10,14 @@
#include "atom/browser/browser.h"
#include "atom/browser/native_window.h"
#include "atom/common/native_mate_converters/callback.h"
#include "atom/common/native_mate_converters/file_path_converter.h"
#include "atom/common/native_mate_converters/gfx_converter.h"
#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/node_includes.h"
#include "atom/common/options_switches.h"
#include "base/command_line.h"
#include "base/threading/thread_task_runner_handle.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/common/content_switches.h"
#include "native_mate/constructor.h"
@@ -29,8 +30,11 @@
#if defined(OS_WIN)
#include "atom/browser/ui/win/taskbar_host.h"
#include "ui/base/win/shell.h"
#endif
#include "atom/common/node_includes.h"
#if defined(OS_WIN)
namespace mate {
@@ -71,20 +75,40 @@ v8::Local<v8::Value> ToBuffer(v8::Isolate* isolate, void* val, int size) {
Window::Window(v8::Isolate* isolate, v8::Local<v8::Object> wrapper,
const mate::Dictionary& options) {
// Use options.webPreferences to create WebContents.
mate::Dictionary web_preferences = mate::Dictionary::CreateEmpty(isolate);
options.Get(options::kWebPreferences, &web_preferences);
mate::Handle<class WebContents> web_contents;
// If no WebContents was passed to the constructor, create it from options.
if (!options.Get("webContents", &web_contents)) {
// Use options.webPreferences to create WebContents.
mate::Dictionary web_preferences = mate::Dictionary::CreateEmpty(isolate);
options.Get(options::kWebPreferences, &web_preferences);
// Copy the backgroundColor to webContents.
v8::Local<v8::Value> value;
if (options.Get(options::kBackgroundColor, &value))
web_preferences.Set(options::kBackgroundColor, value);
// Copy the backgroundColor to webContents.
v8::Local<v8::Value> value;
if (options.Get(options::kBackgroundColor, &value))
web_preferences.Set(options::kBackgroundColor, value);
v8::Local<v8::Value> transparent;
if (options.Get("transparent", &transparent))
web_preferences.Set("transparent", transparent);
// Creates the WebContents used by BrowserWindow.
auto web_contents = WebContents::Create(isolate, web_preferences);
v8::Local<v8::Value> transparent;
if (options.Get("transparent", &transparent))
web_preferences.Set("transparent", transparent);
// Offscreen windows are always created frameless.
bool offscreen;
if (web_preferences.Get("offscreen", &offscreen) && offscreen) {
auto window_options = const_cast<mate::Dictionary&>(options);
window_options.Set(options::kFrame, false);
}
// Creates the WebContents used by BrowserWindow.
web_contents = WebContents::Create(isolate, web_preferences);
}
Init(isolate, wrapper, options, web_contents);
}
void Window::Init(v8::Isolate* isolate,
v8::Local<v8::Object> wrapper,
const mate::Dictionary& options,
mate::Handle<class WebContents> web_contents) {
web_contents_.Reset(isolate, web_contents.ToV8());
api_web_contents_ = web_contents.get();
@@ -129,7 +153,7 @@ Window::~Window() {
// Destroy the native window in next tick because the native code might be
// iterating all windows.
base::MessageLoop::current()->DeleteSoon(FROM_HERE, window_.release());
base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, window_.release());
}
void Window::WillCloseWindow(bool* prevent_default) {
@@ -162,7 +186,8 @@ void Window::OnWindowClosed() {
RemoveFromParentChildWindows();
// Destroy the native class when window is closed.
base::MessageLoop::current()->PostTask(FROM_HERE, GetDestroyClosure());
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, GetDestroyClosure());
}
void Window::OnWindowBlur() {
@@ -229,6 +254,10 @@ void Window::OnWindowScrollTouchEnd() {
Emit("scroll-touch-end");
}
void Window::OnWindowScrollTouchEdge() {
Emit("scroll-touch-edge");
}
void Window::OnWindowSwipe(const std::string& direction) {
Emit("swipe", direction);
}
@@ -481,8 +510,19 @@ bool Window::IsClosable() {
return window_->IsClosable();
}
void Window::SetAlwaysOnTop(bool top) {
window_->SetAlwaysOnTop(top);
void Window::SetAlwaysOnTop(bool top, mate::Arguments* args) {
std::string level = "floating";
int relativeLevel = 0;
std::string error;
args->GetNext(&level);
args->GetNext(&relativeLevel);
window_->SetAlwaysOnTop(top, level, relativeLevel, &error);
if (!error.empty()) {
args->ThrowError(error);
}
}
bool Window::IsAlwaysOnTop() {
@@ -688,6 +728,25 @@ bool Window::SetThumbnailToolTip(const std::string& tooltip) {
return window->taskbar_host().SetThumbnailToolTip(
window_->GetAcceleratedWidget(), tooltip);
}
void Window::SetAppDetails(const mate::Dictionary& options) {
base::string16 app_id;
base::FilePath app_icon_path;
int app_icon_index = 0;
base::string16 relaunch_command;
base::string16 relaunch_display_name;
options.Get("appId", &app_id);
options.Get("appIconPath", &app_icon_path);
options.Get("appIconIndex", &app_icon_index);
options.Get("relaunchCommand", &relaunch_command);
options.Get("relaunchDisplayName", &relaunch_display_name);
ui::win::SetAppDetailsForWindow(
app_id, app_icon_path, app_icon_index,
relaunch_command, relaunch_display_name,
window_->GetAcceleratedWidget());
}
#endif
#if defined(TOOLKIT_VIEWS)
@@ -709,6 +768,17 @@ void Window::SetAspectRatio(double aspect_ratio, mate::Arguments* args) {
window_->SetAspectRatio(aspect_ratio, extra_size);
}
void Window::PreviewFile(const std::string& path, mate::Arguments* args) {
std::string display_name;
if (!args->GetNext(&display_name))
display_name = path;
window_->PreviewFile(path, display_name);
}
void Window::CloseFilePreview() {
window_->CloseFilePreview();
}
void Window::SetParentWindow(v8::Local<v8::Value> value,
mate::Arguments* args) {
if (IsModal()) {
@@ -759,6 +829,17 @@ bool Window::IsVisibleOnAllWorkspaces() {
return window_->IsVisibleOnAllWorkspaces();
}
void Window::SetAutoHideCursor(bool auto_hide) {
window_->SetAutoHideCursor(auto_hide);
}
void Window::SetVibrancy(mate::Arguments* args) {
std::string type;
args->GetNext(&type);
window_->SetVibrancy(type);
}
int32_t Window::ID() const {
return weak_map_id();
}
@@ -805,6 +886,8 @@ void Window::BuildPrototype(v8::Isolate* isolate,
.SetMethod("setFullScreen", &Window::SetFullScreen)
.SetMethod("isFullScreen", &Window::IsFullscreen)
.SetMethod("setAspectRatio", &Window::SetAspectRatio)
.SetMethod("previewFile", &Window::PreviewFile)
.SetMethod("closeFilePreview", &Window::CloseFilePreview)
#if !defined(OS_WIN)
.SetMethod("setParentWindow", &Window::SetParentWindow)
#endif
@@ -873,6 +956,10 @@ void Window::BuildPrototype(v8::Isolate* isolate,
&Window::SetVisibleOnAllWorkspaces)
.SetMethod("isVisibleOnAllWorkspaces",
&Window::IsVisibleOnAllWorkspaces)
#if defined(OS_MACOSX)
.SetMethod("setAutoHideCursor", &Window::SetAutoHideCursor)
#endif
.SetMethod("setVibrancy", &Window::SetVibrancy)
#if defined(OS_WIN)
.SetMethod("hookWindowMessage", &Window::HookWindowMessage)
.SetMethod("isWindowMessageHooked", &Window::IsWindowMessageHooked)
@@ -880,6 +967,7 @@ void Window::BuildPrototype(v8::Isolate* isolate,
.SetMethod("unhookAllWindowMessages", &Window::UnhookAllWindowMessages)
.SetMethod("setThumbnailClip", &Window::SetThumbnailClip)
.SetMethod("setThumbnailToolTip", &Window::SetThumbnailToolTip)
.SetMethod("setAppDetails", &Window::SetAppDetails)
#endif
#if defined(TOOLKIT_VIEWS)
.SetMethod("setIcon", &Window::SetIcon)

View File

@@ -74,6 +74,7 @@ class Window : public mate::TrackableObject<Window>,
void OnWindowMoved() override;
void OnWindowScrollTouchBegin() override;
void OnWindowScrollTouchEnd() override;
void OnWindowScrollTouchEdge() override;
void OnWindowSwipe(const std::string& direction) override;
void OnWindowEnterFullScreen() override;
void OnWindowLeaveFullScreen() override;
@@ -88,6 +89,10 @@ class Window : public mate::TrackableObject<Window>,
#endif
private:
void Init(v8::Isolate* isolate,
v8::Local<v8::Object> wrapper,
const mate::Dictionary& options,
mate::Handle<class WebContents> web_contents);
// APIs for NativeWindow.
void Close();
void Focus();
@@ -131,7 +136,7 @@ class Window : public mate::TrackableObject<Window>,
bool IsFullScreenable();
void SetClosable(bool closable);
bool IsClosable();
void SetAlwaysOnTop(bool top);
void SetAlwaysOnTop(bool top, mate::Arguments* args);
bool IsAlwaysOnTop();
void Center();
void SetPosition(int x, int y, mate::Arguments* args);
@@ -165,6 +170,8 @@ class Window : public mate::TrackableObject<Window>,
void SetMenuBarVisibility(bool visible);
bool IsMenuBarVisible();
void SetAspectRatio(double aspect_ratio, mate::Arguments* args);
void PreviewFile(const std::string& path, mate::Arguments* args);
void CloseFilePreview();
void SetParentWindow(v8::Local<v8::Value> value, mate::Arguments* args);
v8::Local<v8::Value> GetParentWindow() const;
std::vector<v8::Local<v8::Object>> GetChildWindows() const;
@@ -181,6 +188,7 @@ class Window : public mate::TrackableObject<Window>,
void UnhookAllWindowMessages();
bool SetThumbnailClip(const gfx::Rect& region);
bool SetThumbnailToolTip(const std::string& tooltip);
void SetAppDetails(const mate::Dictionary& options);
#endif
#if defined(TOOLKIT_VIEWS)
@@ -190,6 +198,10 @@ class Window : public mate::TrackableObject<Window>,
void SetVisibleOnAllWorkspaces(bool visible);
bool IsVisibleOnAllWorkspaces();
void SetAutoHideCursor(bool auto_hide);
void SetVibrancy(mate::Arguments* args);
int32_t ID() const;
v8::Local<v8::Value> WebContents(v8::Isolate* isolate);

View File

@@ -5,9 +5,12 @@
#include "atom/browser/api/frame_subscriber.h"
#include "atom/common/native_mate_converters/gfx_converter.h"
#include "atom/common/node_includes.h"
#include "base/bind.h"
#include "content/public/browser/render_widget_host.h"
#include "ui/display/display.h"
#include "ui/display/screen.h"
#include "atom/common/node_includes.h"
namespace atom {
@@ -40,6 +43,17 @@ bool FrameSubscriber::ShouldCaptureFrame(
if (only_dirty_)
rect = dirty_rect;
gfx::Size view_size = rect.size();
gfx::Size bitmap_size = view_size;
const gfx::NativeView native_view = view_->GetNativeView();
const float scale =
display::Screen::GetScreen()->GetDisplayNearestWindow(native_view)
.device_scale_factor();
if (scale > 1.0f)
bitmap_size = gfx::ScaleToCeiledSize(view_size, scale);
rect = gfx::Rect(rect.origin(), bitmap_size);
host->CopyFromBackingStore(
rect,
rect.size(),

View File

@@ -65,6 +65,12 @@ class TrackableObject : public TrackableObjectBase,
Wrappable<T>::GetWrapper()->SetAlignedPointerInInternalField(0, nullptr);
}
bool IsDestroyed() {
v8::Local<v8::Object> wrapper = Wrappable<T>::GetWrapper();
return wrapper->InternalFieldCount() == 0 ||
wrapper->GetAlignedPointerFromInternalField(0) == nullptr;
}
// Finds out the TrackableObject from its ID in weak map.
static T* FromWeakMapID(v8::Isolate* isolate, int32_t id) {
if (!weak_map_)

View File

@@ -4,28 +4,67 @@
#include "atom/browser/atom_access_token_store.h"
#include <string>
#include <utility>
#include "atom/browser/atom_browser_context.h"
#include "atom/common/google_api_key.h"
#include "base/environment.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/geolocation_provider.h"
#include "device/geolocation/geolocation_provider.h"
using content::BrowserThread;
namespace atom {
namespace {
namespace internal {
// Notice that we just combined the api key with the url together here, because
// if we use the standard {url: key} format Chromium would override our key with
// the predefined one in common.gypi of libchromiumcontent, which is empty.
const char* kGeolocationProviderURL =
"https://www.googleapis.com/geolocation/v1/geolocate?key="
GOOGLEAPIS_API_KEY;
// Loads access tokens and other necessary data on the UI thread, and
// calls back to the originator on the originating thread.
class TokenLoadingJob : public base::RefCountedThreadSafe<TokenLoadingJob> {
public:
explicit TokenLoadingJob(
const device::AccessTokenStore::LoadAccessTokensCallback& callback)
: callback_(callback), request_context_getter_(nullptr) {}
} // namespace
void Run(AtomBrowserContext* browser_context) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
request_context_getter_ = browser_context->GetRequestContext();
std::unique_ptr<base::Environment> env(base::Environment::Create());
if (!env->GetVar("GOOGLE_API_KEY", &api_key_))
api_key_ = GOOGLEAPIS_API_KEY;
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
base::Bind(&TokenLoadingJob::RespondOnIOThread, this));
}
private:
friend class base::RefCountedThreadSafe<TokenLoadingJob>;
~TokenLoadingJob() {}
void RespondOnIOThread() {
// Equivalent to access_token_map[kGeolocationProviderURL].
// Somehow base::string16 is causing compilation errors when used in a pair
// of std::map on Linux, this can work around it.
device::AccessTokenStore::AccessTokenMap access_token_map;
std::pair<GURL, base::string16> token_pair;
token_pair.first = GURL(GOOGLEAPIS_ENDPOINT + api_key_);
access_token_map.insert(token_pair);
callback_.Run(access_token_map, request_context_getter_);
}
device::AccessTokenStore::LoadAccessTokensCallback callback_;
net::URLRequestContextGetter* request_context_getter_;
std::string api_key_;
};
} // namespace internal
AtomAccessTokenStore::AtomAccessTokenStore() {
content::GeolocationProvider::GetInstance()->UserDidOptIntoLocationServices();
browser_context_ = AtomBrowserContext::From("", false);
device::GeolocationProvider::GetInstance()->UserDidOptIntoLocationServices();
}
AtomAccessTokenStore::~AtomAccessTokenStore() {
@@ -33,35 +72,20 @@ AtomAccessTokenStore::~AtomAccessTokenStore() {
void AtomAccessTokenStore::LoadAccessTokens(
const LoadAccessTokensCallback& callback) {
content::BrowserThread::PostTaskAndReply(
content::BrowserThread::UI,
FROM_HERE,
base::Bind(&AtomAccessTokenStore::GetRequestContextOnUIThread, this),
base::Bind(&AtomAccessTokenStore::RespondOnOriginatingThread,
this, callback));
scoped_refptr<internal::TokenLoadingJob> job(
new internal::TokenLoadingJob(callback));
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
base::Bind(&AtomAccessTokenStore::RunTokenLoadingJob,
this, base::RetainedRef(job)));
}
void AtomAccessTokenStore::RunTokenLoadingJob(
scoped_refptr<internal::TokenLoadingJob> job) {
job->Run(browser_context_.get());
}
void AtomAccessTokenStore::SaveAccessToken(const GURL& server_url,
const base::string16& access_token) {
}
void AtomAccessTokenStore::GetRequestContextOnUIThread() {
auto browser_context = AtomBrowserContext::From("", false);
request_context_getter_ = browser_context->GetRequestContext();
}
void AtomAccessTokenStore::RespondOnOriginatingThread(
const LoadAccessTokensCallback& callback) {
// Equivelent to access_token_map[kGeolocationProviderURL].
// Somehow base::string16 is causing compilation errors when used in a pair
// of std::map on Linux, this can work around it.
AccessTokenMap access_token_map;
std::pair<GURL, base::string16> token_pair;
token_pair.first = GURL(kGeolocationProviderURL);
access_token_map.insert(token_pair);
callback.Run(access_token_map, request_context_getter_.get());
request_context_getter_ = nullptr;
}
} // namespace atom

View File

@@ -5,27 +5,31 @@
#ifndef ATOM_BROWSER_ATOM_ACCESS_TOKEN_STORE_H_
#define ATOM_BROWSER_ATOM_ACCESS_TOKEN_STORE_H_
#include "content/public/browser/access_token_store.h"
#include "device/geolocation/access_token_store.h"
namespace atom {
class AtomAccessTokenStore : public content::AccessTokenStore {
class AtomBrowserContext;
namespace internal {
class TokenLoadingJob;
}
class AtomAccessTokenStore : public device::AccessTokenStore {
public:
AtomAccessTokenStore();
~AtomAccessTokenStore();
// content::AccessTokenStore:
// device::AccessTokenStore:
void LoadAccessTokens(
const LoadAccessTokensCallback& callback) override;
void SaveAccessToken(const GURL& server_url,
const base::string16& access_token) override;
private:
void GetRequestContextOnUIThread();
void RespondOnOriginatingThread(const LoadAccessTokensCallback& callback);
scoped_refptr<net::URLRequestContextGetter> request_context_getter_;
void RunTokenLoadingJob(scoped_refptr<internal::TokenLoadingJob> job);
scoped_refptr<AtomBrowserContext> browser_context_;
DISALLOW_COPY_AND_ASSIGN(AtomAccessTokenStore);
};

View File

@@ -0,0 +1,138 @@
// Copyright (c) 2016 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "atom/browser/atom_blob_reader.h"
#include "content/browser/blob_storage/chrome_blob_storage_context.h"
#include "content/public/browser/browser_thread.h"
#include "net/base/io_buffer.h"
#include "net/base/net_errors.h"
#include "storage/browser/blob/blob_data_handle.h"
#include "storage/browser/blob/blob_reader.h"
#include "storage/browser/blob/blob_storage_context.h"
#include "storage/browser/fileapi/file_system_context.h"
#include "atom/common/node_includes.h"
using content::BrowserThread;
namespace atom {
namespace {
void FreeNodeBufferData(char* data, void* hint) {
delete[] data;
}
void RunCallbackInUI(
const AtomBlobReader::CompletionCallback& callback,
char* blob_data,
int size) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
v8::Isolate* isolate = v8::Isolate::GetCurrent();
v8::Locker locker(isolate);
v8::HandleScope handle_scope(isolate);
if (blob_data) {
v8::Local<v8::Value> buffer = node::Buffer::New(isolate,
blob_data, static_cast<size_t>(size), &FreeNodeBufferData, nullptr)
.ToLocalChecked();
callback.Run(buffer);
} else {
callback.Run(v8::Null(isolate));
}
}
} // namespace
AtomBlobReader::AtomBlobReader(
content::ChromeBlobStorageContext* blob_context,
storage::FileSystemContext* file_system_context)
: blob_context_(blob_context),
file_system_context_(file_system_context) {
}
AtomBlobReader::~AtomBlobReader() {
}
void AtomBlobReader::StartReading(
const std::string& uuid,
const AtomBlobReader::CompletionCallback& completion_callback) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
auto blob_data_handle =
blob_context_->context()->GetBlobDataFromUUID(uuid);
auto callback = base::Bind(&RunCallbackInUI,
completion_callback);
if (!blob_data_handle) {
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
base::Bind(callback, nullptr, 0));
return;
}
auto blob_reader = blob_data_handle->CreateReader(
file_system_context_.get(),
BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE).get());
BlobReadHelper* blob_read_helper =
new BlobReadHelper(std::move(blob_reader), callback);
blob_read_helper->Read();
}
AtomBlobReader::BlobReadHelper::BlobReadHelper(
std::unique_ptr<storage::BlobReader> blob_reader,
const BlobReadHelper::CompletionCallback& callback)
: blob_reader_(std::move(blob_reader)),
completion_callback_(callback) {
}
AtomBlobReader::BlobReadHelper::~BlobReadHelper() {
}
void AtomBlobReader::BlobReadHelper::Read() {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
storage::BlobReader::Status size_status = blob_reader_->CalculateSize(
base::Bind(&AtomBlobReader::BlobReadHelper::DidCalculateSize,
base::Unretained(this)));
if (size_status != storage::BlobReader::Status::IO_PENDING)
DidCalculateSize(net::OK);
}
void AtomBlobReader::BlobReadHelper::DidCalculateSize(int result) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (result != net::OK) {
DidReadBlobData(nullptr, 0);
return;
}
uint64_t total_size = blob_reader_->total_size();
int bytes_read = 0;
scoped_refptr<net::IOBuffer> blob_data =
new net::IOBuffer(static_cast<size_t>(total_size));
auto callback = base::Bind(&AtomBlobReader::BlobReadHelper::DidReadBlobData,
base::Unretained(this),
base::RetainedRef(blob_data));
storage::BlobReader::Status read_status = blob_reader_->Read(
blob_data.get(),
total_size,
&bytes_read,
callback);
if (read_status != storage::BlobReader::Status::IO_PENDING)
callback.Run(bytes_read);
}
void AtomBlobReader::BlobReadHelper::DidReadBlobData(
const scoped_refptr<net::IOBuffer>& blob_data,
int size) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
char* data = new char[size];
memcpy(data, blob_data->data(), size);
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
base::Bind(completion_callback_, data, size));
delete this;
}
} // namespace atom

View File

@@ -0,0 +1,80 @@
// Copyright (c) 2016 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef ATOM_BROWSER_ATOM_BLOB_READER_H_
#define ATOM_BROWSER_ATOM_BLOB_READER_H_
#include <string>
#include "base/callback.h"
namespace content {
class ChromeBlobStorageContext;
}
namespace net {
class IOBuffer;
}
namespace storage {
class BlobDataHandle;
class BlobReader;
class FileSystemContext;
}
namespace v8 {
template <class T>
class Local;
class Value;
}
namespace atom {
// A class to keep track of the blob context. All methods,
// except Ctor are expected to be called on IO thread.
class AtomBlobReader {
public:
using CompletionCallback = base::Callback<void(v8::Local<v8::Value>)>;
AtomBlobReader(content::ChromeBlobStorageContext* blob_context,
storage::FileSystemContext* file_system_context);
~AtomBlobReader();
void StartReading(
const std::string& uuid,
const AtomBlobReader::CompletionCallback& callback);
private:
// A self-destroyed helper class to read the blob data.
// Must be accessed on IO thread.
class BlobReadHelper {
public:
using CompletionCallback = base::Callback<void(char*, int)>;
BlobReadHelper(std::unique_ptr<storage::BlobReader> blob_reader,
const BlobReadHelper::CompletionCallback& callback);
~BlobReadHelper();
void Read();
private:
void DidCalculateSize(int result);
void DidReadBlobData(const scoped_refptr<net::IOBuffer>& blob_data,
int bytes_read);
std::unique_ptr<storage::BlobReader> blob_reader_;
BlobReadHelper::CompletionCallback completion_callback_;
DISALLOW_COPY_AND_ASSIGN(BlobReadHelper);
};
scoped_refptr<content::ChromeBlobStorageContext> blob_context_;
scoped_refptr<storage::FileSystemContext> file_system_context_;
DISALLOW_COPY_AND_ASSIGN(AtomBlobReader);
};
} // namespace atom
#endif // ATOM_BROWSER_ATOM_BLOB_READER_H_

View File

@@ -10,7 +10,6 @@
#include "atom/browser/api/atom_api_app.h"
#include "atom/browser/api/atom_api_protocol.h"
#include "atom/browser/atom_access_token_store.h"
#include "atom/browser/atom_browser_context.h"
#include "atom/browser/atom_browser_main_parts.h"
#include "atom/browser/atom_quota_permission_context.h"
@@ -30,6 +29,7 @@
#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"
@@ -37,6 +37,7 @@
#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/url_constants.h"
#include "content/public/common/web_preferences.h"
#include "net/ssl/ssl_cert_request_info.h"
#include "ppapi/host/ppapi_host.h"
@@ -77,7 +78,7 @@ AtomBrowserClient::~AtomBrowserClient() {
content::WebContents* AtomBrowserClient::GetWebContentsFromProcessID(
int process_id) {
// If the process is a pending process, we should use the old one.
if (ContainsKey(pending_processes_, process_id))
if (base::ContainsKey(pending_processes_, process_id))
process_id = pending_processes_[process_id];
// Certain render process will be created with no associated render view,
@@ -85,6 +86,44 @@ content::WebContents* AtomBrowserClient::GetWebContentsFromProcessID(
return WebContentsPreferences::GetWebContentsFromProcessID(process_id);
}
bool AtomBrowserClient::ShouldCreateNewSiteInstance(
content::BrowserContext* browser_context,
content::SiteInstance* current_instance,
const GURL& url) {
if (url.SchemeIs(url::kJavaScriptScheme))
// "javacript:" scheme should always use same SiteInstance
return false;
if (!IsRendererSandboxed(current_instance->GetProcess()->GetID()))
// non-sandboxed renderers should always create a new SiteInstance
return true;
// Create new a SiteInstance if navigating to a different site.
auto src_url = current_instance->GetSiteURL();
return
!content::SiteInstance::IsSameWebSite(browser_context, src_url, url) &&
// `IsSameWebSite` doesn't seem to work for some URIs such as `file:`,
// handle these scenarios by comparing only the site as defined by
// `GetSiteForURL`.
content::SiteInstance::GetSiteForURL(browser_context, url) != src_url;
}
void AtomBrowserClient::AddSandboxedRendererId(int process_id) {
base::AutoLock auto_lock(sandboxed_renderers_lock_);
sandboxed_renderers_.insert(process_id);
}
void AtomBrowserClient::RemoveSandboxedRendererId(int process_id) {
base::AutoLock auto_lock(sandboxed_renderers_lock_);
sandboxed_renderers_.erase(process_id);
}
bool AtomBrowserClient::IsRendererSandboxed(int process_id) {
base::AutoLock auto_lock(sandboxed_renderers_lock_);
return sandboxed_renderers_.count(process_id);
}
void AtomBrowserClient::RenderProcessWillLaunch(
content::RenderProcessHost* host) {
int process_id = host->GetID();
@@ -92,6 +131,13 @@ void AtomBrowserClient::RenderProcessWillLaunch(
host->AddFilter(new TtsMessageFilter(process_id, host->GetBrowserContext()));
host->AddFilter(
new WidevineCdmMessageFilter(process_id, host->GetBrowserContext()));
content::WebContents* web_contents = GetWebContentsFromProcessID(process_id);
if (WebContentsPreferences::IsSandboxed(web_contents)) {
AddSandboxedRendererId(host->GetID());
// ensure the sandboxed renderer id is removed later
host->AddObserver(this);
}
}
content::SpeechRecognitionManagerDelegate*
@@ -99,10 +145,6 @@ content::SpeechRecognitionManagerDelegate*
return new AtomSpeechRecognitionManagerDelegate;
}
content::AccessTokenStore* AtomBrowserClient::CreateAccessTokenStore() {
return new AtomAccessTokenStore;
}
void AtomBrowserClient::OverrideWebkitPrefs(
content::RenderViewHost* host, content::WebPreferences* prefs) {
prefs->javascript_enabled = true;
@@ -118,7 +160,6 @@ void AtomBrowserClient::OverrideWebkitPrefs(
prefs->allow_universal_access_from_file_urls = true;
prefs->allow_file_access_from_file_urls = true;
prefs->experimental_webgl_enabled = true;
prefs->allow_displaying_insecure_content = false;
prefs->allow_running_insecure_content = false;
// Custom preferences of guest page.
@@ -140,8 +181,7 @@ void AtomBrowserClient::OverrideSiteInstanceForNavigation(
return;
}
// Restart renderer process for all navigations except "javacript:" scheme.
if (url.SchemeIs(url::kJavaScriptScheme))
if (!ShouldCreateNewSiteInstance(browser_context, current_instance, url))
return;
scoped_refptr<content::SiteInstance> site_instance =
@@ -173,6 +213,8 @@ void AtomBrowserClient::AppendExtraCommandLineSwitches(
// Copy following switches to child process.
static const char* const kCommonSwitchNames[] = {
switches::kStandardSchemes,
switches::kEnableSandbox,
switches::kSecureSchemes
};
command_line->CopySwitchesFrom(
*base::CommandLine::ForCurrentProcess(),
@@ -220,13 +262,13 @@ void AtomBrowserClient::AllowCertificateError(
bool overridable,
bool strict_enforcement,
bool expired_previous_decision,
const base::Callback<void(bool)>& callback,
content::CertificateRequestResultType* request) {
const base::Callback<void(content::CertificateRequestResultType)>&
callback) {
if (delegate_) {
delegate_->AllowCertificateError(
web_contents, cert_error, ssl_info, request_url,
resource_type, overridable, strict_enforcement,
expired_previous_decision, callback, request);
expired_previous_decision, callback);
}
}
@@ -252,11 +294,13 @@ bool AtomBrowserClient::CanCreateWindow(
const GURL& opener_top_level_frame_url,
const GURL& source_origin,
WindowContainerType container_type,
const std::string& frame_name,
const GURL& target_url,
const content::Referrer& referrer,
const std::string& frame_name,
WindowOpenDisposition disposition,
const blink::WebWindowFeatures& features,
const std::vector<std::string>& additional_features,
const scoped_refptr<content::ResourceRequestBodyImpl>& body,
bool user_gesture,
bool opener_suppressed,
content::ResourceContext* context,
@@ -266,6 +310,11 @@ bool AtomBrowserClient::CanCreateWindow(
bool* no_javascript_access) {
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
if (IsRendererSandboxed(render_process_id)) {
*no_javascript_access = false;
return true;
}
if (delegate_) {
content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE,
base::Bind(&api::App::OnCreateWindow,
@@ -273,6 +322,8 @@ bool AtomBrowserClient::CanCreateWindow(
target_url,
frame_name,
disposition,
additional_features,
body,
render_process_id,
opener_render_frame_id));
}
@@ -287,6 +338,7 @@ void AtomBrowserClient::GetAdditionalAllowedSchemesForFileSystem(
additional_schemes->insert(additional_schemes->end(),
schemes_list.begin(),
schemes_list.end());
additional_schemes->push_back(content::kChromeDevToolsScheme);
}
brightray::BrowserMainParts* AtomBrowserClient::OverrideCreateBrowserMainParts(
@@ -323,6 +375,7 @@ void AtomBrowserClient::RenderProcessHostDestroyed(
break;
}
}
RemoveSandboxedRendererId(process_id);
}
} // namespace atom

View File

@@ -6,6 +6,7 @@
#define ATOM_BROWSER_ATOM_BROWSER_CLIENT_H_
#include <map>
#include <set>
#include <string>
#include <vector>
@@ -49,7 +50,6 @@ class AtomBrowserClient : public brightray::BrowserClient,
void RenderProcessWillLaunch(content::RenderProcessHost* host) override;
content::SpeechRecognitionManagerDelegate*
CreateSpeechRecognitionManagerDelegate() override;
content::AccessTokenStore* CreateAccessTokenStore() override;
void OverrideWebkitPrefs(content::RenderViewHost* render_view_host,
content::WebPreferences* prefs) override;
std::string GetApplicationLocale() override;
@@ -71,29 +71,32 @@ class AtomBrowserClient : public brightray::BrowserClient,
bool overridable,
bool strict_enforcement,
bool expired_previous_decision,
const base::Callback<void(bool)>& callback,
content::CertificateRequestResultType* request) override;
const base::Callback<void(content::CertificateRequestResultType)>&
callback) override;
void SelectClientCertificate(
content::WebContents* web_contents,
net::SSLCertRequestInfo* cert_request_info,
std::unique_ptr<content::ClientCertificateDelegate> delegate) override;
void ResourceDispatcherHostCreated() override;
bool CanCreateWindow(const GURL& opener_url,
const GURL& opener_top_level_frame_url,
const GURL& source_origin,
WindowContainerType container_type,
const std::string& frame_name,
const GURL& target_url,
const content::Referrer& referrer,
WindowOpenDisposition disposition,
const blink::WebWindowFeatures& features,
bool user_gesture,
bool opener_suppressed,
content::ResourceContext* context,
int render_process_id,
int opener_render_view_id,
int opener_render_frame_id,
bool* no_javascript_access) override;
bool CanCreateWindow(
const GURL& opener_url,
const GURL& opener_top_level_frame_url,
const GURL& source_origin,
WindowContainerType container_type,
const GURL& target_url,
const content::Referrer& referrer,
const std::string& frame_name,
WindowOpenDisposition disposition,
const blink::WebWindowFeatures& features,
const std::vector<std::string>& additional_features,
const scoped_refptr<content::ResourceRequestBodyImpl>& body,
bool user_gesture,
bool opener_suppressed,
content::ResourceContext* context,
int render_process_id,
int opener_render_view_id,
int opener_render_frame_id,
bool* no_javascript_access) override;
void GetAdditionalAllowedSchemesForFileSystem(
std::vector<std::string>* schemes) override;
@@ -108,8 +111,19 @@ class AtomBrowserClient : public brightray::BrowserClient,
void RenderProcessHostDestroyed(content::RenderProcessHost* host) override;
private:
bool ShouldCreateNewSiteInstance(content::BrowserContext* browser_context,
content::SiteInstance* current_instance,
const GURL& dest_url);
// Add/remove a process id to `sandboxed_renderers_`.
void AddSandboxedRendererId(int process_id);
void RemoveSandboxedRendererId(int process_id);
bool IsRendererSandboxed(int process_id);
// pending_render_process => current_render_process.
std::map<int, int> pending_processes_;
// Set that contains the process ids of all sandboxed renderers
std::set<int> sandboxed_renderers_;
base::Lock sandboxed_renderers_lock_;
std::unique_ptr<AtomResourceDispatcherHostDelegate>
resource_dispatcher_host_delegate_;

View File

@@ -5,14 +5,16 @@
#include "atom/browser/atom_browser_context.h"
#include "atom/browser/api/atom_api_protocol.h"
#include "atom/browser/atom_blob_reader.h"
#include "atom/browser/atom_browser_main_parts.h"
#include "atom/browser/atom_download_manager_delegate.h"
#include "atom/browser/atom_permission_manager.h"
#include "atom/browser/browser.h"
#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_ssl_config_service.h"
#include "atom/browser/net/atom_url_request_job_factory.h"
#include "atom/browser/net/http_protocol_handler.h"
#include "atom/browser/web_view_manager.h"
@@ -30,7 +32,9 @@
#include "chrome/common/chrome_paths.h"
#include "chrome/common/pref_names.h"
#include "components/prefs/pref_registry_simple.h"
#include "content/browser/blob_storage/chrome_blob_storage_context.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/storage_partition.h"
#include "content/public/common/url_constants.h"
#include "content/public/common/user_agent.h"
#include "net/ftp/ftp_network_layer.h"
@@ -64,11 +68,13 @@ std::string RemoveWhitespace(const std::string& str) {
} // namespace
AtomBrowserContext::AtomBrowserContext(
const std::string& partition, bool in_memory,
const base::DictionaryValue& options)
AtomBrowserContext::AtomBrowserContext(const std::string& partition,
bool in_memory,
const base::DictionaryValue& options)
: brightray::BrowserContext(partition, in_memory),
network_delegate_(new AtomNetworkDelegate) {
ct_delegate_(new AtomCTDelegate),
network_delegate_(new AtomNetworkDelegate),
cookie_delegate_(new AtomCookieDelegate) {
// Construct user agent string.
Browser* browser = Browser::Get();
std::string name = RemoveWhitespace(browser->GetName());
@@ -104,6 +110,10 @@ net::NetworkDelegate* AtomBrowserContext::CreateNetworkDelegate() {
return network_delegate_;
}
net::CookieMonsterDelegate* AtomBrowserContext::CreateCookieDelegate() {
return cookie_delegate();
}
std::string AtomBrowserContext::GetUserAgent() {
return user_agent_;
}
@@ -120,6 +130,8 @@ AtomBrowserContext::CreateURLRequestJobFactory(
}
protocol_handlers->clear();
job_factory->SetProtocolHandler(url::kAboutScheme,
base::WrapUnique(new AboutProtocolHandler));
job_factory->SetProtocolHandler(
url::kDataScheme, base::WrapUnique(new net::DataProtocolHandler));
job_factory->SetProtocolHandler(
@@ -143,8 +155,7 @@ AtomBrowserContext::CreateURLRequestJobFactory(
url_request_context_getter()->GetURLRequestContext()->host_resolver();
job_factory->SetProtocolHandler(
url::kFtpScheme,
base::WrapUnique(new net::FtpProtocolHandler(
new net::FtpNetworkLayer(host_resolver))));
net::FtpProtocolHandler::Create(host_resolver));
return std::move(job_factory);
}
@@ -182,11 +193,7 @@ content::PermissionManager* AtomBrowserContext::GetPermissionManager() {
}
std::unique_ptr<net::CertVerifier> AtomBrowserContext::CreateCertVerifier() {
return base::WrapUnique(new AtomCertVerifier);
}
net::SSLConfigService* AtomBrowserContext::CreateSSLConfigService() {
return new AtomSSLConfigService;
return base::WrapUnique(new AtomCertVerifier(ct_delegate_.get()));
}
std::vector<std::string> AtomBrowserContext::GetCookieableSchemes() {
@@ -197,6 +204,11 @@ 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());
@@ -207,6 +219,19 @@ void AtomBrowserContext::RegisterPrefs(PrefRegistrySimple* pref_registry) {
pref_registry->RegisterDictionaryPref(prefs::kDevToolsFileSystemPaths);
}
AtomBlobReader* AtomBrowserContext::GetBlobReader() {
if (!blob_reader_.get()) {
content::ChromeBlobStorageContext* blob_context =
content::ChromeBlobStorageContext::GetFor(this);
storage::FileSystemContext* file_system_context =
content::BrowserContext::GetStoragePartition(
this, nullptr)->GetFileSystemContext();
blob_reader_.reset(new AtomBlobReader(blob_context,
file_system_context));
}
return blob_reader_.get();
}
// static
scoped_refptr<AtomBrowserContext> AtomBrowserContext::From(
const std::string& partition, bool in_memory,

View File

@@ -8,10 +8,14 @@
#include <string>
#include <vector>
#include "atom/browser/net/atom_cookie_delegate.h"
#include "brightray/browser/browser_context.h"
#include "net/cookies/cookie_monster.h"
namespace atom {
class AtomBlobReader;
class AtomCTDelegate;
class AtomDownloadManagerDelegate;
class AtomNetworkDelegate;
class AtomPermissionManager;
@@ -30,14 +34,16 @@ class AtomBrowserContext : public brightray::BrowserContext {
// brightray::URLRequestContextGetter::Delegate:
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;
net::SSLConfigService* CreateSSLConfigService() override;
std::vector<std::string> GetCookieableSchemes() override;
net::TransportSecurityState::RequireCTDelegate* GetRequireCTDelegate()
override;
// content::BrowserContext:
content::DownloadManagerDelegate* GetDownloadManagerDelegate() override;
@@ -47,7 +53,11 @@ class AtomBrowserContext : public brightray::BrowserContext {
// brightray::BrowserContext:
void RegisterPrefs(PrefRegistrySimple* pref_registry) override;
AtomBlobReader* GetBlobReader();
AtomNetworkDelegate* network_delegate() const { return network_delegate_; }
AtomCookieDelegate* cookie_delegate() const {
return cookie_delegate_.get();
}
protected:
AtomBrowserContext(const std::string& partition, bool in_memory,
@@ -58,11 +68,14 @@ class AtomBrowserContext : public brightray::BrowserContext {
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

@@ -5,6 +5,7 @@
#include "atom/browser/atom_browser_main_parts.h"
#include "atom/browser/api/trackable_object.h"
#include "atom/browser/atom_access_token_store.h"
#include "atom/browser/atom_browser_client.h"
#include "atom/browser/atom_browser_context.h"
#include "atom/browser/bridge_task_runner.h"
@@ -18,20 +19,39 @@
#include "base/threading/thread_task_runner_handle.h"
#include "chrome/browser/browser_process.h"
#include "content/public/browser/child_process_security_policy.h"
#include "device/geolocation/geolocation_delegate.h"
#include "device/geolocation/geolocation_provider.h"
#include "v8/include/v8-debug.h"
#if defined(USE_X11)
#include "chrome/browser/ui/libgtk2ui/gtk2_util.h"
#include "chrome/browser/ui/libgtkui/gtk_util.h"
#include "ui/events/devices/x11/touch_factory_x11.h"
#endif
namespace atom {
namespace {
// A provider of Geolocation services to override AccessTokenStore.
class AtomGeolocationDelegate : public device::GeolocationDelegate {
public:
AtomGeolocationDelegate() = default;
scoped_refptr<device::AccessTokenStore> CreateAccessTokenStore() final {
return new AtomAccessTokenStore();
}
private:
DISALLOW_COPY_AND_ASSIGN(AtomGeolocationDelegate);
};
template<typename T>
void Erase(T* container, typename T::iterator iter) {
container->erase(iter);
}
} // namespace
// static
AtomBrowserMainParts* AtomBrowserMainParts::self_ = nullptr;
@@ -115,9 +135,9 @@ void AtomBrowserMainParts::PostEarlyInitialization() {
// Make sure node can get correct environment when debugging.
if (node_debugger_->IsRunning())
env->AssignToContext(v8::Debug::GetDebugContext());
env->AssignToContext(v8::Debug::GetDebugContext(js_env_->isolate()));
// Add atom-shell extended APIs.
// Add Electron extended APIs.
atom_bindings_->BindTo(js_env_->isolate(), env->process_object());
// Load everything.
@@ -150,7 +170,7 @@ void AtomBrowserMainParts::PreMainMessageLoopRun() {
bridge_task_runner_ = nullptr;
#if defined(USE_X11)
libgtk2ui::GtkInitFromCommandLine(*base::CommandLine::ForCurrentProcess());
libgtkui::GtkInitFromCommandLine(*base::CommandLine::ForCurrentProcess());
#endif
#if !defined(OS_MACOSX)
@@ -171,6 +191,8 @@ void AtomBrowserMainParts::PostMainMessageLoopStart() {
#if defined(OS_POSIX)
HandleShutdownSignals();
#endif
device::GeolocationProvider::SetGeolocationDelegate(
new AtomGeolocationDelegate());
}
void AtomBrowserMainParts::PostMainMessageLoopRun() {

View File

@@ -60,7 +60,7 @@ void AtomDownloadManagerDelegate::CreateDownloadPath(
std::string(),
suggested_filename,
mime_type,
std::string());
"download");
if (!base::PathExists(default_download_path))
base::CreateDirectory(default_download_path);
@@ -90,10 +90,11 @@ void AtomDownloadManagerDelegate::OnDownloadPathGenerated(
base::FilePath path;
GetItemSavePath(item, &path);
// Show save dialog if save path was not set already on item
if (path.empty() && file_dialog::ShowSaveDialog(window, item->GetURL().spec(),
"", default_path,
file_dialog::Filters(),
&path)) {
file_dialog::DialogSettings settings;
settings.parent_window = window;
settings.title = item->GetURL().spec();
settings.default_path = default_path;
if (path.empty() && file_dialog::ShowSaveDialog(settings, &path)) {
// Remember the last selected download directory.
AtomBrowserContext* browser_context = static_cast<AtomBrowserContext*>(
download_manager_->GetBrowserContext());

View File

@@ -5,20 +5,44 @@
#include "atom/browser/atom_javascript_dialog_manager.h"
#include <string>
#include <vector>
#include "atom/browser/native_window.h"
#include "atom/browser/ui/message_box.h"
#include "base/bind.h"
#include "base/strings/utf_string_conversions.h"
#include "ui/gfx/image/image_skia.h"
using content::JavaScriptMessageType;
namespace atom {
void AtomJavaScriptDialogManager::RunJavaScriptDialog(
content::WebContents* web_contents,
const GURL& origin_url,
content::JavaScriptMessageType javascript_message_type,
JavaScriptMessageType message_type,
const base::string16& message_text,
const base::string16& default_prompt_text,
const DialogClosedCallback& callback,
bool* did_suppress_message) {
callback.Run(false, base::string16());
if (message_type != JavaScriptMessageType::JAVASCRIPT_MESSAGE_TYPE_ALERT &&
message_type != JavaScriptMessageType::JAVASCRIPT_MESSAGE_TYPE_CONFIRM) {
callback.Run(false, base::string16());
return;
}
std::vector<std::string> buttons = {"OK"};
if (message_type == JavaScriptMessageType::JAVASCRIPT_MESSAGE_TYPE_CONFIRM) {
buttons.push_back("Cancel");
}
atom::ShowMessageBox(NativeWindow::FromWebContents(web_contents),
atom::MessageBoxType::MESSAGE_BOX_TYPE_NONE, buttons, -1,
0, atom::MessageBoxOptions::MESSAGE_BOX_NONE, "",
base::UTF16ToUTF8(message_text), "", "", false,
gfx::ImageSkia(),
base::Bind(&OnMessageBoxCallback, callback));
}
void AtomJavaScriptDialogManager::RunBeforeUnloadDialog(
@@ -29,4 +53,18 @@ void AtomJavaScriptDialogManager::RunBeforeUnloadDialog(
callback.Run(false, base::ASCIIToUTF16("This should not be displayed"));
}
void AtomJavaScriptDialogManager::CancelDialogs(
content::WebContents* web_contents,
bool suppress_callbacks,
bool reset_state) {
}
// static
void AtomJavaScriptDialogManager::OnMessageBoxCallback(
const DialogClosedCallback& callback,
int code,
bool checkbox_checked) {
callback.Run(code == 0, base::string16());
}
} // namespace atom

View File

@@ -26,9 +26,14 @@ class AtomJavaScriptDialogManager : public content::JavaScriptDialogManager {
content::WebContents* web_contents,
bool is_reload,
const DialogClosedCallback& callback) override;
void CancelActiveAndPendingDialogs(
content::WebContents* web_contents) override {}
void ResetDialogState(content::WebContents* web_contents) override {};
void CancelDialogs(content::WebContents* web_contents,
bool suppress_callbacks,
bool reset_state) override;
private:
static void OnMessageBoxCallback(const DialogClosedCallback& callback,
int code,
bool checkbox_checked);
};
} // namespace atom

View File

@@ -26,10 +26,52 @@ bool WebContentsDestroyed(int process_id) {
return contents->IsBeingDestroyed();
}
void PermissionRequestResponseCallbackWrapper(
const AtomPermissionManager::StatusCallback& callback,
const std::vector<blink::mojom::PermissionStatus>& vector) {
callback.Run(vector[0]);
}
} // namespace
AtomPermissionManager::AtomPermissionManager()
: request_id_(0) {
class AtomPermissionManager::PendingRequest {
public:
PendingRequest(content::RenderFrameHost* render_frame_host,
const std::vector<content::PermissionType>& permissions,
const StatusesCallback& callback)
: render_process_id_(render_frame_host->GetProcess()->GetID()),
callback_(callback),
results_(permissions.size(), blink::mojom::PermissionStatus::DENIED),
remaining_results_(permissions.size()) {}
void SetPermissionStatus(int permission_id,
blink::mojom::PermissionStatus status) {
DCHECK(!IsComplete());
results_[permission_id] = status;
--remaining_results_;
}
int render_process_id() const {
return render_process_id_;
}
bool IsComplete() const {
return remaining_results_ == 0;
}
void RunCallback() const {
callback_.Run(results_);
}
private:
int render_process_id_;
const StatusesCallback callback_;
std::vector<blink::mojom::PermissionStatus> results_;
size_t remaining_results_;
};
AtomPermissionManager::AtomPermissionManager() {
}
AtomPermissionManager::~AtomPermissionManager() {
@@ -37,12 +79,14 @@ AtomPermissionManager::~AtomPermissionManager() {
void AtomPermissionManager::SetPermissionRequestHandler(
const RequestHandler& handler) {
if (handler.is_null() && !pending_requests_.empty()) {
for (const auto& request : pending_requests_) {
if (!WebContentsDestroyed(request.second.render_process_id))
request.second.callback.Run(blink::mojom::PermissionStatus::DENIED);
if (handler.is_null() && !pending_requests_.IsEmpty()) {
for (PendingRequestsMap::const_iterator iter(&pending_requests_);
!iter.IsAtEnd(); iter.Advance()) {
auto request = iter.GetCurrentValue();
if (!WebContentsDestroyed(request->render_process_id()))
request->RunCallback();
}
pending_requests_.clear();
pending_requests_.Clear();
}
request_handler_ = handler;
}
@@ -51,71 +95,83 @@ int AtomPermissionManager::RequestPermission(
content::PermissionType permission,
content::RenderFrameHost* render_frame_host,
const GURL& requesting_origin,
const ResponseCallback& response_callback) {
int process_id = render_frame_host->GetProcess()->GetID();
if (permission == content::PermissionType::MIDI_SYSEX) {
content::ChildProcessSecurityPolicy::GetInstance()->
GrantSendMidiSysExMessage(process_id);
}
if (!request_handler_.is_null()) {
auto web_contents =
content::WebContents::FromRenderFrameHost(render_frame_host);
++request_id_;
auto callback = base::Bind(&AtomPermissionManager::OnPermissionResponse,
base::Unretained(this),
request_id_,
requesting_origin,
response_callback);
pending_requests_[request_id_] = { process_id, callback };
request_handler_.Run(web_contents, permission, callback);
return request_id_;
}
response_callback.Run(blink::mojom::PermissionStatus::GRANTED);
return kNoPendingOperation;
bool user_gesture,
const StatusCallback& response_callback) {
return RequestPermissions(
std::vector<content::PermissionType>(1, permission),
render_frame_host,
requesting_origin,
user_gesture,
base::Bind(&PermissionRequestResponseCallbackWrapper, response_callback));
}
int AtomPermissionManager::RequestPermissions(
const std::vector<content::PermissionType>& permissions,
content::RenderFrameHost* render_frame_host,
const GURL& requesting_origin,
const base::Callback<void(
const std::vector<blink::mojom::PermissionStatus>&)>& callback) {
// FIXME(zcbenz): Just ignore multiple permissions request for now.
std::vector<blink::mojom::PermissionStatus> permissionStatuses;
for (auto permission : permissions) {
bool user_gesture,
const StatusesCallback& response_callback) {
if (permissions.empty()) {
response_callback.Run(std::vector<blink::mojom::PermissionStatus>());
return kNoPendingOperation;
}
if (request_handler_.is_null()) {
std::vector<blink::mojom::PermissionStatus> statuses;
for (auto permission : permissions) {
if (permission == content::PermissionType::MIDI_SYSEX) {
content::ChildProcessSecurityPolicy::GetInstance()->
GrantSendMidiSysExMessage(render_frame_host->GetProcess()->GetID());
}
statuses.push_back(blink::mojom::PermissionStatus::GRANTED);
}
response_callback.Run(statuses);
return kNoPendingOperation;
}
auto web_contents =
content::WebContents::FromRenderFrameHost(render_frame_host);
int request_id = pending_requests_.Add(new PendingRequest(
render_frame_host, permissions, response_callback));
for (size_t i = 0; i < permissions.size(); ++i) {
auto permission = permissions[i];
if (permission == content::PermissionType::MIDI_SYSEX) {
content::ChildProcessSecurityPolicy::GetInstance()->
GrantSendMidiSysExMessage(render_frame_host->GetProcess()->GetID());
}
permissionStatuses.push_back(blink::mojom::PermissionStatus::GRANTED);
const auto callback =
base::Bind(&AtomPermissionManager::OnPermissionResponse,
base::Unretained(this), request_id, i);
request_handler_.Run(web_contents, permission, callback);
}
callback.Run(permissionStatuses);
return kNoPendingOperation;
return request_id;
}
void AtomPermissionManager::OnPermissionResponse(
int request_id,
const GURL& origin,
const ResponseCallback& callback,
int permission_id,
blink::mojom::PermissionStatus status) {
auto request = pending_requests_.find(request_id);
if (request != pending_requests_.end()) {
if (!WebContentsDestroyed(request->second.render_process_id))
callback.Run(status);
pending_requests_.erase(request);
auto pending_request = pending_requests_.Lookup(request_id);
if (!pending_request)
return;
pending_request->SetPermissionStatus(permission_id, status);
if (pending_request->IsComplete()) {
pending_request->RunCallback();
pending_requests_.Remove(request_id);
}
}
void AtomPermissionManager::CancelPermissionRequest(int request_id) {
auto request = pending_requests_.find(request_id);
if (request != pending_requests_.end()) {
if (!WebContentsDestroyed(request->second.render_process_id))
request->second.callback.Run(blink::mojom::PermissionStatus::DENIED);
pending_requests_.erase(request);
}
auto pending_request = pending_requests_.Lookup(request_id);
if (!pending_request)
return;
if (!WebContentsDestroyed(pending_request->render_process_id()))
pending_request->RunCallback();
pending_requests_.Remove(request_id);
}
void AtomPermissionManager::ResetPermission(
@@ -141,7 +197,7 @@ int AtomPermissionManager::SubscribePermissionStatusChange(
content::PermissionType permission,
const GURL& requesting_origin,
const GURL& embedding_origin,
const ResponseCallback& callback) {
const StatusCallback& callback) {
return -1;
}

View File

@@ -9,6 +9,7 @@
#include <vector>
#include "base/callback.h"
#include "base/id_map.h"
#include "content/public/browser/permission_manager.h"
namespace content {
@@ -22,12 +23,14 @@ class AtomPermissionManager : public content::PermissionManager {
AtomPermissionManager();
~AtomPermissionManager() override;
using ResponseCallback =
using StatusCallback =
base::Callback<void(blink::mojom::PermissionStatus)>;
using StatusesCallback =
base::Callback<void(const std::vector<blink::mojom::PermissionStatus>&)>;
using RequestHandler =
base::Callback<void(content::WebContents*,
content::PermissionType,
const ResponseCallback&)>;
const StatusCallback&)>;
// Handler to dispatch permission requests in JS.
void SetPermissionRequestHandler(const RequestHandler& handler);
@@ -37,18 +40,21 @@ class AtomPermissionManager : public content::PermissionManager {
content::PermissionType permission,
content::RenderFrameHost* render_frame_host,
const GURL& requesting_origin,
const ResponseCallback& callback) override;
bool user_gesture,
const base::Callback<void(blink::mojom::PermissionStatus)>& callback)
override;
int RequestPermissions(
const std::vector<content::PermissionType>& permissions,
content::RenderFrameHost* render_frame_host,
const GURL& requesting_origin,
bool user_gesture,
const base::Callback<void(
const std::vector<blink::mojom::PermissionStatus>&)>& callback) override;
const std::vector<blink::mojom::PermissionStatus>&)>& callback)
override;
protected:
void OnPermissionResponse(int request_id,
const GURL& url,
const ResponseCallback& callback,
int permission_id,
blink::mojom::PermissionStatus status);
// content::PermissionManager:
@@ -72,16 +78,12 @@ class AtomPermissionManager : public content::PermissionManager {
void UnsubscribePermissionStatusChange(int subscription_id) override;
private:
struct RequestInfo {
int render_process_id;
ResponseCallback callback;
};
class PendingRequest;
using PendingRequestsMap = IDMap<PendingRequest, IDMapOwnPointer>;
RequestHandler request_handler_;
std::map<int, RequestInfo> pending_requests_;
int request_id_;
PendingRequestsMap pending_requests_;
DISALLOW_COPY_AND_ASSIGN(AtomPermissionManager);
};

View File

@@ -10,8 +10,17 @@
#include "base/strings/utf_string_conversions.h"
#include "content/public/browser/browser_thread.h"
#include "net/base/escape.h"
#include "net/ssl/client_cert_store.h"
#include "url/gurl.h"
#if defined(USE_NSS_CERTS)
#include "net/ssl/client_cert_store_nss.h"
#elif defined(OS_WIN)
#include "net/ssl/client_cert_store_win.h"
#elif defined(OS_MACOSX)
#include "net/ssl/client_cert_store_mac.h"
#endif
using content::BrowserThread;
namespace atom {
@@ -55,16 +64,12 @@ AtomResourceDispatcherHostDelegate::AtomResourceDispatcherHostDelegate() {
bool AtomResourceDispatcherHostDelegate::HandleExternalProtocol(
const GURL& url,
int child_id,
const content::ResourceRequestInfo::WebContentsGetter& web_contents_getter,
bool is_main_frame,
ui::PageTransition transition,
bool has_user_gesture) {
content::ResourceRequestInfo* info) {
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
base::Bind(&HandleExternalProtocolInUI,
url,
web_contents_getter,
has_user_gesture));
info->GetWebContentsGetterForRequest(),
info->HasUserGesture()));
return true;
}
@@ -75,4 +80,19 @@ AtomResourceDispatcherHostDelegate::CreateLoginDelegate(
return new LoginHandler(auth_info, request);
}
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
}
} // namespace atom

View File

@@ -15,16 +15,13 @@ class AtomResourceDispatcherHostDelegate
AtomResourceDispatcherHostDelegate();
// content::ResourceDispatcherHostDelegate:
bool HandleExternalProtocol(
const GURL& url,
int child_id,
const content::ResourceRequestInfo::WebContentsGetter&,
bool is_main_frame,
ui::PageTransition transition,
bool has_user_gesture) override;
bool HandleExternalProtocol(const GURL& url,
content::ResourceRequestInfo* info) override;
content::ResourceDispatcherHostLoginDelegate* CreateLoginDelegate(
net::AuthChallengeInfo* auth_info,
net::URLRequest* request) override;
std::unique_ptr<net::ClientCertStore> CreateClientCertStore(
content::ResourceContext* resource_context) override;
};
} // namespace atom

View File

@@ -1,111 +0,0 @@
// Copyright (c) 2016 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "atom/browser/atom_security_state_model_client.h"
#include "content/public/browser/cert_store.h"
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/origin_util.h"
#include "content/public/common/ssl_status.h"
#include "net/cert/x509_certificate.h"
DEFINE_WEB_CONTENTS_USER_DATA_KEY(atom::AtomSecurityStateModelClient);
using security_state::SecurityStateModel;
namespace atom {
namespace {
SecurityStateModel::SecurityLevel GetSecurityLevelForSecurityStyle(
content::SecurityStyle style) {
switch (style) {
case content::SECURITY_STYLE_UNKNOWN:
return SecurityStateModel::NONE;
case content::SECURITY_STYLE_UNAUTHENTICATED:
return SecurityStateModel::NONE;
case content::SECURITY_STYLE_AUTHENTICATION_BROKEN:
return SecurityStateModel::SECURITY_ERROR;
case content::SECURITY_STYLE_WARNING:
return SecurityStateModel::SECURITY_WARNING;
case content::SECURITY_STYLE_AUTHENTICATED:
return SecurityStateModel::SECURE;
}
return SecurityStateModel::NONE;
}
} // namespace
AtomSecurityStateModelClient::AtomSecurityStateModelClient(
content::WebContents* web_contents)
: web_contents_(web_contents),
security_state_model_(new SecurityStateModel()) {
security_state_model_->SetClient(this);
}
AtomSecurityStateModelClient::~AtomSecurityStateModelClient() {
}
const SecurityStateModel::SecurityInfo&
AtomSecurityStateModelClient::GetSecurityInfo() const {
return security_state_model_->GetSecurityInfo();
}
bool AtomSecurityStateModelClient::RetrieveCert(
scoped_refptr<net::X509Certificate>* cert) {
content::NavigationEntry* entry =
web_contents_->GetController().GetVisibleEntry();
if (!entry)
return false;
return content::CertStore::GetInstance()->RetrieveCert(
entry->GetSSL().cert_id, cert);
}
bool AtomSecurityStateModelClient::UsedPolicyInstalledCertificate() {
return false;
}
bool AtomSecurityStateModelClient::IsOriginSecure(const GURL& url) {
return content::IsOriginSecure(url);
}
void AtomSecurityStateModelClient::GetVisibleSecurityState(
SecurityStateModel::VisibleSecurityState* state) {
content::NavigationEntry* entry =
web_contents_->GetController().GetVisibleEntry();
if (!entry ||
entry->GetSSL().security_style == content::SECURITY_STYLE_UNKNOWN) {
*state = SecurityStateModel::VisibleSecurityState();
return;
}
state->initialized = true;
state->url = entry->GetURL();
const content::SSLStatus& ssl = entry->GetSSL();
state->initial_security_level =
GetSecurityLevelForSecurityStyle(ssl.security_style);
state->cert_id = ssl.cert_id;
state->cert_status = ssl.cert_status;
state->connection_status = ssl.connection_status;
state->security_bits = ssl.security_bits;
state->sct_verify_statuses.clear();
state->sct_verify_statuses.insert(state->sct_verify_statuses.end(),
ssl.num_unknown_scts,
net::ct::SCT_STATUS_LOG_UNKNOWN);
state->sct_verify_statuses.insert(state->sct_verify_statuses.end(),
ssl.num_invalid_scts,
net::ct::SCT_STATUS_INVALID);
state->sct_verify_statuses.insert(state->sct_verify_statuses.end(),
ssl.num_valid_scts, net::ct::SCT_STATUS_OK);
state->displayed_mixed_content =
(ssl.content_status & content::SSLStatus::DISPLAYED_INSECURE_CONTENT)
? true
: false;
state->ran_mixed_content =
(ssl.content_status & content::SSLStatus::RAN_INSECURE_CONTENT) ? true
: false;
}
} // namespace atom

View File

@@ -1,42 +0,0 @@
// Copyright (c) 2016 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef ATOM_BROWSER_ATOM_SECURITY_STATE_MODEL_CLIENT_H_
#define ATOM_BROWSER_ATOM_SECURITY_STATE_MODEL_CLIENT_H_
#include "components/security_state/security_state_model.h"
#include "components/security_state/security_state_model_client.h"
#include "content/public/browser/web_contents_user_data.h"
namespace atom {
class AtomSecurityStateModelClient
: public security_state::SecurityStateModelClient,
public content::WebContentsUserData<AtomSecurityStateModelClient> {
public:
~AtomSecurityStateModelClient() override;
const security_state::SecurityStateModel::SecurityInfo&
GetSecurityInfo() const;
// security_state::SecurityStateModelClient:
void GetVisibleSecurityState(
security_state::SecurityStateModel::VisibleSecurityState* state) override;
bool RetrieveCert(scoped_refptr<net::X509Certificate>* cert) override;
bool UsedPolicyInstalledCertificate() override;
bool IsOriginSecure(const GURL& url) override;
private:
explicit AtomSecurityStateModelClient(content::WebContents* web_contents);
friend class content::WebContentsUserData<AtomSecurityStateModelClient>;
content::WebContents* web_contents_;
std::unique_ptr<security_state::SecurityStateModel> security_state_model_;
DISALLOW_COPY_AND_ASSIGN(AtomSecurityStateModelClient);
};
} // namespace atom
#endif // ATOM_BROWSER_ATOM_SECURITY_STATE_MODEL_CLIENT_H_

View File

@@ -27,7 +27,7 @@ bool BridgeTaskRunner::PostDelayedTask(
base::TimeDelta delay) {
auto message_loop = base::MessageLoop::current();
if (!message_loop) {
tasks_.push_back(base::MakeTuple(from_here, task, delay));
tasks_.push_back(std::make_tuple(from_here, task, delay));
return true;
}
@@ -48,7 +48,7 @@ bool BridgeTaskRunner::PostNonNestableDelayedTask(
base::TimeDelta delay) {
auto message_loop = base::MessageLoop::current();
if (!message_loop) {
non_nestable_tasks_.push_back(base::MakeTuple(from_here, task, delay));
non_nestable_tasks_.push_back(std::make_tuple(from_here, task, delay));
return true;
}

View File

@@ -5,6 +5,7 @@
#ifndef ATOM_BROWSER_BRIDGE_TASK_RUNNER_H_
#define ATOM_BROWSER_BRIDGE_TASK_RUNNER_H_
#include <tuple>
#include <vector>
#include "base/single_thread_task_runner.h"
@@ -33,7 +34,7 @@ class BridgeTaskRunner : public base::SingleThreadTaskRunner {
base::TimeDelta delay) override;
private:
using TaskPair = base::Tuple<
using TaskPair = std::tuple<
tracked_objects::Location, base::Closure, base::TimeDelta>;
std::vector<TaskPair> tasks_;
std::vector<TaskPair> non_nestable_tasks_;

View File

@@ -7,11 +7,13 @@
#include <string>
#include "atom/browser/atom_browser_main_parts.h"
#include "atom/browser/browser_observer.h"
#include "atom/browser/native_window.h"
#include "atom/browser/window_list.h"
#include "base/files/file_util.h"
#include "base/message_loop/message_loop.h"
#include "base/path_service.h"
#include "base/run_loop.h"
#include "base/threading/thread_task_runner_handle.h"
#include "brightray/browser/brightray_paths.h"
namespace atom {
@@ -82,10 +84,11 @@ void Browser::Shutdown() {
is_shutdown_ = true;
is_quiting_ = true;
FOR_EACH_OBSERVER(BrowserObserver, observers_, OnQuit());
for (BrowserObserver& observer : observers_)
observer.OnQuit();
if (base::MessageLoop::current()) {
base::MessageLoop::current()->PostTask(
if (base::ThreadTaskRunnerHandle::IsSet()) {
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, base::MessageLoop::QuitWhenIdleClosure());
} else {
// There is no message loop available so we are in early stage.
@@ -127,25 +130,25 @@ int Browser::GetBadgeCount() {
bool Browser::OpenFile(const std::string& file_path) {
bool prevent_default = false;
FOR_EACH_OBSERVER(BrowserObserver,
observers_,
OnOpenFile(&prevent_default, file_path));
for (BrowserObserver& observer : observers_)
observer.OnOpenFile(&prevent_default, file_path);
return prevent_default;
}
void Browser::OpenURL(const std::string& url) {
FOR_EACH_OBSERVER(BrowserObserver, observers_, OnOpenURL(url));
for (BrowserObserver& observer : observers_)
observer.OnOpenURL(url);
}
void Browser::Activate(bool has_visible_windows) {
FOR_EACH_OBSERVER(BrowserObserver,
observers_,
OnActivate(has_visible_windows));
for (BrowserObserver& observer : observers_)
observer.OnActivate(has_visible_windows);
}
void Browser::WillFinishLaunching() {
FOR_EACH_OBSERVER(BrowserObserver, observers_, OnWillFinishLaunching());
for (BrowserObserver& observer : observers_)
observer.OnWillFinishLaunching();
}
void Browser::DidFinishLaunching(const base::DictionaryValue& launch_info) {
@@ -155,22 +158,20 @@ void Browser::DidFinishLaunching(const base::DictionaryValue& launch_info) {
base::CreateDirectoryAndGetError(user_data, nullptr);
is_ready_ = true;
FOR_EACH_OBSERVER(BrowserObserver, observers_,
OnFinishLaunching(launch_info));
for (BrowserObserver& observer : observers_)
observer.OnFinishLaunching(launch_info);
}
void Browser::OnAccessibilitySupportChanged() {
FOR_EACH_OBSERVER(BrowserObserver,
observers_,
OnAccessibilitySupportChanged());
for (BrowserObserver& observer : observers_)
observer.OnAccessibilitySupportChanged();
}
void Browser::RequestLogin(
LoginHandler* login_handler,
std::unique_ptr<base::DictionaryValue> request_details) {
FOR_EACH_OBSERVER(BrowserObserver,
observers_,
OnLogin(login_handler, *(request_details.get())));
for (BrowserObserver& observer : observers_)
observer.OnLogin(login_handler, *(request_details.get()));
}
void Browser::NotifyAndShutdown() {
@@ -178,7 +179,8 @@ void Browser::NotifyAndShutdown() {
return;
bool prevent_default = false;
FOR_EACH_OBSERVER(BrowserObserver, observers_, OnWillQuit(&prevent_default));
for (BrowserObserver& observer : observers_)
observer.OnWillQuit(&prevent_default);
if (prevent_default) {
is_quiting_ = false;
@@ -190,9 +192,8 @@ void Browser::NotifyAndShutdown() {
bool Browser::HandleBeforeQuit() {
bool prevent_default = false;
FOR_EACH_OBSERVER(BrowserObserver,
observers_,
OnBeforeQuit(&prevent_default));
for (BrowserObserver& observer : observers_)
observer.OnBeforeQuit(&prevent_default);
return !prevent_default;
}
@@ -205,12 +206,14 @@ void Browser::OnWindowCloseCancelled(NativeWindow* window) {
}
void Browser::OnWindowAllClosed() {
if (is_exiting_)
if (is_exiting_) {
Shutdown();
else if (is_quiting_)
} else if (is_quiting_) {
NotifyAndShutdown();
else
FOR_EACH_OBSERVER(BrowserObserver, observers_, OnWindowAllClosed());
} else {
for (BrowserObserver& observer : observers_)
observer.OnWindowAllClosed();
}
}
} // namespace atom

View File

@@ -14,6 +14,7 @@
#include "base/macros.h"
#include "base/observer_list.h"
#include "base/strings/string16.h"
#include "base/values.h"
#include "native_mate/arguments.h"
#if defined(OS_WIN)
@@ -21,7 +22,6 @@
#endif
namespace base {
class DictionaryValue;
class FilePath;
}
@@ -60,7 +60,7 @@ class Browser : public WindowListObserver {
// Overrides the application version.
void SetVersion(const std::string& version);
// Returns the application's name, default is just Atom-Shell.
// Returns the application's name, default is just Electron.
std::string GetName() const;
// Overrides the application name.
@@ -98,9 +98,11 @@ class Browser : public WindowListObserver {
bool restore_state = false;
bool opened_at_login = false;
bool opened_as_hidden = false;
base::string16 path;
std::vector<base::string16> args;
};
void SetLoginItemSettings(LoginItemSettings settings);
LoginItemSettings GetLoginItemSettings();
LoginItemSettings GetLoginItemSettings(LoginItemSettings options);
#if defined(OS_MACOSX)
// Hide the application.
@@ -146,6 +148,9 @@ class Browser : public WindowListObserver {
// Set docks' icon.
void DockSetIcon(const gfx::Image& image);
void ShowAboutPanel();
void SetAboutPanelOptions(const base::DictionaryValue& options);
#endif // defined(OS_MACOSX)
#if defined(OS_WIN)
@@ -245,6 +250,10 @@ class Browser : public WindowListObserver {
base::string16 app_user_model_id_;
#endif
#if defined(OS_MACOSX)
base::DictionaryValue about_panel_options_;
#endif
DISALLOW_COPY_AND_ASSIGN(Browser);
};

View File

@@ -10,7 +10,7 @@
#include "atom/browser/window_list.h"
#include "atom/common/atom_version.h"
#include "brightray/common/application_info.h"
#include "chrome/browser/ui/libgtk2ui/unity_service.h"
#include "chrome/browser/ui/libgtkui/unity_service.h"
namespace atom {
@@ -63,7 +63,8 @@ bool Browser::SetBadgeCount(int count) {
void Browser::SetLoginItemSettings(LoginItemSettings settings) {
}
Browser::LoginItemSettings Browser::GetLoginItemSettings() {
Browser::LoginItemSettings Browser::GetLoginItemSettings(
LoginItemSettings options) {
return LoginItemSettings();
}

View File

@@ -146,13 +146,13 @@ std::string Browser::GetCurrentActivityType() {
bool Browser::ContinueUserActivity(const std::string& type,
const base::DictionaryValue& user_info) {
bool prevent_default = false;
FOR_EACH_OBSERVER(BrowserObserver,
observers_,
OnContinueUserActivity(&prevent_default, type, user_info));
for (BrowserObserver& observer : observers_)
observer.OnContinueUserActivity(&prevent_default, type, user_info);
return prevent_default;
}
Browser::LoginItemSettings Browser::GetLoginItemSettings() {
Browser::LoginItemSettings Browser::GetLoginItemSettings(
LoginItemSettings options) {
LoginItemSettings settings;
settings.open_at_login = base::mac::CheckLoginItemStatus(
&settings.open_as_hidden);
@@ -253,4 +253,36 @@ void Browser::DockSetIcon(const gfx::Image& image) {
setApplicationIconImage:image.AsNSImage()];
}
void Browser::ShowAboutPanel() {
NSDictionary* options = DictionaryValueToNSDictionary(about_panel_options_);
// Credits must be a NSAttributedString instead of NSString
id credits = options[@"Credits"];
if (credits != nil) {
NSMutableDictionary* mutable_options = [options mutableCopy];
mutable_options[@"Credits"] = [[[NSAttributedString alloc]
initWithString:(NSString*)credits] autorelease];
options = [NSDictionary dictionaryWithDictionary:mutable_options];
}
[[AtomApplication sharedApplication]
orderFrontStandardAboutPanelWithOptions:options];
}
void Browser::SetAboutPanelOptions(const base::DictionaryValue& options) {
about_panel_options_.Clear();
// Upper case option keys for orderFrontStandardAboutPanelWithOptions format
for (base::DictionaryValue::Iterator iter(options);
!iter.IsAtEnd();
iter.Advance()) {
std::string key = iter.key();
std::string value;
if (!key.empty() && iter.value().GetAsString(&value)) {
key[0] = base::ToUpperASCII(key[0]);
about_panel_options_.SetString(key, value);
}
}
}
} // namespace atom

View File

@@ -43,15 +43,19 @@ BOOL CALLBACK WindowsEnumerationHandler(HWND hwnd, LPARAM param) {
return TRUE;
}
bool GetProcessExecPath(base::string16* exe) {
base::FilePath path;
if (!PathService::Get(base::FILE_EXE, &path)) {
LOG(ERROR) << "Error getting app exe path";
return false;
}
*exe = path.value();
return true;
}
bool GetProtocolLaunchPath(mate::Arguments* args, base::string16* exe) {
// Executable Path
if (!args->GetNext(exe)) {
base::FilePath path;
if (!PathService::Get(base::FILE_EXE, &path)) {
LOG(ERROR) << "Error getting app exe path";
return false;
}
*exe = path.value();
if (!args->GetNext(exe) && !GetProcessExecPath(exe)) {
return false;
}
// Read in optional args arg
@@ -65,6 +69,22 @@ bool GetProtocolLaunchPath(mate::Arguments* args, base::string16* exe) {
return true;
}
bool FormatCommandLineString(base::string16* exe,
const std::vector<base::string16>& launch_args) {
if (exe->empty() && !GetProcessExecPath(exe)) {
return false;
}
if (!launch_args.empty()) {
base::string16 formatString = L"%s %s";
*exe = base::StringPrintf(formatString.c_str(),
exe->c_str(),
base::JoinString(launch_args, L" ").c_str());
}
return true;
}
} // namespace
void Browser::Focus() {
@@ -257,34 +277,32 @@ void Browser::SetLoginItemSettings(LoginItemSettings settings) {
base::win::RegKey key(HKEY_CURRENT_USER, keyPath.c_str(), KEY_ALL_ACCESS);
if (settings.open_at_login) {
base::FilePath path;
if (PathService::Get(base::FILE_EXE, &path)) {
base::string16 exePath(path.value());
key.WriteValue(GetAppUserModelID(), exePath.c_str());
base::string16 exe = settings.path;
if (FormatCommandLineString(&exe, settings.args)) {
key.WriteValue(GetAppUserModelID(), exe.c_str());
}
} else {
key.DeleteValue(GetAppUserModelID());
}
}
Browser::LoginItemSettings Browser::GetLoginItemSettings() {
Browser::LoginItemSettings Browser::GetLoginItemSettings(
LoginItemSettings options) {
LoginItemSettings settings;
base::string16 keyPath = L"Software\\Microsoft\\Windows\\CurrentVersion\\Run";
base::win::RegKey key(HKEY_CURRENT_USER, keyPath.c_str(), KEY_ALL_ACCESS);
base::string16 keyVal;
if (!FAILED(key.ReadValue(GetAppUserModelID(), &keyVal))) {
base::FilePath path;
if (PathService::Get(base::FILE_EXE, &path)) {
base::string16 exePath(path.value());
settings.open_at_login = keyVal == exePath;
base::string16 exe = options.path;
if (FormatCommandLineString(&exe, options.args)) {
settings.open_at_login = keyVal == exe;
}
}
return settings;
}
PCWSTR Browser::GetAppUserModelID() {
if (app_user_model_id_.empty()) {
SetAppUserModelID(base::ReplaceStringPlaceholders(

View File

@@ -10,7 +10,6 @@
#include "atom/browser/atom_browser_context.h"
#include "atom/browser/atom_javascript_dialog_manager.h"
#include "atom/browser/atom_security_state_model_client.h"
#include "atom/browser/native_window.h"
#include "atom/browser/ui/file_dialog.h"
#include "atom/browser/web_dialog_helper.h"
@@ -18,10 +17,13 @@
#include "base/files/file_util.h"
#include "chrome/browser/printing/print_preview_message_handler.h"
#include "chrome/browser/printing/print_view_manager_basic.h"
#include "chrome/browser/ssl/security_state_tab_helper.h"
#include "chrome/browser/ui/browser_dialogs.h"
#include "chrome/common/pref_names.h"
#include "components/prefs/pref_service.h"
#include "components/prefs/scoped_user_pref_update.h"
#include "components/security_state/content/content_utils.h"
#include "components/security_state/core/security_state.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/child_process_security_policy.h"
#include "content/public/browser/render_process_host.h"
@@ -32,7 +34,6 @@
#include "storage/browser/fileapi/isolated_context.h"
using content::BrowserThread;
using security_state::SecurityStateModel;
namespace atom {
@@ -93,8 +94,10 @@ FileSystem CreateFileSystemStruct(
return FileSystem(file_system_name, root_url, file_system_path);
}
base::DictionaryValue* CreateFileSystemValue(const FileSystem& file_system) {
auto* file_system_value = new base::DictionaryValue();
std::unique_ptr<base::DictionaryValue> CreateFileSystemValue(
const FileSystem& file_system) {
std::unique_ptr<base::DictionaryValue> file_system_value(
new base::DictionaryValue());
file_system_value->SetString("fileSystemName", file_system.file_system_name);
file_system_value->SetString("rootURL", file_system.root_url);
file_system_value->SetString("fileSystemPath", file_system.file_system_path);
@@ -144,24 +147,6 @@ bool IsDevToolsFileSystemAdded(
return file_system_paths.find(file_system_path) != file_system_paths.end();
}
content::SecurityStyle SecurityLevelToSecurityStyle(
SecurityStateModel::SecurityLevel security_level) {
switch (security_level) {
case SecurityStateModel::NONE:
return content::SECURITY_STYLE_UNAUTHENTICATED;
case SecurityStateModel::SECURITY_WARNING:
case SecurityStateModel::SECURITY_POLICY_WARNING:
return content::SECURITY_STYLE_WARNING;
case SecurityStateModel::EV_SECURE:
case SecurityStateModel::SECURE:
return content::SECURITY_STYLE_AUTHENTICATED;
case SecurityStateModel::SECURITY_ERROR:
return content::SECURITY_STYLE_AUTHENTICATION_BROKEN;
}
return content::SECURITY_STYLE_UNKNOWN;
}
} // namespace
CommonWebContentsDelegate::CommonWebContentsDelegate()
@@ -252,11 +237,11 @@ content::ColorChooser* CommonWebContentsDelegate::OpenColorChooser(
}
void CommonWebContentsDelegate::RunFileChooser(
content::WebContents* guest,
content::RenderFrameHost* render_frame_host,
const content::FileChooserParams& params) {
if (!web_dialog_helper_)
web_dialog_helper_.reset(new WebDialogHelper(owner_window()));
web_dialog_helper_->RunFileChooser(guest, params);
web_dialog_helper_->RunFileChooser(render_frame_host, params);
}
void CommonWebContentsDelegate::EnumerateDirectory(content::WebContents* guest,
@@ -290,88 +275,16 @@ bool CommonWebContentsDelegate::IsFullscreenForTabOrPending(
return html_fullscreen_;
}
content::SecurityStyle CommonWebContentsDelegate::GetSecurityStyle(
blink::WebSecurityStyle CommonWebContentsDelegate::GetSecurityStyle(
content::WebContents* web_contents,
content::SecurityStyleExplanations* explanations) {
auto model_client =
AtomSecurityStateModelClient::FromWebContents(web_contents);
const SecurityStateModel::SecurityInfo& security_info =
model_client->GetSecurityInfo();
const content::SecurityStyle security_style =
SecurityLevelToSecurityStyle(security_info.security_level);
explanations->ran_insecure_content_style =
SecurityLevelToSecurityStyle(
SecurityStateModel::kRanInsecureContentLevel);
explanations->displayed_insecure_content_style =
SecurityLevelToSecurityStyle(
SecurityStateModel::kDisplayedInsecureContentLevel);
explanations->scheme_is_cryptographic = security_info.scheme_is_cryptographic;
if (!security_info.scheme_is_cryptographic)
return security_style;
if (security_info.sha1_deprecation_status ==
SecurityStateModel::DEPRECATED_SHA1_MAJOR) {
explanations->broken_explanations.push_back(
content::SecurityStyleExplanation(
kSHA1Certificate,
kSHA1MajorDescription,
security_info.cert_id));
} else if (security_info.sha1_deprecation_status ==
SecurityStateModel::DEPRECATED_SHA1_MINOR) {
explanations->unauthenticated_explanations.push_back(
content::SecurityStyleExplanation(
kSHA1Certificate,
kSHA1MinorDescription,
security_info.cert_id));
}
explanations->ran_insecure_content =
security_info.mixed_content_status ==
SecurityStateModel::RAN_MIXED_CONTENT ||
security_info.mixed_content_status ==
SecurityStateModel::RAN_AND_DISPLAYED_MIXED_CONTENT;
explanations->displayed_insecure_content =
security_info.mixed_content_status ==
SecurityStateModel::DISPLAYED_MIXED_CONTENT ||
security_info.mixed_content_status ==
SecurityStateModel::RAN_AND_DISPLAYED_MIXED_CONTENT;
if (net::IsCertStatusError(security_info.cert_status)) {
std::string error_string = net::ErrorToString(
net::MapCertStatusToNetError(security_info.cert_status));
content::SecurityStyleExplanation explanation(
kCertificateError,
"There are issues with the site's certificate chain " + error_string,
security_info.cert_id);
if (net::IsCertStatusMinorError(security_info.cert_status))
explanations->unauthenticated_explanations.push_back(explanation);
else
explanations->broken_explanations.push_back(explanation);
} else {
if (security_info.sha1_deprecation_status ==
SecurityStateModel::NO_DEPRECATED_SHA1) {
explanations->secure_explanations.push_back(
content::SecurityStyleExplanation(
kValidCertificate,
kValidCertificateDescription,
security_info.cert_id));
}
}
if (security_info.is_secure_protocol_and_ciphersuite) {
explanations->secure_explanations.push_back(
content::SecurityStyleExplanation(
kSecureProtocol,
kSecureProtocolDescription));
}
return security_style;
content::SecurityStyleExplanations* security_style_explanations) {
SecurityStateTabHelper* helper =
SecurityStateTabHelper::FromWebContents(web_contents);
DCHECK(helper);
security_state::SecurityInfo security_info;
helper->GetSecurityInfo(&security_info);
return security_state::GetSecurityStyle(security_info,
security_style_explanations);
}
void CommonWebContentsDelegate::DevToolsSaveToFile(
@@ -381,10 +294,11 @@ void CommonWebContentsDelegate::DevToolsSaveToFile(
if (it != saved_files_.end() && !save_as) {
path = it->second;
} else {
file_dialog::Filters filters;
base::FilePath default_path(base::FilePath::FromUTF8Unsafe(url));
if (!file_dialog::ShowSaveDialog(owner_window(), url, "", default_path,
filters, &path)) {
file_dialog::DialogSettings settings;
settings.parent_window = owner_window();
settings.title = url;
settings.default_path = base::FilePath::FromUTF8Unsafe(url);
if (!file_dialog::ShowSaveDialog(settings, &path)) {
base::StringValue url_value(url);
web_contents_->CallClientFunction(
"DevToolsAPI.canceledSaveURL", &url_value, nullptr, nullptr);
@@ -445,12 +359,11 @@ void CommonWebContentsDelegate::DevToolsAddFileSystem(
const base::FilePath& file_system_path) {
base::FilePath path = file_system_path;
if (path.empty()) {
file_dialog::Filters filters;
base::FilePath default_path;
std::vector<base::FilePath> paths;
int flag = file_dialog::FILE_DIALOG_OPEN_DIRECTORY;
if (!file_dialog::ShowOpenDialog(owner_window(), "", "", default_path,
filters, flag, &paths))
file_dialog::DialogSettings settings;
settings.parent_window = owner_window();
settings.properties = file_dialog::FILE_DIALOG_OPEN_DIRECTORY;
if (!file_dialog::ShowOpenDialog(settings, &paths))
return;
path = paths[0];

View File

@@ -71,7 +71,7 @@ class CommonWebContentsDelegate
content::WebContents* web_contents,
SkColor color,
const std::vector<content::ColorSuggestion>& suggestions) override;
void RunFileChooser(content::WebContents* web_contents,
void RunFileChooser(content::RenderFrameHost* render_frame_host,
const content::FileChooserParams& params) override;
void EnumerateDirectory(content::WebContents* web_contents,
int request_id,
@@ -81,7 +81,7 @@ class CommonWebContentsDelegate
void ExitFullscreenModeForTab(content::WebContents* source) override;
bool IsFullscreenForTabOrPending(
const content::WebContents* source) const override;
content::SecurityStyle GetSecurityStyle(
blink::WebSecurityStyle GetSecurityStyle(
content::WebContents* web_contents,
content::SecurityStyleExplanations* explanations) override;
void HandleKeyboardEvent(

View File

@@ -89,8 +89,12 @@ void BluetoothChooser::ShowDiscoveryState(DiscoveryState state) {
}
}
void BluetoothChooser::AddDevice(const std::string& device_id,
const base::string16& device_name) {
void BluetoothChooser::AddOrUpdateDevice(const std::string& device_id,
bool should_update_name,
const base::string16& device_name,
bool is_gatt_connected,
bool is_paired,
int signal_strength_level) {
DeviceInfo info = {device_id, device_name};
device_list_.push_back(info);
}

View File

@@ -27,8 +27,12 @@ class BluetoothChooser : public content::BluetoothChooser {
// content::BluetoothChooser:
void SetAdapterPresence(AdapterPresence presence) override;
void ShowDiscoveryState(DiscoveryState state) override;
void AddDevice(const std::string& device_id,
const base::string16& device_name) override;
void AddOrUpdateDevice(const std::string& device_id,
bool should_update_name,
const base::string16& device_name,
bool is_gatt_connected,
bool is_paired,
int signal_strength_level) override;
void RemoveDevice(const std::string& device_id) override;
private:

View File

@@ -87,4 +87,8 @@
atom::Browser::Get()->OnAccessibilitySupportChanged();
}
- (void)orderFrontStandardAboutPanel:(id)sender {
atom::Browser::Get()->ShowAboutPanel();
}
@end

View File

@@ -10,6 +10,10 @@
#include "base/strings/sys_string_conversions.h"
#include "base/values.h"
@interface NSWindow (SierraSDK)
@property(class) BOOL allowsAutomaticWindowTabbing;
@end
@implementation AtomApplicationDelegate
- (void)setApplicationDockMenu:(atom::AtomMenuModel*)model {
@@ -21,6 +25,10 @@
// Don't add the "Enter Full Screen" menu item automatically.
[[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"NSFullScreenMenuItemEverywhere"];
// Don't add the "Show Tab Bar" menu item.
if ([NSWindow respondsToSelector:@selector(allowsAutomaticWindowTabbing)])
NSWindow.allowsAutomaticWindowTabbing = NO;
atom::Browser::Get()->WillFinishLaunching();
}

View File

@@ -16,13 +16,15 @@ class DictionaryValue;
namespace atom {
NSArray* ListValueToNSArray(const base::ListValue& value);
std::unique_ptr<base::ListValue> NSArrayToListValue(NSArray* arr);
NSDictionary* DictionaryValueToNSDictionary(const base::DictionaryValue& value);
std::unique_ptr<base::DictionaryValue> NSDictionaryToDictionaryValue(
NSDictionary* dict);
std::unique_ptr<base::ListValue> NSArrayToListValue(NSArray* arr);
} // namespace atom
#endif // ATOM_BROWSER_MAC_DICT_UTIL_H_

View File

@@ -10,6 +10,18 @@
namespace atom {
NSArray* ListValueToNSArray(const base::ListValue& value) {
std::string json;
if (!base::JSONWriter::Write(value, &json))
return nil;
NSData* jsonData = [NSData dataWithBytes:json.c_str() length:json.length()];
id obj =
[NSJSONSerialization JSONObjectWithData:jsonData options:0 error:nil];
if (![obj isKindOfClass:[NSArray class]])
return nil;
return obj;
}
std::unique_ptr<base::ListValue> NSArrayToListValue(NSArray* arr) {
if (!arr)
return nullptr;

View File

@@ -20,6 +20,7 @@
#include "base/json/json_writer.h"
#include "base/message_loop/message_loop.h"
#include "base/strings/utf_string_conversions.h"
#include "base/threading/thread_task_runner_handle.h"
#include "brightray/browser/inspectable_web_contents.h"
#include "brightray/browser/inspectable_web_contents_view.h"
#include "components/prefs/pref_service.h"
@@ -33,6 +34,7 @@
#include "content/public/common/content_switches.h"
#include "ipc/ipc_message_macros.h"
#include "native_mate/dictionary.h"
#include "third_party/skia/include/core/SkRegion.h"
#include "ui/gfx/codec/png_codec.h"
#include "ui/gfx/geometry/point.h"
#include "ui/gfx/geometry/rect.h"
@@ -332,6 +334,12 @@ void NativeWindow::SetParentWindow(NativeWindow* parent) {
parent_ = parent;
}
void NativeWindow::SetAutoHideCursor(bool auto_hide) {
}
void NativeWindow::SetVibrancy(const std::string& filename) {
}
void NativeWindow::FocusOnWebView() {
web_contents()->GetRenderViewHost()->GetWidget()->Focus();
}
@@ -373,11 +381,17 @@ void NativeWindow::SetAspectRatio(double aspect_ratio,
aspect_ratio_extraSize_ = extra_size;
}
void NativeWindow::PreviewFile(const std::string& path,
const std::string& display_name) {
}
void NativeWindow::CloseFilePreview() {
}
void NativeWindow::RequestToClosePage() {
bool prevent_default = false;
FOR_EACH_OBSERVER(NativeWindowObserver,
observers_,
WillCloseWindow(&prevent_default));
for (NativeWindowObserver& observer : observers_)
observer.WillCloseWindow(&prevent_default);
if (prevent_default) {
WindowList::WindowCloseCancelled(this);
return;
@@ -390,6 +404,10 @@ void NativeWindow::RequestToClosePage() {
if (window_unresposive_closure_.IsCancelled())
ScheduleUnresponsiveEvent(5000);
if (!web_contents())
// Already closed by renderer
return;
if (web_contents()->NeedToFireBeforeUnload())
web_contents()->DispatchBeforeUnload();
else
@@ -404,8 +422,8 @@ void NativeWindow::CloseContents(content::WebContents* source) {
inspectable_web_contents_ = nullptr;
Observe(nullptr);
FOR_EACH_OBSERVER(NativeWindowObserver, observers_,
WillDestroyNativeObject());
for (NativeWindowObserver& observer : observers_)
observer.WillDestroyNativeObject();
// When the web contents is gone, close the window immediately, but the
// memory will not be freed until you call delete.
@@ -431,7 +449,8 @@ void NativeWindow::RendererUnresponsive(content::WebContents* source) {
void NativeWindow::RendererResponsive(content::WebContents* source) {
window_unresposive_closure_.Cancel();
FOR_EACH_OBSERVER(NativeWindowObserver, observers_, OnRendererResponsive());
for (NativeWindowObserver& observer : observers_)
observer.OnRendererResponsive();
}
void NativeWindow::NotifyWindowClosed() {
@@ -441,99 +460,116 @@ void NativeWindow::NotifyWindowClosed() {
WindowList::RemoveWindow(this);
is_closed_ = true;
FOR_EACH_OBSERVER(NativeWindowObserver, observers_, OnWindowClosed());
for (NativeWindowObserver& observer : observers_)
observer.OnWindowClosed();
}
void NativeWindow::NotifyWindowBlur() {
FOR_EACH_OBSERVER(NativeWindowObserver, observers_, OnWindowBlur());
for (NativeWindowObserver& observer : observers_)
observer.OnWindowBlur();
}
void NativeWindow::NotifyWindowFocus() {
FOR_EACH_OBSERVER(NativeWindowObserver, observers_, OnWindowFocus());
for (NativeWindowObserver& observer : observers_)
observer.OnWindowFocus();
}
void NativeWindow::NotifyWindowShow() {
FOR_EACH_OBSERVER(NativeWindowObserver, observers_, OnWindowShow());
for (NativeWindowObserver& observer : observers_)
observer.OnWindowShow();
}
void NativeWindow::NotifyWindowHide() {
FOR_EACH_OBSERVER(NativeWindowObserver, observers_, OnWindowHide());
for (NativeWindowObserver& observer : observers_)
observer.OnWindowHide();
}
void NativeWindow::NotifyWindowMaximize() {
FOR_EACH_OBSERVER(NativeWindowObserver, observers_, OnWindowMaximize());
for (NativeWindowObserver& observer : observers_)
observer.OnWindowMaximize();
}
void NativeWindow::NotifyWindowUnmaximize() {
FOR_EACH_OBSERVER(NativeWindowObserver, observers_, OnWindowUnmaximize());
for (NativeWindowObserver& observer : observers_)
observer.OnWindowUnmaximize();
}
void NativeWindow::NotifyWindowMinimize() {
FOR_EACH_OBSERVER(NativeWindowObserver, observers_, OnWindowMinimize());
for (NativeWindowObserver& observer : observers_)
observer.OnWindowMinimize();
}
void NativeWindow::NotifyWindowRestore() {
FOR_EACH_OBSERVER(NativeWindowObserver, observers_, OnWindowRestore());
for (NativeWindowObserver& observer : observers_)
observer.OnWindowRestore();
}
void NativeWindow::NotifyWindowResize() {
FOR_EACH_OBSERVER(NativeWindowObserver, observers_, OnWindowResize());
for (NativeWindowObserver& observer : observers_)
observer.OnWindowResize();
}
void NativeWindow::NotifyWindowMove() {
FOR_EACH_OBSERVER(NativeWindowObserver, observers_, OnWindowMove());
for (NativeWindowObserver& observer : observers_)
observer.OnWindowMove();
}
void NativeWindow::NotifyWindowMoved() {
FOR_EACH_OBSERVER(NativeWindowObserver, observers_, OnWindowMoved());
for (NativeWindowObserver& observer : observers_)
observer.OnWindowMoved();
}
void NativeWindow::NotifyWindowEnterFullScreen() {
FOR_EACH_OBSERVER(NativeWindowObserver, observers_,
OnWindowEnterFullScreen());
for (NativeWindowObserver& observer : observers_)
observer.OnWindowEnterFullScreen();
}
void NativeWindow::NotifyWindowScrollTouchBegin() {
FOR_EACH_OBSERVER(NativeWindowObserver, observers_,
OnWindowScrollTouchBegin());
for (NativeWindowObserver& observer : observers_)
observer.OnWindowScrollTouchBegin();
}
void NativeWindow::NotifyWindowScrollTouchEnd() {
FOR_EACH_OBSERVER(NativeWindowObserver, observers_,
OnWindowScrollTouchEnd());
for (NativeWindowObserver& observer : observers_)
observer.OnWindowScrollTouchEnd();
}
void NativeWindow::NotifyWindowScrollTouchEdge() {
for (NativeWindowObserver& observer : observers_)
observer.OnWindowScrollTouchEdge();
}
void NativeWindow::NotifyWindowSwipe(const std::string& direction) {
FOR_EACH_OBSERVER(NativeWindowObserver, observers_,
OnWindowSwipe(direction));
for (NativeWindowObserver& observer : observers_)
observer.OnWindowSwipe(direction);
}
void NativeWindow::NotifyWindowLeaveFullScreen() {
FOR_EACH_OBSERVER(NativeWindowObserver, observers_,
OnWindowLeaveFullScreen());
for (NativeWindowObserver& observer : observers_)
observer.OnWindowLeaveFullScreen();
}
void NativeWindow::NotifyWindowEnterHtmlFullScreen() {
FOR_EACH_OBSERVER(NativeWindowObserver, observers_,
OnWindowEnterHtmlFullScreen());
for (NativeWindowObserver& observer : observers_)
observer.OnWindowEnterHtmlFullScreen();
}
void NativeWindow::NotifyWindowLeaveHtmlFullScreen() {
FOR_EACH_OBSERVER(NativeWindowObserver, observers_,
OnWindowLeaveHtmlFullScreen());
for (NativeWindowObserver& observer : observers_)
observer.OnWindowLeaveHtmlFullScreen();
}
void NativeWindow::NotifyWindowExecuteWindowsCommand(
const std::string& command) {
FOR_EACH_OBSERVER(NativeWindowObserver, observers_,
OnExecuteWindowsCommand(command));
for (NativeWindowObserver& observer : observers_)
observer.OnExecuteWindowsCommand(command);
}
#if defined(OS_WIN)
void NativeWindow::NotifyWindowMessage(
UINT message, WPARAM w_param, LPARAM l_param) {
FOR_EACH_OBSERVER(NativeWindowObserver, observers_,
OnWindowMessage(message, w_param, l_param));
for (NativeWindowObserver& observer : observers_)
observer.OnWindowMessage(message, w_param, l_param);
}
#endif
@@ -581,7 +617,7 @@ void NativeWindow::DidFirstVisuallyNonEmptyPaint() {
view->SetSize(GetContentSize());
// Emit the ReadyToShow event in next tick in case of pending drawing work.
base::MessageLoop::current()->PostTask(
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE,
base::Bind(&NativeWindow::NotifyReadyToShow, GetWeakPtr()));
}
@@ -612,7 +648,7 @@ void NativeWindow::ScheduleUnresponsiveEvent(int ms) {
window_unresposive_closure_.Reset(
base::Bind(&NativeWindow::NotifyWindowUnresponsive,
weak_factory_.GetWeakPtr()));
base::MessageLoop::current()->PostDelayedTask(
base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
FROM_HERE,
window_unresposive_closure_.callback(),
base::TimeDelta::FromMilliseconds(ms));
@@ -621,14 +657,15 @@ void NativeWindow::ScheduleUnresponsiveEvent(int ms) {
void NativeWindow::NotifyWindowUnresponsive() {
window_unresposive_closure_.Cancel();
if (!is_closed_ && !IsUnresponsiveEventSuppressed() && IsEnabled())
FOR_EACH_OBSERVER(NativeWindowObserver,
observers_,
OnRendererUnresponsive());
if (!is_closed_ && !IsUnresponsiveEventSuppressed() && IsEnabled()) {
for (NativeWindowObserver& observer : observers_)
observer.OnRendererUnresponsive();
}
}
void NativeWindow::NotifyReadyToShow() {
FOR_EACH_OBSERVER(NativeWindowObserver, observers_, OnReadyToShow());
for (NativeWindowObserver& observer : observers_)
observer.OnReadyToShow();
}
} // namespace atom

View File

@@ -118,9 +118,13 @@ class NativeWindow : public base::SupportsUserData,
virtual bool IsFullScreenable() = 0;
virtual void SetClosable(bool closable) = 0;
virtual bool IsClosable() = 0;
virtual void SetAlwaysOnTop(bool top) = 0;
virtual void SetAlwaysOnTop(bool top,
const std::string& level = "floating",
int relativeLevel = 0,
std::string* error = nullptr) = 0;
virtual bool IsAlwaysOnTop() = 0;
virtual void Center() = 0;
virtual void Invalidate() = 0;
virtual void SetTitle(const std::string& title) = 0;
virtual std::string GetTitle() = 0;
virtual void FlashFrame(bool flash) = 0;
@@ -160,6 +164,11 @@ class NativeWindow : public base::SupportsUserData,
virtual void SetVisibleOnAllWorkspaces(bool visible) = 0;
virtual bool IsVisibleOnAllWorkspaces() = 0;
virtual void SetAutoHideCursor(bool auto_hide);
// Vibrancy API
virtual void SetVibrancy(const std::string& type);
// Webview APIs.
virtual void FocusOnWebView();
virtual void BlurWebView();
@@ -176,6 +185,11 @@ class NativeWindow : public base::SupportsUserData,
gfx::Size GetAspectRatioExtraSize();
virtual void SetAspectRatio(double aspect_ratio, const gfx::Size& extra_size);
// File preview APIs.
virtual void PreviewFile(const std::string& path,
const std::string& display_name);
virtual void CloseFilePreview();
base::WeakPtr<NativeWindow> GetWeakPtr() {
return weak_factory_.GetWeakPtr();
}
@@ -207,6 +221,7 @@ class NativeWindow : public base::SupportsUserData,
void NotifyWindowMoved();
void NotifyWindowScrollTouchBegin();
void NotifyWindowScrollTouchEnd();
void NotifyWindowScrollTouchEdge();
void NotifyWindowSwipe(const std::string& direction);
void NotifyWindowEnterFullScreen();
void NotifyWindowLeaveFullScreen();

View File

@@ -55,6 +55,9 @@ class NativeWindowMac : public NativeWindow,
void SetMovable(bool movable) override;
void SetAspectRatio(double aspect_ratio, const gfx::Size& extra_size)
override;
void PreviewFile(const std::string& path, const std::string& display_name)
override;
void CloseFilePreview() override;
bool IsMovable() override;
void SetMinimizable(bool minimizable) override;
bool IsMinimizable() override;
@@ -64,9 +67,11 @@ class NativeWindowMac : public NativeWindow,
bool IsFullScreenable() override;
void SetClosable(bool closable) override;
bool IsClosable() override;
void SetAlwaysOnTop(bool top) override;
void SetAlwaysOnTop(bool top, const std::string& level,
int relativeLevel, std::string* error) override;
bool IsAlwaysOnTop() override;
void Center() override;
void Invalidate() override;
void SetTitle(const std::string& title) override;
std::string GetTitle() override;
void FlashFrame(bool flash) override;
@@ -88,9 +93,14 @@ class NativeWindowMac : public NativeWindow,
void SetProgressBar(double progress, const ProgressState state) override;
void SetOverlayIcon(const gfx::Image& overlay,
const std::string& description) override;
void SetVisibleOnAllWorkspaces(bool visible) override;
bool IsVisibleOnAllWorkspaces() override;
void SetAutoHideCursor(bool auto_hide) override;
void SetVibrancy(const std::string& type) override;
// content::RenderWidgetHost::InputEventObserver:
void OnInputEvent(const blink::WebInputEvent& event) override;
@@ -114,6 +124,8 @@ class NativeWindowMac : public NativeWindow,
};
TitleBarStyle title_bar_style() const { return title_bar_style_; }
bool zoom_to_page_width() const { return zoom_to_page_width_; }
protected:
// Return a vector of non-draggable regions that fill a window of size
// |width| by |height|, but leave gaps where the window should be draggable.
@@ -152,6 +164,10 @@ class NativeWindowMac : public NativeWindow,
bool is_kiosk_;
bool was_fullscreen_;
bool zoom_to_page_width_;
NSInteger attention_request_id_; // identifier from requestUserAttention
// The presentation options before entering kiosk mode.
@@ -160,9 +176,6 @@ class NativeWindowMac : public NativeWindow,
// The "titleBarStyle" option.
TitleBarStyle title_bar_style_;
// Whether user has scrolled the page to edge.
bool is_edge_;
DISALLOW_COPY_AND_ASSIGN(NativeWindowMac);
};

View File

@@ -4,6 +4,7 @@
#include "atom/browser/native_window_mac.h"
#include <Quartz/Quartz.h>
#include <string>
#include "atom/browser/window_list.h"
@@ -22,6 +23,7 @@
#include "content/public/browser/render_widget_host_view.h"
#include "native_mate/dictionary.h"
#include "skia/ext/skia_utils_mac.h"
#include "third_party/skia/include/core/SkRegion.h"
#include "ui/gfx/skia_util.h"
namespace {
@@ -100,6 +102,41 @@ bool ScopedDisableResize::disable_resize_ = false;
}
}
// Called when the user clicks the zoom button or selects it from the Window
// menu to determine the "standard size" of the window.
- (NSRect)windowWillUseStandardFrame:(NSWindow*)window
defaultFrame:(NSRect)frame {
if (!shell_->zoom_to_page_width())
return frame;
// If the shift key is down, maximize.
if ([[NSApp currentEvent] modifierFlags] & NSShiftKeyMask)
return frame;
content::WebContents* web_contents = shell_->web_contents();
if (!web_contents)
return frame;
CGFloat page_width = static_cast<CGFloat>(
web_contents->GetPreferredSize().width());
NSRect window_frame = [window frame];
// Never shrink from the current size on zoom.
CGFloat zoomed_width = std::max(page_width, NSWidth(window_frame));
// |frame| determines our maximum extents. We need to set the origin of the
// frame -- and only move it left if necessary.
if (window_frame.origin.x + zoomed_width > NSMaxX(frame))
frame.origin.x = NSMaxX(frame) - zoomed_width;
else
frame.origin.x = window_frame.origin.x;
// Set the width. Don't touch y or height.
frame.size.width = zoomed_width;
return frame;
}
- (void)windowDidBecomeMain:(NSNotification*)notification {
content::WebContents* web_contents = shell_->web_contents();
if (!web_contents)
@@ -191,7 +228,7 @@ bool ScopedDisableResize::disable_resize_ = false;
- (void)windowWillEnterFullScreen:(NSNotification*)notification {
// Hide the native toolbar before entering fullscreen, so there is no visual
// artifacts.
if (base::mac::IsOSYosemiteOrLater() &&
if (base::mac::IsAtLeastOS10_10() &&
shell_->title_bar_style() == atom::NativeWindowMac::HIDDEN_INSET) {
NSWindow* window = shell_->GetNativeWindow();
[window setToolbar:nil];
@@ -206,7 +243,7 @@ bool ScopedDisableResize::disable_resize_ = false;
// have to set one, because title bar is visible here.
NSWindow* window = shell_->GetNativeWindow();
if ((shell_->transparent() || !shell_->has_frame()) &&
base::mac::IsOSYosemiteOrLater() &&
base::mac::IsAtLeastOS10_10() &&
// FIXME(zcbenz): Showing titlebar for hiddenInset window is weird under
// fullscreen mode.
shell_->title_bar_style() != atom::NativeWindowMac::HIDDEN_INSET) {
@@ -215,7 +252,7 @@ bool ScopedDisableResize::disable_resize_ = false;
// Restore the native toolbar immediately after entering fullscreen, if we do
// this before leaving fullscreen, traffic light buttons will be jumping.
if (base::mac::IsOSYosemiteOrLater() &&
if (base::mac::IsAtLeastOS10_10() &&
shell_->title_bar_style() == atom::NativeWindowMac::HIDDEN_INSET) {
base::scoped_nsobject<NSToolbar> toolbar(
[[NSToolbar alloc] initWithIdentifier:@"titlebarStylingToolbar"]);
@@ -232,13 +269,13 @@ bool ScopedDisableResize::disable_resize_ = false;
// Restore the titlebar visibility.
NSWindow* window = shell_->GetNativeWindow();
if ((shell_->transparent() || !shell_->has_frame()) &&
base::mac::IsOSYosemiteOrLater() &&
base::mac::IsAtLeastOS10_10() &&
shell_->title_bar_style() != atom::NativeWindowMac::HIDDEN_INSET) {
[window setTitleVisibility:NSWindowTitleHidden];
}
// Turn off the style for toolbar.
if (base::mac::IsOSYosemiteOrLater() &&
if (base::mac::IsAtLeastOS10_10() &&
shell_->title_bar_style() == atom::NativeWindowMac::HIDDEN_INSET) {
shell_->SetStyleMask(false, NSFullSizeContentViewWindowMask);
}
@@ -276,7 +313,29 @@ bool ScopedDisableResize::disable_resize_ = false;
@end
@interface AtomNSWindow : EventDispatchingWindow {
@interface AtomPreviewItem : NSObject <QLPreviewItem>
@property (nonatomic, retain) NSURL* previewItemURL;
@property (nonatomic, retain) NSString* previewItemTitle;
- (id)initWithURL:(NSURL*)url title:(NSString*)title;
@end
@implementation AtomPreviewItem
- (id)initWithURL:(NSURL*)url title:(NSString*)title {
self = [super init];
if (self) {
self.previewItemURL = url;
self.previewItemTitle = title;
}
return self;
}
@end
@interface AtomNSWindow : EventDispatchingWindow<QLPreviewPanelDataSource, QLPreviewPanelDelegate> {
@private
atom::NativeWindowMac* shell_;
bool enable_larger_than_screen_;
@@ -286,6 +345,8 @@ bool ScopedDisableResize::disable_resize_ = false;
@property BOOL disableAutoHideCursor;
@property BOOL disableKeyOrMainWindow;
@property NSPoint windowButtonsOffset;
@property (nonatomic, retain) AtomPreviewItem* quickLookItem;
@property (nonatomic, retain) NSView* vibrantView;
- (void)setShell:(atom::NativeWindowMac*)shell;
- (void)setEnableLargerThanScreen:(bool)enable;
@@ -443,6 +504,36 @@ bool ScopedDisableResize::disable_resize_ = false;
return [[self contentView] superview];
}
// Quicklook methods
- (BOOL)acceptsPreviewPanelControl:(QLPreviewPanel*)panel {
return YES;
}
- (void)beginPreviewPanelControl:(QLPreviewPanel*)panel {
panel.delegate = self;
panel.dataSource = self;
}
- (void)endPreviewPanelControl:(QLPreviewPanel*)panel {
panel.delegate = nil;
panel.dataSource = nil;
}
- (NSInteger)numberOfPreviewItemsInPreviewPanel:(QLPreviewPanel*)panel {
return 1;
}
- (id <QLPreviewItem>)previewPanel:(QLPreviewPanel*)panel previewItemAtIndex:(NSInteger)index {
return [self quickLookItem];
}
- (void)previewFileAtPath:(NSString*)path withName:(NSString*) fileName {
NSURL* url = [[[NSURL alloc] initFileURLWithPath:path] autorelease];
[self setQuickLookItem:[[[AtomPreviewItem alloc] initWithURL:url title:fileName] autorelease]];
[[QLPreviewPanel sharedPreviewPanel] makeKeyAndOrderFront:nil];
}
@end
@interface ControlRegionView : NSView
@@ -528,14 +619,15 @@ NativeWindowMac::NativeWindowMac(
NativeWindow* parent)
: NativeWindow(web_contents, options, parent),
is_kiosk_(false),
was_fullscreen_(false),
zoom_to_page_width_(false),
attention_request_id_(0),
title_bar_style_(NORMAL),
is_edge_(false) {
title_bar_style_(NORMAL) {
int width = 800, height = 600;
options.Get(options::kWidth, &width);
options.Get(options::kHeight, &height);
NSRect main_screen_rect = [[[NSScreen screens] objectAtIndex:0] frame];
NSRect main_screen_rect = [[[NSScreen screens] firstObject] frame];
NSRect cocoa_bounds = NSMakeRect(
round((NSWidth(main_screen_rect) - width) / 2) ,
round((NSHeight(main_screen_rect) - height) / 2),
@@ -620,7 +712,7 @@ NativeWindowMac::NativeWindowMac(
[window_ setDisableKeyOrMainWindow:YES];
if (transparent() || !has_frame()) {
if (base::mac::IsOSYosemiteOrLater()) {
if (base::mac::IsAtLeastOS10_10()) {
// Don't show title bar.
[window_ setTitleVisibility:NSWindowTitleHidden];
}
@@ -633,7 +725,7 @@ NativeWindowMac::NativeWindowMac(
// Hide the title bar.
if (title_bar_style_ == HIDDEN_INSET) {
if (base::mac::IsOSYosemiteOrLater()) {
if (base::mac::IsAtLeastOS10_10()) {
[window_ setTitlebarAppearsTransparent:YES];
base::scoped_nsobject<NSToolbar> toolbar(
[[NSToolbar alloc] initWithIdentifier:@"titlebarStylingToolbar"]);
@@ -651,6 +743,8 @@ NativeWindowMac::NativeWindowMac(
if (!has_frame() || !use_content_size)
SetSize(gfx::Size(width, height));
options.Get(options::kZoomToPageWidth, &zoom_to_page_width_);
// Enable the NSView to accept first mouse event.
bool acceptsFirstMouse = false;
options.Get(options::kAcceptFirstMouse, &acceptsFirstMouse);
@@ -675,22 +769,25 @@ NativeWindowMac::NativeWindowMac(
if (!web_contents)
return event;
if (!began && is_edge_ && (([event phase] == NSEventPhaseMayBegin) ||
if (!began && (([event phase] == NSEventPhaseMayBegin) ||
([event phase] == NSEventPhaseBegan))) {
this->NotifyWindowScrollTouchBegin();
began = YES;
is_edge_ = false;
} else if (began && (([event phase] == NSEventPhaseEnded) ||
([event phase] == NSEventPhaseCancelled))) {
this->NotifyWindowScrollTouchEnd();
began = NO;
is_edge_ = false;
}
return event;
}];
InstallView();
std::string type;
if (options.Get(options::kVibrancyType, &type)) {
SetVibrancy(type);
}
// Set maximizable state last to ensure zoom button does not get reset
// by calls to other APIs.
SetMaximizable(maximizable);
@@ -742,8 +839,9 @@ bool NativeWindowMac::IsFocused() {
void NativeWindowMac::Show() {
if (is_modal() && parent()) {
[parent()->GetNativeWindow() beginSheet:window_
completionHandler:^(NSModalResponse) {}];
if ([window_ sheetParent] == nil)
[parent()->GetNativeWindow() beginSheet:window_
completionHandler:^(NSModalResponse) {}];
return;
}
@@ -840,7 +938,7 @@ void NativeWindowMac::SetBounds(const gfx::Rect& bounds, bool animate) {
NSRect cocoa_bounds = NSMakeRect(bounds.x(), 0, size.width(), size.height());
// Flip coordinates based on the primary screen.
NSScreen* screen = [[NSScreen screens] objectAtIndex:0];
NSScreen* screen = [[NSScreen screens] firstObject];
cocoa_bounds.origin.y =
NSHeight([screen frame]) - size.height() - bounds.y();
@@ -850,7 +948,7 @@ void NativeWindowMac::SetBounds(const gfx::Rect& bounds, bool animate) {
gfx::Rect NativeWindowMac::GetBounds() {
NSRect frame = [window_ frame];
gfx::Rect bounds(frame.origin.x, 0, NSWidth(frame), NSHeight(frame));
NSScreen* screen = [[NSScreen screens] objectAtIndex:0];
NSScreen* screen = [[NSScreen screens] firstObject];
bounds.set_y(NSHeight([screen frame]) - NSMaxY(frame));
return bounds;
}
@@ -900,6 +998,19 @@ void NativeWindowMac::SetAspectRatio(double aspect_ratio,
[window_ setResizeIncrements:NSMakeSize(1.0, 1.0)];
}
void NativeWindowMac::PreviewFile(const std::string& path,
const std::string& display_name) {
NSString* path_ns = [NSString stringWithUTF8String:path.c_str()];
NSString* name_ns = [NSString stringWithUTF8String:display_name.c_str()];
[window_ previewFileAtPath:path_ns withName:name_ns];
}
void NativeWindowMac::CloseFilePreview() {
if ([QLPreviewPanel sharedPreviewPanelExists]) {
[[QLPreviewPanel sharedPreviewPanel] close];
}
}
void NativeWindowMac::SetMovable(bool movable) {
[window_ setMovable:movable];
}
@@ -945,22 +1056,60 @@ bool NativeWindowMac::IsClosable() {
return [window_ styleMask] & NSClosableWindowMask;
}
void NativeWindowMac::SetAlwaysOnTop(bool top) {
[window_ setLevel:(top ? NSFloatingWindowLevel : NSNormalWindowLevel)];
void NativeWindowMac::SetAlwaysOnTop(bool top, const std::string& level,
int relativeLevel, std::string* error) {
int windowLevel = NSNormalWindowLevel;
CGWindowLevel maxWindowLevel = CGWindowLevelForKey(kCGMaximumWindowLevelKey);
CGWindowLevel minWindowLevel = CGWindowLevelForKey(kCGMinimumWindowLevelKey);
if (top) {
if (level == "floating") {
windowLevel = NSFloatingWindowLevel;
} else if (level == "torn-off-menu") {
windowLevel = NSTornOffMenuWindowLevel;
} else if (level == "modal-panel") {
windowLevel = NSModalPanelWindowLevel;
} else if (level == "main-menu") {
windowLevel = NSMainMenuWindowLevel;
} else if (level == "status") {
windowLevel = NSStatusWindowLevel;
} else if (level == "pop-up-menu") {
windowLevel = NSPopUpMenuWindowLevel;
} else if (level == "screen-saver") {
windowLevel = NSScreenSaverWindowLevel;
} else if (level == "dock") {
// Deprecated by macOS, but kept for backwards compatibility
windowLevel = NSDockWindowLevel;
}
}
NSInteger newLevel = windowLevel + relativeLevel;
if (newLevel >= minWindowLevel && newLevel <= maxWindowLevel) {
[window_ setLevel:newLevel];
} else {
*error = std::string([[NSString stringWithFormat:
@"relativeLevel must be between %d and %d", minWindowLevel,
maxWindowLevel] UTF8String]);
}
}
bool NativeWindowMac::IsAlwaysOnTop() {
return [window_ level] == NSFloatingWindowLevel;
return [window_ level] != NSNormalWindowLevel;
}
void NativeWindowMac::Center() {
[window_ center];
}
void NativeWindowMac::Invalidate() {
[window_ flushWindow];
[[window_ contentView] setNeedsDisplay:YES];
}
void NativeWindowMac::SetTitle(const std::string& title) {
// For macOS <= 10.9, the setTitleVisibility API is not available, we have
// to avoid calling setTitle for frameless window.
if (!base::mac::IsOSYosemiteOrLater() && (transparent() || !has_frame()))
if (!base::mac::IsAtLeastOS10_10() && (transparent() || !has_frame()))
return;
[window_ setTitle:base::SysUTF8ToNSString(title)];
@@ -995,10 +1144,11 @@ void NativeWindowMac::SetKiosk(bool kiosk) {
NSApplicationPresentationDisableHideApplication;
[NSApp setPresentationOptions:options];
is_kiosk_ = true;
SetFullScreen(true);
was_fullscreen_ = IsFullscreen();
if (!was_fullscreen_) SetFullScreen(true);
} else if (!kiosk && is_kiosk_) {
is_kiosk_ = false;
SetFullScreen(false);
if (!was_fullscreen_) SetFullScreen(false);
[NSApp setPresentationOptions:kiosk_options_];
}
}
@@ -1009,8 +1159,8 @@ bool NativeWindowMac::IsKiosk() {
void NativeWindowMac::SetBackgroundColor(const std::string& color_name) {
SkColor color = ParseHexColor(color_name);
base::ScopedCFTypeRef<CGColorRef> cgcolor =
skia::CGColorCreateFromSkColor(color);
base::ScopedCFTypeRef<CGColorRef> cgcolor(
skia::CGColorCreateFromSkColor(color));
[[[window_ contentView] layer] setBackgroundColor:cgcolor];
const auto view = web_contents()->GetRenderWidgetHostView();
@@ -1125,12 +1275,83 @@ bool NativeWindowMac::IsVisibleOnAllWorkspaces() {
return collectionBehavior & NSWindowCollectionBehaviorCanJoinAllSpaces;
}
void NativeWindowMac::SetAutoHideCursor(bool auto_hide) {
[window_ setDisableAutoHideCursor:!auto_hide];
}
void NativeWindowMac::SetVibrancy(const std::string& type) {
if (!base::mac::IsAtLeastOS10_10()) return;
NSView* vibrant_view = [window_ vibrantView];
if (type.empty()) {
if (vibrant_view == nil) return;
[vibrant_view removeFromSuperview];
[window_ setVibrantView:nil];
return;
}
NSVisualEffectView* effect_view = (NSVisualEffectView*)vibrant_view;
if (effect_view == nil) {
effect_view = [[[NSVisualEffectView alloc]
initWithFrame: [[window_ contentView] bounds]] autorelease];
[window_ setVibrantView:(NSView*)effect_view];
[effect_view setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
[effect_view setBlendingMode:NSVisualEffectBlendingModeBehindWindow];
[effect_view setState:NSVisualEffectStateActive];
[[window_ contentView] addSubview:effect_view
positioned:NSWindowBelow
relativeTo:nil];
}
NSVisualEffectMaterial vibrancyType = NSVisualEffectMaterialLight;
if (type == "appearance-based") {
vibrancyType = NSVisualEffectMaterialAppearanceBased;
} else if (type == "light") {
vibrancyType = NSVisualEffectMaterialLight;
} else if (type == "dark") {
vibrancyType = NSVisualEffectMaterialDark;
} else if (type == "titlebar") {
vibrancyType = NSVisualEffectMaterialTitlebar;
}
if (base::mac::IsAtLeastOS10_11()) {
// TODO(kevinsawicki): Use NSVisualEffectMaterial* constants directly once
// they are available in the minimum SDK version
if (type == "selection") {
// NSVisualEffectMaterialSelection
vibrancyType = (NSVisualEffectMaterial) 4;
} else if (type == "menu") {
// NSVisualEffectMaterialMenu
vibrancyType = (NSVisualEffectMaterial) 5;
} else if (type == "popover") {
// NSVisualEffectMaterialPopover
vibrancyType = (NSVisualEffectMaterial) 6;
} else if (type == "sidebar") {
// NSVisualEffectMaterialSidebar
vibrancyType = (NSVisualEffectMaterial) 7;
} else if (type == "medium-light") {
// NSVisualEffectMaterialMediumLight
vibrancyType = (NSVisualEffectMaterial) 8;
} else if (type == "ultra-dark") {
// NSVisualEffectMaterialUltraDark
vibrancyType = (NSVisualEffectMaterial) 9;
}
}
[effect_view setMaterial:vibrancyType];
}
void NativeWindowMac::OnInputEvent(const blink::WebInputEvent& event) {
switch (event.type) {
case blink::WebInputEvent::GestureScrollBegin:
case blink::WebInputEvent::GestureScrollUpdate:
case blink::WebInputEvent::GestureScrollEnd:
is_edge_ = true;
this->NotifyWindowScrollTouchEdge();
break;
default:
break;
@@ -1200,10 +1421,10 @@ void NativeWindowMac::ShowWindowButton(NSWindowButton button) {
}
void NativeWindowMac::InstallView() {
// Make sure the bottom corner is rounded: http://crbug.com/396264.
// Make sure the bottom corner is rounded for non-modal windows: http://crbug.com/396264.
// But do not enable it on OS X 10.9 for transparent window, otherwise a
// semi-transparent frame would show.
if (!(transparent() && base::mac::IsOSMavericks()))
if (!(transparent() && base::mac::IsOS10_9()) && !is_modal())
[[window_ contentView] setWantsLayer:YES];
NSView* view = inspectable_web_contents()->GetView()->GetNativeView();
@@ -1228,7 +1449,7 @@ void NativeWindowMac::InstallView() {
[[window_ standardWindowButton:NSWindowFullScreenButton] setHidden:YES];
if (title_bar_style_ != NORMAL) {
if (base::mac::IsOSMavericks()) {
if (base::mac::IsOS10_9()) {
ShowWindowButton(NSWindowZoomButton);
ShowWindowButton(NSWindowMiniaturizeButton);
ShowWindowButton(NSWindowCloseButton);

View File

@@ -64,6 +64,7 @@ class NativeWindowObserver {
virtual void OnWindowMoved() {}
virtual void OnWindowScrollTouchBegin() {}
virtual void OnWindowScrollTouchEnd() {}
virtual void OnWindowScrollTouchEdge() {}
virtual void OnWindowSwipe(const std::string& direction) {}
virtual void OnWindowEnterFullScreen() {}
virtual void OnWindowLeaveFullScreen() {}

View File

@@ -41,13 +41,14 @@
#include "atom/browser/ui/x/window_state_watcher.h"
#include "atom/browser/ui/x/x_window_utils.h"
#include "base/strings/string_util.h"
#include "chrome/browser/ui/libgtk2ui/unity_service.h"
#include "chrome/browser/ui/libgtkui/unity_service.h"
#include "ui/base/x/x11_util.h"
#include "ui/gfx/x/x11_types.h"
#include "ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h"
#include "ui/views/window/native_frame_view.h"
#elif defined(OS_WIN)
#include "atom/browser/ui/views/win_frame_view.h"
#include "atom/browser/ui/win/atom_desktop_native_widget_aura.h"
#include "atom/browser/ui/win/atom_desktop_window_tree_host_win.h"
#include "skia/ext/skia_utils_win.h"
#include "ui/base/win/shell.h"
@@ -138,7 +139,7 @@ NativeWindowViews::NativeWindowViews(
menu_bar_visible_(false),
menu_bar_alt_pressed_(false),
#if defined(OS_WIN)
enabled_a11y_support_(false),
checked_for_a11y_support_(false),
thick_frame_(true),
#endif
keyboard_event_handler_(new views::UnhandledKeyboardEventHandler),
@@ -204,8 +205,7 @@ NativeWindowViews::NativeWindowViews(
if (parent)
params.parent = parent->GetNativeWindow();
params.native_widget =
new views::DesktopNativeWidgetAura(window_.get());
params.native_widget = new AtomDesktopNativeWidgetAura(window_.get());
atom_desktop_window_tree_host_win_ = new AtomDesktopWindowTreeHostWin(
this,
window_.get(),
@@ -426,7 +426,7 @@ bool NativeWindowViews::IsEnabled() {
void NativeWindowViews::Maximize() {
#if defined(OS_WIN)
// For window without WS_THICKFRAME style, we can not call Maximize().
if (!thick_frame_) {
if (!(::GetWindowLong(GetAcceleratedWidget(), GWL_STYLE) & WS_THICKFRAME)) {
restore_bounds_ = GetBounds();
auto display =
display::Screen::GetScreen()->GetDisplayNearestPoint(GetPosition());
@@ -444,7 +444,7 @@ void NativeWindowViews::Maximize() {
void NativeWindowViews::Unmaximize() {
#if defined(OS_WIN)
if (!thick_frame_) {
if (!(::GetWindowLong(GetAcceleratedWidget(), GWL_STYLE) & WS_THICKFRAME)) {
SetBounds(restore_bounds_, false);
return;
}
@@ -488,6 +488,7 @@ void NativeWindowViews::SetFullScreen(bool fullscreen) {
}
// For window without WS_THICKFRAME style, we can not call SetFullscreen().
// This path will be used for transparent windows as well.
if (!thick_frame_) {
if (fullscreen) {
restore_bounds_ = GetBounds();
@@ -572,7 +573,7 @@ void NativeWindowViews::SetContentSizeConstraints(
void NativeWindowViews::SetResizable(bool resizable) {
#if defined(OS_WIN)
if (thick_frame_)
if (has_frame())
FlipWindowStyle(GetAcceleratedWidget(), resizable, WS_THICKFRAME);
#elif defined(USE_X11)
if (resizable != resizable_) {
@@ -595,11 +596,10 @@ void NativeWindowViews::SetResizable(bool resizable) {
bool NativeWindowViews::IsResizable() {
#if defined(OS_WIN)
if (thick_frame_) {
if (has_frame())
return ::GetWindowLong(GetAcceleratedWidget(), GWL_STYLE) & WS_THICKFRAME;
} else {
else
return CanResize();
}
#else
return CanResize();
#endif
@@ -682,7 +682,8 @@ bool NativeWindowViews::IsClosable() {
#endif
}
void NativeWindowViews::SetAlwaysOnTop(bool top) {
void NativeWindowViews::SetAlwaysOnTop(bool top, const std::string& level,
int relativeLevel, std::string* error) {
window_->SetAlwaysOnTop(top);
}
@@ -694,6 +695,10 @@ void NativeWindowViews::Center() {
window_->CenterWindow(GetSize());
}
void NativeWindowViews::Invalidate() {
window_->SchedulePaintInRect(gfx::Rect(GetBounds().size()));
}
void NativeWindowViews::SetTitle(const std::string& title) {
title_ = title;
window_->UpdateWindowTitle();
@@ -846,7 +851,7 @@ void NativeWindowViews::SetMenu(AtomMenuModel* menu_model) {
if (!menu_bar_) {
gfx::Size content_size = GetContentSize();
menu_bar_.reset(new MenuBar);
menu_bar_.reset(new MenuBar(this));
menu_bar_->set_owned_by_client();
if (!menu_bar_autohide_) {

View File

@@ -18,6 +18,8 @@
#include "atom/browser/ui/win/message_handler_delegate.h"
#include "atom/browser/ui/win/taskbar_host.h"
#include "base/win/scoped_gdi_object.h"
#include "ui/base/win/accessibility_misc_utils.h"
#include <UIAutomationCoreApi.h>
#endif
namespace views {
@@ -84,9 +86,11 @@ class NativeWindowViews : public NativeWindow,
bool IsFullScreenable() override;
void SetClosable(bool closable) override;
bool IsClosable() override;
void SetAlwaysOnTop(bool top) override;
void SetAlwaysOnTop(bool top, const std::string& level,
int relativeLevel, std::string* error) override;
bool IsAlwaysOnTop() override;
void Center() override;
void Invalidate() override;
void SetTitle(const std::string& title) override;
std::string GetTitle() override;
void FlashFrame(bool flash) override;
@@ -214,6 +218,7 @@ class NativeWindowViews : public NativeWindow,
// size of the window while in the normal state (not maximized, minimized or
// fullscreen), so we restore it correctly.
gfx::Rect last_normal_bounds_;
gfx::Rect last_normal_bounds_before_move_;
// last_normal_bounds_ may or may not require update on WM_MOVE. When a
// window is maximized, it is moved (WM_MOVE) to maximum size first and then
@@ -228,8 +233,8 @@ class NativeWindowViews : public NativeWindow,
// In charge of running taskbar related APIs.
TaskbarHost taskbar_host_;
// If true we have enabled a11y
bool enabled_a11y_support_;
// Memoized version of a11y check
bool checked_for_a11y_support_;
// Whether to show the WS_THICKFRAME style.
bool thick_frame_;

View File

@@ -72,6 +72,12 @@ const char* AppCommandToString(int command_id) {
}
}
bool IsScreenReaderActive() {
UINT screenReader = 0;
SystemParametersInfo(SPI_GETSCREENREADER, 0, &screenReader, 0);
return screenReader && UiaClientsAreListening();
}
} // namespace
bool NativeWindowViews::ExecuteWindowsCommand(int command_id) {
@@ -91,16 +97,24 @@ bool NativeWindowViews::PreHandleMSG(
// because we still want Chromium to handle returning the actual
// accessibility object.
case WM_GETOBJECT: {
const DWORD obj_id = static_cast<DWORD>(l_param);
if (enabled_a11y_support_) return false;
if (checked_for_a11y_support_) return false;
if (obj_id == OBJID_CLIENT) {
const auto axState = content::BrowserAccessibilityState::GetInstance();
if (axState && !axState->IsAccessibleBrowser()) {
axState->OnScreenReaderDetected();
enabled_a11y_support_ = true;
Browser::Get()->OnAccessibilitySupportChanged();
}
const DWORD obj_id = static_cast<DWORD>(l_param);
if (obj_id != OBJID_CLIENT) {
return false;
}
if (!IsScreenReaderActive()) {
return false;
}
checked_for_a11y_support_ = true;
const auto axState = content::BrowserAccessibilityState::GetInstance();
if (axState && !axState->IsAccessibleBrowser()) {
axState->OnScreenReaderDetected();
Browser::Get()->OnAccessibilitySupportChanged();
}
return false;
@@ -111,9 +125,12 @@ bool NativeWindowViews::PreHandleMSG(
return taskbar_host_.HandleThumbarButtonEvent(LOWORD(w_param));
return false;
case WM_SIZE: {
consecutive_moves_ = false;
// Handle window state change.
HandleSizeEvent(w_param, l_param);
consecutive_moves_ = false;
last_normal_bounds_before_move_ = last_normal_bounds_;
return false;
}
case WM_MOVING: {
@@ -141,6 +158,9 @@ void NativeWindowViews::HandleSizeEvent(WPARAM w_param, LPARAM l_param) {
switch (w_param) {
case SIZE_MAXIMIZED:
last_window_state_ = ui::SHOW_STATE_MAXIMIZED;
if (consecutive_moves_) {
last_normal_bounds_ = last_normal_bounds_before_move_;
}
NotifyWindowMaximize();
break;
case SIZE_MINIMIZED:
@@ -151,14 +171,14 @@ void NativeWindowViews::HandleSizeEvent(WPARAM w_param, LPARAM l_param) {
if (last_window_state_ == ui::SHOW_STATE_NORMAL) {
// Window was resized so we save it's new size.
last_normal_bounds_ = GetBounds();
last_normal_bounds_before_move_ = last_normal_bounds_;
} else {
switch (last_window_state_) {
case ui::SHOW_STATE_MAXIMIZED:
last_window_state_ = ui::SHOW_STATE_NORMAL;
// When the window is restored we resize it to the previous known
// normal size.
SetBounds(last_normal_bounds_, false);
// Don't force out last known bounds onto the window as Windows
// actually gets these correct
NotifyWindowUnmaximize();
break;

View File

@@ -0,0 +1,25 @@
// Copyright (c) 2016 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "atom/browser/net/about_protocol_handler.h"
#include "atom/browser/net/url_request_about_job.h"
namespace atom {
AboutProtocolHandler::AboutProtocolHandler() {}
AboutProtocolHandler::~AboutProtocolHandler() {}
net::URLRequestJob* AboutProtocolHandler::MaybeCreateJob(
net::URLRequest* request,
net::NetworkDelegate* network_delegate) const {
return new URLRequestAboutJob(request, network_delegate);
}
bool AboutProtocolHandler::IsSafeRedirectTarget(const GURL& location) const {
return false;
}
} // namespace atom

View File

@@ -0,0 +1,29 @@
// Copyright (c) 2016 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef ATOM_BROWSER_NET_ABOUT_PROTOCOL_HANDLER_H_
#define ATOM_BROWSER_NET_ABOUT_PROTOCOL_HANDLER_H_
#include "net/url_request/url_request_job_factory.h"
namespace atom {
class AboutProtocolHandler : public net::URLRequestJobFactory::ProtocolHandler {
public:
AboutProtocolHandler();
~AboutProtocolHandler() override;
// net::URLRequestJobFactory::ProtocolHandler:
net::URLRequestJob* MaybeCreateJob(
net::URLRequest* request,
net::NetworkDelegate* network_delegate) const override;
bool IsSafeRedirectTarget(const GURL& location) const override;
private:
DISALLOW_COPY_AND_ASSIGN(AboutProtocolHandler);
};
} // namespace atom
#endif // ATOM_BROWSER_NET_ABOUT_PROTOCOL_HANDLER_H_

View File

@@ -21,7 +21,7 @@
#include "net/base/load_flags.h"
#include "net/base/mime_util.h"
#include "net/base/net_errors.h"
#include "net/filter/filter.h"
#include "net/filter/gzip_source_stream.h"
#include "net/http/http_util.h"
#include "net/url_request/url_request_status.h"
@@ -179,10 +179,14 @@ bool URLRequestAsarJob::IsRedirectResponse(GURL* location,
#endif
}
std::unique_ptr<net::Filter> URLRequestAsarJob::SetupFilter() const {
std::unique_ptr<net::SourceStream> URLRequestAsarJob::SetUpSourceStream() {
std::unique_ptr<net::SourceStream> source =
net::URLRequestJob::SetUpSourceStream();
// Bug 9936 - .svgz files needs to be decompressed.
return base::LowerCaseEqualsASCII(file_path_.Extension(), ".svgz")
? net::Filter::GZipFactory() : nullptr;
? net::GzipSourceStream::Create(std::move(source),
net::SourceStream::TYPE_GZIP)
: std::move(source);
}
bool URLRequestAsarJob::GetMimeType(std::string* mime_type) const {

View File

@@ -56,7 +56,7 @@ class URLRequestAsarJob : public net::URLRequestJob {
void Kill() override;
int ReadRawData(net::IOBuffer* buf, int buf_size) override;
bool IsRedirectResponse(GURL* location, int* http_status_code) override;
std::unique_ptr<net::Filter> SetupFilter() const override;
std::unique_ptr<net::SourceStream> SetUpSourceStream() override;
bool GetMimeType(std::string* mime_type) const override;
void SetExtraRequestHeaders(const net::HttpRequestHeaders& headers) override;
int GetResponseCode() const override;

View File

@@ -5,9 +5,14 @@
#include "atom/browser/net/atom_cert_verifier.h"
#include "atom/browser/browser.h"
#include "atom/browser/net/atom_ct_delegate.h"
#include "atom/common/native_mate_converters/net_converter.h"
#include "base/containers/linked_list.h"
#include "base/memory/ptr_util.h"
#include "base/memory/weak_ptr.h"
#include "content/public/browser/browser_thread.h"
#include "net/base/net_errors.h"
#include "net/cert/cert_verify_result.h"
#include "net/cert/crl_set.h"
#include "net/cert/x509_certificate.h"
@@ -17,54 +22,188 @@ namespace atom {
namespace {
void OnResult(
net::CertVerifyResult* verify_result,
const net::CompletionCallback& callback,
bool result) {
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
base::Bind(callback, result ? net::OK : net::ERR_FAILED));
}
class Response : public base::LinkNode<Response> {
public:
Response(net::CertVerifyResult* verify_result,
const net::CompletionCallback& callback)
: verify_result_(verify_result), callback_(callback) {}
net::CertVerifyResult* verify_result() { return verify_result_; }
net::CompletionCallback callback() { return callback_; }
private:
net::CertVerifyResult* verify_result_;
net::CompletionCallback callback_;
DISALLOW_COPY_AND_ASSIGN(Response);
};
} // namespace
AtomCertVerifier::AtomCertVerifier()
: default_cert_verifier_(net::CertVerifier::CreateDefault()) {
}
class CertVerifierRequest : public AtomCertVerifier::Request {
public:
CertVerifierRequest(const AtomCertVerifier::RequestParams& params,
AtomCertVerifier* cert_verifier)
: params_(params),
cert_verifier_(cert_verifier),
error_(net::ERR_IO_PENDING),
custom_response_(net::ERR_IO_PENDING),
first_response_(true),
weak_ptr_factory_(this) {}
AtomCertVerifier::~AtomCertVerifier() {
}
~CertVerifierRequest() {
cert_verifier_->RemoveRequest(params_);
default_verifier_request_.reset();
while (!response_list_.empty() && !first_response_) {
base::LinkNode<Response>* response_node = response_list_.head();
response_node->RemoveFromList();
Response* response = response_node->value();
RunResponse(response);
}
cert_verifier_ = nullptr;
weak_ptr_factory_.InvalidateWeakPtrs();
}
void RunResponse(Response* response) {
if (custom_response_ == net::ERR_ABORTED) {
*(response->verify_result()) = result_;
response->callback().Run(error_);
} else {
response->verify_result()->Reset();
response->verify_result()->verified_cert = params_.certificate();
cert_verifier_->ct_delegate()->AddCTExcludedHost(params_.hostname());
response->callback().Run(custom_response_);
}
delete response;
}
void Start(net::CRLSet* crl_set,
const net::NetLogWithSource& net_log) {
int error = cert_verifier_->default_verifier()->Verify(
params_, crl_set, &result_,
base::Bind(&CertVerifierRequest::OnDefaultVerificationDone,
weak_ptr_factory_.GetWeakPtr()),
&default_verifier_request_, net_log);
if (error != net::ERR_IO_PENDING)
OnDefaultVerificationDone(error);
}
void OnDefaultVerificationDone(int error) {
error_ = error;
std::unique_ptr<VerifyRequestParams> request(new VerifyRequestParams());
request->hostname = params_.hostname();
request->default_result = net::ErrorToString(error);
request->certificate = params_.certificate();
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
base::Bind(&CertVerifierRequest::OnVerifyRequestInUI,
weak_ptr_factory_.GetWeakPtr(),
cert_verifier_->verify_proc(),
base::Passed(&request)));
}
void OnVerifyRequestInUI(const AtomCertVerifier::VerifyProc& verify_proc,
std::unique_ptr<VerifyRequestParams> request) {
verify_proc.Run(*(request.get()),
base::Bind(&CertVerifierRequest::OnResponseInUI,
weak_ptr_factory_.GetWeakPtr()));
}
void OnResponseInUI(int result) {
BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
base::Bind(&CertVerifierRequest::NotifyResponseInIO,
weak_ptr_factory_.GetWeakPtr(), result));
}
void NotifyResponseInIO(int result) {
custom_response_ = result;
first_response_ = false;
// Responding to first request in the list will initiate destruction of
// the class, respond to others in the list inside destructor.
base::LinkNode<Response>* response_node = response_list_.head();
response_node->RemoveFromList();
Response* response = response_node->value();
RunResponse(response);
}
void AddResponseListener(net::CertVerifyResult* verify_result,
const net::CompletionCallback& callback) {
response_list_.Append(new Response(verify_result, callback));
}
const AtomCertVerifier::RequestParams& params() const { return params_; }
private:
using ResponseList = base::LinkedList<Response>;
const AtomCertVerifier::RequestParams params_;
AtomCertVerifier* cert_verifier_;
int error_;
int custom_response_;
bool first_response_;
ResponseList response_list_;
net::CertVerifyResult result_;
std::unique_ptr<AtomCertVerifier::Request> default_verifier_request_;
base::WeakPtrFactory<CertVerifierRequest> weak_ptr_factory_;
};
AtomCertVerifier::AtomCertVerifier(AtomCTDelegate* ct_delegate)
: default_cert_verifier_(net::CertVerifier::CreateDefault()),
ct_delegate_(ct_delegate) {}
AtomCertVerifier::~AtomCertVerifier() {}
void AtomCertVerifier::SetVerifyProc(const VerifyProc& proc) {
verify_proc_ = proc;
}
int AtomCertVerifier::Verify(
net::X509Certificate* cert,
const std::string& hostname,
const std::string& ocsp_response,
int flags,
const RequestParams& params,
net::CRLSet* crl_set,
net::CertVerifyResult* verify_result,
const net::CompletionCallback& callback,
std::unique_ptr<Request>* out_req,
const net::BoundNetLog& net_log) {
const net::NetLogWithSource& net_log) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (verify_proc_.is_null())
return default_cert_verifier_->Verify(
cert, hostname, ocsp_response, flags, crl_set, verify_result, callback,
out_req, net_log);
if (verify_proc_.is_null()) {
ct_delegate_->ClearCTExcludedHostsList();
return default_cert_verifier_->Verify(params, crl_set, verify_result,
callback, out_req, net_log);
} else {
CertVerifierRequest* request = FindRequest(params);
if (!request) {
out_req->reset();
std::unique_ptr<CertVerifierRequest> new_request =
base::MakeUnique<CertVerifierRequest>(params, this);
new_request->Start(crl_set, net_log);
request = new_request.get();
*out_req = std::move(new_request);
inflight_requests_[params] = request;
}
request->AddResponseListener(verify_result, callback);
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
base::Bind(verify_proc_, hostname, make_scoped_refptr(cert),
base::Bind(OnResult, verify_result, callback)));
return net::ERR_IO_PENDING;
return net::ERR_IO_PENDING;
}
}
bool AtomCertVerifier::SupportsOCSPStapling() {
return true;
if (verify_proc_.is_null())
return default_cert_verifier_->SupportsOCSPStapling();
return false;
}
void AtomCertVerifier::RemoveRequest(const RequestParams& params) {
auto it = inflight_requests_.find(params);
if (it != inflight_requests_.end())
inflight_requests_.erase(it);
}
CertVerifierRequest* AtomCertVerifier::FindRequest(
const RequestParams& params) {
auto it = inflight_requests_.find(params);
if (it != inflight_requests_.end())
return it->second;
return nullptr;
}
} // namespace atom

View File

@@ -5,6 +5,7 @@
#ifndef ATOM_BROWSER_NET_ATOM_CERT_VERIFIER_H_
#define ATOM_BROWSER_NET_ATOM_CERT_VERIFIER_H_
#include <map>
#include <memory>
#include <string>
@@ -12,34 +13,51 @@
namespace atom {
class AtomCTDelegate;
class CertVerifierRequest;
struct VerifyRequestParams {
std::string hostname;
std::string default_result;
scoped_refptr<net::X509Certificate> certificate;
};
class AtomCertVerifier : public net::CertVerifier {
public:
AtomCertVerifier();
explicit AtomCertVerifier(AtomCTDelegate* ct_delegate);
virtual ~AtomCertVerifier();
using VerifyProc =
base::Callback<void(const std::string& hostname,
scoped_refptr<net::X509Certificate>,
const base::Callback<void(bool)>&)>;
using VerifyProc = base::Callback<void(const VerifyRequestParams& request,
const net::CompletionCallback&)>;
void SetVerifyProc(const VerifyProc& proc);
const VerifyProc verify_proc() const { return verify_proc_; }
AtomCTDelegate* ct_delegate() const { return ct_delegate_; }
net::CertVerifier* default_verifier() const {
return default_cert_verifier_.get();
}
protected:
// net::CertVerifier:
int Verify(net::X509Certificate* cert,
const std::string& hostname,
const std::string& ocsp_response,
int flags,
int Verify(const RequestParams& params,
net::CRLSet* crl_set,
net::CertVerifyResult* verify_result,
const net::CompletionCallback& callback,
std::unique_ptr<Request>* out_req,
const net::BoundNetLog& net_log) override;
const net::NetLogWithSource& net_log) override;
bool SupportsOCSPStapling() override;
private:
friend class CertVerifierRequest;
void RemoveRequest(const RequestParams& params);
CertVerifierRequest* FindRequest(const RequestParams& params);
std::map<RequestParams, CertVerifierRequest*> inflight_requests_;
VerifyProc verify_proc_;
std::unique_ptr<net::CertVerifier> default_cert_verifier_;
AtomCTDelegate* ct_delegate_;
DISALLOW_COPY_AND_ASSIGN(AtomCertVerifier);
};

View File

@@ -0,0 +1,44 @@
// Copyright (c) 2016 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "atom/browser/net/atom_cookie_delegate.h"
#include "content/public/browser/browser_thread.h"
namespace atom {
AtomCookieDelegate::AtomCookieDelegate() {
}
AtomCookieDelegate::~AtomCookieDelegate() {
}
void AtomCookieDelegate::AddObserver(Observer* observer) {
observers_.AddObserver(observer);
}
void AtomCookieDelegate::RemoveObserver(Observer* observer) {
observers_.RemoveObserver(observer);
}
void AtomCookieDelegate::NotifyObservers(
const net::CanonicalCookie& cookie,
bool removed,
net::CookieStore::ChangeCause cause) {
for (Observer& observer : observers_)
observer.OnCookieChanged(cookie, removed, cause);
}
void AtomCookieDelegate::OnCookieChanged(
const net::CanonicalCookie& cookie,
bool removed,
net::CookieStore::ChangeCause cause) {
content::BrowserThread::PostTask(
content::BrowserThread::UI,
FROM_HERE,
base::Bind(&AtomCookieDelegate::NotifyObservers,
this, cookie, removed, cause));
}
} // namespace atom

View File

@@ -0,0 +1,48 @@
// Copyright (c) 2016 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef ATOM_BROWSER_NET_ATOM_COOKIE_DELEGATE_H_
#define ATOM_BROWSER_NET_ATOM_COOKIE_DELEGATE_H_
#include "base/observer_list.h"
#include "net/cookies/cookie_monster.h"
namespace atom {
class AtomCookieDelegate : public net::CookieMonsterDelegate {
public:
AtomCookieDelegate();
~AtomCookieDelegate() override;
class Observer {
public:
virtual void OnCookieChanged(const net::CanonicalCookie& cookie,
bool removed,
net::CookieStore::ChangeCause cause) {}
protected:
virtual ~Observer() {}
};
void AddObserver(Observer* observer);
void RemoveObserver(Observer* observer);
// net::CookieMonsterDelegate:
void OnCookieChanged(const net::CanonicalCookie& cookie,
bool removed,
net::CookieStore::ChangeCause cause) override;
private:
base::ObserverList<Observer> observers_;
void NotifyObservers(const net::CanonicalCookie& cookie,
bool removed,
net::CookieStore::ChangeCause cause);
DISALLOW_COPY_AND_ASSIGN(AtomCookieDelegate);
};
} // namespace atom
#endif // ATOM_BROWSER_NET_ATOM_COOKIE_DELEGATE_H_

View File

@@ -0,0 +1,34 @@
// Copyright (c) 2016 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "atom/browser/net/atom_ct_delegate.h"
#include "content/public/browser/browser_thread.h"
namespace atom {
AtomCTDelegate::AtomCTDelegate() {}
AtomCTDelegate::~AtomCTDelegate() {}
void AtomCTDelegate::AddCTExcludedHost(const std::string& host) {
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
ct_excluded_hosts_.insert(host);
}
void AtomCTDelegate::ClearCTExcludedHostsList() {
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
ct_excluded_hosts_.clear();
}
AtomCTDelegate::CTRequirementLevel AtomCTDelegate::IsCTRequiredForHost(
const std::string& host) {
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
if (!ct_excluded_hosts_.empty() &&
(ct_excluded_hosts_.find(host) != ct_excluded_hosts_.end()))
return CTRequirementLevel::NOT_REQUIRED;
return CTRequirementLevel::DEFAULT;
}
} // namespace atom

View File

@@ -0,0 +1,33 @@
// Copyright (c) 2016 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef ATOM_BROWSER_NET_ATOM_CT_DELEGATE_H_
#define ATOM_BROWSER_NET_ATOM_CT_DELEGATE_H_
#include <set>
#include <string>
#include "net/http/transport_security_state.h"
namespace atom {
class AtomCTDelegate : public net::TransportSecurityState::RequireCTDelegate {
public:
AtomCTDelegate();
~AtomCTDelegate() override;
void AddCTExcludedHost(const std::string& host);
void ClearCTExcludedHostsList();
// net::TransportSecurityState::RequireCTDelegate:
CTRequirementLevel IsCTRequiredForHost(const std::string& host) override;
private:
std::set<std::string> ct_excluded_hosts_;
DISALLOW_COPY_AND_ASSIGN(AtomCTDelegate);
};
} // namespace atom
#endif // ATOM_BROWSER_NET_ATOM_CT_DELEGATE_H_

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