Compare commits

...

1863 Commits

Author SHA1 Message Date
Kevin Sawicki
46aed5ff6f Bump v1.6.4 2017-03-22 09:16:08 -07:00
Cheng Zhao
e539129db2 Merge pull request #8852 from electron/web-worker-hook
Add Node.js integration to WebWorker
2017-03-22 09:01:42 -07:00
Cheng Zhao
c1a478179e Merge pull request #8971 from electron/fix-freeenvironment-crash
node::Environment should be destroyed before AtomBindings
2017-03-22 09:00:38 -07:00
Kevin Sawicki
f7e3f9035d Merge pull request #8974 from electron/default-popup-async-value
Default async to false when object is specified
2017-03-21 06:36:29 -07:00
Kevin Sawicki
23b235c9c7 Default async to false when object is specified 2017-03-20 20:37:52 -07:00
Cheng Zhao
99d3fce3c7 node::Environment should be destroyed before AtomBindings
The shutdown code may still uses the APIs provieded by AtomBindings.
2017-03-20 13:01:28 -07:00
Cheng Zhao
71c3e97e81 Fix docs lint warnings 2017-03-20 12:52:46 -07:00
Cheng Zhao
0287f23e3b Fix cpplint warning 2017-03-20 12:52:46 -07:00
Cheng Zhao
40b35a991f Fix js lint 2017-03-20 12:52:46 -07:00
Cheng Zhao
940d77b9a0 Fix typos and adjust sentences 2017-03-20 12:52:46 -07:00
Cheng Zhao
033aa16e04 test: Node integration in web workers 2017-03-20 12:52:46 -07:00
Cheng Zhao
ab83aa0bfd docs: Multithreading 2017-03-20 12:52:46 -07:00
Cheng Zhao
a49af26e39 Add nodeIntegrationInWorker option 2017-03-20 12:52:46 -07:00
Cheng Zhao
e496e18f6e Make Archive thread safe 2017-03-20 12:52:46 -07:00
Cheng Zhao
c068285ff8 AtomBindings should not use default uv loop 2017-03-20 12:52:46 -07:00
Cheng Zhao
9c9c8ec5f1 WebWorkerObserver should be destroyed on exit 2017-03-20 12:52:46 -07:00
Cheng Zhao
d2f185bea5 Create new uv loop in each worker 2017-03-20 12:52:46 -07:00
Cheng Zhao
69df934710 Converter for base::Callback is not thread safe 2017-03-20 12:52:45 -07:00
Cheng Zhao
bb5ad4ac05 Correctly initialize Node environment in worker 2017-03-20 12:52:45 -07:00
Cheng Zhao
b467c3939e Add a new type of NodeBindings 2017-03-20 12:52:45 -07:00
Cheng Zhao
aac934b34e Update native_mate: Make Wrappable thread safe 2017-03-20 12:52:45 -07:00
Cheng Zhao
2cbdb6bac3 Wrap ContextCreated with context scope 2017-03-20 12:52:45 -07:00
Cheng Zhao
e017e157ba Insert node integrations into WebWorker 2017-03-20 12:52:45 -07:00
Kevin Sawicki
253caf35ab Merge pull request #8955 from babanesma/feat/new-clean-command
Feat/new clean command
2017-03-20 10:36:19 -07:00
Kevin Sawicki
2d638e5da7 Add option to clean.py to only remove dist and out dirs 2017-03-20 10:33:04 -07:00
Kevin Sawicki
6ded27f3a9 Merge pull request #8878 from TanninOne/patch-1
Update browser-window.md
2017-03-20 10:14:23 -07:00
Kevin Sawicki
caae03f954 Use rendered language in both ready-to-show docs 2017-03-20 10:13:45 -07:00
Kevin Sawicki
286f529968 Merge pull request #8890 from twolfson/dev/proxy.to.string.sqwished
🐛 Add toString support to remote functions
2017-03-20 09:35:51 -07:00
Kevin Sawicki
75d934e4a2 Merge pull request #8962 from feserafim/patch-1
Update README.md
2017-03-20 09:35:09 -07:00
Felipe Serafim
deef2da87c Update README.md
Correcting some Spanish words mistakes.
2017-03-18 23:23:14 +01:00
Adham Saad
8060b0966f 🐛 #8919 - fix typo 2017-03-17 20:47:20 +02:00
Adham Saad
487a195320 🐛 #8919 - add new command to the docs 2017-03-17 20:44:18 +02:00
Kevin Sawicki
a215e8fb82 Merge pull request #8954 from electron/mark-touchbar-apis-with-experimental-label
Mark touch bar apis with _Experimental_ in docs
2017-03-17 11:02:46 -07:00
Kevin Sawicki
6f047fd4b7 Mark touch bar apis with _Experimental_ 2017-03-17 10:56:41 -07:00
Kevin Sawicki
64984ac23b Merge pull request #8942 from electron/read-binary-data-from-clipboard
Add clipboard.readBuffer(format)
2017-03-17 10:56:24 -07:00
Kevin Sawicki
f119bc0944 Remove unused args param 2017-03-17 10:35:54 -07:00
Kevin Sawicki
c50b518493 Check toString after loading remote properties 2017-03-17 10:29:07 -07:00
Kevin Sawicki
648d3324fb Add spec for remote function with toString property 2017-03-17 10:28:23 -07:00
Kevin Sawicki
11a4c7e408 🎨 2017-03-17 09:57:17 -07:00
Kevin Sawicki
3ae034deab Change data -> format in clipboard docs 2017-03-17 09:57:17 -07:00
Kevin Sawicki
ab05346572 Add clipboard.readBuffer 2017-03-17 09:57:17 -07:00
Kevin Sawicki
0e55e5cbb5 Add initial spec for clipboard.readBuffer 2017-03-17 09:57:17 -07:00
Kevin Sawicki
fe5db82d47 Merge pull request #8926 from electron/upgrade-libcc-for-heap-snapshot-patch
Upgrade libcc and brightray to latest
2017-03-17 09:55:39 -07:00
Kevin Sawicki
f71353a4c5 Merge pull request #8939 from electron/expose-remote-to-sandbox
Expose remote module to sandbox
2017-03-17 09:41:59 -07:00
Kevin Sawicki
9642381c02 Upgrade to libcc 44448acf 2017-03-17 09:37:28 -07:00
Kevin Sawicki
a35cce5f7a Enable takeHeapSnapshot spec 2017-03-17 09:14:17 -07:00
Kevin Sawicki
469ab8b509 Upgrade libcc for heap snapshot patch 2017-03-17 09:14:17 -07:00
Todd Wolfson
818738ce84 🐛 Add toString support to remote functions 2017-03-17 08:21:37 -07:00
Thiago de Arruda
e9b955b9ec Use remote/fs to read preload script during sandboxed setup
Also expose the "fs" module to preload scripts, as a shortcut to
`require('electron').remote.require('fs')`
2017-03-16 14:23:00 -03:00
Thiago de Arruda
f6befbe764 Expose lib/renderer/api/remote.js to sandboxed renderer 2017-03-16 14:21:23 -03:00
Kevin Sawicki
6d45052eea Merge pull request #8900 from electron/handle-buffer-instances-in-sandbox
Handle Buffer deserialization in sandboxed renderers
2017-03-16 10:12:09 -07:00
Thiago de Arruda
a6e4867111 Handle Buffer deserialization in sandboxed renderers
In sandboxed renderers we use browserify to provide a node-like environment. The
Buffer class used by browserify is actually just a wrapper around Uint8Array,
but to deserialize Buffer correctly we must expose the class as a hidden value
and use it in V8ValueConverter.
2017-03-16 13:20:09 -03:00
Kevin Sawicki
da0d0e7aac Merge pull request #8910 from electron/touchbar-scrubber
Touchbar NSScrubber
2017-03-16 09:10:59 -07:00
Adham Saad
713e256843 🐛 #8919 - add new command that cleans only out & dist dirs 2017-03-16 13:34:53 +02:00
Kevin Sawicki
e98ac94d51 🎨 2017-03-15 11:22:31 -07:00
Kevin Sawicki
bc31f05404 highlightedStyle -> overlayStyle 2017-03-15 09:47:07 -07:00
Kevin Sawicki
f41db87e47 Use NSZeroRect for scrubber frame 2017-03-15 09:45:50 -07:00
Kevin Sawicki
466c39ed19 Use icon for consistency with other touch bar APIs 2017-03-15 09:33:11 -07:00
Kevin Sawicki
019883f2fa Merge pull request #8899 from electron/dynamically-generate-browserify-dep-list
Dynamically generate dependencies of browserify build actions
2017-03-15 09:12:31 -07:00
Cheng Zhao
5200b1a1ab Merge pull request #8435 from electron/pdf_rendering
browser: implement native pdf rendering
2017-03-15 18:36:50 +09:00
Kevin Sawicki
49d48a4eb0 Add more non-default options to scrubber spec 2017-03-14 14:15:04 -07:00
Kevin Sawicki
87c219748d Document more constructor options 2017-03-14 14:12:41 -07:00
Kevin Sawicki
2e0e4e69bb Drop on prefix from property names 2017-03-14 14:02:48 -07:00
Kevin Sawicki
6175ee05e2 Remove unneeded long cast 2017-03-14 13:59:29 -07:00
Kevin Sawicki
8b7675baee Add more forward declarations for scrubber APIs 2017-03-14 13:57:39 -07:00
Kevin Sawicki
eeccdf967c Merge pull request #8924 from electron/update-appveyor-badge
Update AppVeyor badge URL
2017-03-14 13:18:04 -07:00
Kevin Sawicki
069baf8cd8 Update AppVeyor badge URL 2017-03-14 10:13:53 -07:00
Samuel Attard
a55cddaa53 Add more options 2017-03-14 18:57:57 +11:00
deepak1556
15e2b2335f address review comments 2017-03-14 00:26:27 +05:30
deepak1556
80ce60f644 spec: check if pdf has loaded 2017-03-14 00:26:27 +05:30
deepak1556
6e02d18a40 update submodules 2017-03-14 00:26:27 +05:30
deepak1556
6be779c777 update spec with new asset 2017-03-14 00:26:27 +05:30
deepak1556
d022d108a3 Dont intercept pdf request for subframes
Will not work without OOPIF support
2017-03-14 00:26:27 +05:30
deepak1556
4381e0895f propagate zoom changes to pdf plugin 2017-03-14 00:26:27 +05:30
deepak1556
eda413861a update spec 2017-03-14 00:26:27 +05:30
deepak1556
093cff5548 update libcc commit 2017-03-14 00:26:27 +05:30
deepak1556
b28e686228 code cleanup 2017-03-14 00:26:27 +05:30
deepak1556
b1b6573bcd build pdf resource in vendor/pdf_viewer 2017-03-14 00:26:27 +05:30
deepak1556
e5100cd103 Remove grit submodule 2017-03-14 00:26:27 +05:30
deepak1556
5a8e522526 StreamManager class is no longer required.
Stream lifetime is managed by webui
2017-03-14 00:26:27 +05:30
deepak1556
c982af991d request for pdf resource from the webui 2017-03-14 00:26:27 +05:30
Cheng Zhao
210f40dd53 Convert "\" to "/" in file:// url 2017-03-14 00:26:27 +05:30
Cheng Zhao
422b7acece Do not store resource_path as FilePath
On Windows the path value returned by PathWithoutParams also uses "/" as
separator, so there is no need to use the FilePath class.
2017-03-14 00:26:27 +05:30
Cheng Zhao
cca1db47ee Print error when path is not found 2017-03-14 00:26:27 +05:30
deepak1556
528853efbf handle reload api call from pdf ui 2017-03-14 00:26:27 +05:30
deepak1556
010193ef44 remove unused header 2017-03-14 00:26:27 +05:30
deepak1556
e4b97a3c93 update submodules to latest 2017-03-14 00:26:27 +05:30
deepak1556
6987e3ecd0 check if target stream is intercepted for correct request 2017-03-14 00:26:27 +05:30
deepak1556
ed89a603f3 update pdf_viewer to chrome 56.0.2924.87 2017-03-14 00:26:27 +05:30
deepak1556
b9710532e1 update api changes 2017-03-14 00:26:27 +05:30
deepak1556
07835bf4e6 update libcc commit 2017-03-14 00:26:27 +05:30
deepak1556
6e241c5e0d update submodule 2017-03-14 00:26:27 +05:30
deepak1556
bd9a9657aa disable node integration for chrome scheme 2017-03-14 00:26:27 +05:30
deepak1556
a4400dc549 add basic spec 2017-03-14 00:26:27 +05:30
deepak1556
3aba23b471 view_id=>stream_id and add some code comments. 2017-03-14 00:26:27 +05:30
deepak1556
e90fd1444f move constants to atom_constants.h 2017-03-14 00:26:27 +05:30
deepak1556
671a8a2cd6 address review comments 2017-03-14 00:26:27 +05:30
deepak1556
6cb626db88 use existing ipc message generator 2017-03-14 00:26:27 +05:30
deepak1556
56c0eb74ff update submodule 2017-03-14 00:26:27 +05:30
deepak1556
cc09b9ac7d BINDINGS_POLICY_WEB_UI is not required 2017-03-14 00:26:27 +05:30
Paul Betts
846d516584 Get us compiling on macOS 2017-03-14 00:26:27 +05:30
Paul Betts
8580a34f9f Get us compiling on Win32 2017-03-14 00:26:27 +05:30
deepak1556
2b64452d9c fix build config 2017-03-14 00:26:27 +05:30
deepak1556
3baa186c0a fix failing download spec 2017-03-14 00:26:27 +05:30
deepak1556
e767c59da2 enable pdf plugin by default 2017-03-14 00:26:27 +05:30
deepak1556
c15f6af892 fix crash when pdf viewer is reloaded 2017-03-14 00:25:59 +05:30
deepak1556
ddc2e0df71 code cleanup 2017-03-14 00:25:59 +05:30
deepak1556
de7dcdedba setup strings for ui 2017-03-14 00:25:59 +05:30
deepak1556
0c7bb72891 listen to ipc messages from plugin to perform SaveAs op 2017-03-14 00:25:59 +05:30
deepak1556
fd8c450ef3 move pdfviewer ui data source to separate file 2017-03-14 00:25:59 +05:30
deepak1556
008497500b update pdf_viewer submodule to use stream url 2017-03-14 00:25:59 +05:30
deepak1556
945e26750e manage the lifetime of streams created 2017-03-14 00:25:59 +05:30
deepak1556
0ab37da785 replace redundant mimetype helper with net utility 2017-03-14 00:25:59 +05:30
deepak1556
578b717b5f fix cpplint error 2017-03-14 00:25:59 +05:30
deepak1556
c8b932fce4 build pdf resources from submodule 2017-03-14 00:25:59 +05:30
deepak1556
c4dd2f4f56 add pdf webui as submodule 2017-03-14 00:25:59 +05:30
deepak1556
3c90fabab7 update pdf ui to work with webui 2017-03-14 00:25:59 +05:30
deepak1556
41c1623824 handle more messages from webui 2017-03-14 00:25:59 +05:30
deepak1556
a2db14476a create webui message handler 2017-03-14 00:25:59 +05:30
deepak1556
8a2b9c893e initialize webui with message handlers 2017-03-14 00:25:59 +05:30
deepak1556
a7ed7068f6 remove grit 2017-03-14 00:25:59 +05:30
deepak1556
be480fb634 import pdf ui 2017-03-14 00:25:59 +05:30
deepak1556
fdd574cea5 browser: implement pdf renderer as webui 2017-03-14 00:25:59 +05:30
Kevin Sawicki
5e70adb511 Guard against only specifying select or highlight handler 2017-03-13 11:23:27 -07:00
Kevin Sawicki
0dcdd60010 Add initial TouchBarScrubber spec 2017-03-13 11:17:55 -07:00
Kevin Sawicki
268dd1a6c2 Remove unneeded include 2017-03-13 11:15:36 -07:00
Kevin Sawicki
e52ece1a1e Implement NSScrubberDataSource in AtomTouchBar 2017-03-13 11:06:41 -07:00
Kevin Sawicki
4f31a5c452 Fix duplicate protocol method declaration 2017-03-13 10:39:42 -07:00
Kevin Sawicki
d7f458d232 Add protocol methods 2017-03-13 10:31:51 -07:00
Kevin Sawicki
2fe21ecdd0 🎨 2017-03-13 10:28:30 -07:00
Kevin Sawicki
37c9d76cd5 Take const references 2017-03-13 10:25:30 -07:00
Kevin Sawicki
dac6e0ce66 Sort filenames 2017-03-13 10:09:09 -07:00
Kevin Sawicki
634bd7b17f Add NSScrubber forward declarations 2017-03-13 10:07:48 -07:00
Kevin Sawicki
48152a813b Merge pull request #8907 from electron/plugin_list_patch
renderer: reset plugin cache when render frame is created
2017-03-13 09:22:21 -07:00
Kevin Sawicki
84e7387b17 Merge pull request #8906 from roramirez/docs-es
Add translated CODE_OF_CONDUCT.md and README.md for spanish language.
2017-03-13 09:11:30 -07:00
Samuel Attard
cfb3798703 Add docs for TouchBarScrubbber 2017-03-13 11:00:25 +11:00
Samuel Attard
a85ae27d68 Fix linting 2017-03-13 11:00:10 +11:00
Samuel Attard
25a231fc50 Initial NSScrubber implementation 2017-03-13 10:51:12 +11:00
Adham Saad
3b265747fe updating README 2017-03-12 14:17:03 +02:00
deepak1556
4281c73cf2 renderer: reset plugin cache when render frame is created 2017-03-12 00:53:39 +05:30
Rodrigo Ramírez Norambuena
eed098277c Add translated CODE_OF_CONDUCT.md and README.md for spanish language. 2017-03-10 22:24:00 -03:00
Kevin Sawicki
280337bf46 Merge pull request #8887 from electron/touchbar-segmneted-control
Touchbar segmented control
2017-03-10 14:43:12 -08:00
Thiago de Arruda
da023b72ee Dynamically generate dependencies of browserify build actions
Instead of having to list in filenames.gypi every javascript file that may go
into a browserify build, generate this list dynamically when the build files are
created by gyp.
2017-03-10 16:30:23 -03:00
Kevin Sawicki
5b1d5b39a2 Set automatic via else block 2017-03-10 10:11:56 -08:00
Kevin Sawicki
3349e32196 Verify selectedIndex to prevent NSRangeException 2017-03-10 10:09:18 -08:00
Kevin Sawicki
3b2faf7b89 Add initial TouchBarSegmentedControl spec 2017-03-10 10:04:22 -08:00
Kevin Sawicki
458e4be77c Add forward declaration for 10.12 API 2017-03-10 09:53:47 -08:00
Kevin Sawicki
7ef69a5af5 Merge pull request #8815 from tarruda/improve-sandbox-expose-more-modules
Improvements to sandbox mode
2017-03-10 09:23:31 -08:00
Samuel Attard
bfe63d7a88 Fix linting 2017-03-10 17:56:26 +11:00
Samuel Attard
e6a66b6006 Add docs for segmented control touch bar item 2017-03-10 17:50:23 +11:00
Samuel Attard
1c027c526b Add segmented control implementation 2017-03-10 17:40:39 +11:00
Thiago de Arruda
dda2288541 Remove lib/renderer/api/ipc-renderer-setup.js
This file is no longer required since sandboxed renderer directly imports
ipc-renderer.js.
2017-03-09 20:40:32 -03:00
Thiago de Arruda
cd05834d96 Refactor sandboxed renderer init scripts
This change gives sandboxed renderer scripts a similar structure to what already
exists in the lib/{browser,renderer,common} directories.

It also allows sandboxed renderer initialization to share more code with
non-sandboxed renderers (ipcRenderer is now imported directly from
lib/renderer/api/ipc-renderer).
2017-03-09 20:39:14 -03:00
Thiago de Arruda
2b8203e383 Make sandboxed ipcRenderer API compatible with non-sandboxed version 2017-03-09 20:39:14 -03:00
Thiago de Arruda
d78f3cae7b Expose builtin v8 modules to AtomSandboxedRendererClient
- Adapt node.cc code that implements `process.binding` to create a similar
  object in AtomSandboxedRendererClient.
- Replace the ipc binding object passed to `lib/sandboxed_renderer/init.js` by
  the new binding object.
- Refactor the initialization script to use this new object to fetch the ipc
  binding and store as a hidden value using the `v8_util` module.

This change also required applying a patch to node.js, so the submodule commit
was updated.
2017-03-09 20:39:14 -03:00
Kevin Sawicki
85d66d2413 Merge pull request #8882 from electron/list-modules-in-separate-files
Refactor electron exports to keep module list in separate files
2017-03-09 15:36:02 -08:00
Thiago de Arruda
44bd93589a Refactor electron exports to keep module list in separate files 2017-03-09 19:08:01 -03:00
Kevin Sawicki
e79a22da5d Merge pull request #8883 from electron/pass-crash-reporter-upload-parameter
Pass `uploadToServer` parameter to linux crash reporter
2017-03-09 12:59:35 -08:00
Thiago de Arruda
e03e37e984 Pass uploadToServer parameter to linux crash reporter 2017-03-09 17:23:52 -03:00
Kevin Sawicki
14e8e463b3 Merge pull request #8864 from electron/zoom_controller_webview_patch
browser: track origin zoom with HostZoomMap
2017-03-09 11:27:34 -08:00
Kevin Sawicki
14b548f27a Merge pull request #8858 from electron/native-image-add-representation
Add nativeImage.addRepresentation API
2017-03-09 10:49:19 -08:00
Kevin Sawicki
f19998ef4c Add more default values 2017-03-09 10:26:44 -08:00
Kevin Sawicki
2946f624ac Add spec for adding representation to existing image 2017-03-09 09:56:42 -08:00
Kevin Sawicki
089bfd2cd2 Document nativeImage.addRepresentation(options) 2017-03-09 09:56:42 -08:00
Kevin Sawicki
6e977cbc3a Assert emptiness and size of built up images 2017-03-09 09:56:42 -08:00
Kevin Sawicki
7e039d92ec Support adding representation from data URL 2017-03-09 09:56:42 -08:00
Kevin Sawicki
d67863aa9f Add addRepresentation buffer support 2017-03-09 09:56:42 -08:00
Kevin Sawicki
17b70670f8 Add initial NativeImage.addRepresentation specs 2017-03-09 09:56:42 -08:00
Kevin Sawicki
783b5e84f4 Merge pull request #8866 from jkleinsc/master
Add WebRTCIPPolicy setting to webContents
2017-03-09 09:55:08 -08:00
Kevin Sawicki
ff5081816f Remove unneeded done call 2017-03-09 09:53:01 -08:00
John Kleinschmidt
3c74404a3e Updated docs. 2017-03-09 09:54:09 -05:00
TanninOne
410e80682a Update browser-window.md
Notes that maximize will also show the window and that ready-to-show won't fire if the window is already being displayed. (See issue #8861)
2017-03-09 15:41:31 +01:00
John Kleinschmidt
d5a658bbe4 Fixed pass by reference and added spec 2017-03-08 22:06:26 -05:00
Kevin Sawicki
c004cf0894 Merge pull request #8870 from electron/touch-bar-links
Add more links to touch bar docs
2017-03-08 13:16:09 -08:00
Kevin Sawicki
dcfab1b6a0 Link more touch bar params 2017-03-08 13:04:55 -08:00
John Kleinschmidt
950e3436c2 Removed webrtcippolicy attribute from webview 2017-03-08 13:52:04 -05:00
John Kleinschmidt
1c2a78a896 Add WebRTCIPPolicy setting to webContents and webview
Resolves #8777
Code to set and get the policy come from the muon framework code:
https://github.com/brave/muon/blob/master/atom/browser/api/atom_api_web_
contents.cc#L1324...L1343
2017-03-08 10:15:48 -05:00
deepak1556
224ffe44aa add spec 2017-03-08 19:16:55 +05:30
deepak1556
b5cfa2e92d track host zoom levels with HostZoomMap 2017-03-08 19:03:43 +05:30
Kevin Sawicki
4f817873f1 Merge pull request #8849 from electron/to-data-url-scale-factor
Support scale factor in more NativeImage APIs
2017-03-07 12:55:56 -08:00
Kevin Sawicki
31cae8e1aa Add more scale factor specs 2017-03-07 12:34:31 -08:00
Kevin Sawicki
8852b128ec Add GetScaleFactorFromOptions helper 2017-03-07 12:27:55 -08:00
Kevin Sawicki
6d5fbe6be2 Document scale factor option 2017-03-07 12:27:55 -08:00
Kevin Sawicki
82a81bb26e Support scale factor to buffer APIs 2017-03-07 12:27:55 -08:00
Kevin Sawicki
e4ead6d018 Remove hasRepresentation and just use 1x png result 2017-03-07 12:27:55 -08:00
Kevin Sawicki
c11cdf321b Support toPNG on image without 1x representation 2017-03-07 12:27:55 -08:00
Kevin Sawicki
8bc65ef495 Add failing spec for toPNG with scale factor 2017-03-07 12:27:55 -08:00
Kevin Sawicki
86babdd412 Remove unused include 2017-03-07 12:27:55 -08:00
Kevin Sawicki
50ade57700 Add more hasRepresentation asserts 2017-03-07 12:27:55 -08:00
Kevin Sawicki
0bbbeb307e Support toDataURL without 1x representation 2017-03-07 12:27:55 -08:00
Kevin Sawicki
8eaf48e552 Add spec for 1x1 PNG data URL 2017-03-07 12:27:55 -08:00
Kevin Sawicki
b46e48cae1 Add failing toDataURL spec 2017-03-07 12:27:55 -08:00
Kevin Sawicki
c0d57d609e Merge pull request #8845 from electron/promise-resolve-assignment
Assign Promise.resolve to constant
2017-03-07 12:27:40 -08:00
Kevin Sawicki
dbe9893d29 Assign Promise.resolve to constant 2017-03-07 12:10:09 -08:00
Kevin Sawicki
e0260d6f53 Bump v1.6.3 2017-03-07 09:49:39 -08:00
Kevin Sawicki
5b8fcb740c Merge pull request #8856 from electron/touch-bar-experimental
Mark TouchBar API as experimental
2017-03-07 09:48:59 -08:00
Kevin Sawicki
bb8d42f1e1 Mark TouchBar as experimental 2017-03-07 09:42:45 -08:00
Kevin Sawicki
8d512de157 Merge pull request #8851 from joaomoreno/joaomoreno-patch-1
Update `ses.resolveProxy` return type
2017-03-07 09:35:29 -08:00
Samuel Attard
f97066511f Capitalize type 2017-03-07 21:25:40 +11:00
João Moreno
5a4d9807ee Update ses.resolveProxy return type
As far as I'm aware, after using the `ses.resolveProxy` API, it seems to return a string in the shape of `PROXY foopy:80;SOCKS5 bar.com:1080`, not an object. Correct me if I'm wrong.
2017-03-07 11:21:51 +01:00
Kevin Sawicki
9547ff135f Merge pull request #8744 from electron/MarshallOfSound-patch-1
Ensure userGesture is boolean when calling executeJavaScript
2017-03-06 11:19:23 -08:00
Kevin Sawicki
6bc464d4b0 Mention userGesture default 2017-03-06 10:51:48 -08:00
Kevin Sawicki
6240e30be1 Default hasUserGesture to false when null 2017-03-06 10:51:17 -08:00
Kevin Sawicki
6fcb784f6e Add failing spec for no callback 2017-03-06 10:49:23 -08:00
Samuel Attard
095e79b043 Ensure the callback is a function when executing JS 2017-03-06 10:46:20 -08:00
Kevin Sawicki
f549bda9fc Merge pull request #8799 from nitsakh/baseURLForDataURL
Support base URL option to loadURL for data URLs
2017-03-06 10:25:53 -08:00
Kevin Sawicki
886b47e713 Merge pull request #8724 from electron/defer_load_url
webContents: defer url load when there is a pending navigation entry
2017-03-06 10:18:36 -08:00
Kevin Sawicki
479af3c9e2 Merge pull request #8678 from liusy182/download-item
only emit `download-item done` event once
2017-03-06 10:11:22 -08:00
Kevin Sawicki
94b7fef30f Merge pull request #8604 from electron/groundwater-patch-1
Emphasize asking for repo URL in bug reports
2017-03-06 09:48:36 -08:00
Kevin Sawicki
e485ff6cea Incorporate feedback 2017-03-06 09:48:11 -08:00
Kevin Sawicki
d26e4a4abf Merge pull request #8800 from electron/https-website
Update website URLs to use HTTPS
2017-03-06 09:32:20 -08:00
Kevin Sawicki
cb66a769d4 Merge pull request #8795 from electron/rename-shortcuts-to-keyboard-shortcuts
Rename shortcuts to keyboard shortcuts
2017-03-06 09:30:55 -08:00
Kevin Sawicki
8b53ff3900 Merge pull request #8840 from Yarkhan/patch-1
Correcting typo
2017-03-06 09:27:38 -08:00
Kevin Sawicki
c7d3d48875 Merge pull request #8837 from rhysd/fix-touchbar-doc
Fix TouchBarSpacer class name in doc
2017-03-06 09:25:57 -08:00
Kevin Sawicki
9234bddc38 Merge pull request #8834 from electron/tb-doc-fixups
Add more explicit types to docs for TouchBar
2017-03-06 09:25:29 -08:00
Cheng Zhao
aaa8e81cd4 Merge pull request #8811 from electron/clean-node-on-exit
Clean up node Environment on exit
2017-03-06 20:36:59 +09:00
Yarkhan
ef5c2bbded Correcting typo 2017-03-05 20:40:18 -03:00
deepak1556
90885d1d8c simply spec 2017-03-06 00:22:20 +05:30
deepak1556
e936143da2 listen for browser initiated pending nav entries too 2017-03-06 00:21:52 +05:30
deepak1556
eb827eb020 update spec 2017-03-06 00:10:46 +05:30
deepak1556
dead1ae1ba webContents: defer url load when there is a pending navigation entry 2017-03-06 00:10:46 +05:30
rhysd
c209b886bf fix TouchBarSpacer class name in doc 2017-03-05 15:09:57 +09:00
Samuel Attard
f97ee56c9f Add more explicit types to docs for TouchBar 2017-03-04 16:14:41 +11:00
Kevin Sawicki
e315116336 Merge pull request #8830 from electron/touchbar-label-color
Support setting TouchBarLabel text color
2017-03-03 15:51:16 -08:00
Kevin Sawicki
4d6c779839 identList -> identifiers 2017-03-03 15:28:32 -08:00
Kevin Sawicki
b879872317 Always set properties in update calls 2017-03-03 15:24:32 -08:00
Kevin Sawicki
2680ee9f8f Add support for setting TouchBarLabel text color 2017-03-03 15:14:51 -08:00
Kevin Sawicki
0098822fcf Merge pull request #8095 from electron/touchbar
Add TouchBar Support
2017-03-03 14:37:56 -08:00
Kevin Sawicki
9f323104e7 Remove unused include 2017-03-03 14:11:09 -08:00
Kevin Sawicki
edebb32014 Drop nullable for consistency 2017-03-03 14:07:59 -08:00
Kevin Sawicki
fde310f50d Mention it only effects 10.12.1 with touch bar 2017-03-03 14:04:55 -08:00
Kevin Sawicki
d9a8c15c69 Add clover to possible values 2017-03-03 14:00:39 -08:00
Kevin Sawicki
ca2898a60e Check that window responds to touchBar selector for pre-10.12.1 compat 2017-03-03 14:00:39 -08:00
Kevin Sawicki
c349aeff80 Add initial touch bar specs 2017-03-03 14:00:39 -08:00
Kevin Sawicki
002369576f Add initial touch bar docs 2017-03-03 14:00:39 -08:00
Kevin Sawicki
81ecd4499c Make exported properties match class names 2017-03-03 14:00:39 -08:00
Kevin Sawicki
eb03ab561d Make config optional 2017-03-03 14:00:39 -08:00
Kevin Sawicki
ce12dcd3b4 Add live popover icon property 2017-03-03 14:00:39 -08:00
Kevin Sawicki
a34f9d3583 Support icon property to match MenuItem 2017-03-03 14:00:39 -08:00
Kevin Sawicki
506b42b563 🎨 2017-03-03 14:00:39 -08:00
Kevin Sawicki
ecc0478e3c Match Popover casing in macOS APIs 2017-03-03 14:00:39 -08:00
Kevin Sawicki
79b17c2cd9 Expose TouchBar on remote module 2017-03-03 14:00:39 -08:00
Kevin Sawicki
d1edd80ef8 Use NSTouchBar itemForIdentifier to lookup existing item 2017-03-03 14:00:39 -08:00
Kevin Sawicki
8d716e8b17 Register item after validating 2017-03-03 14:00:39 -08:00
Kevin Sawicki
93bbe8e70b Use device NS colors consistently 2017-03-03 14:00:39 -08:00
Kevin Sawicki
70d61869a5 Use array to create empty NSMutableArray 2017-03-03 14:00:39 -08:00
Kevin Sawicki
76f112ffc5 Only export TouchBar to start 2017-03-03 14:00:39 -08:00
Kevin Sawicki
5fe3ac60fa Check that atom_touch_bar_ is set 2017-03-03 14:00:39 -08:00
Kevin Sawicki
708ed9d1cd Store ordered settings in AtomTouchBar 2017-03-03 14:00:39 -08:00
Kevin Sawicki
5f9e9d4b36 Add move live updating properties 2017-03-03 14:00:39 -08:00
Kevin Sawicki
61aa9bbff4 Add support for spacer items 2017-03-03 14:00:39 -08:00
Kevin Sawicki
f153d08297 Support setting the initial/available colors 2017-03-03 14:00:39 -08:00
Kevin Sawicki
f9dd91d54d Add static helper to bind touch bar to window 2017-03-03 14:00:39 -08:00
Kevin Sawicki
51f1c5a557 Use SetTouchBar withe empty vector instead of DestroyTouchBar 2017-03-03 14:00:39 -08:00
Kevin Sawicki
d5dbe3676e Add window helpers to TouchBar class 2017-03-03 14:00:39 -08:00
Kevin Sawicki
347d472841 Remove unused clear method 2017-03-03 14:00:39 -08:00
Kevin Sawicki
b959f782f6 Rename instance variable maps 2017-03-03 14:00:39 -08:00
Kevin Sawicki
ec500b2852 Use scoped_nsobject to match Chrome implementation 2017-03-03 14:00:38 -08:00
Kevin Sawicki
812beb240b Remove unneeded includes 2017-03-03 14:00:38 -08:00
Kevin Sawicki
823b3baed0 Use vector of dictionaries instead of mate::Arguments 2017-03-03 14:00:38 -08:00
Kevin Sawicki
98f5858b11 Initial support for dynamic properties 2017-03-03 14:00:38 -08:00
Kevin Sawicki
cbb6f8c33e Store event listeners in each TouchBar class 2017-03-03 14:00:38 -08:00
Kevin Sawicki
1972e2eff9 Update renamed variable 2017-03-03 14:00:38 -08:00
Kevin Sawicki
28f2a4951b touch_bar_helper_ -> atom_touch_bar_ 2017-03-03 14:00:38 -08:00
Kevin Sawicki
b39b49a15a Rename to touch_bar_helper_ to differentiate from touchBar property 2017-03-03 14:00:38 -08:00
Kevin Sawicki
14ef5c5957 Reset helper when makeTouchBar is called 2017-03-03 14:00:38 -08:00
Kevin Sawicki
ca29ec0101 Use reference 2017-03-03 14:00:38 -08:00
Kevin Sawicki
f297ba987e touchBarFromMutatableArray -> touchBarFromItemIdentifiers 2017-03-03 14:00:38 -08:00
Kevin Sawicki
b30f7c3c94 Use std::string ctor 2017-03-03 14:00:38 -08:00
Kevin Sawicki
8500538793 Use base::SysUTF8ToNSString helper 2017-03-03 14:00:38 -08:00
Kevin Sawicki
cf7cd1f32b hasTBDict -> hasItemWithID 2017-03-03 14:00:38 -08:00
Kevin Sawicki
48515d9ecc Ignore objective-c header lint 2017-03-03 14:00:38 -08:00
Kevin Sawicki
b632cdd37d Extract helper class to encapsulate touch bar items 2017-03-03 14:00:38 -08:00
Kevin Sawicki
1b5149ae7a Few memory and scope tweaks 2017-03-03 14:00:38 -08:00
Kevin Sawicki
b16d649819 Use skia color helpers 2017-03-03 14:00:38 -08:00
Kevin Sawicki
eff49ad19c Return early when touchBar is null 2017-03-03 14:00:38 -08:00
Kevin Sawicki
69638a399c Make touchBar readwrite/nullable 2017-03-03 14:00:38 -08:00
Kevin Sawicki
d4d3c78701 Ignore lint warnings in Objective-C header 2017-03-03 14:00:38 -08:00
Kevin Sawicki
9bdca3bbfb Remove linter warnings 2017-03-03 14:00:38 -08:00
Kevin Sawicki
9272582bd6 Revert default_app changes 2017-03-03 14:00:38 -08:00
Kevin Sawicki
52905ae9b3 Get compiling against 10.10 SDK 2017-03-03 14:00:38 -08:00
Kevin Sawicki
2a00bb30c5 Use new NativeWindowObserver helper 2017-03-03 14:00:38 -08:00
Samuel Attard
ba3fbc9d1b Fix Group items 2017-03-03 14:00:38 -08:00
Samuel Attard
28d5c8bbde Add updateConfig ability to other items 2017-03-03 14:00:38 -08:00
Samuel Attard
dd09c91cf2 initial work on updating touch bar item config without rerender 2017-03-03 14:00:38 -08:00
Samuel Attard
61949657f0 Some docs for touch bar 2017-03-03 14:00:38 -08:00
Samuel Attard
15dcc314d3 Export the TouchBar items as their own props on the electron main export 2017-03-03 14:00:38 -08:00
Samuel Attard
d1b3ba39bd Fix cpp linting 2017-03-03 14:00:38 -08:00
Samuel Attard
4f0caffc3b Fix JS linting 2017-03-03 14:00:38 -08:00
Samuel Attard
257b32b84b Remove unused ident 2017-03-03 14:00:38 -08:00
Samuel Attard
43cc5079d8 Implement group item 2017-03-03 14:00:38 -08:00
Samuel Attard
269d899a99 Implement popOver item type (woo hoo it worked) 2017-03-03 14:00:38 -08:00
Samuel Attard
2bc45c8665 Change demo touchbar values 2017-03-03 14:00:38 -08:00
Samuel Attard
c92c4138a8 Add Slider item type and add options to the button type 2017-03-03 14:00:38 -08:00
Samuel Attard
18c7c3ece8 Make label and colorpicker types work 2017-03-03 14:00:38 -08:00
Samuel Attard
7857c83ea1 Make dynamic buttons work along with click events 2017-03-03 14:00:38 -08:00
Samuel Attard
703b5738c8 Initial TouchBar Magic
* Make the AtomNSWindow also a NSTouchbarDelegate
* Implement basic makeTouchBar and makeItemForIdentifier methods
* Initial sending of touch / update events through IPC to BrowserWindowObjects

TODO:
* JS API
* JS Object Converters
* Generalize methods so that popovers can work
2017-03-03 14:00:38 -08:00
Zeke Sikelianos
e027f4aacf Merge pull request #8816 from electron/webview-docs-fixes
Fix API docs for webview tag
2017-03-03 11:23:52 -08:00
Zeke Sikelianos
67dc1b1070 use updated docs linter with webview support 2017-03-03 10:53:30 -08:00
Nitish Sakhawalkar
d75db0ea1a Fixed js lint issues. 2017-03-02 14:37:09 -08:00
Zeke Sikelianos
ffc7a4c8a0 move platform labels to end of description for consistency 2017-03-02 13:57:04 -08:00
Zeke Sikelianos
23eecac288 document arguments for webview methods 2017-03-02 13:29:46 -08:00
Zeke Sikelianos
5ee7434a54 fix indentation of app.setLoginItemSettings arguments 2017-03-02 13:28:58 -08:00
Zeke Sikelianos
01423f79b3 denote webview process so linter will recognize it as an API 2017-03-02 13:27:04 -08:00
Nitish Sakhawalkar
370562b129 Moving data url test outside post navigation block. Trailing separator comment in the docs. 2017-03-02 12:14:18 -08:00
Nitish Sakhawalkar
e8c0813f46 Changes based on review. 2017-03-02 10:58:39 -08:00
Nitish Sakhawalkar
bcda67b8eb No more extra whitespace. 2017-03-02 10:50:48 -08:00
Kevin Sawicki
8f7785bb05 Merge pull request #8806 from electron/felix-winstore-moved
Fix init check for process.windowsStore
2017-03-02 10:35:08 -08:00
Kevin Sawicki
e51a4f0af1 Merge pull request #8804 from electron/isolated-world-origin
Set context isolation origin policy
2017-03-02 09:16:51 -08:00
Kevin Sawicki
7fb77ee1cb Set isolated world security origin 2017-03-02 08:49:18 -08:00
Kevin Sawicki
7f6283352f Add failing spec for fetch from isolated world 2017-03-02 08:49:18 -08:00
Cheng Zhao
cf198904a4 Fix cpplint warnings 2017-03-02 17:26:15 +09:00
Cheng Zhao
1709e74958 Fix crash when the main frame is replaced 2017-03-02 17:19:00 +09:00
Cheng Zhao
24574f7299 Avoid touch an Environemnt after it gets destroyed 2017-03-02 17:19:00 +09:00
Cheng Zhao
29278e500b Destroy node environment when a JS context in renderer is destroyed 2017-03-02 17:19:00 +09:00
Cheng Zhao
d379b05890 async handles should be closed on exit 2017-03-02 17:19:00 +09:00
Cheng Zhao
a0605275b9 Clean up node environment on exit in main process 2017-03-02 17:19:00 +09:00
Nitish Sakhawalkar
c06c4c0ccb Reverting formatting changes made by clang format. 2017-03-01 14:04:41 -08:00
Felix Rieseberg
4aaa936803 Fix init check for process.windowsStore
Windows now allows users to move their `WindowsApps` folder, meaning that it can end up on a different drive (and outside of `Program Files`).
2017-03-01 11:48:51 -08:00
Kevin Sawicki
d009b3267a Bump v1.6.2 2017-03-01 09:11:05 -08:00
Kevin Sawicki
59e656586d Merge pull request #8801 from tomfloyer/patch-1
Fixed typo
2017-03-01 09:05:04 -08:00
Tom Floyer
34e21cb91f Fixed typo 2017-03-01 12:03:00 +03:00
Zeke Sikelianos
15bf7ed536 use https URLs for images 2017-02-28 21:24:31 -08:00
Zeke Sikelianos
166bf7ab8c link to default docs URL from default app nav 2017-02-28 21:21:34 -08:00
Zeke Sikelianos
69f0cb26e7 use https for all Electron website URLs 2017-02-28 21:19:55 -08:00
Nitish Sakhawalkar
879082b1a6 Issue #8735:Support base URL option to loadURL for data URLs 2017-02-28 16:49:03 -08:00
Kevin Sawicki
dba154b062 Merge pull request #8766 from electron/browser-require-in-renderer-process
Don't require browser process API in renderer process
2017-02-28 09:19:30 -08:00
Kevin Sawicki
7a99f0435b Fix typo in comment 2017-02-28 08:45:39 -08:00
Kevin Sawicki
bb1a981a01 Mention variable name to update 2017-02-28 08:45:39 -08:00
Kevin Sawicki
ca8983bf6c Add initial spec for remote modules 2017-02-28 08:45:39 -08:00
Kevin Sawicki
e8a79cb88d Don't require browser process module from renderer
This can cause issues when it is accessed from the
require cache or module tree since the getters throw
errors when called.
2017-02-28 08:45:39 -08:00
Kevin Sawicki
51d6a55061 Merge pull request #8742 from electron/webview-visibility
Route webview window visibility change events in browser process
2017-02-28 08:45:15 -08:00
Zeke Sikelianos
8e7a26ec25 link to keyboard shortcuts from docs README 2017-02-28 08:44:28 -08:00
Zeke Sikelianos
61bce3ef39 rename shortcuts to keyboard-shortcuts for clarity 2017-02-28 08:44:12 -08:00
Kevin Sawicki
54232ee21a Emit event after listener is registered 2017-02-28 08:23:00 -08:00
Kevin Sawicki
1d84d83fd4 Forward webview visibility change events from browser process 2017-02-28 08:23:00 -08:00
Kevin Sawicki
7564a9973b Use const instead of var 2017-02-28 08:23:00 -08:00
Kevin Sawicki
f4717b34e9 Register visibility change listener when attached 2017-02-28 08:23:00 -08:00
Kevin Sawicki
2f5f7721fc Merge pull request #8792 from LasseJacobs/master
Pull request, for dutch translation of glossary.md
2017-02-28 08:18:17 -08:00
Rik Theunis
5fe62d23d9 📝 Fix typos and grammatical errors.
[ci skip]
2017-02-27 23:23:39 +01:00
Lasse Jacobs
76e1f882c0 📝 Fix some grammar mistakes
[ci-skip]
2017-02-27 23:23:05 +01:00
Lasse Jacobs
19a948298b 📝 Fix some spelling mistakes
[ci-skip]
2017-02-27 23:15:51 +01:00
Zeke Sikelianos
5a173965ed Merge pull request #8775 from electron/shortcuts
add a guide to keyboard shortcuts
2017-02-27 09:48:49 -08:00
Zeke Sikelianos
250c656aa7 lint 2017-02-27 09:34:35 -08:00
Kevin Sawicki
776fd56e41 Merge pull request #8787 from serant/translation-doc-typo
Fix typo in translation doc for BrowserWindow
2017-02-27 08:54:02 -08:00
Kevin Sawicki
368da3300e Merge pull request #8783 from thesbros/docs/blink-features-link
📝 Update link to Blink features.
2017-02-27 08:53:34 -08:00
Kevin Sawicki
20a9cf834b Merge pull request #8769 from jwheare/docs-cancel-id
Clarify docs for dialog.showMessageBox cancelId
2017-02-27 08:52:59 -08:00
Zeke Sikelianos
f774ea857e remove electron-localshortcut recommendation 2017-02-27 08:20:23 -08:00
serant
6b138e0215 Fixed typo in translation doc for BrowserWindow 2017-02-27 11:01:44 -05:00
Oden
c10f1210bc 📝 Update link to Blink features. 2017-02-26 20:34:00 -08:00
Zeke Sikelianos
ba4a2d7c30 describe local shortcuts before global 2017-02-25 19:21:33 -08:00
Zeke Sikelianos
5c64075032 add section for browser window events 2017-02-25 19:07:09 -08:00
Zeke Sikelianos
32f44d7917 add a guide to keyboard shortcuts 2017-02-25 18:59:13 -08:00
Zeke Sikelianos
dd5fa2df85 Merge pull request #8746 from electron/clarify-app-activation
clarify actions that cause app.activate event to be emitted
2017-02-25 18:20:43 -08:00
James Wheare
cdc6b13fc8 Clarify docs for dialog.showMessageBox cancelId 2017-02-24 23:56:47 +00:00
Kevin Sawicki
8e4bdec6b6 Merge pull request #8758 from electron/use-local-buffer
Use local Buffer variable in module.js require wrapper
2017-02-24 10:35:35 -08:00
Kevin Sawicki
6c40b1eead Verify global.Buffer is undefined 2017-02-24 09:57:32 -08:00
Kevin Sawicki
ad03ba73a4 Upgrade node for Buffer wrapper fix 2017-02-24 09:57:32 -08:00
Kevin Sawicki
e6fec57bd8 Add failing spec for Buffer from preload required module 2017-02-24 09:57:32 -08:00
Kevin Sawicki
b936221b63 Merge pull request #8733 from electron/macos-cancel-id
Support explicit cancelId on macOS
2017-02-24 09:32:07 -08:00
Kevin Sawicki
be16e75be2 Support explicit cancelId on macOS 2017-02-24 09:05:55 -08:00
Kevin Sawicki
d01250eceb Merge pull request #8739 from electron/pepper-context-menu
Use owner browser window in pepper context menu
2017-02-24 09:05:33 -08:00
Kevin Sawicki
739f3ed102 Popup pepper menu in owner browser window 2017-02-24 08:39:22 -08:00
Kevin Sawicki
c951e253c6 Default to focused window whenever param is null/undefined 2017-02-24 08:39:22 -08:00
Kevin Sawicki
3e05350d6b Check that window is non-null before accessing constructor prop 2017-02-24 08:39:22 -08:00
Kevin Sawicki
5819acbc20 Merge pull request #8745 from electron/async-web-dialog-helper
Use callback dialog methods in RunFileChooser
2017-02-24 08:38:19 -08:00
Kevin Sawicki
ef085a1f15 Remove unneeded AddRef/Release calls handled by base::Bind 2017-02-24 08:15:02 -08:00
Kevin Sawicki
6837ec8576 Check render frame host before getting context 2017-02-24 07:49:26 -08:00
Kevin Sawicki
a62c2f9e2e Remove unused include 2017-02-24 07:37:28 -08:00
Kevin Sawicki
29f92bfb53 Extend RefCounted and add private destructor 2017-02-24 07:37:28 -08:00
Kevin Sawicki
a33ffd621f Use callback dialog methods in RunFileChooser 2017-02-24 07:37:28 -08:00
liusi
ff513f2a84 remove the call to download_item_->Remove() on cancel 2017-02-24 14:08:21 +08:00
Kevin Sawicki
cc688d7fa6 Merge pull request #8760 from popod/popod-startDrag-doc
update startDrag(item) doc
2017-02-23 13:45:22 -08:00
Kevin Sawicki
eb260c3593 Update parameter prefix 2017-02-23 13:03:22 -08:00
popod
ea3b14f0bb update startDrag(item) doc
add doc for `files` option
2017-02-23 21:28:36 +01:00
Zeke Sikelianos
7c4529a01a clarify actions that cause app.activate event to be emitted 2017-02-22 16:42:34 -08:00
Kevin Sawicki
62f4a77755 Merge pull request #8702 from electron/async-menu-popup
Add async menu.popup option
2017-02-22 12:50:57 -08:00
Kevin Sawicki
211bedf910 Invoke close callback after itemSelected runs 2017-02-22 11:47:58 -08:00
Kevin Sawicki
d0b07d5c36 Check that x is non-null 2017-02-22 10:49:25 -08:00
Kevin Sawicki
a8d1a7aed4 Make variables private instead of protected 2017-02-22 10:30:28 -08:00
Kevin Sawicki
2006e22aa4 🎨 2017-02-22 10:30:28 -08:00
Kevin Sawicki
6c6506e5aa Document menu.closePopup 2017-02-22 10:30:28 -08:00
Kevin Sawicki
ce5ac1b056 Implement ClosePopupAt on Windows/Linux 2017-02-22 10:30:28 -08:00
Kevin Sawicki
91d1af053f Implement Menu.closePopup on Windows/Linux 2017-02-22 10:30:28 -08:00
Kevin Sawicki
0a5ccdccb4 Add spec for async Menu.popup 2017-02-22 10:30:28 -08:00
Kevin Sawicki
6a023dc4fe Add Menu.closePopup API on macOS 2017-02-22 10:30:28 -08:00
Kevin Sawicki
947556a23f Move MenuItem spec into root describe 2017-02-22 10:30:28 -08:00
Kevin Sawicki
55f90b4a4b Add new menu.popup signature to planned breaking changes 2017-02-22 10:30:28 -08:00
Kevin Sawicki
d686cf77e9 Update menu.popup docs to take options object 2017-02-22 10:30:28 -08:00
Kevin Sawicki
66b6b4f1cb Map async option to MenuRunner::ASYNC flag 2017-02-22 10:30:28 -08:00
Kevin Sawicki
4430927f98 Add async option to menu.popup 2017-02-22 10:30:28 -08:00
Kevin Sawicki
b091d104f5 Add async menu.popup on Windows/Linux 2017-02-22 10:30:28 -08:00
Kevin Sawicki
636ef0fd29 Add async menu.popup on macOS 2017-02-22 10:30:28 -08:00
Kevin Sawicki
85bdce0722 Merge pull request #8731 from herrmannplatz/patch-1
update setCertificateVerifyProc example
2017-02-22 08:22:21 -08:00
Kevin Sawicki
91bd95a0b2 Add space after if 2017-02-22 08:11:21 -08:00
René Herrmann
c4280612c1 update setCertificateVerifyProc example
setCertificateVerifyProc example should reflect new api
2017-02-22 11:49:14 +01:00
Lasse Jacobs
e5d82edf5d 📝 Add glossary.md to dutch translations part1
[ci skip] Add glossary.md with the first 8 topics.
2017-02-21 14:54:00 -08:00
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
liusi
d56c1909df only emit download-item done event once. 2017-02-14 14:39:33 +08: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
Jacob Groundwater
b8e12a0d21 Update ISSUE_TEMPLATE.md 2017-02-06 14:57:04 -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
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
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
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
deepak1556
bd34db256b browser: fix race in creation of default browser context by AtomAccessTokenStore 2016-10-15 01:00:54 +05:30
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
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
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
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
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
720 changed files with 29573 additions and 8338 deletions

3
.gitignore vendored
View File

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

5
.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
@@ -22,3 +22,6 @@
[submodule "vendor/boto"]
path = vendor/boto
url = https://github.com/boto/boto.git
[submodule "vendor/pdf_viewer"]
path = vendor/pdf_viewer
url = https://github.com/electron/pdf-viewer.git

View File

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

View File

@@ -1,2 +1,35 @@
<!--
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
<!--
Your best chance of getting this bug looked at quickly is to provide a REPOSITORY that can be cloned and run.
You can fork https://github.com/electron/electron-quick-start and include a link to the branch with your changes.
If you provide a URL, please list the commands required to clone/setup/run your repo e.g.
$ git clone $YOUR_URL -b $BRANCH
$ npm install
$ npm start || electron .
-->

View File

@@ -1,4 +1,4 @@
Copyright (c) 2016 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

@@ -1,16 +1,16 @@
[![Electron Logo](http://electron.atom.io/images/electron-logo.svg)](http://electron.atom.io/)
[![Electron Logo](https://electron.atom.io/images/electron-logo.svg)](https://electron.atom.io/)
[![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)
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/bc56v83355fi3369/branch/master?svg=true)](https://ci.appveyor.com/project/electron-bot/electron/branch/master)
[![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) | [Spanish](https://github.com/electron/electron/tree/master/docs-translations/es/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
[Chromium](http://www.chromium.org) and is used by the [Atom
editor](https://github.com/atom/atom) and many other [apps](http://electron.atom.io/apps).
editor](https://github.com/atom/atom) and many other [apps](https://electron.atom.io/apps).
Follow [@ElectronJS](https://twitter.com/electronjs) on Twitter for important
announcements.
@@ -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,7 +74,7 @@ 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)*
@@ -82,4 +83,6 @@ for a community maintained list of useful example apps, tools and resources.
## License
MIT © 2016 Github
[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

@@ -7,6 +7,7 @@
#include <string>
#include <vector>
#include "atom/common/atom_constants.h"
#include "atom/common/atom_version.h"
#include "atom/common/chrome_version.h"
#include "atom/common/options_switches.h"
@@ -18,12 +19,13 @@
#include "content/public/common/content_constants.h"
#include "content/public/common/pepper_plugin_info.h"
#include "content/public/common/user_agent.h"
#include "pdf/pdf.h"
#include "ppapi/shared_impl/ppapi_permissions.h"
#include "third_party/widevine/cdm/stub/widevine_cdm_version.h"
#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 +73,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;
@@ -108,6 +110,25 @@ content::PepperPluginInfo CreateWidevineCdmInfo(const base::FilePath& path,
}
#endif
void ComputeBuiltInPlugins(std::vector<content::PepperPluginInfo>* plugins) {
content::PepperPluginInfo pdf_info;
pdf_info.is_internal = true;
pdf_info.is_out_of_process = true;
pdf_info.name = "Chromium PDF Viewer";
pdf_info.description = "Portable Document Format";
pdf_info.path = base::FilePath::FromUTF8Unsafe(kPdfPluginPath);
content::WebPluginMimeType pdf_mime_type(kPdfPluginMimeType, "pdf",
"Portable Document Format");
pdf_info.mime_types.push_back(pdf_mime_type);
pdf_info.internal_entry_points.get_interface = chrome_pdf::PPP_GetInterface;
pdf_info.internal_entry_points.initialize_module =
chrome_pdf::PPP_InitializeModule;
pdf_info.internal_entry_points.shutdown_module =
chrome_pdf::PPP_ShutdownModule;
pdf_info.permissions = ppapi::PERMISSION_PRIVATE | ppapi::PERMISSION_DEV;
plugins->push_back(pdf_info);
}
void ConvertStringWithSeparatorToVector(std::vector<std::string>* vec,
const char* separator,
const char* cmd_switch) {
@@ -135,7 +156,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,9 +208,10 @@ 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
ComputeBuiltInPlugins(plugins);
}
void AtomContentClient::AddServiceWorkerSchemes(
@@ -197,11 +219,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

@@ -102,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);

View File

@@ -7,18 +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"
#if defined(OS_WIN)
#include "atom/common/api/atom_bindings.h"
#include "atom/common/native_mate_converters/string16_converter.h"
#include "native_mate/dictionary.h"
#endif
#include "atom/common/node_includes.h"
@@ -48,19 +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()));
#if defined(OS_WIN)
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,6 +30,8 @@
#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"
@@ -298,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;
}
@@ -312,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 {
@@ -321,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")
@@ -378,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;
}
@@ -436,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) {
@@ -528,12 +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,
const std::vector<base::string16>& features,
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 =
@@ -545,7 +599,8 @@ void App::OnCreateWindow(const GURL& target_url,
api_web_contents->OnCreateWindow(target_url,
frame_name,
disposition,
features);
features,
body);
}
}
@@ -558,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",
@@ -571,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(
@@ -718,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,
@@ -806,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));
@@ -839,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)
@@ -875,7 +972,8 @@ void App::BuildPrototype(
.SetMethod("isAccessibilitySupportEnabled",
&App::IsAccessibilitySupportEnabled)
.SetMethod("disableHardwareAcceleration",
&App::DisableHardwareAcceleration);
&App::DisableHardwareAcceleration)
.SetMethod("getFileIcon", &App::GetFileIcon);
}
} // namespace api

View File

@@ -10,8 +10,11 @@
#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"
@@ -42,18 +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,
const std::vector<base::string16>& features,
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(
@@ -96,8 +104,8 @@ 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,
@@ -121,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.
@@ -140,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

@@ -69,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

@@ -56,19 +56,20 @@ struct Converter<net::CanonicalCookie> {
};
template<>
struct Converter<AtomCookieDelegate::ChangeCause> {
struct Converter<net::CookieStore::ChangeCause> {
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate,
const AtomCookieDelegate::ChangeCause& val) {
const net::CookieStore::ChangeCause& val) {
switch (val) {
case AtomCookieDelegate::ChangeCause::CHANGE_COOKIE_EXPLICIT:
case net::CookieStore::ChangeCause::INSERTED:
case net::CookieStore::ChangeCause::EXPLICIT:
return mate::StringToV8(isolate, "explicit");
case AtomCookieDelegate::ChangeCause::CHANGE_COOKIE_OVERWRITE:
case net::CookieStore::ChangeCause::OVERWRITE:
return mate::StringToV8(isolate, "overwrite");
case AtomCookieDelegate::ChangeCause::CHANGE_COOKIE_EXPIRED:
case net::CookieStore::ChangeCause::EXPIRED:
return mate::StringToV8(isolate, "expired");
case AtomCookieDelegate::ChangeCause::CHANGE_COOKIE_EVICTED:
case net::CookieStore::ChangeCause::EVICTED:
return mate::StringToV8(isolate, "evicted");
case AtomCookieDelegate::ChangeCause::CHANGE_COOKIE_EXPIRED_OVERWRITE:
case net::CookieStore::ChangeCause::EXPIRED_OVERWRITE:
return mate::StringToV8(isolate, "expired-overwrite");
default:
return mate::StringToV8(isolate, "unknown");
@@ -266,7 +267,7 @@ void Cookies::Set(const base::DictionaryValue& details,
void Cookies::OnCookieChanged(const net::CanonicalCookie& cookie,
bool removed,
AtomCookieDelegate::ChangeCause cause) {
net::CookieStore::ChangeCause cause) {
Emit("changed", cookie, cause, removed);
}

View File

@@ -57,7 +57,7 @@ class Cookies : public mate::TrackableObject<Cookies>,
// AtomCookieDelegate::Observer:
void OnCookieChanged(const net::CanonicalCookie& cookie,
bool removed,
AtomCookieDelegate::ChangeCause cause) override;
net::CookieStore::ChangeCause cause) override;
private:
net::URLRequestContextGetter* request_context_getter_;

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,8 +10,8 @@
#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 "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"
@@ -78,9 +78,9 @@ DownloadItem::~DownloadItem() {
void DownloadItem::OnDownloadUpdated(content::DownloadItem* item) {
if (download_item_->IsDone()) {
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());
}
@@ -110,7 +110,6 @@ bool DownloadItem::CanResume() const {
void DownloadItem::Cancel() {
download_item_->Cancel(true);
download_item_->Remove();
}
int64_t DownloadItem::GetReceivedBytes() const {
@@ -146,6 +145,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();
}
@@ -162,6 +165,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) {
@@ -180,10 +195,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

@@ -176,7 +176,8 @@ void Menu::BuildPrototype(v8::Isolate* isolate,
.SetMethod("isItemCheckedAt", &Menu::IsItemCheckedAt)
.SetMethod("isEnabledAt", &Menu::IsEnabledAt)
.SetMethod("isVisibleAt", &Menu::IsVisibleAt)
.SetMethod("popupAt", &Menu::PopupAt);
.SetMethod("popupAt", &Menu::PopupAt)
.SetMethod("closePopupAt", &Menu::ClosePopupAt);
}
} // namespace api

View File

@@ -53,9 +53,9 @@ class Menu : public mate::TrackableObject<Menu>,
void ExecuteCommand(int command_id, int event_flags) override;
void MenuWillShow(ui::SimpleMenuModel* source) override;
virtual void PopupAt(Window* window,
int x = -1, int y = -1,
int positioning_item = 0) = 0;
virtual void PopupAt(
Window* window, int x, int y, int positioning_item, bool async) = 0;
virtual void ClosePopupAt(int32_t window_id) = 0;
std::unique_ptr<AtomMenuModel> model_;
Menu* parent_;

View File

@@ -7,10 +7,13 @@
#include "atom/browser/api/atom_api_menu.h"
#include <map>
#include <string>
#import "atom/browser/ui/cocoa/atom_menu_controller.h"
using base::scoped_nsobject;
namespace atom {
namespace api {
@@ -19,15 +22,25 @@ class MenuMac : public Menu {
protected:
MenuMac(v8::Isolate* isolate, v8::Local<v8::Object> wrapper);
void PopupAt(Window* window, int x, int y, int positioning_item) override;
base::scoped_nsobject<AtomMenuController> menu_controller_;
void PopupAt(
Window* window, int x, int y, int positioning_item, bool async) override;
void PopupOnUI(const base::WeakPtr<NativeWindow>& native_window,
int32_t window_id, int x, int y, int positioning_item,
bool async);
void ClosePopupAt(int32_t window_id) override;
private:
friend class Menu;
static void SendActionToFirstResponder(const std::string& action);
scoped_nsobject<AtomMenuController> menu_controller_;
// window ID -> open context menu
std::map<int32_t, scoped_nsobject<AtomMenuController>> popup_controllers_;
base::WeakPtrFactory<MenuMac> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(MenuMac);
};

View File

@@ -6,35 +6,58 @@
#include "atom/browser/native_window.h"
#include "atom/browser/unresponsive_suppressor.h"
#include "base/mac/scoped_sending_event.h"
#include "base/message_loop/message_loop.h"
#include "base/strings/sys_string_conversions.h"
#include "brightray/browser/inspectable_web_contents.h"
#include "brightray/browser/inspectable_web_contents_view.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/web_contents.h"
#include "atom/common/node_includes.h"
using content::BrowserThread;
namespace atom {
namespace api {
MenuMac::MenuMac(v8::Isolate* isolate, v8::Local<v8::Object> wrapper)
: Menu(isolate, wrapper) {
: Menu(isolate, wrapper),
weak_factory_(this) {
}
void MenuMac::PopupAt(Window* window, int x, int y, int positioning_item) {
void MenuMac::PopupAt(
Window* window, int x, int y, int positioning_item, bool async) {
NativeWindow* native_window = window->window();
if (!native_window)
return;
auto popup = base::Bind(&MenuMac::PopupOnUI, weak_factory_.GetWeakPtr(),
native_window->GetWeakPtr(), window->ID(), x, y,
positioning_item, async);
if (async)
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, popup);
else
popup.Run();
}
void MenuMac::PopupOnUI(const base::WeakPtr<NativeWindow>& native_window,
int32_t window_id, int x, int y, int positioning_item,
bool async) {
if (!native_window)
return;
brightray::InspectableWebContents* web_contents =
native_window->inspectable_web_contents();
if (!web_contents)
return;
base::scoped_nsobject<AtomMenuController> menu_controller(
[[AtomMenuController alloc] initWithModel:model_.get()
auto close_callback = base::Bind(&MenuMac::ClosePopupAt,
weak_factory_.GetWeakPtr(), window_id);
popup_controllers_[window_id] = base::scoped_nsobject<AtomMenuController>(
[[AtomMenuController alloc] initWithModel:model()
useDefaultAccelerator:NO]);
NSMenu* menu = [menu_controller menu];
NSMenu* menu = [popup_controllers_[window_id] menu];
NSView* view = web_contents->GetView()->GetNativeView();
// Which menu item to show.
@@ -69,11 +92,33 @@ void MenuMac::PopupAt(Window* window, int x, int y, int positioning_item) {
if (rightmostMenuPoint > screenRight)
position.x = position.x - [menu size].width;
// Don't emit unresponsive event when showing menu.
atom::UnresponsiveSuppressor suppressor;
// Show the menu.
[menu popUpMenuPositioningItem:item atLocation:position inView:view];
if (async) {
[popup_controllers_[window_id] setCloseCallback:close_callback];
// Make sure events can be pumped while the menu is up.
base::MessageLoop::ScopedNestableTaskAllower allow(
base::MessageLoop::current());
// One of the events that could be pumped is |window.close()|.
// User-initiated event-tracking loops protect against this by
// setting flags in -[CrApplication sendEvent:], but since
// web-content menus are initiated by IPC message the setup has to
// be done manually.
base::mac::ScopedSendingEvent sendingEventScoper;
// Don't emit unresponsive event when showing menu.
atom::UnresponsiveSuppressor suppressor;
[menu popUpMenuPositioningItem:item atLocation:position inView:view];
} else {
// Don't emit unresponsive event when showing menu.
atom::UnresponsiveSuppressor suppressor;
[menu popUpMenuPositioningItem:item atLocation:position inView:view];
close_callback.Run();
}
}
void MenuMac::ClosePopupAt(int32_t window_id) {
popup_controllers_.erase(window_id);
}
// static

View File

@@ -8,17 +8,20 @@
#include "atom/browser/unresponsive_suppressor.h"
#include "content/public/browser/render_widget_host_view.h"
#include "ui/display/screen.h"
#include "ui/views/controls/menu/menu_runner.h"
using views::MenuRunner;
namespace atom {
namespace api {
MenuViews::MenuViews(v8::Isolate* isolate, v8::Local<v8::Object> wrapper)
: Menu(isolate, wrapper) {
: Menu(isolate, wrapper),
weak_factory_(this) {
}
void MenuViews::PopupAt(Window* window, int x, int y, int positioning_item) {
void MenuViews::PopupAt(
Window* window, int x, int y, int positioning_item, bool async) {
NativeWindow* native_window = static_cast<NativeWindow*>(window->window());
if (!native_window)
return;
@@ -38,14 +41,20 @@ void MenuViews::PopupAt(Window* window, int x, int y, int positioning_item) {
location = gfx::Point(origin.x() + x, origin.y() + y);
}
int flags = MenuRunner::CONTEXT_MENU | MenuRunner::HAS_MNEMONICS;
if (async)
flags |= MenuRunner::ASYNC;
// Don't emit unresponsive event when showing menu.
atom::UnresponsiveSuppressor suppressor;
// Show the menu.
views::MenuRunner menu_runner(
model(),
views::MenuRunner::CONTEXT_MENU | views::MenuRunner::HAS_MNEMONICS);
ignore_result(menu_runner.RunMenuAt(
int32_t window_id = window->ID();
auto close_callback = base::Bind(
&MenuViews::ClosePopupAt, weak_factory_.GetWeakPtr(), window_id);
menu_runners_[window_id] = std::unique_ptr<MenuRunner>(new MenuRunner(
model(), flags, close_callback));
ignore_result(menu_runners_[window_id]->RunMenuAt(
static_cast<NativeWindowViews*>(window->window())->widget(),
NULL,
gfx::Rect(location, gfx::Size()),
@@ -53,6 +62,10 @@ void MenuViews::PopupAt(Window* window, int x, int y, int positioning_item) {
ui::MENU_SOURCE_MOUSE));
}
void MenuViews::ClosePopupAt(int32_t window_id) {
menu_runners_.erase(window_id);
}
// static
mate::WrappableBase* Menu::New(mate::Arguments* args) {
return new MenuViews(args->isolate(), args->GetThis());

View File

@@ -5,8 +5,12 @@
#ifndef ATOM_BROWSER_API_ATOM_API_MENU_VIEWS_H_
#define ATOM_BROWSER_API_ATOM_API_MENU_VIEWS_H_
#include <map>
#include "atom/browser/api/atom_api_menu.h"
#include "base/memory/weak_ptr.h"
#include "ui/display/screen.h"
#include "ui/views/controls/menu/menu_runner.h"
namespace atom {
@@ -17,9 +21,16 @@ class MenuViews : public Menu {
MenuViews(v8::Isolate* isolate, v8::Local<v8::Object> wrapper);
protected:
void PopupAt(Window* window, int x, int y, int positioning_item) override;
void PopupAt(
Window* window, int x, int y, int positioning_item, bool async) override;
void ClosePopupAt(int32_t window_id) override;
private:
// window ID -> open context menu
std::map<int32_t, std::unique_ptr<views::MenuRunner>> menu_runners_;
base::WeakPtrFactory<MenuViews> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(MenuViews);
};

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

@@ -11,6 +11,8 @@
#include "atom/common/node_includes.h"
using content::BrowserThread;
namespace mate {
template<>
@@ -76,10 +78,8 @@ void PowerSaveBlocker::UpdatePowerSaveBlocker() {
new_blocker_type,
device::PowerSaveBlocker::kReasonOther,
ATOM_PRODUCT_NAME,
content::BrowserThread::GetMessageLoopProxyForThread(
content::BrowserThread::UI),
content::BrowserThread::GetMessageLoopProxyForThread(
content::BrowserThread::FILE)));
BrowserThread::GetTaskRunnerForThread(BrowserThread::UI),
BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE)));
power_save_blocker_.swap(new_blocker);
current_blocker_type_ = new_blocker_type;
}

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

@@ -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"
@@ -61,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) {
@@ -99,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) {
@@ -130,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,
@@ -161,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 {
@@ -211,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)
@@ -228,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(
@@ -313,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) {
@@ -331,6 +416,25 @@ 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)
@@ -357,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();
@@ -389,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(),
@@ -481,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,
@@ -520,6 +645,37 @@ void Session::GetBlobData(
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 = Cookies::Create(isolate, browser_context());
@@ -594,15 +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);

View File

@@ -74,11 +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

@@ -14,11 +14,7 @@ namespace atom {
namespace api {
SystemPreferences::SystemPreferences(v8::Isolate* isolate)
#if defined(OS_WIN)
: color_change_listener_(this)
#endif
{
SystemPreferences::SystemPreferences(v8::Isolate* isolate) {
Init(isolate);
#if defined(OS_WIN)
InitializeWindow();
@@ -26,6 +22,9 @@ SystemPreferences::SystemPreferences(v8::Isolate* isolate)
}
SystemPreferences::~SystemPreferences() {
#if defined(OS_WIN)
Browser::Get()->RemoveObserver(this);
#endif
}
#if !defined(OS_MACOSX)
@@ -67,6 +66,7 @@ void SystemPreferences::BuildPrototype(
.SetMethod("unsubscribeLocalNotification",
&SystemPreferences::UnsubscribeLocalNotification)
.SetMethod("getUserDefault", &SystemPreferences::GetUserDefault)
.SetMethod("setUserDefault", &SystemPreferences::SetUserDefault)
.SetMethod("isSwipeTrackingFromScrollEventsEnabled",
&SystemPreferences::IsSwipeTrackingFromScrollEventsEnabled)
#endif

View File

@@ -13,6 +13,8 @@
#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
@@ -26,6 +28,7 @@ namespace api {
class SystemPreferences : public mate::EventEmitter<SystemPreferences>
#if defined(OS_WIN)
, public BrowserObserver
, public gfx::SysColorChangeListener
#endif
{
@@ -51,6 +54,9 @@ class SystemPreferences : public mate::EventEmitter<SystemPreferences>
// 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&)>;
@@ -67,6 +73,9 @@ 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();
@@ -108,7 +117,7 @@ class SystemPreferences : public mate::EventEmitter<SystemPreferences>
bool invertered_color_scheme_;
gfx::ScopedSysColorChangeListener color_change_listener_;
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

@@ -117,6 +117,14 @@ std::string SystemPreferences::GetColor(const std::string& color,
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,
@@ -172,6 +180,11 @@ void SystemPreferences::OnSysColorChange() {
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,15 +35,18 @@
#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/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/frame_host/navigation_entry_impl.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"
@@ -52,6 +55,9 @@
#include "content/public/browser/navigation_details.h"
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/navigation_handle.h"
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_source.h"
#include "content/public/browser/notification_types.h"
#include "content/public/browser/plugin_service.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
@@ -66,10 +72,9 @@
#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)
@@ -130,43 +135,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;
case SAVE_TO_DISK: disposition = "save-to-disk"; 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,
@@ -255,6 +246,22 @@ void OnCapturePageDone(base::Callback<void(const gfx::Image&)> callback,
callback.Run(gfx::Image::CreateFrom1xBitmap(bitmap));
}
// Set the background color of RenderWidgetHostView.
void SetBackgroundColor(content::WebContents* web_contents) {
const auto view = web_contents->GetRenderWidgetHostView();
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);
}
}
}
} // namespace
WebContents::WebContents(v8::Isolate* isolate,
@@ -262,11 +269,11 @@ WebContents::WebContents(v8::Isolate* isolate,
Type type)
: content::WebContentsObserver(web_contents),
embedder_(nullptr),
zoom_controller_(nullptr),
type_(type),
request_id_(0),
background_throttling_(true),
enable_devtools_(true) {
if (type == REMOTE) {
web_contents->SetUserAgentOverride(GetBrowserContext()->GetUserAgent());
Init(isolate);
@@ -279,9 +286,9 @@ WebContents::WebContents(v8::Isolate* isolate,
}
}
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),
@@ -351,7 +358,7 @@ void WebContents::InitWithSessionAndOptions(v8::Isolate* isolate,
content::WebContents *web_contents,
mate::Handle<api::Session> session,
const mate::Dictionary& options) {
Observe(web_contents);
content::WebContentsObserver::Observe(web_contents);
InitWithWebContents(web_contents, session->browser_context());
managed_web_contents()->GetView()->SetDelegate(this);
@@ -359,10 +366,16 @@ void WebContents::InitWithSessionAndOptions(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());
@@ -381,6 +394,11 @@ void WebContents::InitWithSessionAndOptions(v8::Isolate* isolate,
SetOwnerWindow(owner_window);
}
const content::NavigationController* controller =
&web_contents->GetController();
registrar_.Add(this, content::NOTIFICATION_NAV_ENTRY_PENDING,
content::Source<content::NavigationController>(controller));
Init(isolate);
AttachAsUserData(web_contents);
}
@@ -401,11 +419,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 {
@@ -414,17 +432,20 @@ bool WebContents::AddMessageToConsole(content::WebContents* source,
}
}
void WebContents::OnCreateWindow(const GURL& target_url,
const std::string& frame_name,
WindowOpenDisposition disposition,
const std::vector<base::string16>& features) {
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, features);
Emit("-new-window", target_url, frame_name, disposition, features, body);
else
Emit("new-window", target_url, frame_name, disposition, features);
}
void WebContents::WebContentsCreated(content::WebContents* source_contents,
int opener_render_process_id,
int opener_render_frame_id,
const std::string& frame_name,
const GURL& target_url,
@@ -444,15 +465,17 @@ void WebContents::AddNewContents(content::WebContents* source,
v8::Locker locker(isolate());
v8::HandleScope handle_scope(isolate());
auto api_web_contents = CreateFrom(isolate(), new_contents);
Emit("-add-new-contents", api_web_contents, disposition, user_gesture,
if (Emit("-add-new-contents", api_web_contents, disposition, user_gesture,
initial_rect.x(), initial_rect.y(), initial_rect.width(),
initial_rect.height());
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
@@ -464,6 +487,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);
}
@@ -513,6 +541,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 =
@@ -536,7 +575,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);
@@ -622,6 +663,14 @@ 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());
}
@@ -638,11 +687,13 @@ 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");
}
@@ -696,7 +747,6 @@ void WebContents::DidGetResourceResponseStart(
}
void WebContents::DidGetRedirectForResourceRequest(
content::RenderFrameHost* render_frame_host,
const content::ResourceRedirectDetails& details) {
Emit("did-get-redirect-request",
details.url,
@@ -708,6 +758,30 @@ void WebContents::DidGetRedirectForResourceRequest(
details.headers.get());
}
void WebContents::DidStartNavigation(
content::NavigationHandle* navigation_handle) {
if (!navigation_handle->IsInMainFrame() || navigation_handle->IsSamePage())
return;
if (deferred_load_url_.id) {
auto web_contents = navigation_handle->GetWebContents();
auto& controller = web_contents->GetController();
int id = controller.GetPendingEntry()->GetUniqueID();
if (id == deferred_load_url_.id) {
if (!deferred_load_url_.params.url.is_empty()) {
auto params = deferred_load_url_.params;
deferred_load_url_.id = 0;
deferred_load_url_.params =
content::NavigationController::LoadURLParams(GURL());
controller.LoadURLWithParams(params);
SetBackgroundColor(web_contents);
} else {
deferred_load_url_.id = 0;
}
}
}
}
void WebContents::DidFinishNavigation(
content::NavigationHandle* navigation_handle) {
bool is_main_frame = navigation_handle->IsInMainFrame();
@@ -752,6 +826,32 @@ void WebContents::DidUpdateFaviconURL(
Emit("page-favicon-updated", unique_urls);
}
void WebContents::Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
switch (type) {
case content::NOTIFICATION_NAV_ENTRY_PENDING: {
content::NavigationEntry* entry =
content::Details<content::NavigationEntry>(details).ptr();
content::NavigationEntryImpl* entry_impl =
static_cast<content::NavigationEntryImpl*>(entry);
// In NavigatorImpl::DidStartMainFrameNavigation when there is no
// browser side pending entry available it creates a new one based
// on existing pending entry, hence we track the unique id here
// instead in WebContents::LoadURL with controller.GetPendingEntry()
// TODO(deepak1556): Remove once we have
// https://codereview.chromium.org/2661743002.
if (entry_impl->frame_tree_node_id() == -1) {
deferred_load_url_.id = entry->GetUniqueID();
}
break;
}
default:
NOTREACHED();
break;
}
}
void WebContents::DevToolsReloadPage() {
Emit("devtools-reload-page");
}
@@ -794,6 +894,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)
@@ -829,7 +933,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(
@@ -858,7 +963,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),
@@ -882,29 +987,31 @@ 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;
}
GURL base_url_for_data_url;
if (options.Get("baseURLForDataURL", &base_url_for_data_url)) {
params.base_url_for_data_url = base_url_for_data_url;
params.load_type = content::NavigationController::LOAD_TYPE_DATA;
}
params.transition_type = ui::PAGE_TRANSITION_TYPED;
params.should_clear_history_list = true;
params.override_user_agent = content::NavigationController::UA_OVERRIDE_TRUE;
web_contents()->GetController().LoadURLWithParams(params);
// Set the background color of RenderWidgetHostView.
// 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 (deferred_load_url_.id) {
deferred_load_url_.params = params;
return;
}
// For the same reason we can only disable hidden here.
const auto host = static_cast<content::RenderWidgetHostImpl*>(
view->GetRenderWidgetHost());
host->disable_hidden_ = !background_throttling_;
web_contents()->GetController().LoadURLWithParams(params);
// We have to call it right after LoadURL because the RenderViewHost is only
// created after loading a page.
SetBackgroundColor(web_contents());
}
void WebContents::DownloadURL(const GURL& url) {
@@ -960,6 +1067,23 @@ void WebContents::GoToOffset(int offset) {
web_contents()->GetController().GoToOffset(offset);
}
const std::string WebContents::GetWebRTCIPHandlingPolicy() const {
return web_contents()->
GetMutableRendererPrefs()->webrtc_ip_handling_policy;
}
void WebContents::SetWebRTCIPHandlingPolicy(
const std::string& webrtc_ip_handling_policy) {
if (GetWebRTCIPHandlingPolicy() == webrtc_ip_handling_policy)
return;
web_contents()->GetMutableRendererPrefs()->webrtc_ip_handling_policy =
webrtc_ip_handling_policy;
content::RenderViewHost* host = web_contents()->GetRenderViewHost();
if (host)
host->SyncRendererPrefs();
}
bool WebContents::IsCrashed() const {
return web_contents()->IsCrashed();
}
@@ -973,10 +1097,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) {
@@ -1062,9 +1182,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() {
@@ -1076,7 +1194,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;
@@ -1121,7 +1239,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,
@@ -1327,17 +1447,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");
}
}
@@ -1463,13 +1591,47 @@ int WebContents::GetFrameRate() const {
}
void WebContents::Invalidate() {
if (!IsOffScreen())
return;
auto* osr_rwhv = static_cast<OffScreenRenderWidgetHostView*>(
if (IsOffScreen()) {
auto* osr_rwhv = static_cast<OffScreenRenderWidgetHostView*>(
web_contents()->GetRenderWidgetHostView());
if (osr_rwhv)
osr_rwhv->Invalidate();
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) {
@@ -1556,7 +1718,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)
@@ -1601,6 +1762,10 @@ void WebContents::BuildPrototype(v8::Isolate* isolate,
.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)
@@ -1617,6 +1782,10 @@ void WebContents::BuildPrototype(v8::Isolate* isolate,
.SetMethod("copyImageAt", &WebContents::CopyImageAt)
.SetMethod("capturePage", &WebContents::CapturePage)
.SetMethod("setEmbedder", &WebContents::SetEmbedder)
.SetMethod("setWebRTCIPHandlingPolicy",
&WebContents::SetWebRTCIPHandlingPolicy)
.SetMethod("getWebRTCIPHandlingPolicy",
&WebContents::GetWebRTCIPHandlingPolicy)
.SetProperty("id", &WebContents::ID)
.SetProperty("session", &WebContents::Session)
.SetProperty("hostWebContents", &WebContents::HostWebContents)

View File

@@ -13,6 +13,8 @@
#include "atom/browser/api/trackable_object.h"
#include "atom/browser/common_web_contents_delegate.h"
#include "content/common/cursors/webcursor.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
#include "content/public/browser/web_contents_observer.h"
#include "content/public/common/favicon_url.h"
#include "native_mate/handle.h"
@@ -26,6 +28,10 @@ namespace brightray {
class InspectableWebContents;
}
namespace content {
class ResourceRequestBodyImpl;
}
namespace mate {
class Arguments;
class Dictionary;
@@ -35,13 +41,15 @@ namespace atom {
struct SetSizeParams;
class AtomBrowserContext;
class WebContentsZoomController;
class WebViewGuestDelegate;
namespace api {
class WebContents : public mate::TrackableObject<WebContents>,
public CommonWebContentsDelegate,
public content::WebContentsObserver {
public content::WebContentsObserver,
public content::NotificationObserver {
public:
enum Type {
BACKGROUND_PAGE, // A DevTools extension background page.
@@ -84,6 +92,8 @@ class WebContents : public mate::TrackableObject<WebContents>,
void GoBack();
void GoForward();
void GoToOffset(int offset);
const std::string GetWebRTCIPHandlingPolicy() const;
void SetWebRTCIPHandlingPolicy(const std::string& webrtc_ip_handling_policy);
bool IsCrashed() const;
void SetUserAgent(const std::string& user_agent, mate::Arguments* args);
std::string GetUserAgent();
@@ -170,16 +180,24 @@ class WebContents : public mate::TrackableObject<WebContents>,
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,
const GURL& origin,
bool allowed);
// Create window with the given disposition.
void OnCreateWindow(const GURL& target_url,
const std::string& frame_name,
WindowOpenDisposition disposition,
const std::vector<base::string16>& features);
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);
@@ -194,6 +212,8 @@ 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,
@@ -207,12 +227,13 @@ class WebContents : public mate::TrackableObject<WebContents>,
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,
@@ -238,10 +259,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;
@@ -269,6 +295,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(
@@ -285,8 +312,9 @@ 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 DidStartNavigation(
content::NavigationHandle* navigation_handle) override;
void DidFinishNavigation(
content::NavigationHandle* navigation_handle) override;
bool OnMessageReceived(const IPC::Message& message) override;
@@ -298,10 +326,17 @@ 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;
// content::NotificationObserver:
void Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) override;
// brightray::InspectableWebContentsDelegate:
void DevToolsReloadPage() override;
@@ -311,6 +346,13 @@ class WebContents : public mate::TrackableObject<WebContents>,
void DevToolsClosed() override;
private:
struct LoadURLParams {
LoadURLParams() : params(GURL()), id(0) {}
content::NavigationController::LoadURLParams params;
int id;
};
AtomBrowserContext* GetBrowserContext() const;
uint32_t GetNextRequestId() {
@@ -329,6 +371,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_;
@@ -338,6 +388,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_;
@@ -350,6 +403,11 @@ class WebContents : public mate::TrackableObject<WebContents>,
// Whether to enable devtools.
bool enable_devtools_;
// Container to hold url parms for deferred load when
// there is a pending navigation entry.
LoadURLParams deferred_load_url_;
content::NotificationRegistrar registrar_;
DISALLOW_COPY_AND_ASSIGN(WebContents);
};

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,12 +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/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"
@@ -28,6 +30,7 @@
#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"
@@ -88,6 +91,13 @@ Window::Window(v8::Isolate* isolate, v8::Local<v8::Object> wrapper,
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);
}
@@ -143,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) {
@@ -176,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() {
@@ -271,6 +282,11 @@ void Window::OnExecuteWindowsCommand(const std::string& command_name) {
Emit("app-command", command_name);
}
void Window::OnTouchBarItemResult(const std::string& item_id,
const base::DictionaryValue& details) {
Emit("-touch-bar-interaction", item_id, details);
}
#if defined(OS_WIN)
void Window::OnWindowMessage(UINT message, WPARAM w_param, LPARAM l_param) {
if (IsWindowMessageHooked(message)) {
@@ -501,8 +517,17 @@ bool Window::IsClosable() {
void Window::SetAlwaysOnTop(bool top, mate::Arguments* args) {
std::string level = "floating";
int relativeLevel = 0;
std::string error;
args->GetNext(&level);
window_->SetAlwaysOnTop(top, level);
args->GetNext(&relativeLevel);
window_->SetAlwaysOnTop(top, level, relativeLevel, &error);
if (!error.empty()) {
args->ThrowError(error);
}
}
bool Window::IsAlwaysOnTop() {
@@ -708,6 +733,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)
@@ -729,6 +773,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()) {
@@ -779,6 +834,25 @@ 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);
}
void Window::SetTouchBar(const std::vector<mate::PersistentDictionary>& items) {
window_->SetTouchBar(items);
}
void Window::RefreshTouchBarItem(const std::string& item_id) {
window_->RefreshTouchBarItem(item_id);
}
int32_t Window::ID() const {
return weak_map_id();
}
@@ -825,6 +899,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
@@ -893,6 +969,12 @@ 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)
.SetMethod("_setTouchBarItems", &Window::SetTouchBar)
.SetMethod("_refreshTouchBarItem", &Window::RefreshTouchBarItem)
#if defined(OS_WIN)
.SetMethod("hookWindowMessage", &Window::HookWindowMessage)
.SetMethod("isWindowMessageHooked", &Window::IsWindowMessageHooked)
@@ -900,6 +982,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

@@ -16,6 +16,7 @@
#include "atom/common/api/atom_api_native_image.h"
#include "atom/common/key_weak_map.h"
#include "native_mate/handle.h"
#include "native_mate/persistent_dictionary.h"
#include "ui/gfx/image/image.h"
class GURL;
@@ -51,6 +52,8 @@ class Window : public mate::TrackableObject<Window>,
NativeWindow* window() const { return window_.get(); }
int32_t ID() const;
protected:
Window(v8::Isolate* isolate, v8::Local<v8::Object> wrapper,
const mate::Dictionary& options);
@@ -83,6 +86,8 @@ class Window : public mate::TrackableObject<Window>,
void OnRendererUnresponsive() override;
void OnRendererResponsive() override;
void OnExecuteWindowsCommand(const std::string& command_name) override;
void OnTouchBarItemResult(const std::string& item_id,
const base::DictionaryValue& details) override;
#if defined(OS_WIN)
void OnWindowMessage(UINT message, WPARAM w_param, LPARAM l_param) override;
@@ -170,6 +175,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;
@@ -186,6 +193,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)
@@ -195,7 +203,12 @@ class Window : public mate::TrackableObject<Window>,
void SetVisibleOnAllWorkspaces(bool visible);
bool IsVisibleOnAllWorkspaces();
int32_t ID() const;
void SetAutoHideCursor(bool auto_hide);
void SetVibrancy(mate::Arguments* args);
void SetTouchBar(const std::vector<mate::PersistentDictionary>& items);
void RefreshTouchBarItem(const std::string& item_id);
v8::Local<v8::Value> WebContents(v8::Isolate* isolate);
// Remove this window from parent window's |child_windows_|.

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

@@ -11,28 +11,31 @@
#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 {
// 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 content::AccessTokenStore::LoadAccessTokensCallback& callback)
const device::AccessTokenStore::LoadAccessTokensCallback& callback)
: callback_(callback), request_context_getter_(nullptr) {}
void Run() {
BrowserThread::PostTaskAndReply(
BrowserThread::UI,
FROM_HERE,
base::Bind(&TokenLoadingJob::PerformWorkOnUIThread, this),
base::Bind(&TokenLoadingJob::RespondOnOriginatingThread, this));
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:
@@ -40,20 +43,11 @@ class TokenLoadingJob : public base::RefCountedThreadSafe<TokenLoadingJob> {
~TokenLoadingJob() {}
void PerformWorkOnUIThread() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
auto browser_context = AtomBrowserContext::From("", false);
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;
}
void RespondOnOriginatingThread() {
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.
content::AccessTokenStore::AccessTokenMap access_token_map;
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);
@@ -61,15 +55,16 @@ class TokenLoadingJob : public base::RefCountedThreadSafe<TokenLoadingJob> {
callback_.Run(access_token_map, request_context_getter_);
}
content::AccessTokenStore::LoadAccessTokensCallback callback_;
device::AccessTokenStore::LoadAccessTokensCallback callback_;
net::URLRequestContextGetter* request_context_getter_;
std::string api_key_;
};
} // namespace
} // namespace internal
AtomAccessTokenStore::AtomAccessTokenStore() {
content::GeolocationProvider::GetInstance()->UserDidOptIntoLocationServices();
browser_context_ = AtomBrowserContext::From("", false);
device::GeolocationProvider::GetInstance()->UserDidOptIntoLocationServices();
}
AtomAccessTokenStore::~AtomAccessTokenStore() {
@@ -77,8 +72,16 @@ AtomAccessTokenStore::~AtomAccessTokenStore() {
void AtomAccessTokenStore::LoadAccessTokens(
const LoadAccessTokensCallback& callback) {
scoped_refptr<TokenLoadingJob> job(new TokenLoadingJob(callback));
job->Run();
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,

View File

@@ -5,22 +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 RunTokenLoadingJob(scoped_refptr<internal::TokenLoadingJob> job);
scoped_refptr<AtomBrowserContext> browser_context_;
DISALLOW_COPY_AND_ASSIGN(AtomAccessTokenStore);
};

View File

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

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,9 +29,9 @@
#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/geolocation_delegate.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/resource_dispatcher_host.h"
@@ -55,19 +54,6 @@ bool g_suppress_renderer_process_restart = false;
// Custom schemes to be registered to handle service worker.
std::string g_custom_service_worker_schemes = "";
// A provider of Geolocation services to override AccessTokenStore.
class AtomGeolocationDelegate : public content::GeolocationDelegate {
public:
AtomGeolocationDelegate() = default;
content::AccessTokenStore* CreateAccessTokenStore() final {
return new AtomAccessTokenStore();
}
private:
DISALLOW_COPY_AND_ASSIGN(AtomGeolocationDelegate);
};
void Noop(scoped_refptr<content::SiteInstance>) {
}
@@ -92,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,
@@ -159,11 +145,6 @@ content::SpeechRecognitionManagerDelegate*
return new AtomSpeechRecognitionManagerDelegate;
}
content::GeolocationDelegate*
AtomBrowserClient::CreateGeolocationDelegate() {
return new AtomGeolocationDelegate();
}
void AtomBrowserClient::OverrideWebkitPrefs(
content::RenderViewHost* host, content::WebPreferences* prefs) {
prefs->javascript_enabled = true;
@@ -179,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.
@@ -233,7 +213,8 @@ void AtomBrowserClient::AppendExtraCommandLineSwitches(
// Copy following switches to child process.
static const char* const kCommonSwitchNames[] = {
switches::kStandardSchemes,
switches::kEnableSandbox
switches::kEnableSandbox,
switches::kSecureSchemes
};
command_line->CopySwitchesFrom(
*base::CommandLine::ForCurrentProcess(),
@@ -281,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);
}
}
@@ -313,12 +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<base::string16>& additional_features,
const std::vector<std::string>& additional_features,
const scoped_refptr<content::ResourceRequestBodyImpl>& body,
bool user_gesture,
bool opener_suppressed,
content::ResourceContext* context,
@@ -341,6 +323,7 @@ bool AtomBrowserClient::CanCreateWindow(
frame_name,
disposition,
additional_features,
body,
render_process_id,
opener_render_frame_id));
}

View File

@@ -50,7 +50,6 @@ class AtomBrowserClient : public brightray::BrowserClient,
void RenderProcessWillLaunch(content::RenderProcessHost* host) override;
content::SpeechRecognitionManagerDelegate*
CreateSpeechRecognitionManagerDelegate() override;
content::GeolocationDelegate* CreateGeolocationDelegate() override;
void OverrideWebkitPrefs(content::RenderViewHost* render_view_host,
content::WebPreferences* prefs) override;
std::string GetApplicationLocale() override;
@@ -72,30 +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,
const std::vector<base::string16>& additional_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;

View File

@@ -10,10 +10,11 @@
#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"
@@ -67,10 +68,11 @@ 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),
ct_delegate_(new AtomCTDelegate),
network_delegate_(new AtomNetworkDelegate),
cookie_delegate_(new AtomCookieDelegate) {
// Construct user agent string.
@@ -128,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(
@@ -151,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);
}
@@ -190,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() {
@@ -205,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());

View File

@@ -15,6 +15,7 @@
namespace atom {
class AtomBlobReader;
class AtomCTDelegate;
class AtomDownloadManagerDelegate;
class AtomNetworkDelegate;
class AtomPermissionManager;
@@ -40,8 +41,9 @@ class AtomBrowserContext : public brightray::BrowserContext {
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;
@@ -67,6 +69,7 @@ class AtomBrowserContext : public brightray::BrowserContext {
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_;

View File

@@ -5,33 +5,55 @@
#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/atom_web_ui_controller_factory.h"
#include "atom/browser/bridge_task_runner.h"
#include "atom/browser/browser.h"
#include "atom/browser/javascript_environment.h"
#include "atom/browser/node_debugger.h"
#include "atom/common/api/atom_bindings.h"
#include "atom/common/asar/asar_util.h"
#include "atom/common/node_bindings.h"
#include "atom/common/node_includes.h"
#include "base/command_line.h"
#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;
@@ -39,8 +61,8 @@ AtomBrowserMainParts::AtomBrowserMainParts()
: fake_browser_process_(new BrowserProcess),
exit_code_(nullptr),
browser_(new Browser),
node_bindings_(NodeBindings::Create(true)),
atom_bindings_(new AtomBindings),
node_bindings_(NodeBindings::Create(NodeBindings::BROWSER)),
atom_bindings_(new AtomBindings(uv_default_loop())),
gc_timer_(true, true) {
DCHECK(!self_) << "Cannot have two AtomBrowserMainParts";
self_ = this;
@@ -50,6 +72,7 @@ AtomBrowserMainParts::AtomBrowserMainParts()
}
AtomBrowserMainParts::~AtomBrowserMainParts() {
asar::ClearArchives();
// Leak the JavascriptEnvironment on exit.
// This is to work around the bug that V8 would be waiting for background
// tasks to finish on exit, while somehow it waits forever in Electron, more
@@ -112,10 +135,11 @@ void AtomBrowserMainParts::PostEarlyInitialization() {
// Create the global environment.
node::Environment* env =
node_bindings_->CreateEnvironment(js_env_->context());
node_env_.reset(new NodeEnvironment(env));
// 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 Electron extended APIs.
atom_bindings_->BindTo(js_env_->isolate(), env->process_object());
@@ -145,12 +169,15 @@ void AtomBrowserMainParts::PreMainMessageLoopRun() {
base::Bind(&v8::Isolate::LowMemoryNotification,
base::Unretained(js_env_->isolate())));
content::WebUIControllerFactory::RegisterFactory(
AtomWebUIControllerFactory::GetInstance());
brightray::BrowserMainParts::PreMainMessageLoopRun();
bridge_task_runner_->MessageLoopIsReady();
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 +198,8 @@ void AtomBrowserMainParts::PostMainMessageLoopStart() {
#if defined(OS_POSIX)
HandleShutdownSignals();
#endif
device::GeolocationProvider::SetGeolocationDelegate(
new AtomGeolocationDelegate());
}
void AtomBrowserMainParts::PostMainMessageLoopRun() {

View File

@@ -22,6 +22,7 @@ class Browser;
class JavascriptEnvironment;
class NodeBindings;
class NodeDebugger;
class NodeEnvironment;
class BridgeTaskRunner;
class AtomBrowserMainParts : public brightray::BrowserMainParts {
@@ -81,6 +82,7 @@ class AtomBrowserMainParts : public brightray::BrowserMainParts {
std::unique_ptr<JavascriptEnvironment> js_env_;
std::unique_ptr<NodeBindings> node_bindings_;
std::unique_ptr<AtomBindings> atom_bindings_;
std::unique_ptr<NodeEnvironment> node_env_;
std::unique_ptr<NodeDebugger> node_debugger_;
base::Timer gc_timer_;

View File

@@ -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

@@ -6,11 +6,15 @@
#include "atom/browser/login_handler.h"
#include "atom/browser/web_contents_permission_helper.h"
#include "atom/common/atom_constants.h"
#include "atom/common/platform_util.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/stream_info.h"
#include "net/base/escape.h"
#include "net/ssl/client_cert_store.h"
#include "net/url_request/url_request.h"
#include "url/gurl.h"
#if defined(USE_NSS_CERTS)
@@ -57,6 +61,23 @@ void HandleExternalProtocolInUI(
permission_helper->RequestOpenExternalPermission(callback, has_user_gesture);
}
void OnPdfResourceIntercepted(
const GURL& original_url,
const content::ResourceRequestInfo::WebContentsGetter&
web_contents_getter) {
content::WebContents* web_contents = web_contents_getter.Run();
if (!web_contents)
return;
// The URL passes the original pdf resource url, that will be requested
// by the webui page.
// chrome://pdf-viewer/index.html?src=https://somepage/123.pdf
content::NavigationController::LoadURLParams params(
GURL(base::StringPrintf("%sindex.html?%s=%s", kPdfViewerUIOrigin,
kPdfPluginSrc, original_url.spec().c_str())));
web_contents->GetController().LoadURLWithParams(params);
}
} // namespace
AtomResourceDispatcherHostDelegate::AtomResourceDispatcherHostDelegate() {
@@ -64,17 +85,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::ResourceContext* resource_context) {
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;
}
@@ -100,4 +116,23 @@ AtomResourceDispatcherHostDelegate::CreateClientCertStore(
#endif
}
bool AtomResourceDispatcherHostDelegate::ShouldInterceptResourceAsStream(
net::URLRequest* request,
const base::FilePath& plugin_path,
const std::string& mime_type,
GURL* origin,
std::string* payload) {
const content::ResourceRequestInfo* info =
content::ResourceRequestInfo::ForRequest(request);
if (mime_type == "application/pdf" && info->IsMainFrame()) {
*origin = GURL(kPdfViewerUIOrigin);
content::BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
base::Bind(&OnPdfResourceIntercepted, request->url(),
info->GetWebContentsGetterForRequest()));
return true;
}
return false;
}
} // namespace atom

View File

@@ -5,6 +5,8 @@
#ifndef ATOM_BROWSER_ATOM_RESOURCE_DISPATCHER_HOST_DELEGATE_H_
#define ATOM_BROWSER_ATOM_RESOURCE_DISPATCHER_HOST_DELEGATE_H_
#include <string>
#include "content/public/browser/resource_dispatcher_host_delegate.h"
namespace atom {
@@ -15,19 +17,21 @@ 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,
content::ResourceContext* resource_context) 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;
bool ShouldInterceptResourceAsStream(net::URLRequest* request,
const base::FilePath& plugin_path,
const std::string& mime_type,
GURL* origin,
std::string* payload) override;
private:
DISALLOW_COPY_AND_ASSIGN(AtomResourceDispatcherHostDelegate);
};
} // 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

@@ -0,0 +1,66 @@
// Copyright (c) 2017 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "atom/browser/atom_web_ui_controller_factory.h"
#include <string>
#include "atom/browser/ui/webui/pdf_viewer_ui.h"
#include "atom/common/atom_constants.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "content/public/browser/web_contents.h"
namespace atom {
// static
AtomWebUIControllerFactory* AtomWebUIControllerFactory::GetInstance() {
return base::Singleton<AtomWebUIControllerFactory>::get();
}
AtomWebUIControllerFactory::AtomWebUIControllerFactory() {}
AtomWebUIControllerFactory::~AtomWebUIControllerFactory() {}
content::WebUI::TypeID AtomWebUIControllerFactory::GetWebUIType(
content::BrowserContext* browser_context,
const GURL& url) const {
if (url.host() == kPdfViewerUIHost) {
return const_cast<AtomWebUIControllerFactory*>(this);
}
return content::WebUI::kNoWebUI;
}
bool AtomWebUIControllerFactory::UseWebUIForURL(
content::BrowserContext* browser_context,
const GURL& url) const {
return GetWebUIType(browser_context, url) != content::WebUI::kNoWebUI;
}
bool AtomWebUIControllerFactory::UseWebUIBindingsForURL(
content::BrowserContext* browser_context,
const GURL& url) const {
return UseWebUIForURL(browser_context, url);
}
content::WebUIController*
AtomWebUIControllerFactory::CreateWebUIControllerForURL(content::WebUI* web_ui,
const GURL& url) const {
if (url.host() == kPdfViewerUIHost) {
base::StringPairs toplevel_params;
base::SplitStringIntoKeyValuePairs(url.query(), '=', '&', &toplevel_params);
std::string stream_id, src;
for (const auto& param : toplevel_params) {
if (param.first == kPdfPluginSrc) {
src = param.second;
}
}
auto browser_context = web_ui->GetWebContents()->GetBrowserContext();
return new PdfViewerUI(browser_context, web_ui, src);
}
return nullptr;
}
} // namespace atom

View File

@@ -0,0 +1,40 @@
// Copyright (c) 2017 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef ATOM_BROWSER_ATOM_WEB_UI_CONTROLLER_FACTORY_H_
#define ATOM_BROWSER_ATOM_WEB_UI_CONTROLLER_FACTORY_H_
#include "base/macros.h"
#include "base/memory/singleton.h"
#include "content/public/browser/web_ui_controller_factory.h"
namespace atom {
class AtomWebUIControllerFactory : public content::WebUIControllerFactory {
public:
static AtomWebUIControllerFactory* GetInstance();
AtomWebUIControllerFactory();
virtual ~AtomWebUIControllerFactory();
// content::WebUIControllerFactory:
content::WebUI::TypeID GetWebUIType(content::BrowserContext* browser_context,
const GURL& url) const override;
bool UseWebUIForURL(content::BrowserContext* browser_context,
const GURL& url) const override;
bool UseWebUIBindingsForURL(content::BrowserContext* browser_context,
const GURL& url) const override;
content::WebUIController* CreateWebUIControllerForURL(
content::WebUI* web_ui,
const GURL& url) const override;
private:
friend struct base::DefaultSingletonTraits<AtomWebUIControllerFactory>;
DISALLOW_COPY_AND_ASSIGN(AtomWebUIControllerFactory);
};
} // namespace atom
#endif // ATOM_BROWSER_ATOM_WEB_UI_CONTROLLER_FACTORY_H_

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

@@ -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.

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);
@@ -255,6 +255,16 @@ void Browser::DockSetIcon(const gfx::Image& image) {
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];
}

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()
@@ -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

@@ -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

@@ -12,6 +12,8 @@
#include "gin/array_buffer.h"
#include "gin/v8_initializer.h"
#include "atom/common/node_includes.h"
namespace atom {
JavascriptEnvironment::JavascriptEnvironment()
@@ -46,4 +48,11 @@ bool JavascriptEnvironment::Initialize() {
return true;
}
NodeEnvironment::NodeEnvironment(node::Environment* env) : env_(env) {
}
NodeEnvironment::~NodeEnvironment() {
node::FreeEnvironment(env_);
}
} // namespace atom

View File

@@ -8,8 +8,13 @@
#include "base/macros.h"
#include "gin/public/isolate_holder.h"
namespace node {
class Environment;
}
namespace atom {
// Manage the V8 isolate and context automatically.
class JavascriptEnvironment {
public:
JavascriptEnvironment();
@@ -37,6 +42,18 @@ class JavascriptEnvironment {
DISALLOW_COPY_AND_ASSIGN(JavascriptEnvironment);
};
// Manage the Node Environment automatically.
class NodeEnvironment {
public:
explicit NodeEnvironment(node::Environment* env);
~NodeEnvironment();
private:
node::Environment* env_;
DISALLOW_COPY_AND_ASSIGN(NodeEnvironment);
};
} // namespace atom
#endif // ATOM_BROWSER_JAVASCRIPT_ENVIRONMENT_H_

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

@@ -0,0 +1,26 @@
// Copyright (c) 2017 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "atom/browser/loader/layered_resource_handler.h"
namespace atom {
LayeredResourceHandler::LayeredResourceHandler(
net::URLRequest* request,
std::unique_ptr<content::ResourceHandler> next_handler,
Delegate* delegate)
: content::LayeredResourceHandler(request, std::move(next_handler)),
delegate_(delegate) {}
LayeredResourceHandler::~LayeredResourceHandler() {}
bool LayeredResourceHandler::OnResponseStarted(
content::ResourceResponse* response,
bool* defer) {
if (delegate_)
delegate_->OnResponseStarted(response);
return next_handler_->OnResponseStarted(response, defer);
}
} // namespace atom

View File

@@ -0,0 +1,40 @@
// Copyright (c) 2017 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef ATOM_BROWSER_LOADER_LAYERED_RESOURCE_HANDLER_H_
#define ATOM_BROWSER_LOADER_LAYERED_RESOURCE_HANDLER_H_
#include "content/browser/loader/layered_resource_handler.h"
namespace atom {
// Resource handler that notifies on various stages of a resource request.
class LayeredResourceHandler : public content::LayeredResourceHandler {
public:
class Delegate {
public:
Delegate() {}
virtual ~Delegate() {}
virtual void OnResponseStarted(content::ResourceResponse* response) = 0;
};
LayeredResourceHandler(net::URLRequest* request,
std::unique_ptr<content::ResourceHandler> next_handler,
Delegate* delegate);
~LayeredResourceHandler() override;
// content::LayeredResourceHandler:
bool OnResponseStarted(content::ResourceResponse* response,
bool* defer) override;
private:
Delegate* delegate_;
DISALLOW_COPY_AND_ASSIGN(LayeredResourceHandler);
};
} // namespace atom
#endif // ATOM_BROWSER_LOADER_LAYERED_RESOURCE_HANDLER_H_

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"
@@ -333,6 +334,19 @@ void NativeWindow::SetParentWindow(NativeWindow* parent) {
parent_ = parent;
}
void NativeWindow::SetAutoHideCursor(bool auto_hide) {
}
void NativeWindow::SetVibrancy(const std::string& filename) {
}
void NativeWindow::SetTouchBar(
const std::vector<mate::PersistentDictionary>& items) {
}
void NativeWindow::RefreshTouchBarItem(const std::string& item_id) {
}
void NativeWindow::FocusOnWebView() {
web_contents()->GetRenderViewHost()->GetWidget()->Focus();
}
@@ -374,11 +388,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;
@@ -409,8 +429,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.
@@ -436,7 +456,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() {
@@ -446,104 +467,123 @@ 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_EACH_OBSERVER(NativeWindowObserver, observers_,
OnWindowScrollTouchEdge());
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);
}
void NativeWindow::NotifyTouchBarItemInteraction(
const std::string& item_id,
const base::DictionaryValue& details) {
for (NativeWindowObserver& observer : observers_)
observer.OnTouchBarItemResult(item_id, details);
}
#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
@@ -591,7 +631,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()));
}
@@ -622,7 +662,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));
@@ -631,14 +671,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

@@ -21,6 +21,7 @@
#include "content/public/browser/web_contents_observer.h"
#include "content/public/browser/web_contents_user_data.h"
#include "extensions/browser/app_window/size_constraints.h"
#include "native_mate/persistent_dictionary.h"
#include "ui/gfx/image/image.h"
#include "ui/gfx/image/image_skia.h"
@@ -119,9 +120,12 @@ class NativeWindow : public base::SupportsUserData,
virtual void SetClosable(bool closable) = 0;
virtual bool IsClosable() = 0;
virtual void SetAlwaysOnTop(bool top,
const std::string& level = "floating") = 0;
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;
@@ -161,6 +165,16 @@ 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);
// Touchbar API
virtual void SetTouchBar(
const std::vector<mate::PersistentDictionary>& items);
virtual void RefreshTouchBarItem(const std::string& item_id);
// Webview APIs.
virtual void FocusOnWebView();
virtual void BlurWebView();
@@ -177,6 +191,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();
}
@@ -215,6 +234,8 @@ class NativeWindow : public base::SupportsUserData,
void NotifyWindowEnterHtmlFullScreen();
void NotifyWindowLeaveHtmlFullScreen();
void NotifyWindowExecuteWindowsCommand(const std::string& command);
void NotifyTouchBarItemInteraction(const std::string& item_id,
const base::DictionaryValue& details);
#if defined(OS_WIN)
void NotifyWindowMessage(UINT message, WPARAM w_param, LPARAM l_param);

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, const std::string& level) 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,17 @@ 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;
void SetTouchBar(
const std::vector<mate::PersistentDictionary>& items) override;
void RefreshTouchBarItem(const std::string& item_id) override;
// content::RenderWidgetHost::InputEventObserver:
void OnInputEvent(const blink::WebInputEvent& event) override;
@@ -114,6 +127,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 +167,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.

View File

@@ -4,8 +4,10 @@
#include "atom/browser/native_window_mac.h"
#include <Quartz/Quartz.h>
#include <string>
#include "atom/browser/ui/cocoa/atom_touch_bar.h"
#include "atom/browser/window_list.h"
#include "atom/common/color_util.h"
#include "atom/common/draggable_region.h"
@@ -101,6 +103,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)
@@ -192,7 +229,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];
@@ -207,7 +244,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) {
@@ -216,7 +253,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"]);
@@ -233,13 +270,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);
}
@@ -277,20 +314,48 @@ 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, NSTouchBarDelegate> {
@private
atom::NativeWindowMac* shell_;
bool enable_larger_than_screen_;
base::scoped_nsobject<AtomTouchBar> atom_touch_bar_;
CGFloat windowButtonsInterButtonSpacing_;
}
@property BOOL acceptsFirstMouse;
@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;
- (void)enableWindowButtonsOffset;
- (void)resetTouchBar:(const std::vector<mate::PersistentDictionary>&)settings;
- (void)refreshTouchBarItem:(const std::string&)item_id;
@end
@implementation AtomNSWindow
@@ -303,6 +368,35 @@ bool ScopedDisableResize::disable_resize_ = false;
enable_larger_than_screen_ = enable;
}
- (void)resetTouchBar:(const std::vector<mate::PersistentDictionary>&)settings {
if (![self respondsToSelector:@selector(touchBar)]) return;
atom_touch_bar_.reset([[AtomTouchBar alloc] initWithDelegate:self
window:shell_
settings:settings]);
self.touchBar = nil;
}
- (void)refreshTouchBarItem:(const std::string&)item_id {
if (atom_touch_bar_ && self.touchBar)
[atom_touch_bar_ refreshTouchBarItem:self.touchBar id:item_id];
}
- (NSTouchBar*)makeTouchBar {
if (atom_touch_bar_)
return [atom_touch_bar_ makeTouchBar];
else
return nil;
}
- (NSTouchBarItem*)touchBar:(NSTouchBar*)touchBar
makeItemForIdentifier:(NSTouchBarItemIdentifier)identifier {
if (touchBar && atom_touch_bar_)
return [atom_touch_bar_ makeItemForIdentifier:identifier];
else
return nil;
}
// NSWindow overrides.
- (void)swipeWithEvent:(NSEvent *)event {
@@ -444,6 +538,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
@@ -529,13 +653,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) {
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 +746,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 +759,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 +777,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);
@@ -689,6 +817,11 @@ NativeWindowMac::NativeWindowMac(
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);
@@ -839,7 +972,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();
@@ -849,7 +982,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;
}
@@ -899,6 +1032,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];
}
@@ -944,8 +1090,12 @@ bool NativeWindowMac::IsClosable() {
return [window_ styleMask] & NSClosableWindowMask;
}
void NativeWindowMac::SetAlwaysOnTop(bool top, const std::string& level) {
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;
@@ -962,10 +1112,19 @@ void NativeWindowMac::SetAlwaysOnTop(bool top, const std::string& level) {
} else if (level == "screen-saver") {
windowLevel = NSScreenSaverWindowLevel;
} else if (level == "dock") {
// Deprecated by macOS, but kept for backwards compatibility
windowLevel = NSDockWindowLevel;
}
}
[window_ setLevel:windowLevel];
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() {
@@ -976,10 +1135,15 @@ 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)];
@@ -1014,10 +1178,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_];
}
}
@@ -1144,6 +1309,86 @@ 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::SetTouchBar(
const std::vector<mate::PersistentDictionary>& items) {
[window_ resetTouchBar:items];
}
void NativeWindowMac::RefreshTouchBarItem(const std::string& item_id) {
[window_ refreshTouchBarItem:item_id];
}
void NativeWindowMac::OnInputEvent(const blink::WebInputEvent& event) {
switch (event.type) {
case blink::WebInputEvent::GestureScrollBegin:
@@ -1219,10 +1464,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();
@@ -1247,7 +1492,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

@@ -8,6 +8,7 @@
#include <string>
#include "base/strings/string16.h"
#include "base/values.h"
#include "ui/base/window_open_disposition.h"
#include "url/gurl.h"
@@ -70,6 +71,8 @@ class NativeWindowObserver {
virtual void OnWindowLeaveFullScreen() {}
virtual void OnWindowEnterHtmlFullScreen() {}
virtual void OnWindowLeaveHtmlFullScreen() {}
virtual void OnTouchBarItemResult(const std::string& item_id,
const base::DictionaryValue& details) {}
// Called when window message received
#if defined(OS_WIN)

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"
@@ -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, const std::string& level) {
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

@@ -86,9 +86,11 @@ class NativeWindowViews : public NativeWindow,
bool IsFullScreenable() override;
void SetClosable(bool closable) override;
bool IsClosable() override;
void SetAlwaysOnTop(bool top, const std::string& level) 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;
@@ -216,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

View File

@@ -125,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: {
@@ -155,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:
@@ -165,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,23 +22,135 @@ 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;
@@ -45,22 +162,48 @@ int AtomCertVerifier::Verify(
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(
params, 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_, params.hostname(), params.certificate(),
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,18 +13,31 @@
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(const RequestParams& params,
@@ -31,12 +45,19 @@ class AtomCertVerifier : public net::CertVerifier {
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

@@ -23,14 +23,17 @@ void AtomCookieDelegate::RemoveObserver(Observer* observer) {
}
void AtomCookieDelegate::NotifyObservers(
const net::CanonicalCookie& cookie, bool removed, ChangeCause cause) {
FOR_EACH_OBSERVER(Observer,
observers_,
OnCookieChanged(cookie, removed, cause));
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, ChangeCause cause) {
const net::CanonicalCookie& cookie,
bool removed,
net::CookieStore::ChangeCause cause) {
content::BrowserThread::PostTask(
content::BrowserThread::UI,
FROM_HERE,

View File

@@ -19,7 +19,7 @@ class AtomCookieDelegate : public net::CookieMonsterDelegate {
public:
virtual void OnCookieChanged(const net::CanonicalCookie& cookie,
bool removed,
ChangeCause cause) {}
net::CookieStore::ChangeCause cause) {}
protected:
virtual ~Observer() {}
};
@@ -30,7 +30,7 @@ class AtomCookieDelegate : public net::CookieMonsterDelegate {
// net::CookieMonsterDelegate:
void OnCookieChanged(const net::CanonicalCookie& cookie,
bool removed,
ChangeCause cause) override;
net::CookieStore::ChangeCause cause) override;
private:
@@ -38,7 +38,7 @@ class AtomCookieDelegate : public net::CookieMonsterDelegate {
void NotifyObservers(const net::CanonicalCookie& cookie,
bool removed,
ChangeCause cause);
net::CookieStore::ChangeCause cause);
DISALLOW_COPY_AND_ASSIGN(AtomCookieDelegate);
};

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