Compare commits

...

2478 Commits

Author SHA1 Message Date
Cheng Zhao
553341db87 Bump v1.2.3 2016-06-16 12:38:00 +09:00
Cheng Zhao
59fc30e6ae Merge pull request #6073 from electron/protocol-crash
Make api::Protocol thread safe
2016-06-16 03:35:37 +00:00
Cheng Zhao
9e947d3973 Merge pull request #6072 from electron/fix-crash-windows
Work around a compiler bug that crashes on Windows
2016-06-16 03:09:37 +00:00
Cheng Zhao
335cd8779c spec: Correctly cleanup the protocol test 2016-06-16 11:09:52 +09:00
Cheng Zhao
fe0e17d1c3 Make api::Protocol thread safe 2016-06-16 11:09:52 +09:00
Cheng Zhao
659384383e Avoid storing JobFactory in BrowserContext
JobFactory should always be created and accessed in IO thread.
2016-06-16 11:09:51 +09:00
Cheng Zhao
9372d4df32 Make sure BrowserContext is deleted after Protocol 2016-06-16 11:09:51 +09:00
Cheng Zhao
bb10551d23 Work around a compiler bug that crashes on Windows 2016-06-16 10:55:25 +09:00
Kevin Sawicki
9267004b53 Merge pull request #6052 from electron/doc-entitlements
Document entitlements needed for dialog APIs
2016-06-15 11:14:00 -07:00
Kevin Sawicki
2d6986d270 Merge pull request #6061 from zephyrzoom/master
Update online-offline-events.md
2016-06-15 11:11:30 -07:00
707
6567b4c8bf Update online-offline-events.md
漏掉了一个字
2016-06-15 19:30:02 +08:00
Cheng Zhao
efa667fa0a Merge pull request #6035 from electron/content-scripts-in-web-views
Load content scripts in webview devtools
2016-06-15 07:26:27 +00:00
Cheng Zhao
0615fbda84 Merge pull request #6053 from electron/flash-docs
Improve the docs on loading flash plugin
2016-06-15 01:31:32 +00:00
Cheng Zhao
e6ba0ac52a Merge pull request #6049 from electron/sys-executable
Include sys.executable in build libchromiumcontent args
2016-06-15 01:06:38 +00:00
Cheng Zhao
be90e2e9ff Improve the docs on loading flash plugin 2016-06-15 09:41:47 +09:00
Kevin Sawicki
ae6ffa6d5e unkown -> unknown 2016-06-14 15:47:33 -07:00
Kevin Sawicki
4e89656538 🎨 2016-06-14 15:47:33 -07:00
Kevin Sawicki
bf791c110f Tweak type check to consider windows and webviews 2016-06-14 15:47:33 -07:00
Kevin Sawicki
85517a1eea Add 2 spaces before comment 2016-06-14 15:47:33 -07:00
Kevin Sawicki
ee09c7534a Only add extensions to windows and webviews 2016-06-14 15:47:33 -07:00
Kevin Sawicki
f29801ad2b Add background page web contents type 2016-06-14 15:47:33 -07:00
Kevin Sawicki
ee0bab6389 Specify type instead of isGuest 2016-06-14 15:47:33 -07:00
Kevin Sawicki
c7b2545b1b Use web contents type enum and add converter 2016-06-14 15:47:32 -07:00
Kevin Sawicki
fc2b5eebc0 Remove unused includes 2016-06-14 15:47:32 -07:00
Kevin Sawicki
f25c1f864b Use RenderProcessPreferences for non-remote web contents 2016-06-14 15:47:32 -07:00
Kevin Sawicki
5c5fb0e39e Tweak documentation link 2016-06-14 15:24:05 -07:00
Kevin Sawicki
bfde8b02bb Drop the certain 2016-06-14 15:22:12 -07:00
Kevin Sawicki
54d1647a5c Mention dialog entitlements 2016-06-14 15:20:29 -07:00
Kevin Sawicki
45a9b0e0a5 Include sys.executable in build libchromiumcontent args 2016-06-14 11:49:54 -07:00
Kevin Sawicki
9223019af8 Merge pull request #6043 from JimiC/patch-1
Improved test exit
2016-06-14 10:07:57 -07:00
Jimi (Dimitris) Charalampidis
8121f913ca Improving test exit
Test should always exit (app.stop()) either on success or failure.
2016-06-14 16:36:54 +03:00
Cheng Zhao
12a35a05c6 Merge pull request #6038 from electron/check-alert
Fix exception in alert for inavlid parameter
2016-06-14 06:36:00 +00:00
Cheng Zhao
18a38dbfc1 Fix exception in alert for inavlid parameter 2016-06-14 15:22:01 +09:00
Cheng Zhao
b0f3443d72 Merge pull request #6037 from electron/auto-updater-wait
Use "--processStartAndWait" when launching Update.exe
2016-06-14 05:59:40 +00:00
Cheng Zhao
3f2c3e0448 Wait for current app to quit before launching new app 2016-06-14 14:31:41 +09:00
Cheng Zhao
f4c10060af Update brightray for #4261 2016-06-14 13:40:37 +09:00
Cheng Zhao
ae22980ee3 Merge pull request #6030 from electron/repl-error-on-windows
Log error when repling on Windows
2016-06-13 23:43:51 +00:00
Cheng Zhao
af722cc104 Merge pull request #6029 from electron/web-contents-created-app-api
Add web-contents-created event to app
2016-06-13 23:31:47 +00:00
Cheng Zhao
fcc7dc774a Merge pull request #6026 from electron/ready-to-show
Add "ready-to-show" event and docs on showing window gracefully
2016-06-13 23:24:14 +00:00
Kevin Sawicki
82d0d06d61 Log error when repling on Windows 2016-06-13 09:46:33 -07:00
Kevin Sawicki
f67e2043c8 Add back options param 2016-06-13 09:06:42 -07:00
Kevin Sawicki
d160be5daa Add web-contents-created event spec 2016-06-13 09:05:04 -07:00
Kevin Sawicki
88a81ef946 Doc web-contents-created 2016-06-13 09:01:06 -07:00
Kevin Sawicki
56001b481e Emit web-contents-created on app 2016-06-13 08:59:57 -07:00
Kevin Sawicki
c422613169 Merge pull request #6027 from Kushagra8888/patch-2
remove extraneous 'not'
2016-06-13 08:54:55 -07:00
Kushagra Sharma
61c0981ac7 remove extraneous 'not'
[ci skip]
2016-06-13 20:14:42 +05:30
Cheng Zhao
fc09c98bec Use once for 'ready-to-show' 2016-06-13 22:19:44 +09:00
Cheng Zhao
f7f86160c1 Only do the trick when window is hidden 2016-06-13 22:18:57 +09:00
Cheng Zhao
8a50a1b9d3 docs: Showing window gracefully 2016-06-13 22:11:40 +09:00
Cheng Zhao
4d65af3c60 Add ready-to-show event 2016-06-13 21:20:16 +09:00
Cheng Zhao
2dc453b4be Merge pull request #6023 from electron/ignore-focus
Add focusable option
2016-06-13 09:17:55 +00:00
Cheng Zhao
d92570a04b Merge pull request #6022 from tjctw/patch-1
Update mac-app-store-submission-guide.md
2016-06-13 08:53:55 +00:00
Cheng Zhao
e284deb7e1 docs: The side effect of focusable: false on Linux 2016-06-13 17:53:08 +09:00
Cheng Zhao
50f1837097 On Windows focusable: false also means skipTaskbar: true 2016-06-13 17:24:45 +09:00
Cheng Zhao
8eca728e0a Add focusable option 2016-06-13 17:10:28 +09:00
TJC
f255bb1b04 Update mac-app-store-submission-guide.md
typo
2016-06-13 16:07:35 +08:00
Cheng Zhao
5aecd10502 docs: Document the behavior of win.setIgnoreFocus on OS X 2016-06-13 16:40:02 +09:00
Cheng Zhao
ce00f4a273 Merge pull request #6013 from miniak/setIgnoreFocus
Add BrowserWindow.prototype.setIgnoreFocus
2016-06-13 07:18:10 +00:00
Cheng Zhao
927436de1a Merge pull request #6019 from preco21/korean-docs-7
docs: Update Korean docs as upstream
2016-06-13 06:43:41 +00:00
Cheng Zhao
04479b40a7 Merge pull request #6012 from miniak/menu-item-roles
Document 'zoom' role + add missing menu items (Delete / Paste and Match Style / Zoom)
2016-06-13 06:21:53 +00:00
Cheng Zhao
33a69fe50b Merge pull request #6008 from develar/patch-1
Add info about electron-builder to build windows installer
2016-06-13 06:16:53 +00:00
Plusb Preco
951aa72847 📝 Update Korean docs as upstream
[ci skip]
2016-06-13 12:19:37 +09:00
Cheng Zhao
4f1f0add27 docs: Reword the requirement of setApplication Menu 2016-06-13 10:52:12 +09:00
Cheng Zhao
9b566d8a40 Merge pull request #5999 from greggman/update-menu-docs-1
Document Menu.setApplicationMenu from main process
2016-06-13 01:42:47 +00:00
Cheng Zhao
8fe5dd22b2 Merge pull request #6018 from electron/string-map
Cleanup code for autoUpdater
2016-06-13 01:02:53 +00:00
Cheng Zhao
853d7b1b79 Merge pull request #5965 from electron/installed-extension-api
Add BrowserWindow.getDevToolsExtensions API
2016-06-13 00:45:58 +00:00
Cheng Zhao
26c4fc34cb Reset SQRLUpdater when setFeedURL is called 2016-06-13 09:41:14 +09:00
Cheng Zhao
a3786f66c9 Do not add JS wrapper for setFeedURL
When possible we should avoid adding wrappers in JS, it usually makes
code more difficult to mantain
2016-06-13 09:38:47 +09:00
Cheng Zhao
e2442fb052 Move converter for std::map to native_mate 2016-06-13 09:27:13 +09:00
Cheng Zhao
85379e3148 Merge pull request #5879 from miniak/autoUpdater
Add optional requestHeaders argument to autoUpdater.setFeedURL
2016-06-13 00:17:24 +00:00
Plusb Preco
68e99be9f6 📝 Update Korean docs as upstream
[ci skip]
2016-06-13 03:42:26 +09:00
Plusb Preco
bab8f6f60f 📝 Update Korean docs as upstream
* Small fixes

[ci skip]
2016-06-13 03:28:11 +09:00
Milan Burda
7a1d1ee0ea Add BrowserWindow.prototype.setIgnoreFocus 2016-06-12 20:20:57 +02:00
Plusb Preco
6176f65759 📝 Fix grammatical issue
[ci skip]
2016-06-13 02:51:47 +09:00
Plusb Preco
3ebf0fd335 📝 Update Korean docs as upstream
[ci skip]
2016-06-13 02:40:39 +09:00
Plusb Preco
d73d803a57 📝 Small fixes
[ci skip]
2016-06-13 02:28:25 +09:00
Milan Burda
f5699ad3a6 Document 'zoom' role + add missing menu items (Delete / Paste and Match Style / Zoom) 2016-06-12 19:21:52 +02:00
Milan Burda
c89d8b19b6 Add optional requestHeaders argument to autoUpdater.setFeedURL + allow calling mulitple times 2016-06-12 12:46:16 +02:00
Vladimir Krivosheev
109596501c Add info about electron-builder to build windows installer 2016-06-12 10:48:50 +02:00
Greggman
19c9170d6c Document Menu.setApplicationMenu from main process
You can't call Menu.setApplicationMenu until the app is ready.


[ci skip]
2016-06-11 14:09:53 +09:00
Jessica Lord
c68ca16148 Merge pull request #5974 from electron/chrome-storage-sync
Add chrome.storage.sync and chrome.storage.get APIs
2016-06-10 12:20:03 -07:00
Kevin Sawicki
88b62a33ab Merge pull request #5989 from electron/dan-remove-node-version-file
Bump .node-version file
2016-06-10 11:23:25 -07:00
Daniel Pham
47350bba8f ⬆️ node@6.1.0 2016-06-10 14:19:42 -04:00
Kevin Sawicki
4ab6429f1d Merge pull request #5986 from electron/doc-requires
Access remote from electron require
2016-06-10 10:27:57 -07:00
Kevin Sawicki
5e88abed7e Access remote from electron require in translated doc 2016-06-10 10:27:25 -07:00
Kevin Sawicki
9438ba3aaf Access remote from electron require 2016-06-10 10:24:35 -07:00
Jessica Lord
39e6081a00 🔥 line 2016-06-10 09:59:47 -07:00
Kevin Sawicki
f9b7033f43 Fix typo in example 2016-06-10 09:34:34 -07:00
Kevin Sawicki
2804272c7d Doc getDevToolsExtensions 2016-06-10 09:29:26 -07:00
Kevin Sawicki
1f245d5ff6 Add getDevToolsExtensions API 2016-06-10 09:26:38 -07:00
Kevin Sawicki
091682a039 Doc BrowserWindow.isDevToolsExtensionInstalled 2016-06-10 09:24:04 -07:00
Kevin Sawicki
0a26075699 Add BrowserWindow.isDevToolsExtensionInstalled API 2016-06-10 09:24:04 -07:00
Cheng Zhao
e824603f37 Merge pull request #5979 from cyberkatze/patch-7
fixed errors in text
2016-06-10 12:22:04 +00:00
Cheng Zhao
39b918fbfe Merge pull request #5978 from cyberkatze/patch-6
fixed errors in text
2016-06-10 12:21:58 +00:00
Cheng Zhao
0cbcc6db39 Merge pull request #5977 from cyberkatze/patch-5
fixed errors in text
2016-06-10 12:21:49 +00:00
Cheng Zhao
90a1b45135 Merge pull request #5975 from electron/disable-only-specs-on-ci
Log and exit when calling only in specs on CI
2016-06-10 12:11:31 +00:00
Cheng Zhao
4373dc1eac Merge pull request #5972 from electron/non-writeable-guest-id
Make guestId on BrowserWindowProxy non-writeable
2016-06-10 12:02:07 +00:00
Josh Bernitt
4219513457 issue 2813 add app name after Quit
Adding the application name after the Quit string for Mac OS systems.
2016-06-10 21:01:06 +09:00
Cheng Zhao
21081549fd Merge pull request #5967 from electron/window-opener-webview
Support window.opener from windows opened from a <webview>
2016-06-10 11:52:37 +00:00
Ali Elderov
538a4f61ee fixed errors in text 2016-06-10 08:39:28 +02:00
Ali Elderov
9bc536a95f fixed errors in text 2016-06-10 08:31:46 +02:00
Ali Elderov
cf4b40d3e6 fixed errors in text 2016-06-10 08:21:32 +02:00
Cheng Zhao
ccaf837da4 Merge pull request #5964 from electron/manifest-errors
Throw errors reading/parsing manifest.json files
2016-06-10 03:28:57 +00:00
Kevin Sawicki
34e01833d3 Merge pull request #5966 from electron/felix-docs-windows-store
Update Guide for Windows Store Apps
2016-06-09 17:36:55 -07:00
Kevin Sawicki
110f1f8b75 Tweak error message 2016-06-09 17:00:32 -07:00
Felix Rieseberg
8204412f9b 📝 Update Guide for Windows Store Apps
- Updated the guide to reflect that electron-windows-store no longer
   requires container conversion prerequisites
 - Added a link and a note about using background tasks to include
   UWP features
2016-06-09 16:59:42 -07:00
Kevin Sawicki
55a4e2589b Log/exit when only called in specs on CI 2016-06-09 16:56:25 -07:00
Jessica Lord
8fa4d66a5e Remove .only from spec 2016-06-09 16:39:42 -07:00
Jessica Lord
ede3dbd201 🚿 Lint 2016-06-09 16:39:24 -07:00
Jessica Lord
f121f46a24 Merge branch 'master' into chrome-storage-sync 2016-06-09 16:35:00 -07:00
Jessica Lord
dc10568917 Handle the three get cases 2016-06-09 16:26:42 -07:00
Jessica Lord
d6d4d51173 Fix spec case 2016-06-09 16:26:25 -07:00
Cheng Zhao
3dbef4ab8f Merge pull request #5959 from electron/download-item-interrupt
Add more bindings to DownloadItem
2016-06-09 22:50:34 +00:00
Kevin Sawicki
50f5025447 Merge pull request #5924 from electron/chrome-i18n-get-message
Implement chrome.i18n.getMessage
2016-06-09 14:47:37 -07:00
Kevin Sawicki
2efc913222 Remove standard lint warnings 2016-06-09 14:17:54 -07:00
Jessica Lord
d6b108b272 Add spec 2016-06-09 14:14:20 -07:00
Jessica Lord
41d6ddd588 Add storage file 2016-06-09 14:14:14 -07:00
Kevin Sawicki
01f96fe6af Default locale to en 2016-06-09 14:00:53 -07:00
Jessica Lord
0ed10658a3 Add spec 2016-06-09 13:57:51 -07:00
Kevin Sawicki
9f64c39f8c Remove lint warnings 2016-06-09 13:57:08 -07:00
Kevin Sawicki
2367cd574e Cache extension metadata 2016-06-09 13:57:08 -07:00
Kevin Sawicki
ea9d2dadf8 Add fixme for sync ipc 2016-06-09 13:57:08 -07:00
Kevin Sawicki
d4925e6226 Add initial support for placeholders and substitutions 2016-06-09 13:57:08 -07:00
Kevin Sawicki
d54de73e03 🎨 2016-06-09 13:57:08 -07:00
Kevin Sawicki
84960af793 Add initial chrome.i18n.getMessage API 2016-06-09 13:57:08 -07:00
Kevin Sawicki
939ae567ac 🎨 2016-06-09 13:53:36 -07:00
Kevin Sawicki
39180e6539 Get webContents from guestId 2016-06-09 13:50:42 -07:00
Kevin Sawicki
2f88bec177 Add guestId non-writeable assertions 2016-06-09 13:45:09 -07:00
Kevin Sawicki
2f93735909 Make BrowserWindowProxy guestId non-writeable 2016-06-09 13:41:42 -07:00
Kevin Sawicki
c8180ab301 Update spec description 2016-06-09 12:06:49 -07:00
Kevin Sawicki
a184b6afb3 Add spec for window.open from <webview> 2016-06-09 12:02:01 -07:00
Kevin Sawicki
bbc3a71c9f Use webContents id as guest id in opened windows 2016-06-09 11:29:38 -07:00
Kevin Sawicki
ebf9773269 Use const/let and removes CoffeeScript ref vars 2016-06-09 10:35:48 -07:00
Kevin Sawicki
6d3fc611bd Tweak duplicate extension message 2016-06-09 10:08:21 -07:00
Kevin Sawicki
f46edd5186 Throw errors reading/parsing manifest.json 2016-06-09 09:45:02 -07:00
Kevin Sawicki
d1ac5dd29b Add specs for manifest.json read/parse error 2016-06-09 09:44:49 -07:00
Kevin Sawicki
a3899f17f9 Merge pull request #5963 from agustinwang/patch-1
fix typo
2016-06-09 08:56:45 -07:00
agustin.wang
6f8893b42b fix typo 2016-06-09 23:16:46 +08:00
Cheng Zhao
054446a8bf Merge pull request #5958 from cyberkatze/patch-4
fixed errors in text
2016-06-09 12:06:58 +00:00
Cheng Zhao
cc6b812d96 Merge pull request #5957 from cyberkatze/patch-3
updated translation for README.md
2016-06-09 12:06:49 +00:00
Cheng Zhao
573a8320c1 Merge pull request #5956 from cyberkatze/patch-2
updated translation for supported-platforms.md
2016-06-09 12:06:37 +00:00
Cheng Zhao
cbcbcaeb41 docs: Make the example cover all cases 2016-06-09 20:57:29 +09:00
Cheng Zhao
dcad25c98c Add isPaused and canResume 2016-06-09 20:51:01 +09:00
Cheng Zhao
3f1dba3016 docs: Update DownloadItem for getState 2016-06-09 20:35:12 +09:00
Cheng Zhao
0321e23c7a Add DownloadItem.getState 2016-06-09 20:27:39 +09:00
Ali Elderov
c9e8c7f1b6 fixed errors in text 2016-06-09 10:38:28 +02:00
Ali Elderov
0dc49ca713 updated translation for README.md 2016-06-09 10:26:55 +02:00
Ali Elderov
8a2aa018ff updated translation for supported-platforms.md 2016-06-09 10:25:02 +02:00
Cheng Zhao
2ec5406ca6 Merge pull request #5904 from deepak1556/extension_partition_patch
browser: set up extension protocol handler for each browser context
2016-06-09 08:04:58 +00:00
Cheng Zhao
c6eda51b43 Merge pull request #5955 from enlight/fix-atom-taskbarhost-typo
Fix typo in `atom::TaskbarHost::InitializeTaskbar()`
2016-06-09 07:11:25 +00:00
Cheng Zhao
bfac5ba6f2 Merge pull request #5954 from agustinwang/patch-1
update `win` to `mainWindow`
2016-06-09 07:11:07 +00:00
Cheng Zhao
5f1e9d4ea7 Merge pull request #5952 from enlight/patch-3
Update Build System Overview doc
2016-06-09 07:07:32 +00:00
Vadim Macagon
a6f0fcf89f Fix typo in atom::TaskbarHost::InitializeTaskbar()
`InitailizeTaskbar` -> `InitializeTaskbar`
2016-06-09 12:21:21 +07:00
deepak1556
4749e18fc0 fix spec and docs 2016-06-09 10:48:05 +05:30
deepak1556
b91217f29e emit once for each session and add spec 2016-06-09 10:40:51 +05:30
deepak1556
cb5e648502 register extension handler for every session created 2016-06-09 10:40:51 +05:30
deepak1556
ebff40b5a5 add docs 2016-06-09 10:39:18 +05:30
deepak1556
aa853dd3be move protocol to session properties for working with partitions 2016-06-09 10:39:18 +05:30
deepak1556
0e0235407b fill net::URLRequest details on IO thread 2016-06-09 10:39:18 +05:30
deepak1556
414183e0fd fix dereferencing null pointer 2016-06-09 10:39:18 +05:30
agustin.wang
48a939ac7e 更新浏览器窗口变量名称
最新的 electron-quick-start 仓库中的变量已由 win 变更为 mainWindow
2016-06-09 12:55:07 +08:00
Cheng Zhao
d5bb7d7525 Merge pull request #5950 from VReality64/master
📝 Update Korean doc to a latest version.
2016-06-09 04:20:27 +00:00
Vadim Macagon
537c62a9a8 Update Build System Overview doc
`atom.gyp` was renamed to `electron.gyp` not long ago but this document wasn't updated.
2016-06-09 10:58:58 +07:00
Cheng Zhao
8a92ee403c Merge pull request #5945 from electron/default-title-to-app-name
Default window title to app name
2016-06-09 02:06:30 +00:00
Cheng Zhao
0abd55221d Merge pull request #5944 from electron/set-maximizable-last
Set maximizable state after installing view
2016-06-09 01:52:35 +00:00
Cheng Zhao
b422c47b67 Merge pull request #5943 from bbondy/master
Allow obtaining system Pepper Flash path
2016-06-09 01:48:53 +00:00
Cheng Zhao
20372f057e Merge pull request #5913 from electron/webview-devtools-extensions
Enable DevTools extensions in webviews
2016-06-09 01:45:55 +00:00
VReality64
9c10ecd13f 📝 Update Korean doc to a latest version.
[ci skip]
2016-06-09 09:59:14 +09:00
Kevin Sawicki
7d48827199 Default window title to app name 2016-06-08 14:17:33 -07:00
Kevin Sawicki
9f93f4e27f Set maximizable state after installing view 2016-06-08 13:56:45 -07:00
Brian R. Bondy
352a9cd6f2 Allow obtaining system Pepper Flash path 2016-06-08 16:40:15 -04:00
Kevin Sawicki
f33537336b Add default statement 2016-06-08 12:00:14 -07:00
Kevin Sawicki
4823a04a44 hookWindowForTabEvents -> hookWebContentsForTabEvents 2016-06-08 12:00:13 -07:00
Kevin Sawicki
11e68ff932 Only add extensions to non-remote webContents 2016-06-08 12:00:13 -07:00
Kevin Sawicki
c8c60dd313 Add devtools from web-contents-created event 2016-06-08 12:00:13 -07:00
Kevin Sawicki
d8fe5da3ea 🎨 2016-06-08 12:00:13 -07:00
Kevin Sawicki
ec8b9e3f35 Export loadDevToolsExtensions API to use in guest view manager 2016-06-08 12:00:13 -07:00
Kevin Sawicki
219d177731 Load extensions for all web contents 2016-06-08 12:00:13 -07:00
Kevin Sawicki
4f7bde38a9 Assert on tab id as well 2016-06-08 12:00:13 -07:00
Kevin Sawicki
bf47056561 Pluralize extension 2016-06-08 12:00:13 -07:00
Kevin Sawicki
78e3bb0660 🎨 2016-06-08 12:00:13 -07:00
Kevin Sawicki
4c1ede32cf Use destroyed event instead of closed event 2016-06-08 12:00:12 -07:00
Kevin Sawicki
4f46f75d8f Load dev tools extensions in webviews 2016-06-08 12:00:12 -07:00
Kevin Sawicki
19787544b5 Add failing spec for webview devtools extension 2016-06-08 12:00:12 -07:00
Kevin Sawicki
82bee12c00 Merge pull request #5911 from mafintosh/patch-1
support --abi
2016-06-08 11:57:16 -07:00
Mathias Buus
7dcb939338 support --abi 2016-06-08 20:55:06 +02:00
Kevin Sawicki
f4c1cd11a0 Merge pull request #5921 from electron/webview-show-definition-for-selection
Add showDefinitionForSelection to webContents/webview
2016-06-08 10:40:10 -07:00
Kevin Sawicki
7250c461be Remove NOTIMPLEMENTED() call 2016-06-08 10:21:28 -07:00
Kevin Sawicki
70996c79ba Add showDefinitionForSelection webContents proxy method 2016-06-08 10:19:43 -07:00
Kevin Sawicki
6337e93e6d Check for Mac in if block 2016-06-08 10:15:37 -07:00
Kevin Sawicki
c66299bf66 Document webview.showDefinitionForSelection 2016-06-08 10:15:36 -07:00
Kevin Sawicki
8c520cf158 🎨 2016-06-08 10:15:36 -07:00
Kevin Sawicki
6360a5cae4 Add deprecation TODO for BrowserWindow.showDefinitionForSelection 2016-06-08 10:15:36 -07:00
Kevin Sawicki
ce19c2c0ad Document webContents.showDefinitionForSelection 2016-06-08 10:15:36 -07:00
Kevin Sawicki
4f0a52628e Add showDefinitionForSelection to webContents/webview 2016-06-08 10:15:36 -07:00
Kevin Sawicki
e4398dde42 Merge pull request #5942 from enlight/patch-2
Fix location of code snippet in nativeImage docs
2016-06-08 09:36:42 -07:00
Vadim Macagon
8e2ae9b9e7 Fix location of code snippet in nativeImage docs
The code snippet for `nativeImage.createFromPath` somehow ended up in the wrong section of the document, this PR moves it back where it belongs.
2016-06-08 23:34:45 +07:00
Cheng Zhao
b2bea57eff Bump v1.2.2 2016-06-08 16:47:41 +09:00
Cheng Zhao
3cb5649f07 Merge pull request #5932 from electron/fix-standard-scheme
Fix crash when using fetch in custom protocols
2016-06-08 07:47:04 +00:00
Cheng Zhao
1bfbd215ea Don't rely on AddAdditionalSchemes for setting standard schemes
On Linux because of the existence of zygote process, it becomes very
tricky to correctly set standard schemes, basically we have to:
1. Pass --standard-schemes to both zygote and render processes
2. Init standard schemes for both zygote and render processes

The )1 is very hard to achieve, so instead of using
AddAdditionalSchemes, we just call url::AddStandardScheme directly.
2016-06-08 16:32:02 +09:00
Cheng Zhao
7108cc5f2b Mark standard scheme as safe scheme 2016-06-08 15:49:26 +09:00
Cheng Zhao
920ebee333 Make sure standard schemes are also set in child process 2016-06-08 15:46:50 +09:00
Cheng Zhao
1146b2d5c1 spec: Custom protocol can have "fetch" working in it 2016-06-08 14:44:30 +09:00
Cheng Zhao
2696c0a693 Merge pull request #5929 from electron/chrome-update
Update to Chrome 51.0.2704.84
2016-06-08 02:25:58 +00:00
Cheng Zhao
77dc08f2f9 Update to Chrome 51.0.2704.84 2016-06-08 11:08:24 +09:00
Cheng Zhao
2ed2db2068 Merge pull request #5928 from electron/bellow
bellow => below
2016-06-08 02:07:14 +00:00
Cheng Zhao
3ec4fcb3ec bellow => below 2016-06-08 11:03:01 +09:00
Cheng Zhao
6c5eaf6178 Merge pull request #5923 from electron/disable-blink-features
Support disabling Blink features
2016-06-08 02:00:30 +00:00
Cheng Zhao
013bd004c9 Merge pull request #5922 from ekonstantinidis/patch-1
Move example to the correct place
2016-06-08 01:57:56 +00:00
Cheng Zhao
d2331bc2c0 Merge pull request #5915 from electron/remove-result-collection
Remove unused results collection
2016-06-08 00:58:16 +00:00
Kevin Sawicki
02e0ca60ef Use lowercase param key 2016-06-07 16:35:23 -07:00
Kevin Sawicki
cd2041375b Add missing A in constant name 2016-06-07 16:31:16 -07:00
Kevin Sawicki
96012d6523 Remove trailing comma 2016-06-07 16:24:05 -07:00
Kevin Sawicki
f7b0bb2bf3 Add TODO about blinkFeatures -> enableBlinkFeatures 2016-06-07 16:23:09 -07:00
Emmanouil Konstantinidis
9b979f3b49 Move example to the correct place 2016-06-07 23:40:07 +01:00
Kevin Sawicki
c7f2c25bc9 Mention enabling/disabling 2016-06-07 13:59:30 -07:00
Kevin Sawicki
1b6a95adcb Document disableblinkfeatures attribute 2016-06-07 13:57:54 -07:00
Kevin Sawicki
636e356977 Document disableBlinkFeatures option 2016-06-07 13:56:33 -07:00
Kevin Sawicki
b941e25bf5 Link to RuntimeEnabledFeatures.in 2016-06-07 13:55:44 -07:00
Kevin Sawicki
ca6e3ed1ef Add webview support for disabled blink features 2016-06-07 13:49:31 -07:00
Kevin Sawicki
ae71cf3df1 Add disableBlinkFeatures option 2016-06-07 13:42:42 -07:00
Kevin Sawicki
ba762464d2 More let/const-ing 2016-06-07 10:29:29 -07:00
Kevin Sawicki
5c880b7c99 We -> we 2016-06-07 10:25:21 -07:00
Kevin Sawicki
ce1a9740f6 🎨 Use const and for/of loops 2016-06-07 10:24:48 -07:00
Kevin Sawicki
3bcb411e28 Don't collect unused results array 2016-06-07 10:24:33 -07:00
Cheng Zhao
4948bcc806 Merge pull request #5910 from electron/win-click-through
Implement win.setIgnoreMouseEvents for Windows and Linux
2016-06-07 12:05:07 +00:00
Cheng Zhao
5f838a1ee4 Merge pull request #5907 from VReality64/master
Update Korean documentation translation to a latest version
2016-06-07 11:39:25 +00:00
Cheng Zhao
e7754fa55a Merge pull request #5906 from ThaddeusJiang/master
update Quick Start Page[zh-CN]
2016-06-07 11:38:51 +00:00
Cheng Zhao
6192eef1b6 Update docs on win.setIgnoreMouseEvents 2016-06-07 20:32:52 +09:00
Cheng Zhao
f8b69c1fac Implement SetIgnoreMouseEvents for Linux 2016-06-07 20:23:29 +09:00
Cheng Zhao
cae25cab3e Implement SetIgnoreMouseEvents for Windows 2016-06-07 19:38:41 +09:00
VReality64
219bc2fc51 Update Korean documentation translation to a latest version 2016-06-07 19:19:21 +09:00
Cheng Zhao
fe4b957587 Merge pull request #5905 from electron/frameless-title
Fix title of frameless window showing as empty under fullscreen
2016-06-07 10:18:59 +00:00
jf_jiang
ece468681f fix outside link 2016-06-07 18:57:45 +09:00
jf_jiang
7e5f9fef52 update Quick Start Page[zh-CN]
Based on electron ver 1.1.3 update Quick Start Page[Simplified
Chinese].
2016-06-07 18:52:01 +09:00
Cheng Zhao
b444211d6f Fix title of frameless window showing as empty under fullscreen 2016-06-07 17:26:26 +09:00
Cheng Zhao
d3d2ca9a31 Merge pull request #5903 from electron/update-target-url
Add update-target-url event
2016-06-07 07:10:54 +00:00
Cheng Zhao
3c873736d7 Add update-target-url event 2016-06-07 15:56:19 +09:00
Cheng Zhao
1c504ec45d Merge pull request #5901 from electron/screen-docs
docs: Update the code sample of screen module
2016-06-07 05:04:55 +00:00
Cheng Zhao
1a22caabe8 docs: Update the code sample of screen module
* We should not require it before the ready event;
* There is no need to use electronScreen as name in the main process.
2016-06-07 13:56:57 +09:00
Cheng Zhao
08f8e06c55 Merge pull request #5894 from electron/chrome-runtime-id
Implement chrome.runtime.id
2016-06-07 01:54:58 +00:00
Cheng Zhao
2701ed6dd7 Merge pull request #5893 from electron/remove-extension-id-logging
Don't log devtools extension id
2016-06-07 01:54:16 +00:00
Cheng Zhao
243052742e Merge pull request #5898 from electron/native-module-signing
docs: Move "Sign Native Modules" to MAS Guide
2016-06-07 01:40:55 +00:00
Cheng Zhao
5fc64aea38 docs: Move "Sign Native Modules" to MAS Guide 2016-06-07 10:26:53 +09:00
Cheng Zhao
cb5f5660e1 Merge pull request #5890 from jpittner/patch-1
Update using-native-node-modules.md
2016-06-07 01:09:40 +00:00
Kevin Sawicki
61ce19ba7e Set chrome.runtime.id 2016-06-06 14:42:07 -07:00
Kevin Sawicki
d6311daea3 Add failing spec for chrome.runtime.id 2016-06-06 14:41:55 -07:00
Kevin Sawicki
a906336b1e Don't log extension id 2016-06-06 13:03:01 -07:00
Cheng Zhao
7e7186933f Merge pull request #5889 from electron/disable-gpu
Add app.disableHardwareAcceleration() API
2016-06-06 12:08:37 +00:00
jpittner
3edde9143b Update using-native-node-modules.md
Explains how native modules to be signed and packaged.
2016-06-06 13:46:34 +02:00
Cheng Zhao
02cfe30df9 Add app.disableHardwareAcceleration() API 2016-06-06 20:19:55 +09:00
Cheng Zhao
3e809901e0 Merge pull request #5888 from electron/linux-focus
Fix NativeWindow::Focus not moving focus to window
2016-06-06 08:26:47 +00:00
Cheng Zhao
32b692b60c Fix NativeWindow::Focus not moving focus to window
Chromium's implementation is somehow not working as expected, the new
implementation follows the behavior of wmctrl.
2016-06-06 16:59:31 +09:00
Cheng Zhao
438cab1f56 Merge pull request #5886 from electron/chrome-update
Update to Chrome 51.0.2704.79
2016-06-06 07:47:43 +00:00
Cheng Zhao
adec511891 Update to Chrome 51.0.2704.79 2016-06-06 15:59:07 +09:00
Cheng Zhao
14210174d3 Merge pull request #5883 from sethlu/update-mas-submission-guide
Update Chinese translation for MAS Submission Guide
2016-06-06 06:20:16 +00:00
Cheng Zhao
1066c1acaf Merge pull request #5882 from electron/felix-extension-warning-2
Log a warning if an extension's manifest cannot be parsed
2016-06-06 06:20:02 +00:00
Cheng Zhao
ec691a3a64 Merge pull request #5870 from danhp/missing-roles
Add 'delete' and 'pasteandmatchstyle' roles
2016-06-06 06:16:53 +00:00
sethlu
8cca8d66e3 Update Chinese translation 2016-06-06 09:57:07 +08:00
Daniel Pham
bd1eae86a1 Add 'delete' and 'pasteandmatchstyle' roles 2016-06-05 21:50:37 -04:00
Cheng Zhao
08f5322658 Merge pull request #5873 from sourenaraya/patch-1
Fix shared data example in FAQ
2016-06-06 01:48:13 +00:00
Felix Rieseberg
eb62abcc23 🎨 Log a warning if an extension's manifest cannot be parsed
Also logs a clean warning if an extension's manifest is incomplete,
missing, or can otherwise not be parsed.
2016-06-05 18:30:49 -07:00
Cheng Zhao
8847af0e54 Merge pull request #5859 from electron/felix-extension-warning
Log a warning if an extension has already been loaded
2016-06-06 01:22:47 +00:00
sourenaraya
506bc4db4c Fix shared data example
since `remote` module unaviable
2016-06-05 20:39:10 +10:00
Felix Rieseberg
b42e6583f7 🎨 Log a warning if an extension has already been loaded
If an extension has already been loaded (for instance because it’s
persisted), `addDevToolsExtension` will return nothing, which is
confusing. This adds a little `console.warn` to educate people about
what’s happening.

Closes #5854
2016-06-03 14:32:22 -07:00
Cheng Zhao
9d55424c48 Merge pull request #5849 from preco21/korean-docs-6
docs: Update Korean docs as upstream
2016-06-03 11:29:13 +00:00
Plusb Preco
6f8ebee3e8 📝 Update Korean docs as upstream
[ci skip]
2016-06-03 18:41:47 +09:00
Plusb Preco
d4ab4bee93 📝 Update Korean docs as upstream
[ci skip]
2016-06-03 18:37:46 +09:00
Plusb Preco
41f99187e7 📝 Update Korean docs as upstream
[ci skip]
2016-06-03 17:47:21 +09:00
Cheng Zhao
f59eecb1cc Merge pull request #5833 from CharlieHess/osx-global-defaults
Support array / dictionary types in getUserDefault
2016-06-03 08:36:44 +00:00
Cheng Zhao
567a7ed829 Merge pull request #5839 from sqrthree/patch-1
Correct wrong words
2016-06-03 04:50:58 +00:00
Cheng Zhao
4ec064d311 Merge pull request #5837 from electron/restart
Add app.relaunch API
2016-06-03 04:00:12 +00:00
Cheng Zhao
7f9e296f9c Merge pull request #5826 from Pym/patch-1
Add nuts link to the docs
2016-06-03 03:30:13 +00:00
Cheng Zhao
707d68f719 spec: Add test case for app.relaunch 2016-06-03 12:12:20 +09:00
Cheng Zhao
be6ed84ff2 args should always be checked 2016-06-03 12:08:45 +09:00
Paul Betts
4d8c73734c Merge pull request #5841 from envygeeks/patch-1
List all the possible folders for Linux.
2016-06-02 19:36:38 -07:00
Jordon Bedwell
020da553ff List all the possible folders for Linux.
Linux has several folders, depending on who is using the Linux install.  On our systems it could be any one of those depending on the user and what software they prefer to use, they all have the React plugin however, each one sits in a different folder.  I prefer Chrome because of Netflix, she prefers Chromium and we also have Chrome Beta available.
2016-06-02 20:29:25 -05:00
Kevin Sawicki
b0ccf6fd74 Merge pull request #5840 from electron/code-block-name
Correct typo in code block name
2016-06-02 09:40:07 -07:00
Kevin Sawicki
96ca8edbb4 javascript -> javascript 2016-06-02 09:39:17 -07:00
Plusb Preco
d234467682 📝 Update Korean docs as upstream
[ci skip]
2016-06-02 23:50:50 +09:00
sqrthree
2ef2c1af02 Correct wrong words
修正错别字
2016-06-02 22:35:40 +08:00
Cheng Zhao
d3fe80991c docs: app.relaunch 2016-06-02 22:06:27 +09:00
Cheng Zhao
91a9e67dca Provide a flexible API for app.relaunch 2016-06-02 21:49:29 +09:00
Cheng Zhao
3de41fb22d Correctly quotes the argv on Windows 2016-06-02 21:10:39 +09:00
Cheng Zhao
8435f1c900 Allow using current argv for relaunch 2016-06-02 20:48:36 +09:00
Cheng Zhao
9a08cbce27 Uniform when to use args or argv 2016-06-02 20:41:59 +09:00
Cheng Zhao
0d066de53e Make sure the new instance inherite cwd on mac 2016-06-02 20:32:29 +09:00
Cheng Zhao
0646f6ea9e Implement Relaunch on Windows 2016-06-02 19:49:36 +09:00
Cheng Zhao
a3f39e9d0b Implement Relaunch on Linux 2016-06-02 16:54:21 +09:00
Cheng Zhao
c3fe2dae9d Separate LaunchProgram from mac implementation 2016-06-02 16:23:46 +09:00
Charlie Hess
e377298cd2 Be consistent in spec organization. 2016-06-01 19:29:24 -07:00
Charlie Hess
fa3b17444f All we really need to do is make getUserDefault support array / object types. 2016-06-01 19:21:17 -07:00
Charlie Hess
587dd2fe51 Expose the method to JS and write a simple test. 2016-06-01 18:56:25 -07:00
Charlie Hess
0230567891 Write a new method that returns prefs under the NSGlobalDomain. 2016-06-01 18:55:20 -07:00
Charlie Hess
aa1b8cd74b Expose the NSArrayToListValue converter. 2016-06-01 18:53:49 -07:00
Cheng Zhao
060829da64 Separate implementations of RelauncherMain and RelauncherSynchronizeWithParent 2016-06-02 09:09:32 +09:00
Charlie Hess
10dcb10898 Merge remote-tracking branch 'upstream/master' 2016-06-01 14:38:49 -07:00
Kevin Sawicki
c3e9ce34a1 Merge pull request #5829 from electron/rename-frameworks-repo
Rename and move atom-shell-frameworks repo
2016-06-01 13:32:19 -07:00
Kevin Sawicki
789a878f07 Rename atom-shell-frameworks repo name and org 2016-06-01 13:25:36 -07:00
Pierre-Yves Jamon
3b11355521 Add nuts link to the docs
Add link to GitbookIO/nuts in the docs page for autoUpdater
2016-06-01 15:22:08 +02:00
Cheng Zhao
fc30a2a084 Use AtomCommandLine to process command line parameters 2016-06-01 22:15:50 +09:00
Cheng Zhao
6df18956cd Get ready to make relauncher cross-platform 2016-06-01 22:04:20 +09:00
Cheng Zhao
abdcb9d481 Implement app.relaunch on OS X 2016-06-01 18:22:14 +09:00
Cheng Zhao
7b3ba739bf Import chrome/browser/mac/relauncher.{cc,h} 2016-06-01 16:26:08 +09:00
Cheng Zhao
97dd71d79e Bump v1.2.1 2016-06-01 16:15:53 +09:00
Cheng Zhao
e46ef5a15a Merge pull request #5824 from electron/cleanup-web-contents
Cleanup the web-contents.js code
2016-06-01 07:14:31 +00:00
Cheng Zhao
8f49d43b69 Merge pull request #5781 from deepak1556/bluetooth_patch
webContents: add event to select bluetooth device
2016-06-01 06:40:08 +00:00
Cheng Zhao
f4dc8f6d26 Merge pull request #5823 from ColinEberhardt/patch-1
minor typo fixes
2016-06-01 06:34:57 +00:00
Cheng Zhao
01b10b3b39 Slightly improve docs of webContents.printToPDF 2016-06-01 15:32:37 +09:00
Cheng Zhao
0864d3b1ee Cleanup the printToPDF code 2016-06-01 15:32:37 +09:00
deepak1556
7434838463 fix docs 2016-06-01 11:44:29 +05:30
deepak1556
de4bff003f fix header paths and comments 2016-06-01 11:44:29 +05:30
deepak1556
db4dc4757a move bluetooth_chooser to atom/browser/lib 2016-06-01 11:43:39 +05:30
deepak1556
51daf8e194 add docs 2016-06-01 11:43:39 +05:30
deepak1556
a70749e80a browser: implement bluetooth chooser interface 2016-06-01 11:43:39 +05:30
Cheng Zhao
eb882855bc Cleanup the CoffeeScript converted code 2016-06-01 15:08:51 +09:00
Cheng Zhao
5bb8da6073 Explicitly initialize session before webContents 2016-06-01 14:57:35 +09:00
Cheng Zhao
523e8c2e1c Update libchromiumcontent and brightray for #5781 2016-06-01 14:53:05 +09:00
Cheng Zhao
0565c42add Merge pull request #5812 from vasumahesh1/feature-pdf
webContents: custom pageSize for printToPDF
2016-06-01 05:52:08 +00:00
Colin Eberhardt
89adc122c3 Minor typo fixes 2016-06-01 06:36:45 +01:00
Cheng Zhao
28c9dcc393 Merge pull request #5817 from electron/plist-vars
Add variables for plist paths
2016-06-01 04:33:27 +00:00
Cheng Zhao
15d32a9096 Merge pull request #5820 from electron/session-check
Throw error when session module is used before app is ready
2016-06-01 03:22:00 +00:00
Cheng Zhao
8dfbbcefc8 Throw error when session module is used before app is ready 2016-06-01 10:53:06 +09:00
Cheng Zhao
d105524135 Cleanup the JavaScript code of session 2016-06-01 10:42:24 +09:00
Kevin Sawicki
18f005092b Merge pull request #5819 from gjtorikian/patch-1
Fix typo
2016-05-31 17:56:16 -07:00
Garen Torikian
2aa1aedd92 Fix typo 2016-05-31 17:51:09 -07:00
Kevin Sawicki
606fc1a5b7 Add plist path variables 2016-05-31 16:48:03 -07:00
Vasu Mahesh
fc6628d159 Add: custom pageSize for printToPDF 2016-05-31 22:40:11 +05:30
Cheng Zhao
f5839c3a5b Merge pull request #5782 from electron/store-icons
Keep copies of window icons
2016-05-31 10:07:15 +00:00
Cheng Zhao
aea2135016 Keep copies of window icons 2016-05-31 17:47:45 +09:00
Plusb Preco
a454cc8260 📝 Update Korean docs as upstream
[ci skip]
2016-05-31 16:14:56 +09:00
Plusb Preco
31f2ac8bf3 📝 Update README.md
[ci skip]
2016-05-31 16:14:40 +09:00
Cheng Zhao
6c705fdd70 Merge pull request #5776 from electron/fix-node-output
Correctly redirect output to console on Windows
2016-05-31 03:19:58 +00:00
Cheng Zhao
4d8994df92 spec: child_process.fork shouble be able to pipe stdio 2016-05-31 11:05:58 +09:00
Cheng Zhao
381da76967 Correctly redirect output to console 2016-05-31 10:19:13 +09:00
Cheng Zhao
543d4bb2b1 Merge pull request #5770 from electron/clear-before-notice
Clear the buffers before notifying the other end of the pipe
2016-05-30 22:52:01 +00:00
Cheng Zhao
f02143b8f2 Clear the buffers before notifying the other end of the pipe 2016-05-30 22:38:01 +09:00
Cheng Zhao
0c93b21a5f Merge pull request #5769 from electron/fetch-job-cleanup
Refactor the URLRequestFetchJob code
2016-05-30 12:08:12 +00:00
Cheng Zhao
49f1278601 Refactor the URLRequestFetchJob code
This makes the read end and write end of the pipe have same logic, so it
is more easy to maintain.
2016-05-30 20:31:00 +09:00
Cheng Zhao
912cedc593 Merge pull request #5753 from deepak1556/url_request_fetch_job_patch
protocol: store initial response data for when resource loader becomes ready
2016-05-30 10:53:53 +00:00
Cheng Zhao
6e14a55817 Merge pull request #5768 from electron/fix-web-securiy-node-integration
Initialize script context in DidClearWindowObject
2016-05-30 08:01:48 +00:00
Cheng Zhao
ad3b3e0162 Merge pull request #5766 from kcrt/jpdocs
Japanese: add web-view-tag.md
2016-05-30 07:51:55 +00:00
Cheng Zhao
6755aa44f6 Initialize script context in DidClearWindowObject
Doing it in RunScriptsAtDocumentStart would somehow result in weird
results when webSecurity is off.
2016-05-30 16:34:28 +09:00
Cheng Zhao
ce0d3d93ab spec: disablewebsecurity should not break preload and node integration 2016-05-30 15:23:09 +09:00
TAKAHASHI Kyohei
5ab86cc2df 📝 trivial change in web-view-tag.md
There is a mistake about the information of `stopFindInPage`.
[ci skip]
2016-05-30 14:02:15 +09:00
TAKAHASHI Kyohei
12631a18c0 📝 Japanese: add web-view-tag.md 2016-05-30 13:59:43 +09:00
Cheng Zhao
7ec467e337 docs: Move the "Packaging Tools" out of "Rebranding" chapter 2016-05-30 10:37:32 +09:00
Cheng Zhao
a176aaee01 Merge pull request #5734 from danhp/fix-aspect-ratio
Fix 'setAspectRatio(0)' not resetting the default behaviour.
2016-05-30 01:14:03 +00:00
Cheng Zhao
3e41aebaa7 Merge pull request #5763 from electron/window-icon-size
Choose the correct icon size for Windows taskbar
2016-05-30 01:01:28 +00:00
Cheng Zhao
26fa963a70 Merge pull request #5720 from danhp/release-single-instance
Add 'app.releaseSingleInstance()'
2016-05-30 00:51:13 +00:00
Cheng Zhao
5a9eb5cfa6 Choose the correct icon size for Windows taskbar 2016-05-30 09:46:42 +09:00
Cheng Zhao
79cb648b6b Merge pull request #5726 from danhp/fix-context-menu
Fix context menus only showing on primary monitor.
2016-05-30 00:16:21 +00:00
Cheng Zhao
09796587b4 Remove trailing whitespaces and cleanup the code logic 2016-05-30 09:12:16 +09:00
Cheng Zhao
ec53e49fad Merge pull request #5718 from felixrieseberg/windows-fullscreenable
Fix setFullscreen() on Windows
2016-05-30 00:08:16 +00:00
Cheng Zhao
9f0fc96025 Merge pull request #5711 from electron/extension-code-cleanup
Implement partial chrome.* API for devtools extension
2016-05-29 23:29:08 +00:00
Plusb Preco
b78f7701e5 📝 Update Korean docs as upstream
[ci skip]
2016-05-30 01:59:32 +09:00
Daniel Pham
34af9794a2 Add test for 'setAspectRatio(0)' 2016-05-29 08:47:42 -04:00
deepak1556
9d8af43617 add spec 2016-05-29 13:43:26 +05:30
deepak1556
23fbb57d72 protocol: store response data when reader is not ready 2016-05-29 13:17:31 +05:30
Cheng Zhao
d1e56f416c Update the docs on using DevTools extension 2016-05-29 15:19:41 +09:00
Cheng Zhao
5f3fdbe635 Simplify the implementation of sendToAll 2016-05-29 12:10:32 +09:00
Cheng Zhao
de001a9bbf Use meaningful name for extensionId 2016-05-29 11:57:20 +09:00
Cheng Zhao
ec1944c146 Implement chrome.tab.onCreated/onRemoved APIs 2016-05-29 11:50:14 +09:00
Cheng Zhao
2431d886bf Current handle sender.tab for background pages 2016-05-29 10:46:48 +09:00
Cheng Zhao
dd804d7432 Enable specifying custom command line switches 2016-05-29 10:34:53 +09:00
Cheng Zhao
f693b042b5 Fix js lint warnings 2016-05-28 22:46:15 +09:00
Cheng Zhao
747f910ce0 Merge pull request #5736 from electron/missing-has-own-property
Support objects with no prototype over IPC
2016-05-28 13:42:30 +00:00
Cheng Zhao
3c7d94f2d9 Merge pull request #5742 from electron/duplicate-hidden-inset-check
Remove duplicate hidden-inset check
2016-05-28 13:42:15 +00:00
Cheng Zhao
f4fe60d126 Set default mimeType for BufferJob 2016-05-28 22:36:22 +09:00
Cheng Zhao
30dca2b4e1 Pages in chrome extension should not have node integration 2016-05-28 21:46:53 +09:00
Cheng Zhao
9ed4730cba Pass sender for chrome.runtime.onMessage 2016-05-28 21:45:23 +09:00
Cheng Zhao
5eb9ed1729 Implement chrome.tabs.sendMessage 2016-05-28 21:35:07 +09:00
Cheng Zhao
62fb4f9820 Implement chrome.runtime.sendMessage 2016-05-28 21:23:43 +09:00
Cheng Zhao
ba315248e0 Use ipcRenderer.sendTo to get rid of routers in main process 2016-05-28 21:13:00 +09:00
Cheng Zhao
a58b84bbd7 spec: ipcRenderer.sendTo sends message to WebContents 2016-05-28 20:50:30 +09:00
Cheng Zhao
ae1f442b02 Add ipcRenderer.sendTo 2016-05-28 20:50:28 +09:00
Cheng Zhao
d55b96fdf5 Clean up the Chrome API implementation code 2016-05-28 20:33:18 +09:00
Cheng Zhao
31628abadc Implement chrome.tabs.executeScript 2016-05-28 16:41:12 +09:00
Cheng Zhao
db94121360 Implement port.sender 2016-05-28 16:01:16 +09:00
Cheng Zhao
f5b430d9e1 Inject chrome.* to content scripts 2016-05-28 15:37:44 +09:00
Cheng Zhao
d8db695712 Handle port disconnecting 2016-05-28 12:07:08 +09:00
Cheng Zhao
599d3c147b Background pages and content script should be loaded on startup 2016-05-28 10:39:11 +09:00
Cheng Zhao
e76c36a9a8 Make simple runtime.connect work 2016-05-28 10:26:41 +09:00
Cheng Zhao
dfe7ae2124 Add webContents.fromId 2016-05-28 10:10:24 +09:00
Kevin Sawicki
5deb86d6f9 Merge pull request #5744 from aaronang/docs-improve-structure-of-source-code
📝 Indicate directories in the Structure of Source Code section
2016-05-27 15:41:28 -07:00
Aaron Ang
0a03dcd481 📝 Indicate directories in the Structure of Source Code section
[ci skip]
2016-05-28 00:22:47 +02:00
Kevin Sawicki
6e8945d7fa Merge pull request #5738 from electron/remove-deprecated-apis-from-docs
Remove deprecated APIs from the docs
2016-05-27 15:10:45 -07:00
Kevin Sawicki
1704b1ad53 Remove APIs that are no longer present 2016-05-27 15:08:29 -07:00
Kevin Sawicki
d02c1fbbf4 Merge pull request #5670 from electron/custom-fork-docs
Create guide for how to create your own from-source Electron fork
2016-05-27 14:34:49 -07:00
Kevin Sawicki
6add7f8d49 we -> it 2016-05-27 14:34:23 -07:00
Kevin Sawicki
ba6c8b531f Add ELECTRON_REPO example 2016-05-27 14:06:40 -07:00
Kevin Sawicki
82bc98ec3c Put - at end of previous line 2016-05-27 14:06:04 -07:00
Kevin Sawicki
1e28e3fc27 Add trailing slashes to directories 2016-05-27 14:06:04 -07:00
Kevin Sawicki
2effa32e3e Tighten up section title 2016-05-27 14:06:04 -07:00
Kevin Sawicki
f17e64e726 Tweak fork section 2016-05-27 14:06:04 -07:00
Kevin Sawicki
556b39c6f2 ATOM_SHELL -> ELECTRON in env vars 2016-05-27 14:06:04 -07:00
Kevin Sawicki
4734cbaf1c Move custom fork content to app distribution doc 2016-05-27 14:06:04 -07:00
Paul Betts
153a7f19ae Add notes on S3 directory structure 2016-05-27 14:06:04 -07:00
Paul Betts
0b27db2ef4 Create guide for how to create your own from-source Electron fork
This PR adds the notes on how to use Surf to build and upload a custom version of Electron
2016-05-27 14:06:04 -07:00
Kevin Sawicki
b465f2c3c4 Remove duplicate hidden-inset check 2016-05-27 13:27:35 -07:00
Kevin Sawicki
1e99f656cc Merge pull request #5737 from electron/browser-window-proxy-print
Add print() to BrowserWindowProxy
2016-05-27 11:33:08 -07:00
Kevin Sawicki
84f6015037 Call print on webContents 2016-05-27 11:11:55 -07:00
Felix Rieseberg
fa7f084625 📠 Add print() to BrowserWindowProxy
Closes #5685
2016-05-27 11:11:19 -07:00
Kevin Sawicki
fc4b224dec Add asserts for properties 2016-05-27 10:52:56 -07:00
Kevin Sawicki
59dd7ca9df Guard against object with no hasOwnProperty 2016-05-27 10:46:02 -07:00
Kevin Sawicki
7cf6be07a6 Add failing spec for remote property with no prototype 2016-05-27 10:45:39 -07:00
Kevin Sawicki
ac394ec3ef Merge pull request #5725 from electron/clipboard-api-names
Upper case initialisms in clipboard API
2016-05-27 09:09:12 -07:00
Daniel Pham
0c710fce33 🍎 Fix 'setAspectRatio(0)' not resetting the default behaviour. 2016-05-27 08:56:34 -04:00
Cheng Zhao
9ab76fb884 Add webContents.sendToAll to send message to all frames 2016-05-27 16:58:49 +09:00
Cheng Zhao
c1facec5a6 No need to hijack setInjectedScriptForOrigin 2016-05-27 15:12:49 +09:00
Cheng Zhao
134f9019eb Enable node integration for pages in devtools extension 2016-05-27 15:10:46 +09:00
Cheng Zhao
7e1f159185 Run content scripts at correct phase 2016-05-27 11:12:51 +09:00
Cheng Zhao
49d9446cce Implement a simple content script injector 2016-05-27 10:29:57 +09:00
Cheng Zhao
97c04735a2 Handle unloading devtools correctly 2016-05-27 09:55:59 +09:00
Cheng Zhao
a63ff714f8 Read content_scripts to preferences 2016-05-27 09:47:37 +09:00
Cheng Zhao
7eab259d92 Make it possible to only set preferences for BrowserWindow 2016-05-27 09:20:46 +09:00
Cheng Zhao
4fb9e20c33 Add API to set render process preferences 2016-05-27 08:51:02 +09:00
Daniel Pham
f4c3f0423a 🎁 Add 'app.releaseSingleInstance()' 2016-05-26 18:50:06 -04:00
Cheng Zhao
b646d7a55c The consts 2016-05-27 07:43:23 +09:00
Daniel Pham
b0c72adbe1 🍎 Fix context menus only showing on primary monitor. 2016-05-26 17:43:38 -04:00
Kevin Sawicki
23962e133e Use correct TODO format 2016-05-26 14:28:33 -07:00
Kevin Sawicki
efeb9647ff Update docs for new API names 2016-05-26 14:26:12 -07:00
Kevin Sawicki
71b73a9cfb Use new APIs 2016-05-26 14:24:47 -07:00
Kevin Sawicki
dc7316f52f Upper case abbreviations 2016-05-26 14:23:20 -07:00
Felix Rieseberg
836f8ab33c 🐛 Fix setFullscreen() on Windows
This ensures that a BrowserWindow responds to `setFullscreen(true)` if
`full screenable` was not defined during creation.

This bug was on Windows only.
2016-05-26 11:52:25 -07:00
Cheng Zhao
cdfbe876a5 Make sure chrome.devtools.inspectedWindow.tabId is set 2016-05-26 19:57:10 +09:00
Cheng Zhao
edd8210ae5 Add simple support for background page 2016-05-26 19:57:10 +09:00
Cheng Zhao
99c1434051 Store the original manifest file 2016-05-26 18:38:20 +09:00
Cheng Zhao
513b66f207 Cleanup chrome-extension.js after the Coffe2ES transfer 2016-05-26 18:38:20 +09:00
Cheng Zhao
f29598d907 getHostForPath => generateHostForPath
The original name implies no side effect, but is is not true.
2016-05-26 18:38:20 +09:00
Cheng Zhao
c1272743b9 Bump v1.2.0 2016-05-26 18:07:52 +09:00
Cheng Zhao
eeb996e92f Merge pull request #5710 from electron/chrome-lastest-stable
Update to Chrome 51.0.2704.63
2016-05-26 09:07:24 +00:00
Cheng Zhao
eb8284e285 Update to Chrome 51.0.2704.63 2016-05-26 18:06:55 +09:00
Cheng Zhao
20b09e9d03 Merge pull request #5701 from danhp/propagate-close
Properly notify observers when window prevents close
2016-05-26 05:33:55 +00:00
Cheng Zhao
93b8237e1f Merge pull request #5700 from felixrieseberg/standard-7
Implement JavaScript Standard Style 7
2016-05-26 04:57:36 +00:00
Cheng Zhao
8a4b7eb062 Merge pull request #5689 from cdaringe/master
Support non-native promises
2016-05-26 04:49:40 +00:00
Cheng Zhao
4ea7602871 Merge pull request #5684 from electron/webview-visibilitychange
Support document visibility and events in webviews
2016-05-26 01:07:24 +00:00
Cheng Zhao
fa1246ccf7 Merge pull request #5683 from electron/no-more-atom-shell
Rename remaining Atom Shell references
2016-05-26 01:06:36 +00:00
Cheng Zhao
0b9c11a5f2 Fix pylint warnings 2016-05-26 10:06:25 +09:00
Kevin Sawicki
4e44900930 Initialize guest_instance_id 2016-05-25 18:05:37 -07:00
Daniel Pham
d1c302800f Fix: Properly notify observers when window prevents close 2016-05-25 19:26:57 -04:00
Felix Rieseberg
bef6748c06 🎨 Implement JS Standard Code Style 7
Updates Standard Code Style to 7 (latest major) and ensures that code
is conform.

 * camelCase is now enforced
 * No assignments in return statements
2016-05-25 16:20:49 -07:00
Kevin Sawicki
75754804af Use auto for embedder var 2016-05-25 10:34:33 -07:00
Kevin Sawicki
88f665bc1b Restore original include location 2016-05-25 10:28:35 -07:00
Kevin Sawicki
814e4377a4 Restore original comment position 2016-05-25 10:26:59 -07:00
Kevin Sawicki
6632547b17 parent -> embedder 2016-05-25 10:26:20 -07:00
Kevin Sawicki
89ffa02d75 Tweak comment 2016-05-25 10:26:05 -07:00
Kevin Sawicki
b1ce57faa9 Remove redundant atom:: namespace use 2016-05-25 10:22:43 -07:00
Kevin Sawicki
03c6fbf80f 🎨 2016-05-25 10:20:00 -07:00
Kevin Sawicki
f58322891b Remove added switch/option 2016-05-25 10:17:35 -07:00
Kevin Sawicki
583bb49f6c Get hidden state by using parent window directly 2016-05-25 10:13:12 -07:00
Kevin Sawicki
69c69880e5 Tweak spec description 2016-05-25 09:12:52 -07:00
Kevin Sawicki
4e68a8d16e Remove logging in parent page 2016-05-25 09:12:52 -07:00
Kevin Sawicki
73b07f76a3 Support document visiblity state and events in webviews 2016-05-25 09:12:52 -07:00
Kevin Sawicki
1e15ce6ccd Add failing spec for webview visiblity changes 2016-05-25 09:12:52 -07:00
cdaringe
32073fa079 🎨 Support non-native promises 2016-05-25 10:11:18 -06:00
Kevin Sawicki
9684f61e12 atom_gyp -> electron_gyp 2016-05-25 09:10:46 -07:00
Kevin Sawicki
6c8cf16508 Deprecate ATOM_SHELL_GITHUB_TOKEN 2016-05-25 09:08:10 -07:00
Kevin Sawicki
43f0dfd0ab Deprecate old S3 env vars 2016-05-25 09:08:09 -07:00
Kevin Sawicki
1bdb9f3de0 Add fallback s3 config values 2016-05-25 09:08:09 -07:00
Kevin Sawicki
94c8b0e1b1 atom_shell -> electron 2016-05-25 09:08:09 -07:00
Kevin Sawicki
7e209dd982 ATOM_SHELL_INTERNAL_CRASH_SERVICE -> ELECTRON_INTERNAL_CRASH_SERVICE 2016-05-25 09:08:09 -07:00
Kevin Sawicki
8f1943bc7b Link to other apps 2016-05-25 09:08:09 -07:00
Kevin Sawicki
3dd2f709e0 Remove mention of Atom Shell 2016-05-25 09:08:09 -07:00
Cheng Zhao
b86ded3b54 Merge pull request #5688 from enlight/patch-1
Improve documentation of `ses.cookies.set()`
2016-05-25 10:44:33 +00:00
Cheng Zhao
3ef0947718 Merge pull request #5687 from electron/fix-invalid-parameter
Ignore invalid parameter error on Window
2016-05-25 07:03:33 +00:00
Vadim Macagon
c2633460eb Improve documentation of ses.cookies.set()
Fix description of the `details.url` param in `ses.cookies.set()`, and clarify the fact that cookies without an expiration date will not be retained between sessions.
2016-05-25 12:46:17 +07:00
Cheng Zhao
34c4e797bb Truncate the strings passed to google_breakpad::CustomInfoEntry 2016-05-25 14:46:15 +09:00
Cheng Zhao
545c9f5bed Ignore invalid parameter error in Electron 2016-05-25 14:46:15 +09:00
Cheng Zhao
4cd0de0e87 Merge pull request #5682 from electron/remove-old-run-as-node-env-var
Remove ATOM_SHELL_INTERNAL_RUN_AS_NODE support
2016-05-25 02:17:18 +00:00
Cheng Zhao
b1226a908b Update node: remove ATOM_SHELL_INTERNAL_RUN_AS_NODE 2016-05-25 10:55:02 +09:00
Cheng Zhao
f34cd8767c Merge pull request #5658 from danhp/handoff-fallback
Add fallback URL to handoff
2016-05-25 01:13:03 +00:00
Daniel Pham
eb0889de38 🍎 Add fallback URL to handoff. 2016-05-24 21:06:14 -04:00
Cheng Zhao
e97ce6f7e1 Merge pull request #5669 from felixrieseberg/build-instructions
Update Windows Build Instructions
2016-05-24 23:49:37 +00:00
Kevin Sawicki
89538b19ee Upgrade node for ELECTRON_RUN_AS_NODE change 2016-05-24 10:42:09 -07:00
Kevin Sawicki
b68d1ecb83 Remove ATOM_SHELL_INTERNAL_RUN_AS_NODE support 2016-05-24 10:17:57 -07:00
Kevin Sawicki
407a5d4415 Merge pull request #5681 from electron/default-app-error-handling
Tweak default app error handling
2016-05-24 10:15:56 -07:00
Kevin Sawicki
3e15021c12 Remove . after path to prevent confusion 2016-05-24 09:56:36 -07:00
Kevin Sawicki
ca72d4346b application -> app for consitency 2016-05-24 09:53:23 -07:00
Kevin Sawicki
74cde4e714 Log stack when available 2016-05-24 09:51:09 -07:00
Kevin Sawicki
48522d4b70 Remove custom MODULE_NOT_FOUND code check 2016-05-24 09:45:32 -07:00
Kevin Sawicki
63b84923ce Update copy 2016-05-24 09:43:25 -07:00
Kevin Sawicki
4a35206302 🎨 2016-05-24 09:42:31 -07:00
Kevin Sawicki
6de4249af8 Tweak resolve filename error message 2016-05-24 09:41:31 -07:00
Kevin Sawicki
deb15e60b5 Lead with package.json path 2016-05-24 09:38:04 -07:00
Kevin Sawicki
f691a46d4d Use dialog.showErrorBox 2016-05-24 09:37:52 -07:00
Kevin Sawicki
67c88d2f8a Move Module require to top 2016-05-24 09:33:55 -07:00
Kevin Sawicki
4d56437a26 Merge pull request #5610 from bigtimebuddy/master
The "Error opening app" dialog
2016-05-24 09:22:11 -07:00
Felix Rieseberg
2a7590529e 📝 Update Windows Build Instructions
Closes #5655
2016-05-24 06:12:07 -07:00
Cheng Zhao
28e2058ff1 Merge pull request #5648 from electron/chrome51
Update to Chrome 51
2016-05-24 10:59:11 +00:00
Cheng Zhao
1dd98171f4 Bump v1.1.2 2016-05-24 15:59:21 +09:00
Cheng Zhao
994cc62031 Merge pull request #5668 from electron/strip-ffmpeg
Strip ffmpeg in zip file
2016-05-24 04:33:09 +00:00
Cheng Zhao
cd444e82f9 Merge pull request #5666 from electron/remote-promise-reject
Handle rejection of remote promises
2016-05-24 04:30:25 +00:00
Cheng Zhao
9d924bb6d7 Merge pull request #5662 from electron/electron-require
Always return internal module when requiring electron
2016-05-24 01:46:36 +00:00
Cheng Zhao
995a20a125 Merge pull request #5653 from electron/menu-position-fix
Fix context menu not showing correctly in devtools
2016-05-24 01:02:48 +00:00
Kevin Sawicki
677a317274 Strip ffmpeg in zip file 2016-05-23 15:47:07 -07:00
Jessica Lord
1ba07a9d6d Merge pull request #5659 from danhp/patch-2
Mention that x and y have to be used together when creating new window
2016-05-23 15:44:42 -07:00
Kevin Sawicki
a4f94b89b4 Add comment about Module path 2016-05-23 15:15:39 -07:00
Kevin Sawicki
5e2f36387f Move require spec to api-app-spec 2016-05-23 15:14:55 -07:00
Kevin Sawicki
4a41311409 Test that calling regular module succeeds 2016-05-23 15:14:55 -07:00
Kevin Sawicki
6ac0151e65 Remove lint warnings 2016-05-23 15:14:55 -07:00
Kevin Sawicki
fe0ec67623 Add spec for electron module require 2016-05-23 15:14:55 -07:00
Kevin Sawicki
19fd841c30 🎨 2016-05-23 15:14:55 -07:00
Kevin Sawicki
566b0676bc Pre-resolve electron require path 2016-05-23 15:14:55 -07:00
Kevin Sawicki
daea448b61 .coffee -> .js 2016-05-23 15:14:55 -07:00
Kevin Sawicki
7929daa48c Pass both callback values to then 2016-05-23 15:07:01 -07:00
Kevin Sawicki
f3af1dbd54 Add failing spec for rejected remote promise 2016-05-23 15:06:46 -07:00
Matt Karl
ee61a2880a Removes main error, fixes messaging for JSON parse 2016-05-23 16:47:55 -04:00
Kevin Sawicki
1c9fe8d23e Merge pull request #5664 from electron/cibuild-ps1
Add a Windows script to just invoke cibuild
2016-05-23 13:07:18 -07:00
Paul Betts
52888c97b5 Add a Windows script to just invoke cibuild 2016-05-23 12:37:47 -07:00
Matt Karl
58d9d2cf41 Adds JSON parse, invalid and missing main field errors 2016-05-23 15:00:55 -04:00
Daniel Pham
5010150c8c 📝 Mention that x and y have to be used together when creating new window
[ci skip]
2016-05-23 13:00:43 -04:00
Cheng Zhao
3402c7be3f Suppress ffi test on Windows 2016-05-23 23:31:00 +09:00
Cheng Zhao
37a4267450 Update brightray: fix Windows linking problem 2016-05-23 23:24:43 +09:00
Cheng Zhao
2208b8bd6e Update symbol names of icu 2016-05-23 22:53:50 +09:00
Cheng Zhao
2edf559571 Update brightray: fix OS X linking problem 2016-05-23 22:05:26 +09:00
Cheng Zhao
0d4f1abdf9 Move the menu sightly higher when repositioning the menu
Otherwise the menu is not able to show the last menu item and the arrow
will show.
2016-05-23 21:54:06 +09:00
Cheng Zhao
b866b34ac8 The unit of position is CGFloat 2016-05-23 21:53:50 +09:00
Cheng Zhao
fca91db133 Fix showing context menu in devtools 2016-05-23 21:08:16 +09:00
Cheng Zhao
badecb49f3 Update brightray: fix Linux linking problem 2016-05-23 19:50:05 +09:00
Cheng Zhao
9f858e1243 Merge branch 'master' into chrome51 2016-05-23 19:49:43 +09:00
Cheng Zhao
c489d6d4b3 Merge pull request #5638 from deepak1556/iwa_patch
browser: flags to control iwa enabled server whitelist
2016-05-23 10:48:30 +00:00
Cheng Zhao
208acd1b9c Update brightray: Manage NetLog in BrowserClient 2016-05-23 19:02:40 +09:00
Cheng Zhao
1b9bced8c0 Merge pull request #5644 from leethomas/fix/osx-aspect-ratio
🍎  let Cocoa handle keeping aspect ratio on window resize
2016-05-23 08:15:44 +00:00
Cheng Zhao
f756a3e682 Fix crash when quitting 2016-05-23 17:03:49 +09:00
Cheng Zhao
44651656dd Fix building on Windows 2016-05-23 16:39:19 +09:00
Cheng Zhao
9d82041923 Fix js lint warnings 2016-05-23 16:15:39 +09:00
Cheng Zhao
d6f9e57e33 Fix chrome.devtools not available in devtools extensions 2016-05-23 16:04:37 +09:00
Cheng Zhao
de1fc9d432 Fix building on Linux 2016-05-23 15:27:01 +09:00
deepak1556
f68d0f324f deprecate app.allowNTLMCredentialsForAllDomains 2016-05-23 11:44:21 +05:30
Cheng Zhao
a92b4a6da4 Make |button| default to left button
This fixes the failing test of sendInputEvent.
2016-05-23 14:27:39 +09:00
Cheng Zhao
fa0ce7ad5f Adjust to the new behaviors of beforeunload handler 2016-05-23 14:27:39 +09:00
Cheng Zhao
06800940ec Fix cpplint warnings 2016-05-23 13:03:43 +09:00
Cheng Zhao
4b675a741d Init feature list in node process
It is a new dependency of gin.
2016-05-23 13:01:47 +09:00
Cheng Zhao
530f19e956 Fix crash due to site_instace being freed early 2016-05-23 12:57:46 +09:00
Cheng Zhao
899cdb48d7 Fix using invalid pointer as SiteInstance 2016-05-23 12:46:14 +09:00
Cheng Zhao
a2bd55dd3c Adapt to changes of Chrome 51 API changes (Part 2) 2016-05-23 12:29:14 +09:00
leethomas
de27b34891 disregard extraSize when initially setting the aspect ratio 2016-05-22 19:09:21 -07:00
Cheng Zhao
7ba391da7c Update to API changes of Chrome 51 2016-05-23 10:59:39 +09:00
leethomas
1d61f987cb code styling 2016-05-22 18:59:00 -07:00
Cheng Zhao
05c2999651 Update to Chrome 51.0.2704.54 2016-05-23 10:11:19 +09:00
Cheng Zhao
fd5f120434 Merge pull request #5646 from electron/update-breakpad
Fix crash reporter not working on x64 Windows
2016-05-23 00:25:24 +00:00
leethomas
09de0c2766 call base SetAspectRatio in NativeWindowMac implementation 2016-05-22 17:22:57 -07:00
leethomas
ac6e4aff5e comments 2016-05-22 17:00:14 -07:00
Cheng Zhao
13b4c8bb06 Ignore invalid parameter error in crash service process 2016-05-23 08:59:34 +09:00
leethomas
7aaf974362 override SetAspectRatio for NativeWindowMac 2016-05-22 16:50:50 -07:00
leethomas
8f7a04f9c3 🍎 let Cocoa handle keeping the aspect ratio whenever the edges are dragged 2016-05-22 15:43:47 -07:00
deepak1556
62cad610e0 bring back app.allowNTLMCredentialsForAllDomains 2016-05-23 01:52:09 +05:30
Cheng Zhao
4c531e909b Update breakpad to lastest master 2016-05-22 22:06:12 +09:00
Cheng Zhao
b52b6e12c4 Merge pull request #5640 from electron/update-crashpad
Update crashpad to latest master
2016-05-22 12:47:34 +00:00
Cheng Zhao
48b161f210 Update crashpad to 35da3b6 2016-05-22 21:00:16 +09:00
Cheng Zhao
06da5d543c Merge pull request #5622 from kcrt/jpmanual
Japanese manual: Update tutorials and api
2016-05-22 07:57:36 +00:00
Cheng Zhao
5267d734bb Merge pull request #5634 from deepak1556/net_error_description_patch
renderer: generate net error strings when requested
2016-05-22 00:34:56 +00:00
deepak1556
3db2daf790 browser: flags to control iwa enabled server whitelist 2016-05-21 23:38:50 +05:30
TAKAHASHI Kyohei
9d02292dec Japanese manual: modified template string
modified based on the comments from Flatta
[ci skip]
2016-05-22 00:22:51 +09:00
TAKAHASHI Kyohei
77eb0e8e3f Japanese manual: Update tutorials and api
[ci skip]
2016-05-22 00:17:20 +09:00
Cheng Zhao
6f3d0e1782 Merge pull request #5603 from leethomas/osx-horizontal-sheet-offset
Osx horizontal sheet offset
2016-05-21 14:07:53 +00:00
Cheng Zhao
6c8ffcf7a0 Merge pull request #5631 from electron/x64-by-default-win32
Default to amd64 on Windows
2016-05-21 13:39:25 +00:00
Cheng Zhao
363ab2075c Update libchromiumcontent for #5618 2016-05-21 20:48:06 +09:00
deepak1556
c9b314d43c renderer: generate net error strings when requested 2016-05-21 10:21:15 +05:30
Paul Betts
0e63050916 Default to amd64 on Windows 2016-05-20 14:20:48 -07:00
Kevin Sawicki
8821cae34f Merge pull request #5630 from electron/env-var-headings
Use ### for env var headings
2016-05-20 14:05:15 -07:00
Kevin Sawicki
f16f48aa7c Tweak example intros 2016-05-20 14:04:01 -07:00
Kevin Sawicki
e1d9229507 Tweak intro sentence 2016-05-20 14:03:28 -07:00
Kevin Sawicki
588420ecd2 Use active voice 2016-05-20 14:02:10 -07:00
Kevin Sawicki
d56c36b4a7 Minor wording updates 2016-05-20 14:01:08 -07:00
Kevin Sawicki
d983eb42e6 Use ### for headings for consistency 2016-05-20 13:58:48 -07:00
Matt Karl
b08393a663 Fixed linting error 2016-05-20 16:01:08 -04:00
Matt Karl
a1e59b814c Changed default button, updated link 2016-05-20 13:29:42 -04:00
Kevin Sawicki
f52cd31d0d Merge pull request #5625 from electron/doc-headings
Capitalize Object in doc heading
2016-05-20 10:01:54 -07:00
Kevin Sawicki
f266b979af Capitalize Object 2016-05-20 09:25:10 -07:00
Matt Karl
25cb0fcbb9 Added Learn More button 2016-05-20 11:04:10 -04:00
Cheng Zhao
8b9d189671 Merge pull request #5624 from electron/hicon
Feed Windows APIs with ICO icons of appropriate size
2016-05-20 14:30:00 +00:00
Cheng Zhao
3182485e68 No need to reference the icon in Tray 2016-05-20 22:44:02 +09:00
Cheng Zhao
a93c9462ed Add BrowserWindow.setIcon 2016-05-20 22:22:15 +09:00
Cheng Zhao
b33c04d041 docs: Recommend to use ICO icon 2016-05-20 19:58:47 +09:00
Cheng Zhao
d26480b74e Correctly set window icon from ICO 2016-05-20 19:46:05 +09:00
Cheng Zhao
ea2807c890 Make it possible to get different size of icons from ICO 2016-05-20 17:51:05 +09:00
Cheng Zhao
0059e7bcf9 Use LoadIconMetric to load correct icon 2016-05-20 17:12:07 +09:00
Cheng Zhao
9e26e5c121 Load HICON directly in NotifyIcon 2016-05-20 16:55:22 +09:00
Cheng Zhao
67d9ae27c3 Remove the JavaScript wrapper for setContextMenu 2016-05-20 16:18:38 +09:00
Cheng Zhao
adfd99f5f0 Convert to mate::Handle<NativeImage> instead of gfx::Image 2016-05-20 16:14:40 +09:00
leethomas
9196a9f334 update docs 2016-05-19 20:32:14 -07:00
leethomas
7d93642f42 extend setSheetOffset to accept an optional 2nd offset 2016-05-19 20:32:06 -07:00
Cheng Zhao
7c34d8333c Store ico image in HCION 2016-05-20 11:31:02 +09:00
Cheng Zhao
d5f3e5d59a Bump v1.1.1 2016-05-20 09:30:24 +09:00
Cheng Zhao
8ac93e02c6 Merge pull request #5616 from electron/inherit-zoom
Inherit zoomFactor in webview
2016-05-20 00:27:06 +00:00
Cheng Zhao
4193fb1742 Merge pull request #5617 from electron/dont-return-from-on-functions
Remove returns from event listeners
2016-05-20 00:26:29 +00:00
Cheng Zhao
844f9e989b Merge pull request #5611 from jviotti/fix/invalid-archive-asar-exec
Override `child_process.execFile` asar patch for `child_process.exec`
2016-05-20 00:24:10 +00:00
Cheng Zhao
d6dffc570c Merge pull request #5614 from electron/bengotow-remote-docs
Update remote.md to mention enumerable property limitation
2016-05-19 23:54:20 +00:00
Cheng Zhao
4a075866de Merge pull request #5608 from Gaserd/patch-4
docs : Russian
2016-05-19 23:51:22 +00:00
Kevin Sawicki
cc7395eea8 Remove returns from event listeners 2016-05-19 15:28:08 -07:00
Kevin Sawicki
b09c81202a Add test for webview zoomFactor inheritance 2016-05-19 14:46:52 -07:00
Kevin Sawicki
4754e4aabb Add zoomFactor to guest params 2016-05-19 14:32:16 -07:00
Kevin Sawicki
fef2f789cd 🎨 2016-05-19 14:30:53 -07:00
Juan Cruz Viotti
1a27ecdad4 Override child_process.execFile asar patch for child_process.exec
NodeJS implements `child_process.exec` by simply passing the whole
command to `child_process.execFile`. See:

- https://github.com/nodejs/node/blob/master/lib/child_process.js#L90
- https://github.com/nodejs/node/blob/master/lib/child_process.js#L99

Electron patches `child_process.execFile` to add support for `asar`
archives by injecting logic that extracts the required files from the
`asar` to a temporary location before delegating the work to the
original `child_process.execFile`.

In order to decide whether to inject the custom `asar` extracting logic,
Electron makes use of a helper function called `splitPath()`. See:

- https://github.com/electron/electron/blob/master/lib/common/asar.js#L37

If the first argument of the returned array equals `true`, means that
the path is considered to be an `asar` archive, and thus the extraction
logic takes place. The problem is that if the command passed to
`child_process.execFile` *contains* a path to an asar archive, padded
with other commands/arguments, `splitPath()` will consider it to be an
`asar` archive, and will try to extract it, throwing a rightfully
`Invalid package` error.

Fixes: https://github.com/electron/electron/issues/5571
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
2016-05-19 17:19:36 -04:00
Ben Gotow
2bade868bb Update remote.md to mention enumerable property limitation
#5599
2016-05-19 09:31:02 -07:00
Matt Karl
e87ced60e5 The "Error opening app" dialog, now with less attitude 2016-05-19 10:33:22 -04:00
Sergey
836e2e4e91 docs : Russian
Russian language for http://electron.atom.io/docs/tutorial/mac-app-store-submission-guide/
2016-05-19 16:46:42 +03:00
Cheng Zhao
a2b6731bf2 Merge pull request #5606 from electron/process-docs
Cleanup the docs of process object
2016-05-19 11:59:37 +00:00
Cheng Zhao
983d611e96 Cleanup the docs of process object 2016-05-19 20:12:56 +09:00
Cheng Zhao
0bd3e28a05 Merge pull request #5526 from electron/process-stats
Process and System memory statistics API
2016-05-19 10:34:01 +00:00
Cheng Zhao
480f0fbfd7 Merge pull request #5600 from tensor5/update_clang_only_if_needed
Update Clang only if needed
2016-05-19 10:29:29 +00:00
Cheng Zhao
590c2bcf23 Merge pull request #5604 from preco21/korean-docs-5
docs: Update Korean docs as upstream
2016-05-19 10:27:03 +00:00
Cheng Zhao
8fd9957453 Merge pull request #5605 from preco21/document-fixes-5
docs: Improve docs
2016-05-19 10:26:38 +00:00
Cheng Zhao
e488320d37 Ignore failures of OS X on Travis CI 2016-05-19 19:23:02 +09:00
Cheng Zhao
195e0e64d0 Update brightray for #5578 2016-05-19 19:22:32 +09:00
Cheng Zhao
17528a4dfd Merge pull request #5578 from deepak1556/disable_http2_patch
browser: flag to disable HTTP/2 and SPDY/3.1 protocols
2016-05-19 10:21:36 +00:00
Cheng Zhao
53d0db0a28 Merge pull request #5602 from electron/static-linking-vs-runtime
Link with VS2015 libraries statically for Release build
2016-05-19 09:50:53 +00:00
Plusb Preco
d6ab81c1da 📝 Fix link to improve readability
[ci skip]
2016-05-19 18:36:26 +09:00
Plusb Preco
3ee9eef308 📝 Remove unused link
[ci skip]
2016-05-19 18:34:08 +09:00
Plusb Preco
9cbcd228f3 📝 Adjust line length to 80
[ci skip]
2016-05-19 18:32:43 +09:00
Plusb Preco
e1bf0ea2b4 📝 Adjust line length to 80
[ci skip]
2016-05-19 18:28:29 +09:00
Plusb Preco
5c8ecd8a97 📝 Small fixes
* Adjust line length to `80`.
* Fix typos

[ci skip]
2016-05-19 18:28:00 +09:00
Plusb Preco
2b7c3735bd 📝 Update Korean docs as upstream
[ci skip]
2016-05-19 17:22:51 +09:00
Cheng Zhao
f8c1db160e Only use the osfhandle hack on Windows 2016-05-19 17:02:40 +09:00
Cheng Zhao
e609a5bee2 Fix passing fd across modules 2016-05-19 16:38:37 +09:00
leethomas
eaacbc86c7 📝 update english docs to include setSheetOffsets 2016-05-18 23:59:25 -07:00
Cheng Zhao
4702d8b640 No need to download and ship vs runtime libraries 2016-05-19 15:49:26 +09:00
leethomas
359123458d 🍎 allow x-axis offset to be set for sheets 2016-05-18 23:45:54 -07:00
Cheng Zhao
d8c05ecc0d Link with Vs2015 runtime statically for Release build 2016-05-19 15:06:47 +09:00
Cheng Zhao
f441ba2694 Merge pull request #5601 from electron/team-id
Include team ID in the base bundle ID
2016-05-19 03:24:31 +00:00
Cheng Zhao
5d906c0e4e docs: Team ID is now required for signing 2016-05-19 11:13:09 +09:00
Cheng Zhao
a361d50b95 Add team ID to base Bundle ID 2016-05-19 10:57:57 +09:00
Nicola Squartini
18b2094198 Update Clang only if needed 2016-05-19 10:14:57 +09:00
Kevin Sawicki
1032287511 Merge pull request #5588 from brunoqueiros/error-message
Improve error message
2016-05-18 17:41:57 -07:00
Cheng Zhao
d3beaa0b16 Merge pull request #5595 from miniak/asar-fix
Make js2asar.py more robust
2016-05-18 23:40:11 +00:00
Bruno Queiros
046cb0df8d 🎨 Use the same stack trace for both cases 2016-05-18 19:02:42 -03:00
Kevin Sawicki
97d903bca3 Merge pull request #5587 from kcrt/master
Japanese manual: add electron-versioning.
2016-05-18 13:55:10 -07:00
Kevin Sawicki
0456be1535 Merge pull request #5594 from Gaserd/patch-3
Create supported-platforms.md
2016-05-18 13:52:47 -07:00
Milan Burda
161bd89a24 Make js2asar.py more robust 2016-05-18 12:54:53 -07:00
Sergey
5f9976c46a Create supported-platforms.md
Create new file - supported-platforms.
Russian language for this page - http://electron.atom.io/docs/tutorial/supported-platforms/
2016-05-18 22:40:12 +03:00
Paul Betts
872c6ea763 📝 2016-05-18 11:08:04 -07:00
Paul Betts
e995befcd0 Move everything into atom_bindings 2016-05-18 11:07:30 -07:00
Paul Betts
d49302858b Merge pull request #5589 from Gaserd/patch-2
исправление ошибки в слове
2016-05-18 10:57:53 -07:00
Sergey
d3e0c08255 исправление ошибки в слове
ничего критичного, просто букву не ту поставили.
2016-05-18 18:04:52 +03:00
Bruno Queiros
06e3e65c1b 🎨 Improve error message 2016-05-18 11:00:08 -03:00
TAKAHASHI Kyohei
962ce6c44c Japanese manual: add electron-versioning.
electron-versioning.md is translated.
Other tutorial files are updated.
[ci skip]
2016-05-18 22:33:21 +09:00
Cheng Zhao
e05f795d1d Merge pull request #5584 from electron/sandbox-no-expl
Enable sandboxing without using temporary-exception
2016-05-18 10:02:30 +00:00
Cheng Zhao
906948218f docs: Update MAS guide without using temporary-exception 2016-05-18 16:48:22 +09:00
Cheng Zhao
deddf98533 Currently set base bundle ID 2016-05-18 16:42:26 +09:00
Plusb Preco
d7fdb16078 📝 Update Korean docs as upstream
[ci skip]
2016-05-18 16:41:21 +09:00
Cheng Zhao
d2a567d6ab Merge pull request #5582 from electron/notification-user-info
Pass userInfo in systemPreferences.subscribeNotification
2016-05-18 07:36:31 +00:00
Cheng Zhao
3d0b98c9ca Use string description for unknown types 2016-05-18 16:01:08 +09:00
Cheng Zhao
68cf267b1d Do not convert NSDictionary to JSON 2016-05-18 15:49:33 +09:00
Cheng Zhao
240c346d02 Ignore invalid JSON object when converting NSDictionary 2016-05-18 14:54:37 +09:00
Cheng Zhao
97250b53e8 Pass userInfo in subscribeNotification 2016-05-18 14:40:19 +09:00
Cheng Zhao
49cca0978d Merge pull request #5580 from electron/annoymous-web-contents
Add support for anonymous WebContents
2016-05-18 05:31:10 +00:00
Cheng Zhao
87c10b3ac2 Make non-public module accesible via remote 2016-05-18 13:57:48 +09:00
Cheng Zhao
5f6c468f0f Handle keyboard events for WebContents that do not have owner window 2016-05-18 13:57:48 +09:00
Cheng Zhao
dc9b3fcef7 Remove WebViewGuestDelegate::HandleKeyboardEvent 2016-05-18 13:57:48 +09:00
Cheng Zhao
d6cb84f8a3 WebContents without owner window should always open detached devtools 2016-05-18 13:57:48 +09:00
Cheng Zhao
998ce73ad9 Add webContents.id property 2016-05-18 13:57:48 +09:00
Cheng Zhao
8a061b7183 A normal WebContents can have no owner window 2016-05-18 13:57:48 +09:00
Cheng Zhao
118afab67b Make sure BrowserContext is always destroyed after WebContents 2016-05-18 13:57:48 +09:00
Plusb Preco
7fd3149031 📝 Update Korean docs as upstream
[ci skip]
2016-05-18 12:15:29 +09:00
Cheng Zhao
242508e22f Merge pull request #5574 from electron/devtools-extension-test
Add test that loads a devtools extension
2016-05-18 01:46:44 +00:00
Cheng Zhao
5368da18ad Merge pull request #5575 from electron/link-to-spectron
Add spectron to ChromeDriver doc
2016-05-18 01:34:56 +00:00
deepak1556
467ccabb7e browser: flag to disable HTTP/2 and SPDY/3.1 protocols 2016-05-18 06:56:58 +05:30
Cheng Zhao
397d0e34ee Merge pull request #5559 from electron/disable-webview
Disable webview when nodeIntegration is off
2016-05-18 01:26:58 +00:00
Cheng Zhao
27da0f3338 Merge pull request #5576 from electron/title-tweaks
Tweak doc headings
2016-05-18 01:26:27 +00:00
Cheng Zhao
c7f5210b50 Merge pull request #5567 from felixrieseberg/versioning
Add Information about Versioning
2016-05-18 00:43:23 +00:00
Cheng Zhao
7bd11c14f6 Update brightray to fix linking problem on Linux 2016-05-18 09:42:38 +09:00
Kevin Sawicki
cee31ff67a Remove semicolon 2016-05-17 16:42:37 -07:00
Kevin Sawicki
9266f9abfc Update interval id variable name 2016-05-17 16:42:21 -07:00
Kevin Sawicki
f95c46d987 Show last panel by id 2016-05-17 16:40:34 -07:00
Kevin Sawicki
866260a2a6 with -> on 2016-05-17 16:05:47 -07:00
Kevin Sawicki
bfb75df49c Tweak doc headings 2016-05-17 16:02:54 -07:00
Kevin Sawicki
b301c473cd Simplify sentence 2016-05-17 15:14:50 -07:00
Kevin Sawicki
3f3871b1be Add spectron section 2016-05-17 15:13:26 -07:00
Kevin Sawicki
2043356fa3 Recommend electron-chromedriver 2016-05-17 15:09:09 -07:00
Kevin Sawicki
13cfc2d2a0 Add comment about panel switching via input event 2016-05-17 15:05:58 -07:00
Kevin Sawicki
8d0c5c30b8 Use consistent function styles 2016-05-17 15:05:27 -07:00
Kevin Sawicki
0b4b79d0a4 Use control on non-mac platforms 2016-05-17 15:01:32 -07:00
Kevin Sawicki
7db2601ea8 DRY up specs 2016-05-17 14:59:33 -07:00
Kevin Sawicki
77b074fbad Add spec for undocked devtools 2016-05-17 14:56:00 -07:00
Paul Betts
dc86ec8ddd Come Correct with Wrapping 2016-05-17 14:54:33 -07:00
Kevin Sawicki
189380d4ea Add spec for devtools extension 2016-05-17 14:52:45 -07:00
Paul Betts
bfb4867e10 🔥 old docs 2016-05-17 14:52:01 -07:00
Paul Betts
1623622073 Dox 2016-05-17 14:48:49 -07:00
Paul Betts
ae2eec3efa Move process-stats methods to process 2016-05-17 14:47:56 -07:00
Paul Betts
b51be9b83f Add docs 2016-05-17 14:47:56 -07:00
Paul Betts
60bc2acd6c Linting 2016-05-17 14:47:56 -07:00
Paul Betts
cd7bc0e50c Rename Metrics => MemoryInfo so it's consistent 2016-05-17 14:47:56 -07:00
Paul Betts
75362450cd Everything is in KB 2016-05-17 14:47:56 -07:00
Paul Betts
191b054ff0 Implement process and system memory statistics 2016-05-17 14:47:56 -07:00
Paul Betts
f4538daa0a Wire it up 2016-05-17 14:47:56 -07:00
Paul Betts
a7ac7ba4c1 Add the dumbest new builtin that works 2016-05-17 14:47:56 -07:00
Felix Rieseberg
7e09b1664a 📝 Add Information about Versioning 2016-05-17 20:20:25 +02:00
Plusb Preco
ee9e28dfdf 📝 Update Korean docs as upstream
[ci skip]
2016-05-17 21:18:31 +09:00
Cheng Zhao
fb6f5320e7 Update brightray for #5348 2016-05-17 20:33:44 +09:00
Cheng Zhao
7ce87c470a docs: webview is only available with nodeIntegration on 2016-05-17 17:10:33 +09:00
Cheng Zhao
90f52169af No more need to check for nodeIntegration when creating guest view 2016-05-17 17:06:02 +09:00
Cheng Zhao
0140015500 spec: WebView is disabled when nodeIntegration is disabled 2016-05-17 17:04:13 +09:00
Cheng Zhao
c1399f9bdc Disable webview when nodeIntegration is off 2016-05-17 16:51:06 +09:00
Cheng Zhao
3fedea4b9e Merge pull request #5557 from electron/osx-buttons
Implement titleBarStyle without using NSFullSizeContentViewWindowMask
2016-05-17 16:48:45 +09:00
Cheng Zhao
13bfb099a2 Fix the toolbar showing when titleBarStyle is hidden-inset 2016-05-17 16:25:18 +09:00
Cheng Zhao
f53aabaef5 Implement titleBarStyle without using NSFullSizeContentViewWindowMask 2016-05-17 15:48:14 +09:00
Cheng Zhao
ecbb088ea6 Merge pull request #5542 from stevekinney/standardize-requires
Standardize requires
2016-05-16 10:42:12 +09:00
Cheng Zhao
f5442a4888 Merge pull request #5540 from kcrt/master
Update: Japanese version of MAS submission guide
2016-05-16 10:33:25 +09:00
Cheng Zhao
57f082055a Merge pull request #5509 from electron/bengotow/dialog-titles
Add buttonLabel param to showOpen/showSave dialogs
2016-05-16 10:27:28 +09:00
Cheng Zhao
e53bfad018 Fix building on Windows 2016-05-16 10:09:41 +09:00
Steve Kinney
0d3d097ce8 💄 Standarize requires in JavaScript API 2016-05-15 09:41:30 -04:00
Steve Kinney
2317b56ac4 💄 Make the power-save-blocker a bit more concise 2016-05-15 09:36:13 -04:00
TAKAHASHI Kyohei
16c870191f Update: Japanese version of MAS submission-guide 2016-05-15 15:42:35 +09:00
Ben Gotow
54c654530e Fix linux support 2016-05-15 01:29:13 -05:00
Ben Gotow
6217d497ed Fix build issues 2016-05-15 01:03:32 -05:00
Ben Gotow
84cce6c2c1 Don't default to "Open", "Save", just let OS decide 2016-05-15 01:03:32 -05:00
Ben Gotow
40c531737d Add buttonLabel param to showOpen/showSave dialogs 2016-05-15 01:03:32 -05:00
Cheng Zhao
88f3c34412 Merge pull request #5532 from stevekinney/patch-2
💄 Use ES6; clean up CoffeeScript conversion in BrowserWindow module
2016-05-15 12:38:28 +09:00
Steve Kinney
fd9c9c3be7 💄 Use spread operator instead of arguments object 2016-05-14 22:33:21 -04:00
Steve Kinney
236810a923 💄 Use ES6; clean up CoffeeScript conversion
💄 Destructure app module

Address linting errors
2016-05-14 22:33:20 -04:00
Cheng Zhao
88dc73ec3f Merge pull request #5533 from stevekinney/patch-3
💄 Destructure globalShortcut module
2016-05-15 11:16:19 +09:00
Cheng Zhao
195a4bb3c1 Merge pull request #5538 from electron/vs2015-runtime
Ship with runtime libraries of Visual Studio 2015
2016-05-15 11:15:49 +09:00
Cheng Zhao
c540721bd3 Merge pull request #5537 from electron/suppress-more-tests
Suppress the tests that need to call window.open on Travis CI
2016-05-15 11:15:42 +09:00
Steve Kinney
c11d18fe06 💄 Destructure globalShortcut module
💄 Remove globalShortcut property

Add back the globalShortcut property
2016-05-14 21:53:42 -04:00
Cheng Zhao
8ed3659bb8 Link with libraries of Visual Studio 2015 2016-05-15 10:41:43 +09:00
Cheng Zhao
ba7a32b16e Sync submodule recursively 2016-05-15 10:33:23 +09:00
Cheng Zhao
800ab50b56 Download redist files of VS2015 2016-05-15 10:30:19 +09:00
Cheng Zhao
f43b9665c1 And increase timeout for the rest 2016-05-15 10:00:29 +09:00
Cheng Zhao
14906eb6c8 Merge pull request #5530 from stevekinney/patch-1
💄 Add ES6; Clean up from CoffeeScript conversion in app module
2016-05-15 09:57:49 +09:00
Cheng Zhao
c53e47265d Merge pull request #5535 from Godoy/translate-pt-br
Translate tutorial/devtools-extension.md to Portuguese (pt-br).
2016-05-15 09:47:29 +09:00
Cheng Zhao
5986a302d1 Merge pull request #5531 from kcrt/patch-1
wrong link destination
2016-05-15 09:46:59 +09:00
Cheng Zhao
f5acc8b599 Merge pull request #5525 from stanfieldr/doc-improvements
A little confused by docs
2016-05-15 09:45:43 +09:00
Cheng Zhao
e5af03547f Merge pull request #5534 from kcrt/master
Translate tutorial/security.md to Japanese.
2016-05-15 09:41:52 +09:00
Cheng Zhao
861a79dd6a Suppress the tests that need to call window.open on Travis CI 2016-05-15 09:41:02 +09:00
Cheng Zhao
5fe270a78f Merge pull request #5522 from Wolfer/patch-1
Update application-distribution.md
2016-05-15 09:38:31 +09:00
Steve Kinney
b1275420a3 Require download_items inline 2016-05-14 19:43:30 -04:00
Adriano Godoy
fb161d5f1f PT-BR link to devtools-extension tutorial on README.md 2016-05-14 16:06:11 -03:00
Adriano Godoy
6ac24f592c Translate tutorial/devtools-extension.md to Portuguese (pt-br). 2016-05-14 16:01:52 -03:00
TAKAHASHI Kyohei
88d158f2c1 Translate tutorial/security.md to Japanese. 2016-05-15 02:37:55 +09:00
Steve Kinney
e5036c0988 Use anonymous function for wrapping native classes 2016-05-14 12:28:28 -04:00
TAKAHASHI, Kyohei
0b5efcbc75 wrong link destination 2016-05-15 00:36:11 +09:00
Steve Kinney
0785c3bd15 💄 Add spaces to comply with Standard 2016-05-14 11:31:08 -04:00
Steve Kinney
5dc88aa543 💄 Add ES6; Clean up from CoffeeScript conversion 2016-05-14 11:17:46 -04:00
Cheng Zhao
5ec2e8d7e5 Merge pull request #5413 from electron/process-resource-usage
Fetch Process resource usage from WebContents
2016-05-14 23:28:51 +09:00
Cheng Zhao
3214fdd73f Fix failing CI on OS X 2016-05-14 23:11:13 +09:00
Cheng Zhao
d3e359ab2d No need for explicit type conversion 2016-05-14 22:50:05 +09:00
Cheng Zhao
c740438032 Rename webFrame.purgeCaches to webFrame.clearCache
This matches the name of session.clearCache.
2016-05-14 22:48:25 +09:00
Cheng Zhao
7459581d13 Fix cpplint warnings 2016-05-14 22:40:18 +09:00
Cheng Zhao
03052e81c1 Merge pull request #5519 from danhp/context-menu-docs
Fix indentation for context menu docs.
2016-05-14 21:49:16 +09:00
Daniel Pham
1bac1a9028 📝 Fix styling of the context-menu docs
[ci skip]
2016-05-14 08:43:23 -04:00
Cheng Zhao
de08473ea3 Merge pull request #5518 from danhp/popup-show-all
Fix context menu positioning on OS X
2016-05-14 20:00:30 +09:00
Robert Stanfield
2d46f6f66f It isn't entirely clear to me that 'window-all-closed' is used for
this purpose. I originally looked for an event that would fire if
all windows were closed and the reason was NOT due to the application
quitting; however, this differs in that it is called regardless of
whether the app was quitting.
2016-05-13 21:34:42 -04:00
Serg F
2287ad6d37 Update application-distribution.md 2016-05-13 23:19:56 +03:00
Paul Betts
2234307d41 Whitespace issues 2016-05-13 10:54:10 -07:00
Paul Betts
652913f8d6 Just return the type directly 2016-05-13 10:54:10 -07:00
Paul Betts
19cba3ff85 Use doubles to represent memory size in bytes 2016-05-13 10:54:10 -07:00
Paul Betts
6f0057532a Forgot scripts 2016-05-13 10:54:10 -07:00
Paul Betts
908084c0fd Document resource methods 2016-05-13 10:54:10 -07:00
Paul Betts
d83c36e0fd Add a way to drop all cached memory 2016-05-13 10:54:10 -07:00
Paul Betts
22a3765394 Wire up a new method in web frame 2016-05-13 10:54:10 -07:00
Paul Betts
61e775c055 Write native_mate converters for WebCache::ResourceTypeStat and friends 2016-05-13 10:54:10 -07:00
Daniel Pham
bebf8eabca 🍎 Fix context menu positioning 2016-05-13 10:54:40 -04:00
Cheng Zhao
847d9580b7 Bump v1.1.0 2016-05-13 17:00:02 +09:00
Cheng Zhao
faf896db67 Merge pull request #5461 from electron/chrome50
Continue the work of Chrome 50 upgrade
2016-05-13 14:52:09 +09:00
Cheng Zhao
10f144069d Allow using __weak keyword 2016-05-13 13:49:53 +09:00
Cheng Zhao
29b799de73 Update clang revision to 261368 2016-05-13 11:18:16 +09:00
Cheng Zhao
525d456f7c Update to Chrome 50.0.2661.102 2016-05-13 11:14:43 +09:00
Cheng Zhao
f1142cf2b5 Adapt to changes on hash functions of Chrome 50 2016-05-13 11:12:15 +09:00
Cheng Zhao
08779eb6d9 Use VS2015 on appveyor 2016-05-13 11:12:15 +09:00
Cheng Zhao
2d7b5c53b1 Change version number so native modules can build 2016-05-13 11:12:15 +09:00
Cheng Zhao
8dc8f8f485 Update libchromiumcontent: fix Release build on Windows 2016-05-13 11:12:01 +09:00
Cheng Zhao
4a409b870e chromedriver's version is now v2.21 2016-05-13 11:12:01 +09:00
Cheng Zhao
bb5b30b8a0 It is not allowed to run scripts in DidCreateDocumentElement 2016-05-13 11:12:01 +09:00
Cheng Zhao
906ae043f9 Fix crash when creating external buffer 2016-05-13 11:12:01 +09:00
Cheng Zhao
0ad03d9ff7 Suppress crashReporter test on x64 Windows for now 2016-05-13 11:12:01 +09:00
Cheng Zhao
3aaff23f78 Do not call import_vs_env for non-win32 2016-05-13 11:12:01 +09:00
Cheng Zhao
e77582baee Fix compilation warnings introduced by VS 2015 2016-05-13 11:12:01 +09:00
Cheng Zhao
2497c73009 Import build env from VS 2015 2016-05-13 11:12:01 +09:00
Cheng Zhao
73223fe5c3 Upgrade to Node v6 2016-05-13 11:12:01 +09:00
Cheng Zhao
9c0f298064 Update libchromiumcontent to fix renderer process crash 2016-05-13 11:12:01 +09:00
Cheng Zhao
525e3ee9c6 Update crashpad with AppKit patch 2016-05-13 11:11:50 +09:00
Cheng Zhao
9ccb495f60 Do not remove the patch for Command key 2016-05-13 11:11:50 +09:00
Cheng Zhao
35d9e37220 Simplify the check for web_frame_widget 2016-05-13 11:11:50 +09:00
Brian R. Bondy
e8c4fb6903 setBaseBackgroundColor moved to WebFrameWidget 2016-05-13 11:11:50 +09:00
Brian R. Bondy
a9652052c4 Update Brightray and libchromiumcontent v50 ref (Electron maintainer use
your refs)
2016-05-13 11:11:50 +09:00
Brian R. Bondy
a52dbf0784 Update SharedMemory buf constructor 2016-05-13 11:07:17 +09:00
Brian R. Bondy
900001e547 Update PlatformCanvas to SKCanvas 2016-05-13 11:07:17 +09:00
Brian R. Bondy
37ccd34a88 Update x11 global shortcut listeners 2016-05-13 11:07:17 +09:00
Brian R. Bondy
f93fa53aea Update linux menu overrides 2016-05-13 11:07:17 +09:00
Brian R. Bondy
0253aec0cd Add SkUserConfig.h with blank SkDebugf macro
This file was copied from:
./third_party/skia/include/config/SkUserConfig.h

But because of this linking error we needed to
define a macro for SkDebugf.

```
"SkDebugf(char const*, ...)", referenced from:
      SkBitmap::allocPixels(SkImageInfo const&, unsigned long) in
      libbrave_lib.a(brave_lib.native_desktop_media_list.o)
      ld: symbol(s) not found for architecture x86_64
```

There used to be a hack to copy this file here which was removed:
8de9d9e2bc
2016-05-13 11:07:17 +09:00
Brian R. Bondy
ce7c1023d5 Minimum fixes needed for chromium_src 2016-05-13 11:07:17 +09:00
Brian R. Bondy
02d72c81af Fix linking problem with IPC::MessageT
IPC::MessageT<ChromeUtilityHostMsg_ProcessStarted_Meta, std::__1::tuple<>, void>::MessageT(IPC::Routing)
2016-05-13 11:07:17 +09:00
Brian R. Bondy
22863b9f31 Fix GURL coonstructor from webkit string error 2016-05-13 11:07:17 +09:00
Brian R. Bondy
48e62ac0b5 Remove wwebaudio from web_preferences
Becauseit doesn't exist there anymore
2016-05-13 11:07:17 +09:00
Brian R. Bondy
732936713a GetNativeScreen -> GetScreen 2016-05-13 11:07:17 +09:00
Brian R. Bondy
f418ac5b5d Update to brave crashpad dep (Electron maintainer rebase this to use
your ref)
2016-05-13 11:07:17 +09:00
Brian R. Bondy
d889bdef49 Remove user_gesture parameter from PermissionManager::RequestPermission 2016-05-13 11:07:17 +09:00
Brian R. Bondy
c04353a845 WebFindOptions in its own header 2016-05-13 11:07:17 +09:00
Brian R. Bondy
ff91aeb5d4 Iterator to use size_t 2016-05-13 11:07:17 +09:00
Brian R. Bondy
8a2aebd03f PermissionStatus constant update 2016-05-13 11:07:17 +09:00
Brian R. Bondy
82f3bb26ce AccessTokenSet -> AccessTokenMap 2016-05-13 11:07:17 +09:00
Brian R. Bondy
2da39d31aa Update to new pref service location in components 2016-05-13 11:07:17 +09:00
Brian R. Bondy
5fda9bc6ae LoadAccessTokensCallbackType -> LoadAccessTokensCallback 2016-05-13 11:07:17 +09:00
Brian R. Bondy
93e9cf4ac1 No more GetCookieMonster 2016-05-13 11:07:17 +09:00
Brian R. Bondy
dc7928021d Widevine AAC CDM no longer avail
See chromium ./third_party /widevine/cdm/widevine_cdm_common.h
2016-05-13 11:07:17 +09:00
Brian R. Bondy
b78fe04f8f Remove Vorbis from CDM support
See https://codereview.chromium.org/1690353002
2016-05-13 11:07:17 +09:00
Brian R. Bondy
8d4ed037a2 Add referrer_schems to AddAdditionalSchemes 2016-05-13 11:07:17 +09:00
Cheng Zhao
57b0f288cb Bump v1.0.2 2016-05-13 09:21:33 +09:00
Cheng Zhao
ceea7adf98 Update brightray for electron/brightray#219 2016-05-13 09:19:46 +09:00
Cheng Zhao
751ebe7377 Merge pull request #5513 from danhp/patch-1
Document 'Tab' as a supported accelerator.
2016-05-13 09:08:32 +09:00
Cheng Zhao
c59f38c370 Merge pull request #5508 from electron/bengotow/docs-tweaks
Add to security checklist
2016-05-13 08:46:08 +09:00
Daniel Pham
9a72afc963 📝 Document 'Tab' as a supported accelerator.
[ci skip]
2016-05-12 16:00:58 -04:00
Ben Gotow
b9b6e8aa68 Add to security checklist 2016-05-12 10:42:29 -07:00
Cheng Zhao
b32bc8cf3e Merge pull request #5502 from anthonyryan1/master
Replace gtk_widget_hide_all with gtk_widget_hide
2016-05-12 19:37:25 +09:00
Cheng Zhao
01dcee6449 Update brightray for #5503 2016-05-12 18:01:03 +09:00
Machisté N. Quintana
83e3d059b4 Merge pull request #5504 from dalabarge/patch-1
Fixed grammar issue.
2016-05-11 19:29:36 -07:00
Daniel LaBarge
eef9d9beaf Fixed grammar issue. 2016-05-11 21:08:01 -05:00
Cheng Zhao
f86bd75f82 Merge pull request #5501 from ecmadao/patch-1
Update screen.md
2016-05-12 10:36:38 +09:00
Cheng Zhao
9a35d54ecf Merge pull request #5500 from radarhere/master
Fixed typo
2016-05-12 10:26:39 +09:00
Cheng Zhao
989dfe01e1 Merge pull request #5496 from deepak1556/linux_dialog_icon_patch
dialog: resize icon on linux before showing
2016-05-12 10:24:32 +09:00
ecmadao
b81742f335 Update screen.md
bugfix-修改错别字
2016-05-12 09:21:10 +08:00
Cheng Zhao
5a702425eb Merge pull request #5489 from felixrieseberg/windows-store-guide
Add Windows Store Guide
2016-05-12 09:30:18 +09:00
Cheng Zhao
f6d4af8882 Merge pull request #5487 from felixrieseberg/windows-dialog-array
Document Dialog Buttons Behavior on Windows
2016-05-12 09:26:28 +09:00
Andrew Murray
2d19d8108b Fixed typo 2016-05-12 08:14:17 +10:00
Anthony Ryan
c29b844a97 Replace gtk_widget_hide_all with gtk_widget_hide
gtk_widget_hide_all was deprecated in gtk+ 2.24 and was removed
entirely in recent versions. This is a pretty straight forward
replacement.
2016-05-11 15:33:43 -04:00
deepak1556
64718888dd dialog: resize icon on linux before showing 2016-05-11 22:30:10 +05:30
Cheng Zhao
064af6ecb2 Merge branch '1-0-release' 2016-05-11 22:11:08 +09:00
Cheng Zhao
959f7a1911 Merge pull request #5491 from electron/key-weak-map
Extend the IDWeakMap to accept arbitrary key type
2016-05-11 22:10:43 +09:00
Cheng Zhao
ff3104b44b hash function for pair is already defined in VS 2016-05-11 21:32:28 +09:00
Cheng Zhao
12d40cd310 Add typename hint to fix compilation error on VS2015 2016-05-11 20:57:21 +09:00
Cheng Zhao
759a46f3d6 Use DoubleIDWeakMap for |rendererFunctions| 2016-05-11 20:40:48 +09:00
Cheng Zhao
6578c4f0b3 Bump v1.0.1 2016-05-11 20:10:38 +09:00
Cheng Zhao
b2d83fd8a8 Merge pull request #5490 from electron/webcontents-event
Listen for devtools-opened on webContents
2016-05-11 19:59:09 +09:00
Kevin Sawicki
a32f50ef64 Use arrow function for this binding 2016-05-11 12:54:52 +02:00
Kevin Sawicki
1b2b7fc4ce Listen for devtools-opened on webContents 2016-05-11 12:48:46 +02:00
Cheng Zhao
49ac160ff7 Move createIDWeakMap to v8Util 2016-05-11 19:30:06 +09:00
Cheng Zhao
a077355d70 Turn api::IDWeakMap into api::KeyWeakMap<T> 2016-05-11 18:21:35 +09:00
Felix Rieseberg
ffa5abe99b 📝 Add Windows Store Guide
This commit adds a guide about how to compile your app as a Windows Store app, analog to the Mac App Store guide.
2016-05-11 10:50:46 +02:00
Felix Rieseberg
9200e32b0e 📝 Document Dialog Buttons Behavior on Windows
Closes #5464
2016-05-11 10:27:37 +02:00
Cheng Zhao
04d59991b0 Use create function instead of IDWeakMap constructor 2016-05-11 16:15:32 +09:00
Cheng Zhao
c708ae8eb5 Remove IDWeakMap 2016-05-11 15:51:22 +09:00
Cheng Zhao
ea93553225 Make KeyWeakMap a template class 2016-05-11 15:17:35 +09:00
Cheng Zhao
e6c0b1fe0c Fix leak when KeyWeakMap::Remove is called directly
Usually the KeyObject would be destroyed when GC happens, but then
Remove is called before GC happens, the KeyObject would be leaked
forever. This fixes it by keeping KeyObject as a member of map.
2016-05-11 15:17:35 +09:00
Cheng Zhao
79c1ad85f9 Add KeyWeakMap without Add method 2016-05-11 15:17:35 +09:00
Cheng Zhao
7f2a46cdd5 Remove unused methods of IDWeakMap 2016-05-11 15:17:35 +09:00
Cheng Zhao
2cd41b2f84 Merge branch 'master' of https://github.com/electron/electron 2016-05-11 15:15:15 +09:00
Cheng Zhao
0f52a6da39 Merge branch '1-0-release' 2016-05-11 15:14:56 +09:00
Cheng Zhao
71704fc5d8 Merge pull request #5486 from electron/fix-dump-version-info-js
Do not use require('app') in dump-version-info.js
2016-05-11 15:12:04 +09:00
Cheng Zhao
e5890728dc Do not use require('app') in dump-version-info.js 2016-05-11 15:07:09 +09:00
Cheng Zhao
08d2320ad6 Merge pull request #5485 from preco21/korean-docs-4
docs: Update Korean docs as upstream
2016-05-11 14:48:43 +09:00
Plusb Preco
95c9e48822 📝 Update Korean docs as upstream
[ci skip]
2016-05-11 13:48:40 +09:00
Machisté N. Quintana
8bb097e0a4 Merge pull request #5480 from preco21/patch-3
docs: Match object notation style
2016-05-10 21:27:45 -07:00
Plusb Preco
01c483e0dd 📝 Update README-ko.md
[ci skip]
2016-05-11 10:48:54 +09:00
Plusb Preco
4cdba29fbd 📝 Match object notation style
[ci skip]
2016-05-11 10:30:02 +09:00
Cheng Zhao
ed70a11ff8 Merge pull request #5477 from danhp/download-bounce
Add API: app.dock.downloadFinished(filePath)
2016-05-11 09:41:08 +09:00
Cheng Zhao
8dd5f58161 Merge pull request #5479 from electron/widevine-path
Fix passing paths in command line
2016-05-11 09:24:24 +09:00
Cheng Zhao
1d6f05c9bb Merge branch 'document-fixes-4' of https://github.com/preco21/electron into preco21-document-fixes-4 2016-05-11 09:23:52 +09:00
Cheng Zhao
d0b39bc4fe Merge pull request #5473 from preco21/korean-docs-3
docs: Update Korean docs as upstream
2016-05-11 09:20:51 +09:00
Cheng Zhao
dec971a889 Merge pull request #5471 from nickytonline/fix-readme
Fixed code snippet in read me
2016-05-11 09:12:01 +09:00
Cheng Zhao
0dad2581ef Fix passing paths in command line 2016-05-11 08:57:35 +09:00
Nick Taylor
b54af73782 fixed code snippet in menu api documentation. 2016-05-10 22:32:45 +02:00
Daniel Pham
6dae07b76f Add API: app.dock.downloadFinished(filePath) 2016-05-10 15:02:56 -04:00
Plusb Preco
ebc7f5cba0 📝 Remove whitespace
[ci skip]
2016-05-11 03:34:06 +09:00
Plusb Preco
c4d34eb465 📝 Update Korean docs as upstream
[ci skip]
2016-05-11 03:14:06 +09:00
Plusb Preco
5146befa46 📝 Match variable names
[ci skip]
2016-05-11 02:38:42 +09:00
Plusb Preco
885aeec442 📝 Match variable names
[ci skip]
2016-05-11 02:16:32 +09:00
Plusb Preco
f1b184ef78 📝 Fix code style issue
* Change `var` to `let`.
* Change `function() {}` to `() => {}`.
* Use shorthand function syntax on object notation.
* Remove spaces between object notation brackets.
* Small fixes.
2016-05-11 02:15:09 +09:00
Plusb Preco
139a4f984a 📝 Add missing semicolons
[ci skip]
2016-05-11 01:57:55 +09:00
Plusb Preco
6e0112bf9f 📝 Cleanup codes
[ci skip]
2016-05-11 01:34:51 +09:00
Plusb Preco
552102b88d 📝 Remove whitespace after code block
[ci skip]
2016-05-11 01:32:13 +09:00
Plusb Preco
4d7296e1db 📝 Match destructuring style
[ci skip]
2016-05-11 01:26:38 +09:00
Cheng Zhao
61bf3ae1ee Merge pull request #5462 from zicai/patch-1
Docs:fix a minor typo
2016-05-10 19:44:36 +09:00
Plusb Preco
5787bb0226 📝 Fix code style issue
* Match equality operators for consistent that `==`, `!=` by `===`,
`!==`.
* Match string expression notation `"` by `'`.

[ci skip]
2016-05-10 18:42:21 +09:00
zicai
8e48fde5ac Docs:fix a minor typo 2016-05-10 16:53:14 +08:00
Plusb Preco
3cc2dd216f 📝 Adjust line length to 80
[ci skip]
2016-05-10 17:41:16 +09:00
Plusb Preco
cd3d154cc3 📝 Small fixes
[ci skip]
2016-05-10 17:35:12 +09:00
Plusb Preco
6bad16377d 📝 Update Korean docs as upstream
[ci skip]
2016-05-10 16:27:14 +09:00
Cheng Zhao
3014e61792 Update native_mate: close #5392 2016-05-10 16:10:02 +09:00
Plusb Preco
12e62746b3 📝 Add security.md
[ci skip]
2016-05-10 13:48:26 +09:00
Cheng Zhao
61ec3acde9 Merge pull request #5459 from electron/soft-warning
Turn exception in protocol.registerStandardSchemes into warning warning
2016-05-10 11:11:00 +09:00
Cheng Zhao
8e7a5adc60 spec: protocol.registerStandardSchemes does not throw 2016-05-10 09:57:13 +09:00
Cheng Zhao
4dc431043f docs: When to use protocol.registerStandardSchemes 2016-05-10 09:53:35 +09:00
Cheng Zhao
566bb1f708 Turn the exception in protocol.registerStandardSchemes to warning 2016-05-10 09:53:35 +09:00
Cheng Zhao
ab3122ef2a No need to keep the deprecated APIs
They will be removed in next release.
2016-05-10 09:53:35 +09:00
Cheng Zhao
c40fb67890 Bump v1.0.0 2016-05-09 21:17:35 +09:00
Cheng Zhao
797b0ddb9a Fix exception when refreshing specs window 2016-05-09 20:08:50 +09:00
Cheng Zhao
e139012f9a Merge pull request #5373 from electron/remove-deprecated-apis
Remove deprecated apis
2016-05-09 19:16:38 +09:00
Plusb Preco
60d7dd991d 📝 Fix small typos
[ci skip]
2016-05-09 16:23:11 +09:00
Plusb Preco
897d376978 📝 Update Korean docs as upstream
[ci skip]
2016-05-09 16:20:05 +09:00
Plusb Preco
ad4450ec88 📝 Small fixes
[ci skip]
2016-05-09 11:23:46 +09:00
Plusb Preco
fe5dc5d28e 📝 Update Korean docs as upstream
[ci skip]
2016-05-09 10:43:52 +09:00
Cheng Zhao
af0afecb45 Merge pull request #5406 from deepak1556/protocol_standard_scheme_patch
protocol: fix registerStandardSchemes api
2016-05-09 09:12:35 +09:00
Cheng Zhao
6b79f53416 Merge pull request #5440 from electron/bengotow/remove-default-protocol
Implement RemoveAsDefaultProtocolClient on OS X
2016-05-09 08:36:21 +09:00
Ben Gotow
ac905e7080 Add docs, avoid side effects when not currently default 2016-05-08 10:50:17 -07:00
deepak1556
70dac71639 delay protocol object creation 2016-05-08 16:44:14 +05:30
Cheng Zhao
4841e37502 Merge pull request #5445 from electron/fix-flaky-tests
Suppress the window.open tests on travis CI's mac machine
2016-05-08 16:44:29 +09:00
Cheng Zhao
c682ccd9d0 Suppress the window.open tests on travis CI's mac machine 2016-05-08 15:15:16 +09:00
Cheng Zhao
b358dff689 Merge pull request #5444 from electron/expiration-date
Fix `expirationDate` not showing for persistent cookies
2016-05-08 15:13:36 +09:00
Cheng Zhao
e24ce97731 Set expirationDate for persistent cookie 2016-05-08 14:38:07 +09:00
Cheng Zhao
1dcbd352cc Merge pull request #5436 from stevekinney/refactor-parse-args-in-dialog
Refactor parseArgs function in dialog module
2016-05-08 11:57:02 +09:00
Cheng Zhao
85f700f458 Merge pull request #5432 from stevekinney/default-app-to-es6
Update default_app to ES6 conventions
2016-05-08 11:21:01 +09:00
Cheng Zhao
3fcb4be303 Merge pull request #5418 from felixrieseberg/security-guide
Add Security Tutorial
2016-05-08 11:20:21 +09:00
deepak1556
9c71c9fa6a fix docs and spec 2016-05-08 01:37:57 +05:30
deepak1556
0f2ae385ed allow protocol module initialization before app ready.
* ensure registerStandardSchemes can only be called before app ready
 * ensure other protocol methods can only be used after app ready
2016-05-08 01:36:34 +05:30
deepak1556
1ff33b7c81 protocol: fix registerStandardSchemes api 2016-05-08 01:36:34 +05:30
Ben Gotow
19d5d3b7d1 Implement RemoveAsDefaultProtocolClient on OS X 2016-05-07 11:07:58 -07:00
Steve Kinney
91220f2a98 💄 Simplify conditional check for BrowserWindow 2016-05-07 09:13:40 -06:00
Steve Kinney
f3e633eb2c 💄 Use destructuring to shift arguments 2016-05-07 08:55:26 -06:00
Steve Kinney
6708e2a302 💄 Cache last argument in parseArgs
This is to eliminate the need to access the array twice.
2016-05-07 08:52:52 -06:00
Steve Kinney
b6fd4fed38 💄 Update default_app to ES6 conventions
Add space before object literal method
2016-05-07 08:18:22 -06:00
Felix Rieseberg
02e8e929e1 📝 Add Security Tutorial
Add basic information about Electron and Security, including an
invitation to contribute to security features. Contains information by
@zcbenz, @zeke, and @paulcbetts.
2016-05-07 10:57:36 +01:00
Cheng Zhao
b05fa2ed5b Merge pull request #5430 from deepak1556/ipc_renderer_patch
ipcRenderer: fix crash with multiple listeners to sync message
2016-05-07 16:32:54 +09:00
Cheng Zhao
e46a50512d Merge pull request #5428 from miniak/update-app-manifest
Update app manifest
2016-05-07 11:20:25 +09:00
Cheng Zhao
8f4b6afa64 Merge pull request #5431 from deepak1556/devtools_file_system_indexer_patch
devtools: handle file system indexing requests
2016-05-07 10:55:12 +09:00
Cheng Zhao
e6f4dd0f85 Update brightray for #5431 2016-05-07 10:54:34 +09:00
Cheng Zhao
767c235708 Fix compilation error 2016-05-07 10:38:41 +09:00
Milan Burda
bc8689889d Add dpiAware to app manifest instead of calling SetProcessDpiAwareness / SetProcessDPIAware 2016-05-07 01:18:01 +02:00
Milan Burda
bb32039fde Add disableWindowFiltering to app manifest to enable enumeration of modern app windows in node modules 2016-05-07 01:17:27 +02:00
deepak1556
53ac79cb19 devtools: handle file system indexing requests 2016-05-07 04:32:54 +05:30
Kevin Sawicki
081c8e1f28 Merge pull request #5426 from electron/vendor-link-in-docs
Link to vendor folder on GitHub
2016-05-06 13:31:23 -07:00
Kevin Sawicki
6861d645ad Link to vendor folder on GitHub 2016-05-06 13:25:01 -07:00
Kevin Sawicki
ef459c7676 Remove support for options now on webPreferences 2016-05-06 10:12:56 -07:00
Cheng Zhao
28f1aef7b4 Remove ELECTRON_HIDE_INTERNAL_MODULES in docs 2016-05-06 10:12:56 -07:00
Cheng Zhao
fd432ddbc9 Fix the toDataUrl call in desktopCapturer 2016-05-06 10:12:56 -07:00
Cheng Zhao
446da677b5 Remove NativeImage.toDataUrl 2016-05-06 10:12:56 -07:00
Kevin Sawicki
7685380105 Remove crashed event forwarding 2016-05-06 10:12:56 -07:00
Kevin Sawicki
56cd57872c Remove BrowserWindow events now on WebContents 2016-05-06 10:12:56 -07:00
Kevin Sawicki
f2d8eadf4e Remove deprecated prototol APIs 2016-05-06 10:12:55 -07:00
deepak1556
14661819c2 move session wrapper to webcontents 2016-05-06 10:12:55 -07:00
Kevin Sawicki
609f5dcaaf Update read path to something that exists 2016-05-06 10:12:55 -07:00
Kevin Sawicki
4d6b95aa52 Tweak spec description 2016-05-06 10:12:55 -07:00
Kevin Sawicki
0eefb282ca Test no handler via call to deprecate.log 2016-05-06 10:12:55 -07:00
Kevin Sawicki
722a07de86 Add explicit call to deprecate.log 2016-05-06 10:12:55 -07:00
Kevin Sawicki
30b60516fe Initialize session explicitly 2016-05-06 10:12:55 -07:00
Kevin Sawicki
814ae7b4a4 🎨 2016-05-06 10:12:55 -07:00
Kevin Sawicki
d627ead273 Remove linter errors 2016-05-06 10:12:55 -07:00
Kevin Sawicki
16d4c436cb Keep exporting deprecate/deprecations 2016-05-06 10:12:55 -07:00
Kevin Sawicki
7ad86a12b4 Remove empty _init 2016-05-06 10:12:54 -07:00
Kevin Sawicki
58473f41ab Remove deprecated BrowserWindow options specs 2016-05-06 10:12:54 -07:00
Kevin Sawicki
4cb620c195 Remove support for translating hyphenated options 2016-05-06 10:12:54 -07:00
Kevin Sawicki
bea232f53a Update specs for internal module require 2016-05-06 10:12:54 -07:00
Kevin Sawicki
ef801d5543 Remove .only call 2016-05-06 10:12:54 -07:00
Kevin Sawicki
1e140fb32c Remove ipc.js files 2016-05-06 10:12:54 -07:00
Kevin Sawicki
2ce4237083 Remove hideInternalModules API 2016-05-06 10:12:54 -07:00
Kevin Sawicki
dafa14fe42 Don't export deprecate API 2016-05-06 10:12:54 -07:00
Kevin Sawicki
bf91410a22 Remove deprecated main process ipc module 2016-05-06 10:12:54 -07:00
Kevin Sawicki
d988cae16d Remove deprecated ipc module 2016-05-06 10:12:53 -07:00
Kevin Sawicki
a6cf7a1095 Remove deprecated crashReporter.start options 2016-05-06 10:12:53 -07:00
Kevin Sawicki
6f0471f6cb Remove deprecated options check in BrowserWindow 2016-05-06 10:12:53 -07:00
Kevin Sawicki
0342db9328 Remove hyphenated options 2016-05-06 10:12:53 -07:00
Kevin Sawicki
dae68be2ce Remove deprecated APIs 2016-05-06 10:12:53 -07:00
Kevin Sawicki
0cf50b1c0b Merge pull request #5425 from electron/remove-atom-org-links
Update links to electron org in docs
2016-05-06 10:12:02 -07:00
Kevin Sawicki
7cca287b60 Update links to electron org 2016-05-06 10:11:43 -07:00
Kevin Sawicki
476aea5a3f Merge pull request #5424 from electron/windows-installer-docs
Link to electron-winstaller
2016-05-06 10:11:33 -07:00
Kevin Sawicki
f84b5a7642 Link to electron-winstaller 2016-05-06 10:05:12 -07:00
Kevin Sawicki
9a56974c83 Merge pull request #5423 from electron/fix-spacing-app-doc
Fix spacing on lines and url
2016-05-06 09:59:58 -07:00
Jessica Lord
0e8636cb2a Fix spacing on lines and url 2016-05-06 18:56:07 +02:00
Cheng Zhao
f58b3f853e Merge pull request #5421 from electron/default-app-flag
Add a flag indicating app is started from default app
2016-05-06 22:09:02 +09:00
Cheng Zhao
c18880bd77 Add a flag indicating app is started from default app 2016-05-06 21:49:49 +09:00
Cheng Zhao
7b83d920fa Merge pull request #5412 from electron/osx-disable-rubber-banding
Add scrollBounce option and disable it by default
2016-05-06 15:35:14 +09:00
Cheng Zhao
df397dab30 Add scrollBounce option and disable it by default 2016-05-06 14:57:43 +09:00
Cheng Zhao
4ce26dfa68 Merge pull request #5409 from electron/did-fail-load-clarification
Clarify how did-fail-load handles redirects
2016-05-06 14:27:46 +09:00
Cheng Zhao
16bfc19547 Merge pull request #5411 from electron/min-max-size-docs
docs: Make it clear that size constraints only apply for users
2016-05-06 14:24:59 +09:00
Cheng Zhao
a4405dad45 docs: Make it clear that size constraints only apply for users
[ci skip]
2016-05-06 14:21:19 +09:00
Cheng Zhao
aa516ae01a Merge pull request #5408 from electron/ld-update-code-of-conduct
📝 Update to v1.4 of the Code of Conduct
2016-05-06 10:41:25 +09:00
Charlie Hess
69c4c7e3be Clarify how did-fail-load handles redirects. 2016-05-05 15:52:00 -07:00
deepak1556
45b3bd3a22 ipcRenderer: fix crash with multiple listeners to sync message 2016-05-06 02:52:59 +05:30
Lee Dohm
edfb1b5d0e 📝 Update to v1.4 of the Code of Conduct
Also, switch email address for reporting.
2016-05-05 13:48:44 -07:00
Cheng Zhao
969a30fc3b Merge branch 'update-code-samples' of https://github.com/stevekinney/electron into stevekinney-update-code-samples 2016-05-05 20:55:25 +09:00
Cheng Zhao
636570306a Merge pull request #5401 from electron/ns-js-object
Fully support the userInfo object in app.setUserActivity and continue-activity event
2016-05-05 17:59:43 +09:00
Cheng Zhao
2c31d7c1e8 Revert "Generalize this mate converter for reuse."
This reverts commit 92606579d3.
2016-05-05 17:26:31 +09:00
Cheng Zhao
c9c4ba39ab docs: We support arbitrary NSDictionary now 2016-05-05 17:07:46 +09:00
Cheng Zhao
2f9fee0c8a Move the job of creating userActivity to AtomApplication 2016-05-05 16:38:47 +09:00
Cheng Zhao
60bd60e1ed Fully support converting NSDictionary to JS userInfo object 2016-05-05 16:26:44 +09:00
Cheng Zhao
8e1d2479ac spec: Should not run app.setUserActivity test on non-OS X 2016-05-05 12:27:25 +09:00
Cheng Zhao
7268f434b2 Fix code styling problems 2016-05-05 12:26:23 +09:00
Cheng Zhao
3f2a25d07c Merge pull request #5352 from CharlieHess/hands-on-hand-off
OS X Handoff Feature
2016-05-05 12:06:56 +09:00
Cheng Zhao
f10ab71f60 Merge pull request #5388 from electron/default-app-styling
Make the drag box fill the remaining height of window in default app
2016-05-05 11:16:16 +09:00
Cheng Zhao
4b42fe1b24 Merge pull request #5393 from appetizermonster/patch-2
Fix small mistakes in Korean Doc
2016-05-05 11:15:35 +09:00
Cheng Zhao
0901a70166 Merge pull request #5379 from danhp/context-menu
Expose the 'context-menu' event.
2016-05-05 11:12:58 +09:00
Charlie Hess
b2fb95f857 Use scoped_nsobject to ensure our intermediate objects get cleaned up. 2016-05-04 11:28:49 -07:00
Steve Kinney
55babea2bb 📝 Update tutorials to ES6 [ci skip] 2016-05-04 12:11:51 -06:00
Steve Kinney
3271492c86 📝 Update FAQ to ES6 [ci skip] 2016-05-04 12:02:24 -06:00
Steve Kinney
afe0296e0f 📝 Rewrite docs on destructuring assignment [ci skip] 2016-05-04 11:59:40 -06:00
Steve Kinney
5a9f28e034 📝 Update API documentation to ES6 [ci skip] 2016-05-04 11:59:02 -06:00
Steve Kinney
178496afe5 📝 Update documentation style guide to ES6 [ci skip] 2016-05-04 10:55:05 -06:00
Heejin Lee
2b079588bb Fix small mistakes in CONTRIBUTING-ko.md 2016-05-05 00:02:53 +09:00
Daniel Pham
a6f2d401fa Follow object naming conventions for params in the 'context-menu' event 2016-05-04 10:41:10 -04:00
Cheng Zhao
6fba72a40c Merge pull request #5383 from preco21/korean-docs-2
docs: Update Korean docs as upstream
2016-05-04 23:20:44 +09:00
Cheng Zhao
fe73688975 Merge pull request #5387 from preco21/patch-1
docs: Match code syntax
2016-05-04 23:20:23 +09:00
Cheng Zhao
ef561fb919 Merge pull request #5378 from CGamesPlay/master
Use select to query the uv kqueue
2016-05-04 23:08:12 +09:00
Plusb Preco
9483cd351a 📝 Update Korean docs as upstream
[ci skip]
2016-05-04 18:45:52 +09:00
Cheng Zhao
28d12166fd Fix margin of elements in flex 2016-05-04 18:01:29 +09:00
Cheng Zhao
7074789011 Remove some unnecessary css rules 2016-05-04 18:01:29 +09:00
Cheng Zhao
5e73b0372d Make the drag box fill the remaining height of window 2016-05-04 18:01:29 +09:00
Cheng Zhao
540076e9d5 Fix code styling issue 2016-05-04 17:12:10 +09:00
Cheng Zhao
8957ba5222 Merge pull request #5371 from adambuckland/fix_auto_update_error
Fix autoUpdater error on OS X
2016-05-04 16:58:25 +09:00
Cheng Zhao
4c1a0d29b0 Merge pull request #5367 from sindresorhus/patch-1
improve the `webContents.openDevTools` docs
2016-05-04 16:52:48 +09:00
Charlie Hess
7b207aa1b6 Don't run this spec on platforms where the method is unavailable. 2016-05-03 23:33:40 -07:00
Plusb Preco
9fcafc6f9e 📝 Update Korean docs as upstream
[ci skip]
2016-05-04 15:00:59 +09:00
Plusb Preco
8be2239a45 📝 Match code syntax
[ci skip]
2016-05-04 14:34:11 +09:00
Plusb Preco
d63d570327 📝 Fix typo
[ci skip]
2016-05-04 09:46:14 +09:00
Charlie Hess
12764a66ed Add an accessor for the current activity type and write the simplest possible test. 2016-05-03 15:51:31 -07:00
Charlie Hess
42768bcc2b Save the activity on the application instance to ensure we hold a reference. Activities that enable search need to persist. 2016-05-03 14:57:16 -07:00
Daniel Pham
81eb3e3428 📝 Document 'context-menu' event 2016-05-03 17:52:24 -04:00
Daniel Pham
0fffbea79d Add 'context-menu' event to 'WebContents' 2016-05-03 17:50:54 -04:00
Plusb Preco
ebd8d30f25 📝 Small fixes
[ci skip]
2016-05-04 02:55:10 +09:00
Charlie Hess
a5a2e20449 📝 on using only strings. 2016-05-03 10:34:59 -07:00
Charlie Hess
03d25ce6c0 Revert "Add some shady methods to get V8 objects or arrays from NSDictionary or NSArray."
This reverts commit 2295f3a832.
2016-05-03 10:32:42 -07:00
Charlie Hess
f84a973d69 Revert "Use a DictionaryValue everywhere instead of a string map."
This reverts commit 90cc10944a.
2016-05-03 10:31:53 -07:00
Paul Betts
2606f8020a Merge pull request #5382 from danhp/patch-1
Fix Windows debug doc pointing to OS X
2016-05-03 09:28:45 -07:00
Daniel Pham
e9c9e22a9e 📝 Fix Windows debug doc pointing to OS X
[ci skip]
2016-05-03 11:51:57 -04:00
Cheng Zhao
513b07b3b3 Merge pull request #5377 from electron/custom_compiler
Add more options for building on Linux
2016-05-03 22:23:31 +09:00
Ryan Patterson
b15c07e1a8 Use select to query the uv kqueue
This resolves #38. I've verified that events still get processed like they
should on El Capitan 10.11.3 (15D21).
2016-05-02 23:54:21 -07:00
Plusb Preco
0e7de568a2 📝 Small fixes
[ci skip]
2016-05-03 15:34:47 +09:00
Plusb Preco
f984536523 📝 Improve grammar
[ci skip]
2016-05-03 12:07:06 +09:00
Cheng Zhao
67a768fc77 Do not download clang on Windows 2016-05-03 09:38:15 +09:00
Cheng Zhao
49eed1ebb9 Ignore CC and CXX if user didn't change build configuration 2016-05-03 09:31:39 +09:00
Cheng Zhao
0567f09d6d docs: The building environment variables 2016-05-03 08:29:23 +09:00
Charlie Hess
90cc10944a Use a DictionaryValue everywhere instead of a string map. 2016-05-02 16:18:58 -07:00
Charlie Hess
2295f3a832 Add some shady methods to get V8 objects or arrays from NSDictionary or NSArray. 2016-05-02 14:45:59 -07:00
Charlie Hess
b53480e15c Merge remote-tracking branch 'origin/master' into hands-on-hand-off 2016-05-02 12:18:26 -07:00
Charlie Hess
dbe36748d4 Merge branch 'master' of https://github.com/atom/atom-shell 2016-05-02 12:18:10 -07:00
Plusb Preco
be32039cf9 📝 Update Korean docs as upstream
[ci skip]
2016-05-03 02:43:21 +09:00
Kevin Sawicki
543211b53a Merge pull request #5372 from electron/update-appveyor
Update link to AppVeyor build badge
2016-05-02 09:26:14 -07:00
Kevin Sawicki
fecd9ee4a0 Update link to AppVeyor build badge 2016-05-02 09:07:14 -07:00
Cheng Zhao
e39d5a9eb9 docs: Introduce clang flags 2016-05-02 22:32:43 +09:00
Cheng Zhao
ac3a704abc Avoid overriding environment variables 2016-05-02 12:38:17 +00:00
Cheng Zhao
34b4ebd9f3 Fix logic errors 2016-05-02 12:15:10 +00:00
Cheng Zhao
098d72b741 Convert --clang_dir and --disable_clang to --defines 2016-05-02 21:19:16 +09:00
Cheng Zhao
26e4ce30bb Pass --disable_clang and --clang_dir to libchromiumcontent 2016-05-02 20:06:21 +09:00
Cheng Zhao
7cbe6bc8bd Merge pull request #5366 from electron/bootstrap-libchromiumcontent
Add --build_libchromiumcontent command line switch
2016-05-02 19:07:22 +09:00
Cheng Zhao
bd70d9008f Update modules before calling build_libchromiumcontent 2016-05-02 07:45:48 +00:00
Sindre Sorhus
ad09196433 improve the webContents.openDevTools docs
consistent value notation and explain the difference between `undocked` and `detach` mode.
2016-05-02 14:39:46 +07:00
Cheng Zhao
cc24bea813 Fix pylint warnings 2016-05-02 16:38:58 +09:00
Cheng Zhao
459a65d296 docs: the --build_libchromiumcontent switch 2016-05-02 16:35:33 +09:00
Cheng Zhao
64abae0b3c docs: Cleanup unnecessary parts in build-instructions-linux.md 2016-05-02 16:26:18 +09:00
Cheng Zhao
26c0ad1c2f Add --build_libchromiumcontent option 2016-05-02 16:17:38 +09:00
Plusb Preco
a83b891a95 📝 Update Korean docs as upstream
[ci skip]
2016-05-02 10:21:27 +09:00
Plusb Preco
51f095e5c3 Merge remote-tracking branch 'refs/remotes/electron/master' 2016-05-02 10:18:38 +09:00
Plusb Preco
a60bb9031a Merge remote-tracking branch 'refs/remotes/electron/master' 2016-05-02 10:18:25 +09:00
Cheng Zhao
f1edd88e56 Merge pull request #5365 from TyanNN/master
Translated application distribution and application packaging to ru_RU
2016-05-02 10:08:20 +09:00
Cheng Zhao
c48598a5bc Merge pull request #5360 from miniak/patch-1
Fix systemPreferences docs
2016-05-02 09:43:35 +09:00
TyanNN
6cb8f278a2 Translated application distribution and application packaging to ru_RU 2016-05-01 21:18:49 +03:00
Milan Burda
91911d2d32 Fix systemPreferences docs 2016-05-01 18:03:58 +02:00
Adam Buckland
abb60ecd2e Fix autoUpdater error on OS X
If there is no localizedFailureReason, then then this will no longer be
added to the error string (which would result previously in it printing
'(null)' as part of the string)
2016-05-01 13:43:56 +01:00
Cheng Zhao
586e5e2ba5 Merge pull request #5361 from preco21/korean-docs
docs: Update Korean docs as upstream
2016-05-01 14:34:00 +09:00
Cheng Zhao
b2e77b2e6b Merge pull request #5357 from TyanNN/master
Translated Quickstart to ru_RU
2016-05-01 11:46:15 +09:00
Charlie Hess
21ae288ee7 📝 about the plist changes. 2016-04-30 13:03:10 -07:00
Charlie Hess
05493502ea Value first, key second. 2016-04-30 11:17:29 -07:00
Plusb Preco
33aecb9978 📝 Update Korean docs as upstream
[ci skip]
2016-05-01 02:46:19 +09:00
Plusb Preco
a554f9e683 📝 Update Korean docs as upstream
[ci skip]
2016-05-01 02:10:23 +09:00
Plusb Preco
6fda14ce88 📝 Update Korean docs as upstream
[ci skip]
2016-05-01 01:53:21 +09:00
Plusb Preco
f426c9c951 📝 Improve grammar
[ci skip]
2016-05-01 01:12:54 +09:00
Plusb Preco
bde412dd69 📝 Fix typos
[ci skip]
2016-05-01 01:11:21 +09:00
Cheng Zhao
03ce8a195a Merge pull request #5359 from electron/windows-pdb
Upload PDBs to Windows symbol server
2016-05-01 00:10:34 +09:00
Cheng Zhao
47f7f7b02e Revert "Don't upload PDB files in CI"
This reverts commit 7ab8134613.
2016-04-30 21:43:33 +09:00
Cheng Zhao
d91cd424fe Revert "Run tests for branches on appveyor"
This reverts commit 33370b18b3.

This commit was wrongly pushed.
2016-04-30 21:21:11 +09:00
Cheng Zhao
5766f4703a Merge pull request #5358 from electron/windows-ci
Run tests on Windows CI machine
2016-04-30 21:18:23 +09:00
Cheng Zhao
f65f8918c9 Fix specs on Windows when running without desktop session 2016-04-30 21:03:22 +09:00
Cheng Zhao
33370b18b3 Run tests for branches on appveyor 2016-04-30 20:42:24 +09:00
TyanNN
dae63ec4f1 Translated Quickstart to ru_RU 2016-04-30 13:54:19 +03:00
Cheng Zhao
214eb0430c Fix a few failing tests on Windows 2016-04-30 18:21:18 +09:00
Cheng Zhao
2a55d93501 Remove the output file after testing 2016-04-30 17:52:53 +09:00
Cheng Zhao
b68a25835f Make sure output is written when test fails 2016-04-30 17:48:07 +09:00
Cheng Zhao
3dcf69eab3 Also run tests on 32bit Windows 2016-04-30 17:17:23 +09:00
Cheng Zhao
8aa88067ca Do not write to stdout in Electron when running on win32 CI machine
This makes Electron crash on CI machine somehow.
2016-04-30 17:08:51 +09:00
Cheng Zhao
6756f8c7af Make win32 CI machine run tests 2016-04-30 15:38:23 +09:00
Charlie Hess
cea1b49db0 Add some documentation in app.md. 2016-04-29 22:25:09 -07:00
Charlie Hess
195940292d This is preventDefault by convention. 2016-04-29 22:08:19 -07:00
Charlie Hess
88805ec7e2 Make the Linter happy. 2016-04-29 22:05:36 -07:00
Cheng Zhao
fe3c78ad84 Merge pull request #5353 from electron/update-old-bracket-notation-in-translations
update all references to old atom-log bracket notation
2016-04-30 12:13:07 +09:00
Cheng Zhao
47a2a3a13f Merge pull request #5349 from electron/link-to-electron-prebuilt
describe electron-prebuilt and link to it
2016-04-30 11:59:44 +09:00
Cheng Zhao
b693ced765 Merge pull request #5346 from electron/update-quick-start-code
update quick-start code to match quick-start repo
2016-04-30 11:56:50 +09:00
Zeke Sikelianos
9f99ba3b73 update all references to old atom-log bracket notation 2016-04-29 18:35:02 -07:00
Charlie Hess
3a9a1d35d7 Add the AppDelegate override for restoring from hand-off, and fire the app event. 2016-04-29 17:37:01 -07:00
Charlie Hess
c20acb0361 Implement a "continue-activity" event on app for resuming from hand-off. 2016-04-29 17:36:04 -07:00
Charlie Hess
6df4bb176d Implement app.setUserActivity(type, userInfo). 2016-04-29 17:35:07 -07:00
Charlie Hess
92606579d3 Generalize this mate converter for reuse. 2016-04-29 17:32:25 -07:00
Kevin Sawicki
1bbc6211ca Merge pull request #5347 from rhedshi/patch-1
Update mac-app-store-submission-guide.md
2016-04-29 13:34:02 -07:00
Zeke Sikelianos
0c9c1229e3 describe electron-prebuilt and link to it 2016-04-29 13:32:00 -07:00
rhedshi
95476a81ae Update mac-app-store-submission-guide.md 2016-04-29 13:28:41 -07:00
Zeke Sikelianos
2f71d6afe0 update quick-start code to match quick-start repo 2016-04-29 13:17:50 -07:00
Charlie Hess
e9514bf35d Merge branch 'master' of https://github.com/atom/atom-shell 2016-04-29 13:12:56 -07:00
Cheng Zhao
edb73fb734 Bump v0.37.8 2016-04-29 20:48:19 +09:00
Cheng Zhao
cb45c94db9 Merge pull request #5340 from electron/create-user-data
Make sure the userData directory is created before ready event
2016-04-29 20:36:27 +09:00
Cheng Zhao
66853344c0 Make sure the userData directory is created before ready event 2016-04-29 20:20:52 +09:00
Plusb Preco
83af5de572 📝 Small fixes
[ci skip]
2016-04-29 10:32:33 +09:00
Arif Çakıroğlu
f7d4ff90ea added accelerator.md to api folders and translated (#5316)
* added accelerator.md to api folders and translated 🎉

* added file-object.md to api folder and translated

* added all folders to /tr-TR for broken links

* removed untouched documentation file

* broken link fix
2016-04-29 08:28:46 +09:00
Cheng Zhao
4001f10e2d Merge pull request #5334 from miniak/fix-screen-events
Fix #3075 by not caching the displays (id is not persistent on Windows)
2016-04-29 08:24:55 +09:00
Cheng Zhao
c2833274bf Merge pull request #5332 from Stone-Jay/patch-7
Update desktop-environment-integration.md (zh-CN)
2016-04-29 08:22:26 +09:00
Kevin Sawicki
9f82620bb0 Merge pull request #5300 from electron/default-app-styles
Update default app styles
2016-04-28 09:27:33 -07:00
Kevin Sawicki
b0dc7ff841 Remove header link hover color 2016-04-28 09:12:13 -07:00
Kevin Sawicki
80bece5640 Add links to nav bar 2016-04-28 09:12:13 -07:00
simurai
5995e3f400 Make drag&drop text wrap-able 2016-04-28 09:12:13 -07:00
simurai
3e4ecd6d6e Fix logo
So the inner dot is filled
2016-04-28 09:12:12 -07:00
Kevin Sawicki
6979ea7fda Use default cursor on holder area 2016-04-28 09:12:12 -07:00
Kevin Sawicki
068909dc03 Tweak header text color 2016-04-28 09:12:12 -07:00
Kevin Sawicki
dd337640f5 🎨 2016-04-28 09:12:12 -07:00
Kevin Sawicki
c6edab0950 Tweak link style 2016-04-28 09:12:12 -07:00
Kevin Sawicki
7e9d790070 Tweak font weight on holder div 2016-04-28 09:12:12 -07:00
Kevin Sawicki
54aa458ba4 Tweak font 2016-04-28 09:12:12 -07:00
Kevin Sawicki
09b036f07b Update header colors 2016-04-28 09:12:12 -07:00
Milan Burda
340b7220f1 Fix #3075 by not caching the displays (id is not persistent on Windows) 2016-04-28 17:46:41 +02:00
StoneStoneStone
1bac04c69d Update desktop-environment-integration.md 2016-04-28 22:30:14 +08:00
Cheng Zhao
850bc2d443 Merge pull request #5320 from deepak1556/desktopcapture_api_patch
renderer: fix desktop capture api not responding different subsequest calls
2016-04-28 20:14:58 +09:00
deepak1556
d64e3784f4 renderer: fix desktop capture api not responding different subsequest calls 2016-04-28 14:24:22 +05:30
Cheng Zhao
68192785e7 Merge pull request #5319 from deepak1556/webcontents_executejavascript_patch
webContents: fix executejavascript when called before page load
2016-04-28 16:43:50 +09:00
Cheng Zhao
d9db23185c Merge pull request #5302 from ritazh/default-protocol-handler
Add API: IsDefaultProtocolClient
2016-04-28 16:13:06 +09:00
Cheng Zhao
122652a368 Merge pull request #5315 from deepak1556/download_manager_patch
browser: fix some edge cases with download manager
2016-04-28 16:08:22 +09:00
Cheng Zhao
77573281b5 Merge pull request #5314 from Stone-Jay/patch-6
Translate `testing-on-headless-ci.md` to Chinese
2016-04-28 11:12:55 +09:00
deepak1556
4e6b148eaa webContents: fix executejavascript when called before page load 2016-04-28 01:54:08 +05:30
Rita Zhang
df2141d9e6 Add API: IsDefaultProtocolClient 2016-04-27 12:24:46 -07:00
deepak1556
6dbd2ce243 use DownloadItem to determine download initiator 2016-04-27 20:29:39 +05:30
StoneStoneStone
bfae925b0f Translate testing-on-headless-ci.md to Chinese 2016-04-27 22:49:07 +08:00
deepak1556
46208b5b3e session: dont attach download dialog to deleted webContents window 2016-04-27 20:00:31 +05:30
Cheng Zhao
0fa92923da Merge pull request #5311 from electron/fix-singleton
Create user_data_dir before creating singleton lock
2016-04-27 22:25:15 +09:00
Cheng Zhao
4435cdc576 Create user_data_dir before creating singleton lock 2016-04-27 21:52:50 +09:00
Cheng Zhao
302a6e42bd Merge pull request #5310 from electron/ci-no-clean
Do not run clean in cibuild
2016-04-27 20:21:55 +09:00
Cheng Zhao
f3c3042deb Do not run clean in cibuild 2016-04-27 19:55:01 +09:00
Cheng Zhao
7b8a05f01f Merge pull request #5298 from phamdaniel/fix-mac-accelerators
Fix converting from windows virtual keycode back to mac keycode
2016-04-27 10:23:28 +09:00
Kevin Sawicki
32c93f713a Merge pull request #5301 from electron/webframe-docs
Update module names in docs
2016-04-26 13:46:38 -07:00
Kevin Sawicki
4080442f80 content-tracing -> contentTracing 2016-04-26 10:28:20 -07:00
Kevin Sawicki
b1c0e7e2ab web-frame -> webFrame 2016-04-26 10:28:04 -07:00
Daniel Pham
21af03d71a 🍎 Fix converting from windows virtual keycode back to mac keycode 2016-04-26 10:53:26 -04:00
Cheng Zhao
cdb4444caa Merge pull request #5293 from electron/native-gc
Dereference remote objects with native code
2016-04-26 19:39:48 +09:00
Cheng Zhao
76a954077d Simplify RemoteCallbackFreer 2016-04-26 16:37:46 +09:00
Cheng Zhao
4f21a50d23 Remove duplicated converter for content::WebContents 2016-04-26 16:31:56 +09:00
Cheng Zhao
d9778413e1 Should also destory RemoteCallbackFreer when page is reloaded 2016-04-26 16:30:26 +09:00
Cheng Zhao
06cf0406fe Dereference remote objects with native code
Previously we rely on the v8util.setDestructor to dereference the remote
objects in JavaScript, however as documented in V8, it is forbidden to
call V8 APIs in object's destructor (e.g. the weak callback), and doing
so would result in crashs.

This commit removes the JavaScript setDestructor method, and avoids
doing the dereference work with V8.
2016-04-26 16:16:22 +09:00
Cheng Zhao
570dc7ca9b Merge branch 'MarshallOfSound-master' 2016-04-26 11:15:56 +09:00
Cheng Zhao
f081c77422 Fix compilation error 2016-04-26 11:15:36 +09:00
Cheng Zhao
f3a9d3eed7 Merge pull request #5290 from arifcakiroglu/master
Translate docs to Turkish
2016-04-26 11:13:09 +09:00
Samuel Attard
315cd9d2c8 Emit an error if quitAndInstall is called without an update being available 2016-04-26 11:55:57 +10:00
Cheng Zhao
db91adc2e8 Merge branch 'michal1106-patch-1' 2016-04-26 10:24:57 +09:00
Cheng Zhao
a0c14eed04 Revise the using-pepper-flash-plugin.md 2016-04-26 10:24:43 +09:00
Cheng Zhao
63d0704490 Merge pull request #5282 from electron/system-preferences
Add systemPreferences module
2016-04-26 08:21:43 +09:00
arifcakiroglu
64db17dde7 Added Turkish Docs link to README-ko 2016-04-26 01:03:17 +03:00
arifcakiroglu
d02125bde5 Update README 2016-04-26 00:49:34 +03:00
michal1106
62d00163a8 Update using-pepper-flash-plugin.md 2016-04-25 16:45:56 +03:00
Cheng Zhao
b5d2e51100 docs: platform-theme-changed is deprecated 2016-04-25 22:27:44 +09:00
Cheng Zhao
11653aa9c8 docs: systemPreferences 2016-04-25 15:36:38 +09:00
Cheng Zhao
067e9c1a85 Add systemPreferences.getUserDefault 2016-04-25 15:35:52 +09:00
Cheng Zhao
a421c66f3f Deprecate the platform-theme-changed event 2016-04-25 14:35:34 +09:00
Cheng Zhao
9557226223 Add systemPreferences.subscribeNotification 2016-04-25 14:25:14 +09:00
Cheng Zhao
ddd8eae661 Move isAeroGlassEnabled and isDarkMode to systemPreferences 2016-04-25 12:35:09 +09:00
Cheng Zhao
d72a0e452f BuildPrototype should not be empty 2016-04-25 12:24:11 +09:00
Cheng Zhao
13f8599ba1 Add systemPreferences module 2016-04-25 11:32:33 +09:00
Cheng Zhao
60b9ff3948 Merge pull request #5280 from electron/better-wrappable
Clean up the Wrappable class
2016-04-25 11:22:56 +09:00
Cheng Zhao
9fe3dbcfe0 Make VS happy 2016-04-25 10:40:19 +09:00
Cheng Zhao
272592415d Fix building on non-mac 2016-04-25 10:34:41 +09:00
Cheng Zhao
993695af07 Remove unneeded cleanup code 2016-04-25 10:23:36 +09:00
Cheng Zhao
60d2cb8a84 Remove the isolate parameter of GetWrapper 2016-04-25 10:19:25 +09:00
Cheng Zhao
2ae52d0ff4 Make Wrappable a template class 2016-04-25 10:17:54 +09:00
Cheng Zhao
a8f08e1fab Merge pull request #5263 from miniak/mac-fix-maximize
Fix BrowserWindow.maximize/unmaximize on Mac
2016-04-24 13:58:36 +09:00
Cheng Zhao
096b948570 Merge pull request #5249 from electron/api-summaries
create a one-liner description for each API
2016-04-24 13:50:17 +09:00
Cheng Zhao
c7f338a5ef Merge pull request #5260 from fierroformo/fix-spanish-docs
Fix spanish docs
2016-04-24 13:45:13 +09:00
Cheng Zhao
c7754e712d Merge pull request #5253 from preco21/master
docs: Update Korean docs as Upstream
2016-04-24 13:38:06 +09:00
Cheng Zhao
2f06a2af81 Merge pull request #5252 from miniak/doc-fix
Documentation fixes
2016-04-24 13:37:45 +09:00
Milan Burda
e1516d4244 Fix BrowserWindow.maximize/unmaximize on Mac 2016-04-23 01:16:31 +02:00
Alejandro Betancourt
778d18a510 Fix links in readme for spanish translation 2016-04-22 17:13:51 -05:00
Milan Burda
dfd1a46956 Document process.crash method 2016-04-22 23:58:41 +02:00
Alejandro Betancourt
28381757d5 Fix translations to spanish 2016-04-22 14:34:46 -05:00
Zeke Sikelianos
799fd13c50 more updates to api summaries based on feedback 2016-04-22 11:42:54 -07:00
Zeke Sikelianos
2c8261b429 update excerpts based on feedback 2016-04-22 10:32:28 -07:00
Zeke Sikelianos
0527b17e42 blockquote summaries 2016-04-22 10:32:28 -07:00
Zeke Sikelianos
ee190ca62a create a one-liner description for each API 2016-04-22 10:32:28 -07:00
Jessica Lord
a4de40ec89 Merge pull request #5254 from preco21/document-fixes-3
docs: Improve documentations
2016-04-22 09:55:25 -07:00
Kevin Sawicki
08e18d46ea Merge pull request #5244 from electron/disable-node-in-web-view-when-disabled-in-parent
Disable node in webviews when disabled in parent window
2016-04-22 09:05:58 -07:00
Plusb Preco
6205dfa25f 📝 Remove additional whitespaces
[ci skip]
2016-04-22 23:30:41 +09:00
Plusb Preco
a14014941b 📝 Fix coding style issues
[ci skip]
2016-04-22 23:26:19 +09:00
Plusb Preco
ba9fa95653 📝 Remove additional whitespaces
[ci skip]
2016-04-22 23:23:39 +09:00
Plusb Preco
66f4701d93 📝 Remove additional whitespaces
[ci skip]
2016-04-22 23:23:15 +09:00
Plusb Preco
b6f8dcea20 📝 Add missing platform specified tag
[ci skip]
2016-04-22 23:21:42 +09:00
Plusb Preco
7fa4b7c8b5 📝 Normalize code tags
[ci skip]
2016-04-22 23:15:31 +09:00
Plusb Preco
b862cee6ec 📝 Correct heading order
[ci skip]
2016-04-22 23:11:39 +09:00
Plusb Preco
741f8091b4 📝 Fix coding style issues
* Correct heading order
* Adjust line length to `80`
* Beautify docs
* Apply small fixes
* Normalize whitespaces

[ci skip]
2016-04-22 23:09:59 +09:00
Plusb Preco
cbc2a869e3 📝 Fix typos
[ci skip]
2016-04-22 22:56:24 +09:00
Plusb Preco
c72bb6df33 📝 Remove unused link reference
[ci skip]
2016-04-22 22:55:38 +09:00
Plusb Preco
4f4277e25e 📝 Fix coding style issues
* Adjust line length to `80`
* Normalize whitespaces

[ci skip]
2016-04-22 22:54:43 +09:00
Plusb Preco
0282180b9c 📝 Correct description style
[ci skip]
2016-04-22 22:20:41 +09:00
Plusb Preco
08dbd35ced 📝 Apply small fixes
[ci skip]
2016-04-22 22:14:42 +09:00
Plusb Preco
552609db73 📝 Apply small fixes
[ci skip]
2016-04-22 22:13:02 +09:00
Plusb Preco
57115a447c 📝 Update README-ko.md
[ci skip]
2016-04-22 22:12:46 +09:00
Plusb Preco
d125483c13 📝 Update Korean docs as upstream
[ci skip]
2016-04-22 22:02:39 +09:00
Milan Burda
da727a3c1b Fix display.rotation documentation 2016-04-22 12:32:11 +02:00
Cheng Zhao
c04d43ca13 Bump v0.37.7 2016-04-22 17:39:11 +09:00
Cheng Zhao
394ffa88dd Merge pull request #5250 from electron/felix/camelCase
Windows Store Camels
2016-04-22 11:23:15 +09:00
Felix Rieseberg
c0f63eed4e 🎨 Windows Store Camels 2016-04-21 19:11:25 -07:00
Kevin Sawicki
bb2cab2858 Merge pull request #5247 from djpereira/patch-1
Update desktop-capturer.md
2016-04-21 15:32:56 -07:00
Daniel Pereira
b45f683655 Update desktop-capturer.md
Fixed native image link.
2016-04-21 17:00:19 -05:00
Kevin Sawicki
8e7bf1051d Disable node integration on webview when disabled on window 2016-04-21 11:52:10 -07:00
Kevin Sawicki
e4bd592e0e Add failing spec 2016-04-21 11:49:42 -07:00
Plusb Preco
67f672541c 📝 Update Korean docs as upstream
[ci skip]
2016-04-21 18:51:27 +09:00
Cheng Zhao
c92e622ce0 Merge pull request #5238 from electron/felix/appx-detection
Add Windows Store Detection
2016-04-21 16:21:38 +09:00
Felix Rieseberg
2a2a8d3263 Add Windows Store Detection
If we're running as a Windows Store appx package,
`process.windowsstore` will be `true`, otherwise
`undefined`.
2016-04-21 00:02:03 -07:00
Cheng Zhao
b30143c67d Merge pull request #5237 from electron/set-path-no-create
Do not create the folder passed to app.setPath
2016-04-21 14:49:55 +09:00
Cheng Zhao
df97be30e5 Do not create the folder passed to app.setPath 2016-04-21 14:37:29 +09:00
Cheng Zhao
1c75baa8b3 Merge pull request #5236 from electron/short-ss-path
Make the length of SingletonSocket's path as short as we can
2016-04-21 14:14:24 +09:00
Cheng Zhao
0900762507 Make the length of SingletonSocket's path as short as we can 2016-04-21 13:58:11 +09:00
Plusb Preco
30d37fcba4 📝 Small fixes
[ci skip]
2016-04-21 12:33:56 +09:00
Cheng Zhao
ec832f418a Merge pull request #5233 from electron/remove-no-exception
Guard against unexist owner when removing ref to remote object
2016-04-21 11:50:27 +09:00
Cheng Zhao
a836ee4ea7 Merge pull request #5231 from deepak1556/open_external_pemission_patch
session: allow providing permission to handle external protocols
2016-04-21 11:50:01 +09:00
Cheng Zhao
b5c1db9ad9 Guard against unexist owner when removing ref to remote object 2016-04-21 11:23:20 +09:00
deepak1556
ca756c3c24 session: allow providing permission to handle external protocols 2016-04-21 05:27:07 +05:30
Cheng Zhao
aa29dc0c8a Merge pull request #5199 from Mr0grog/5183-disambiguate-loading-from-main-frame-loading
Add `isLoadingMainFrame()` to WebContents
2016-04-20 20:49:56 +09:00
Plusb Preco
720fbc1003 📝 Update Korean docs as upstream
* Update docs
* Small fixes

[ci skip]
2016-04-20 18:45:07 +09:00
Rob Brackett
dc8fc7c079 📝 Add English docs for webContents.isLoadingMainFrame()
[ci skip]
2016-04-19 23:27:22 -07:00
Cheng Zhao
823c4f91a8 Merge pull request #5219 from atdrago/master
Add note for OS X about using `role` on MenuItem
2016-04-20 15:11:43 +09:00
Cheng Zhao
809135f657 Merge pull request #5222 from Stone-Jay/master
fixes some translation mistakes
2016-04-20 15:05:25 +09:00
Cheng Zhao
47ec7dcaa0 Merge pull request #5213 from rmcdonald/patch-1
Correct transposition errors by changing xfvb to xvfb
2016-04-20 15:05:04 +09:00
Cheng Zhao
3fdcbcef03 Merge pull request #5223 from electron/remote-cleanup
Small cleanup of the code determining value's type
2016-04-20 14:47:16 +09:00
Cheng Zhao
965c3f605e Merge pull request #5197 from deepak1556/client_certificate_patch
app: api to import client certificate
2016-04-20 14:35:00 +09:00
Cheng Zhao
680652d01c buffer, null, array etc. all belong to object 2016-04-20 14:32:32 +09:00
Cheng Zhao
ff1b7d18f6 Cleanup the code determining value's type 2016-04-20 14:26:49 +09:00
Rob Brackett
d3e879cd7f Change WebContents::IsLoadingMainFrame to compare SiteInstances
(per @deepak1556's recommendation)

Also updates tests to cover the situation where navigating between pages from the same potential "site" and adds generalized tests for `isLoadingMainFrame()`.
2016-04-19 22:05:09 -07:00
Cheng Zhao
d7a391dc61 Merge pull request #5214 from alexgleason/docs-downloaditem-typo
Fixed docs sample code programming error for DownloadItem
2016-04-20 13:44:31 +09:00
Cheng Zhao
d3bff7fffc Merge pull request #5208 from deepak1556/devtools_dock_state_patch
devtools: allow opening in specified dock state
2016-04-20 13:34:52 +09:00
Cheng Zhao
a3e8591a41 Update brightray for #5208 2016-04-20 13:34:30 +09:00
deepak1556
794d120754 rename importClientCertificate => importCertificate 2016-04-20 08:45:49 +05:30
StoneStoneStone
bdde5fd7ad Update screen.md 2016-04-20 10:58:32 +08:00
StoneStoneStone
57bdbd8185 Update download-item.md 2016-04-20 10:39:47 +08:00
StoneStoneStone
16b54e1502 Update screen.md 2016-04-20 10:37:41 +08:00
StoneStoneStone
7468118df5 Update screen.md 2016-04-20 10:26:31 +08:00
Rob Brackett
942971b01a Fix linting errors. 2016-04-19 19:20:59 -07:00
Cheng Zhao
652110707e Merge pull request #5202 from electron/updating-submodules
keeping submodules up to date
2016-04-20 10:51:12 +09:00
Adam Drago
b80272dbb4 Add note for OS X about using role on MenuItem 2016-04-19 18:12:37 -07:00
Cheng Zhao
5b7637687c Merge pull request #5143 from felixrieseberg/debug-instructions
Add Debugging Instructions for Windows
2016-04-20 09:33:25 +09:00
Cheng Zhao
b2a3aabc90 Merge pull request #5218 from electron/style-fix
Fix some coding style issues
2016-04-20 09:31:53 +09:00
Cheng Zhao
18f5fcde60 Fix some coding style issues 2016-04-20 09:18:50 +09:00
Cheng Zhao
eb9e0e5534 Merge pull request #4922 from electron/bengotow/sheet-offset
Allow sheets to be attached at a custom offset #4679
2016-04-20 08:55:42 +09:00
Cheng Zhao
8ca1a6961c Merge pull request #5147 from deepak1556/devtools_network_controller_patch
session: set client id when enabling network emulation
2016-04-20 08:52:59 +09:00
Cheng Zhao
37e500dc10 Merge pull request #5203 from Stone-Jay/master
Translate download-item.md to Chinese
2016-04-20 08:50:25 +09:00
Cheng Zhao
873e9c44db Merge pull request #5196 from raybooysen/patch-1
Update screen.md
2016-04-20 08:44:41 +09:00
Jessica Lord
5e9fe1c6eb Merge pull request #5168 from electron/jlord-patch-1
A few style updates 2 docs
2016-04-19 12:29:42 -07:00
Alex Gleason
02c8c58c0b Fixed docs sample code programming error for DownloadItem 2016-04-19 12:47:05 -04:00
Zeke Sikelianos
8f04dd1b9c remove the git 2016-04-19 09:46:48 -07:00
rmcdonald
838cf0ffdc Correct transposition errors by changing xfvb to xvfb 2016-04-19 09:31:04 -07:00
deepak1556
58dfad4d01 devtools: allow opening in specified dock state 2016-04-19 18:12:05 +05:30
Cheng Zhao
34ee29871b Merge pull request #5205 from electron/mas-fix
Fix the support for Mac App Store
2016-04-19 20:56:24 +09:00
Cheng Zhao
fd6747483a Update the codesign code for latest Xcode 2016-04-19 20:31:31 +09:00
Cheng Zhao
bd406ab046 Update the MAS submission guide 2016-04-19 20:31:31 +09:00
deepak1556
2d8286515d expose api only on platforms using nss cert database 2016-04-19 11:29:24 +05:30
Ben Gotow
414245f4d8 Keep function placement consistent 2016-04-18 22:45:38 -07:00
Ben Gotow
8f89cd2d59 Move "setSheetOffset" to the BrowserWindow 2016-04-18 22:39:12 -07:00
deepak1556
ddf962c6ea client_id is accessed on different threads 2016-04-19 10:01:38 +05:30
StoneStoneStone
591f8fed88 Update frameless-window.md 2016-04-19 12:03:34 +08:00
StoneStoneStone
fcad4ee186 Create download-item.md 2016-04-19 11:58:58 +08:00
Zeke Sikelianos
916114dd28 📝 keeping submodules up to date 2016-04-18 20:23:11 -07:00
StoneStoneStone
ace235b2fe Merge pull request #3 from electron/master
update from electron
2016-04-19 09:13:30 +08:00
Jessica Lord
c3200ba7f6 Revert "Fix headers"
This reverts commit 4dd2716865.
2016-04-18 18:00:32 -07:00
Cheng Zhao
1c87acbb75 Merge pull request #5194 from Stone-Jay/patch-5
Create frameless-window.md
2016-04-19 08:59:45 +09:00
Cheng Zhao
5c75fbe369 Merge pull request #5192 from andrewda/patch-1
Update link to setFeatureEnabledFromString
2016-04-19 08:59:15 +09:00
Rob Brackett
64a84dee3b Add isLoadingMainFrame method to WebContents.
Also switch `webContents.executeJavaScript` to check it instead of `isLoading`.
There doesn’t seem to be a reasonable public way to get this information out of Chromium, so it’s synthesized here based on WebContentsObserver callbacks.
Fixes #5183.
2016-04-18 10:37:08 -07:00
Rob Brackett
3a9bbe30ac Test for #5183 - webContents.executeJavaScript hangs on subframe load. 2016-04-18 10:33:56 -07:00
deepak1556
2c0494dcef fix spec 2016-04-18 22:57:37 +05:30
deepak1556
919be67cd2 remove --client-certificate flag 2016-04-18 22:26:37 +05:30
deepak1556
2ddac9352f add spec 2016-04-18 21:53:44 +05:30
Ray Booysen
5a9b86dd05 Update screen.md 2016-04-18 17:04:47 +01:00
deepak1556
1240c83e40 set trust bits for CA certs 2016-04-18 21:05:33 +05:30
StoneStoneStone
142300aeb9 Create frameless-window.md
Translate `frameless-window.md` to Chinese.  And I'm not sure that the `non-client frame`'s translation is accurate.
2016-04-18 22:38:15 +08:00
Cheng Zhao
eeccd90455 Merge pull request #5191 from electron/initialize-embedder
Initialize the embedder_ member data
2016-04-18 15:13:41 +09:00
Cheng Zhao
a8032e8fef Merge pull request #5184 from miniak/fix-docs
Fix documentation
2016-04-18 15:13:27 +09:00
deepak1556
b8e04f4947 set client id on AtomNetworkDelegate instead of cmd line switch 2016-04-18 11:35:24 +05:30
Andrew Dassonville
12483486c0 Update link to setFeatureEnabledFromString 2016-04-17 23:04:02 -07:00
Cheng Zhao
34319abf4a Initialize the embedder_ member data
Otherwise it is going to be some random value and bite us.
2016-04-18 14:52:03 +09:00
deepak1556
e81cec4058 app: api to import client certificate 2016-04-18 10:54:43 +05:30
deepak1556
fcf04377d7 set network emulation client id in request headers 2016-04-18 10:49:00 +05:30
Cheng Zhao
0bf1e56156 Update brightray for electron/brightray#212 2016-04-18 13:59:15 +09:00
Plusb Preco
c8e77f47ab 📝 Fix typos
[ci skip]
2016-04-18 02:39:05 +09:00
Milan Burda
d512421084 Fix documentation 2016-04-16 19:58:03 +02:00
Ben Gotow
1976c271ec Fix JS linter errors 2016-04-16 11:04:48 -04:00
Ben Gotow
65c37fe64b Create local variable to typecast view 2016-04-16 10:57:39 -04:00
Ben Gotow
c87c49f4c8 Allow sheets to be attached at a custom offset #4679
Adds a new "setSheetOffset" API to the `dialog` module, which allows you to change the attachment point for sheets on Mac OS X. I put the API on the dialog module, even though Mac OS X requires that the native window hold and return the desired offset.

1. I was originally hoping to make this an argument on the actual dialog.show* calls, but it seems the parameter set is defined in `libchromiumcontent` and I wasn't sure it would be appropriate to add there?

2.  The API could also be on the BrowserWindow (eg `BrowserWindow.setSheetOffset`). I don't have a strong preference, but I think it's more discoverable on the `dialog` module.
2016-04-16 10:16:43 -04:00
Zeke Sikelianos
8d08c3241d Merge pull request #5176 from shokmaster/patch-1
Correct misspellings
2016-04-15 12:46:30 -07:00
Cheng Zhao
16de30dd04 Merge pull request #5169 from Stone-Jay/patch-4
Update sample code in online-offline-events.md
2016-04-15 22:16:07 +09:00
Cheng Zhao
522d592832 Merge pull request #5167 from Stone-Jay/patch-3
translation error in browser-window.md
2016-04-15 21:14:09 +09:00
Cheng Zhao
2414096560 Merge pull request #5166 from preco21/master
docs: Update Korean docs as upstream
2016-04-15 20:39:55 +09:00
Cheng Zhao
cb947873c4 Merge pull request #5161 from electron/felix/iss5097
AutoUpdate Windows: Don't spawn if running
2016-04-15 20:10:03 +09:00
Cheng Zhao
44bc24174c Merge pull request #5159 from djpereira/patch-1
Sample missing reference to webContents for toggleDevTools
2016-04-15 19:59:50 +09:00
Cheng Zhao
9574f79d0f Merge pull request #5157 from christoth/master
webview: add CSS styling notes to doc
2016-04-15 19:58:54 +09:00
Juan Antonio Gómez
132ac20ccf Correct misspellings
Correct misspellings
2016-04-15 11:49:08 +02:00
StoneStoneStone
7d788cfa7a Merge pull request #2 from Stone-Jay/patch-4
Patch 4
2016-04-15 16:02:58 +08:00
Cheng Zhao
aefb672393 Bump v0.37.6 2016-04-15 16:48:09 +09:00
Cheng Zhao
059ca01767 Update brightray for printing fix 2016-04-15 16:47:17 +09:00
Cheng Zhao
38f0088844 Update brightray for #4973 2016-04-15 16:35:51 +09:00
StoneStoneStone
07346ae858 Update sample code in online-offline-events.md
change `ipc` to `ipcMain`/`ipcRenderer`
2016-04-15 14:10:11 +08:00
Jessica Lord
4dd2716865 Fix headers 2016-04-14 20:55:43 -07:00
StoneStoneStone
1985e1b8e0 translation error in browser-window.md
'same-origin policy' means '同源策略' in Chinese
2016-04-15 10:04:01 +08:00
Cheng Zhao
075da45b74 Merge pull request #5155 from electron/mac-background-color
Set the backgroundColor of RenderWidgetHostView
2016-04-15 08:48:09 +09:00
Jessica Lord
7d96f3d720 Add new line
so that the list is styled correctly on website
2016-04-14 15:53:34 -07:00
Felix Rieseberg
a5b93211e6 AutoUpdate Windows: Don't spawn if running
Previously, the auto updater would run as many squirrel processes
as told. This introduces a little change where instead of spawning
a second process, we attach to the already running process - or, if
different arguments are passed, return and emit an error.

This is not failsafe, but it ensures that we don't run into simple
race condition crashes.

Closes $5097
2016-04-14 11:22:28 -07:00
Daniel Pereira
7b56085a0a Update menu.md
There was a missing reference to webContents.
2016-04-14 10:50:08 -05:00
christoth
4708477f5a webview: add CSS styling notes
Create a new section for CSS and add notes to avoid hiding the webview via hidden or display:none; and provide a recommended approach.
2016-04-14 10:29:55 -04:00
Plusb Preco
95a53fc832 📝 Small fixes
[ci skip]
2016-04-14 22:56:56 +09:00
Plusb Preco
b8e64ac40e 📝 Update Korean docs as upstream
[ci skip]
2016-04-14 22:55:09 +09:00
Cheng Zhao
b84a178ceb Set the backgroundColor of RenderWidgetHostView 2016-04-14 21:52:17 +09:00
Cheng Zhao
64d37065bd Merge pull request #5117 from deepak1556/devtools_security_panel_patch
provide security style for devtools security panel
2016-04-14 20:23:58 +09:00
Cheng Zhao
7501a02b34 Merge pull request #5153 from electron/fix-frameless-background
Fix wrong default transparent background for frameless window
2016-04-14 20:05:35 +09:00
deepak1556
54545a8a6e provide security style for devtools security panel 2016-04-14 16:20:14 +05:30
Cheng Zhao
11ba1832d1 Only transparent window does not have background color 2016-04-14 19:35:31 +09:00
Cheng Zhao
9e85cb4c11 Merge pull request #5152 from electron/fix-win-printing
Fix printing not working on Windows
2016-04-14 19:22:56 +09:00
Cheng Zhao
7d4e0629d6 Fix the link error 2016-04-14 18:22:29 +09:00
Cheng Zhao
ae0d007c5e Do no load PDF library from DLL
We already have them compiled in.
2016-04-14 17:15:20 +09:00
Cheng Zhao
b9ad09db91 Update libchromiumcontent with necessary headers and libs 2016-04-14 17:14:45 +09:00
Cheng Zhao
47cc390e41 Merge pull request #5146 from Stone-Jay/patch-2
Update process.md
2016-04-14 15:11:55 +09:00
Cheng Zhao
7787dee638 Merge pull request #5141 from electron/optimize-visibility-state
Optimize the implementation of document.visibilityState
2016-04-14 11:56:13 +09:00
StoneStoneStone
cb2343c69e Update process.md
translation error, change "实效" to “失效".
2016-04-14 10:08:01 +08:00
Cheng Zhao
31eb793fb0 Avoid adding a new option to webPreferences 2016-04-14 10:50:07 +09:00
Felix Rieseberg
3c6e933231 📝 Add Debugging Instructions for Windows
Ref #5140
2016-04-13 15:39:05 -07:00
Cheng Zhao
8f0e594007 Fix lint warnings 2016-04-13 23:10:31 +09:00
Cheng Zhao
43c44da50b Correctly set initial visibilityState 2016-04-13 23:07:28 +09:00
Cheng Zhao
07a4c52919 Reduces the IPC messages used for visibilityState 2016-04-13 21:36:43 +09:00
Cheng Zhao
c3ac92b500 Update brightray for the linux notification improvements 2016-04-13 20:13:45 +09:00
Cheng Zhao
07572965df Merge pull request #5137 from electron/fix-did-fail-load
Revert #3643
2016-04-13 20:12:50 +09:00
Cheng Zhao
65c612a66d Avoid external URLs 2016-04-13 19:55:59 +09:00
Cheng Zhao
0a39449694 spec: loadUrl should not crash in did-fail-provisional-load handler 2016-04-13 19:39:11 +09:00
Cheng Zhao
92882c358a No more need to delay did-fail-load event 2016-04-13 19:33:59 +09:00
Cheng Zhao
49d25693ee Merge pull request #5136 from electron/gc-timer
Use LowMemoryNotification for GC
2016-04-13 18:47:28 +09:00
Cheng Zhao
3780d9f033 Use LowMemoryNotification for GC 2016-04-13 17:58:36 +09:00
Cheng Zhao
de51f2c1ba Merge pull request #5131 from electron/focus-delay
Delay the focus/blur event to next tick
2016-04-13 13:00:18 +09:00
Cheng Zhao
99a9aa085e views: Delay the focus/blur event to next tick 2016-04-13 11:02:34 +09:00
christoth
1379e4f2dc Merge pull request #1 from electron/master
Update
2016-04-12 12:38:40 -04:00
Cheng Zhao
313883b1fc Merge pull request #5119 from electron/hijack-reload
Handle the Page.reload command coming from devtools
2016-04-12 17:57:27 +09:00
Cheng Zhao
2fbe06a2a5 Handle the Page.reload command coming from devtools 2016-04-12 16:36:12 +09:00
Cheng Zhao
c9a3fc4317 Merge pull request #5118 from electron/webview-no-script
Fix webview and preload script not working when there is no script tag in page
2016-04-12 15:32:28 +09:00
Cheng Zhao
17446f4284 Make sure every page will get a script context created 2016-04-12 15:11:10 +09:00
Cheng Zhao
bb70defcb8 spec: webview should work without script tag in page 2016-04-12 15:10:26 +09:00
Cheng Zhao
5efa075aca spec: preload attribute should work without script tag in page 2016-04-12 14:57:40 +09:00
Cheng Zhao
d6b4c2a842 Merge pull request #5114 from anshao/master
Delete the extra text
2016-04-12 14:02:23 +09:00
Cheng Zhao
41e771d011 Merge pull request #5108 from preco21/master
docs: Update Korean docs as upstream
2016-04-12 08:46:22 +09:00
zenganshao
337d105104 Delete the extra text 2016-04-11 22:43:02 +08:00
Cheng Zhao
d3fb123920 Merge pull request #5102 from Stone-Jay/patch-1
Update quick-start.md
2016-04-11 21:48:59 +09:00
Cheng Zhao
a07612c1ed Merge branch '5074-did-get-response-details-resource-type' of https://github.com/Mr0grog/electron into Mr0grog-5074-did-get-response-details-resource-type 2016-04-11 21:05:40 +09:00
Cheng Zhao
a2f7458e07 Merge pull request #5091 from electron/electron-asar-in-stack-traces
Rename ATOM_SHELL_ASAR to ELECTRON_ASAR
2016-04-11 20:27:15 +09:00
Cheng Zhao
5659ee5c0b Merge pull request #5030 from deepak1556/webrequest_response_headers_patch
session: webRequest.OnHeadersReceived should accept status line.
2016-04-11 20:04:32 +09:00
Cheng Zhao
056aaa2a62 Update brightray for #4931 2016-04-11 19:30:59 +09:00
Cheng Zhao
107d759ea2 Merge pull request #5072 from sneakypete81/master
Don't wait for xdg-open to exit when OpenExternal is called (Linux)
2016-04-11 19:27:53 +09:00
Cheng Zhao
796f6614f7 Merge pull request #5073 from electron/naming-things
Document API naming conventions
2016-04-11 19:16:31 +09:00
Plusb Preco
726d0d6b60 📝 Update Korean docs as upstream
[ci skip]
2016-04-11 11:18:25 +09:00
Plusb Preco
a048bddaa5 📝 Fix url to relative
[ci skip]
2016-04-11 10:51:31 +09:00
Plusb Preco
c1f64b3f85 📝 Add missing changes
[ci skip]
2016-04-11 10:39:23 +09:00
Plusb Preco
3c44dfa210 📝 Fix grammatical typos
[ci skip]
2016-04-11 10:39:18 +09:00
Plusb Preco
1fe97ddf2e 📝 Fix url locale
[ci skip]
2016-04-11 10:38:34 +09:00
Plusb Preco
0a80618263 📝 Add missing changes
[ci skip]
2016-04-11 10:18:47 +09:00
StoneStoneStone
fca3a5f853 Update quick-start.md
Translation error about system events(line43).
2016-04-10 11:23:26 +08:00
Rob Brackett
1a842bf9d5 Fix trailing whitespace caught by linter. 2016-04-08 13:15:40 -07:00
Rob Brackett
50f51899de Document resourceType arg for did-get-response-details event. 2016-04-08 13:03:22 -07:00
Rob Brackett
15b042b5f6 Add support/tests for did-get-response-details event on <WebView> 2016-04-08 12:55:20 -07:00
Rob Brackett
c1b1348735 Add resourceType arg to webContents did-get-response-details event.
Fixes #5074 and follows @zcbenz's recommendation to expose ResourceTypeToString from atom_network_delegate publicly.
Also adds testing for other arguments to the `did-get-response-details` events, since there were no existing tests for them.
2016-04-08 11:19:36 -07:00
Kevin Sawicki
732697a8a2 Rename ATOM_SHELL_ASAR to ELECTRON_ASAR 2016-04-08 08:53:58 -07:00
Kevin Sawicki
066092abb6 Merge pull request #5079 from electron/set-node-version-to-5-dot-10
Upgrade .node-version to 5.10.0
2016-04-08 08:24:53 -07:00
Kevin Sawicki
37119768a0 ⬆️ node@5.10.0 2016-04-08 08:24:40 -07:00
deepak1556
3fb39ad3ef provide option to override status line 2016-04-08 14:03:57 +05:30
Pete Burgers
00ff209fe7 Ensure process is cleaned up, to avoid leaks 2016-04-08 08:35:35 +01:00
Pete Burgers
46365f4076 wait_for_exit param should be const 2016-04-08 08:32:45 +01:00
Cheng Zhao
5ff97317fe Merge pull request #5086 from electron/no-throttling
Add backgroundThrottling option to webPreferences
2016-04-08 16:25:09 +09:00
Cheng Zhao
d169ebf737 Merge pull request #5070 from christoth/master
webview: Update doc to reflect use of flexbox layout
2016-04-08 16:09:12 +09:00
Cheng Zhao
2f6796bd7f Disable throttling in tests 2016-04-08 15:57:14 +09:00
Cheng Zhao
d156846036 Add backgroundThrottling option to webPreferences 2016-04-08 15:54:33 +09:00
Cheng Zhao
d703a87317 Update libchromiumcontent with disable_hidden.patch 2016-04-08 15:22:57 +09:00
deepak1556
4fc35a4587 session: webRequest.OnHeadersReceived should follow server redirect
Its required to follow server redirects.
2016-04-08 11:40:43 +05:30
Kevin Sawicki
f403950503 Merge pull request #5064 from electron/upgrade-asar-for-graceful-fs-warning
Upgrade asar to remove graceful-fs warning
2016-04-07 11:40:04 -07:00
Kevin Sawicki
f20950702d ⬆️ asar@0.11 2016-04-07 10:36:41 -07:00
Kevin Sawicki
1a3ede6ca5 Merge pull request #5075 from electron/upgrade-ci-node
Use node 0.10 instead of 0.8 on internal CI machines
2016-04-07 10:35:52 -07:00
Kevin Sawicki
4041d52864 Use single quotes 2016-04-07 10:15:31 -07:00
Kevin Sawicki
10860e4ec5 Use npm.cmd on Windows to print version 2016-04-07 10:14:52 -07:00
Kevin Sawicki
687a512b11 Log node and npm versions 2016-04-07 10:03:16 -07:00
Kevin Sawicki
e95224deab Remove += 2016-04-07 10:00:23 -07:00
Kevin Sawicki
a74b9607b6 Add more logging 2016-04-07 09:59:46 -07:00
Kevin Sawicki
0fad8fdc4b Add missing .path 2016-04-07 09:56:04 -07:00
Kevin Sawicki
7e87973d60 Log version to verify 2016-04-07 09:55:23 -07:00
Kevin Sawicki
d3308cf8c3 Use node 0.10.21 on CI 2016-04-07 09:53:33 -07:00
Zeke Sikelianos
348a0e958b wrap cases in backticks 2016-04-07 09:49:55 -07:00
Zeke Sikelianos
4d8d4d5f2a use globalShortcut as a better mixedCase example 2016-04-07 09:49:17 -07:00
Zeke Sikelianos
193c6d6e93 📝 document API naming conventions 2016-04-07 09:40:31 -07:00
Kevin Sawicki
49b82decd8 Merge pull request #5061 from electron/rename-ipc-events
Rename internal IPC events to start with ELECTRON_
2016-04-07 09:37:07 -07:00
Kevin Sawicki
8d8d5878a3 Rename ATOM_ ipc event prefix to ELECTRON_ 2016-04-07 09:04:55 -07:00
Pete Burgers
79ba8feaf8 Don't wait for xdg-open to exit when OpenExternal is called (Linux)
Some browsers (eg. Firefox) may not return until the browser window is
closed. This causes the Electron application to lock up while the browser
window is open.

See https://github.com/atom/atom/issues/6320
2016-04-07 17:04:15 +01:00
Kevin Sawicki
577480421d Merge pull request #5063 from electron/mention-codesigning
Mention signing is required on OS X for automatic updates
2016-04-07 09:04:00 -07:00
Kevin Sawicki
59991f2fd8 Mention codesigning is required on OS X 2016-04-07 09:03:31 -07:00
christoth
a79c63581d Update doc to reflect use of flexbox layout
Updated documentation, changed `display:inline-block` to `display:inline-flex', explicitly noted the use of the new layout and how it can be broken by overwriting the CSS `display' property.
2016-04-07 10:42:42 -04:00
Cheng Zhao
cf2a17cf88 Merge pull request #5048 from preco21/master
Docs: Update Korean docs as upstream
2016-04-07 21:22:24 +09:00
Cheng Zhao
82856eb099 Merge pull request #5029 from Mr0grog/5013-add-main-frame-param-for-did-fail-load
Add `isMainFrame` param to WebContents `did-fail-load` event
2016-04-07 20:22:02 +09:00
Cheng Zhao
7d3f8cb222 Merge pull request #5009 from deepak1556/context_creation_patch
browser: create cert verifier when browser context is created
2016-04-07 16:18:55 +09:00
Cheng Zhao
efb0fc2ea5 Merge pull request #4968 from phamdaniel/exit-events
Don't emit 'will-quit' when 'app.exit()' is called.
2016-04-07 16:14:35 +09:00
Cheng Zhao
aae83cbce8 Merge pull request #4986 from Aluxian/Aluxian-patch-1
Add squirrel-updates-server link in the docs
2016-04-07 16:11:49 +09:00
Cheng Zhao
adb112e970 Merge pull request #5056 from electron/fix-a11y-reader
Fix NVDA/JAWS support in Electron
2016-04-07 16:11:05 +09:00
Cheng Zhao
bcb4ba6f99 Merge pull request #5040 from electron/python2
Allow bootstrap to be invoked via python2
2016-04-07 16:10:51 +09:00
Cheng Zhao
cb47dfa90e Fix problem with old Node 2016-04-07 15:59:28 +09:00
Cheng Zhao
71b67534a8 Fix coding styles 2016-04-07 15:45:20 +09:00
Paul Betts
3ee366257c Allow bootstrap to be invoked via python2
This means that on most Linux distributions where python3 is the default, we
can invoke `python2 script/bootstrap.py` and have it all work
2016-04-07 15:43:57 +09:00
Cheng Zhao
d171cfe8d0 Merge pull request #4924 from electron/bengotow/osx-tray-templates
Fix broken template image support in Tray icon
2016-04-07 15:40:35 +09:00
Cheng Zhao
548febfa4c Fix style issues 2016-04-07 15:23:16 +09:00
Ben Gotow
e0ee60f290 Fix memory leak 2016-04-07 15:21:07 +09:00
Ben Gotow
91457fe739 Support images larger than self.bounds 2016-04-07 15:21:07 +09:00
Ben Gotow
f9644463a9 Fix broken template image support in Tray icon
Between Electron `0.30.x` and `0.37.x`, the tray icon stopped automatically inverting template images when highlighted. NSImageView normally uses the correct color for template images magicaly, but I think the addition of event handlers in the container view prevents the image view from determining highlight state.

This PR switches to drawing the image manually. The `drawRect` function decides whether to use `image` or `alternateImage`(pressed image) and then if that image is marked as a template, it fills it with the same color used for the text before drawing it.
2016-04-07 15:21:07 +09:00
Cheng Zhao
80f66031cb Merge pull request #5068 from electron/fix-ci
Update node: bring CI back to green
2016-04-07 15:20:16 +09:00
Cheng Zhao
fb299c7fcb Update node: bring CI back to green 2016-04-07 14:58:14 +09:00
Cheng Zhao
55b8e9aa44 Bump v0.37.5 2016-04-07 10:34:25 +09:00
Cheng Zhao
b4885b9a37 atom => electron in upload script 2016-04-07 10:34:25 +09:00
Paul Betts
6e7aa6d299 Even though this call is probably fast, it can potentially happen a lot, make it _really_ fast 2016-04-06 10:44:39 -07:00
Paul Betts
c474ad0913 Revert "Remove custom WM_GETOBJECT"
This reverts commit 705001a50e.
2016-04-06 10:16:41 -07:00
Plusb Preco
5dfc64120f Merge remote-tracking branch 'refs/remotes/electron/master' 2016-04-06 14:03:03 +09:00
Cheng Zhao
b48788af43 Merge pull request #5033 from electron/fix-buffer-crash
Rebase on the correct Node commit
2016-04-05 20:44:09 +09:00
Cheng Zhao
dd283ff8d7 spec: We should not use pre release of Node 2016-04-05 19:53:07 +09:00
Cheng Zhao
7796dbb7ce Update node: rebase on v5.10.0 tag instead of master branch 2016-04-05 19:34:13 +09:00
Cheng Zhao
c562b24df8 spec: Add test case for #5028 2016-04-05 17:08:27 +09:00
Rob Brackett
884c9cc2f5 Document isMainFrame argument for WebContents did-fail-load event. 2016-04-04 19:36:34 -07:00
Rob Brackett
f12f87d6f0 Add isMainFrame as last argument to WebContents did-fail-load event.
Fixes #5013.
2016-04-04 19:26:06 -07:00
Kevin Sawicki
fa27120429 Merge pull request #4978 from electron/new-electron-org
Updates links for new GitHub organization
2016-04-04 12:34:50 -07:00
Kevin Sawicki
c2bcf8cbde Update links for new Electron org 2016-04-04 12:18:37 -07:00
Kevin Sawicki
b553981644 Update readme and contributing guide for new org 2016-04-04 12:07:22 -07:00
Kevin Sawicki
fc84c952f2 Update source code for new org 2016-04-04 12:07:22 -07:00
Kevin Sawicki
102f7e8e33 Update docs for new org 2016-04-04 12:05:53 -07:00
Kevin Sawicki
5ffa30a563 Update submodules for new org 2016-04-04 12:05:53 -07:00
Plusb Preco
492a7d0ffe 📝 Update Korean docs as upstream
[ci skip]
2016-04-04 01:01:01 +09:00
Plusb Preco
6e9c27fdaa 📝 Update Korean docs as upstream
[ci skip]
2016-04-04 00:56:07 +09:00
Cheng Zhao
fdb138f79c Bump v0.37.4 2016-04-03 18:31:23 +09:00
Cheng Zhao
d62d8bbf0a Merge pull request #4998 from atom/node-5.10.0
Upgrade Node to v5.10.0
2016-04-03 16:53:11 +09:00
Cheng Zhao
39a20ea4fb Upgrade Node to v5.10.0 2016-04-03 15:05:47 +09:00
Cheng Zhao
442ccbe204 Merge pull request #4997 from atom/default-app-background-color
Set backgroundColor for the default app
2016-04-03 14:07:39 +09:00
Cheng Zhao
a9ea8b92f0 Merge pull request #4988 from atom/accelerator-docs
use example accelerators that align with best practices
2016-04-03 14:03:32 +09:00
Cheng Zhao
eb82f7cea9 Update docs for backgroundColor 2016-04-03 13:55:33 +09:00
Cheng Zhao
165009681b Set backgroundColor for the default app 2016-04-03 13:53:09 +09:00
Cheng Zhao
a6f19c4292 Merge pull request #4996 from atom/osx-no-white-flash
Remove the white flash when loading page on OS X
2016-04-03 13:44:43 +09:00
deepak1556
769ba02b2a browser: create cert verifier when browser context is created 2016-04-03 10:01:47 +05:30
Cheng Zhao
491bf30a15 Window with frame should have white background by default 2016-04-03 12:04:58 +09:00
Cheng Zhao
f94661547c mac: backgroundColor should not change titlebar color 2016-04-03 11:59:21 +09:00
Cheng Zhao
4a724e91e0 Update libchromiumcontent: remove white background on OS X 2016-04-03 11:17:57 +09:00
Cheng Zhao
e5aa712bf3 Merge pull request #4995 from atom/fix-white-flash
Set the background color of RenderViewHost to transparent
2016-04-03 11:14:27 +09:00
Cheng Zhao
9828875ebc Set the background color of RenderViewHost to transparent 2016-04-03 10:42:49 +09:00
Cheng Zhao
8c3ff97ba4 Make the logic of ParseHexColor more easy to understand
This also fixes the #FFFF style of color hex.
2016-04-03 10:42:49 +09:00
Cheng Zhao
8bc95fe279 Merge pull request #4993 from atom/background-color
Use BrowserWindow's backgroundColor as renderer view's background color
2016-04-03 09:39:10 +09:00
Charlie Hess
a66565fd3f Merge remote-tracking branch 'upstream/master' 2016-04-02 11:54:16 -07:00
Cheng Zhao
19a172f2f5 Remove the hacks because of transparent background 2016-04-02 21:21:30 +09:00
Cheng Zhao
1980d85f3e Fix converting SkColor to NSColor
Close #4992.
2016-04-02 21:18:15 +09:00
Cheng Zhao
cb470cb94b Use BrowserWindow's backgroundColor as renderer view's background color 2016-04-02 20:46:50 +09:00
Cheng Zhao
70ca49e36a Merge pull request #4989 from atom/document-option-vs-alt
use alt, not option
2016-04-02 19:19:09 +09:00
Cheng Zhao
7bfe80f835 Merge pull request #4897 from atom/node-integration-inheritance
Disable node on child window when disabled on parent
2016-04-02 19:14:58 +09:00
Kevin Sawicki
527ff66115 Pull app/session from remote 2016-04-01 16:59:13 -07:00
Kevin Sawicki
3695e38719 Remove duplicate require 2016-04-01 16:53:44 -07:00
Kevin Sawicki
7734f6af62 Remove semicolons 2016-04-01 16:52:55 -07:00
Kevin Sawicki
909ed54bef Remove stray log 2016-04-01 16:52:28 -07:00
Kevin Sawicki
230ed78dd6 Remove lint warnings 2016-04-01 16:51:17 -07:00
Kevin Sawicki
ef2a28ca86 Listen for browser-window-created event for asserts 2016-04-01 16:50:20 -07:00
Kevin Sawicki
55b12c184b Doc node integration inheritance 2016-04-01 16:48:21 -07:00
Kevin Sawicki
eafe9c245b Disable guest node integration when embedder has it disabled 2016-04-01 16:48:21 -07:00
Kevin Sawicki
fd12e1f506 Add failing spec for webview nodeIntegration inheritance 2016-04-01 16:47:17 -07:00
Kevin Sawicki
4890734f66 Add missing title param 2016-04-01 16:42:53 -07:00
Kevin Sawicki
e5164d2255 Check of nodeIntegration is strictly equal to false 2016-04-01 16:42:21 -07:00
Kevin Sawicki
dbe1c1d4e4 Check nodeIntegration on embedder's webPreferences 2016-04-01 16:40:50 -07:00
Kevin Sawicki
9e66df23d0 Add clearer assertion of process being undefined 2016-04-01 16:40:33 -07:00
Kevin Sawicki
d7b1792503 Use template strings 2016-04-01 16:39:31 -07:00
Kevin Sawicki
2713580d09 Remove stray log 2016-04-01 16:39:31 -07:00
Kevin Sawicki
463e077c3a Disable node on child when disabled on parent 2016-04-01 16:39:18 -07:00
Kevin Sawicki
777704e659 Add failing spec for nodeIntegration inheritance 2016-04-01 16:39:06 -07:00
Kevin Sawicki
afdad927b7 Merge pull request #4976 from atom/electron-resources
Rename atom to electron in bundled resources
2016-04-01 16:26:05 -07:00
Kevin Sawicki
3c96d7b726 Rename atom.asar to electron.asar in specs 2016-04-01 16:12:57 -07:00
Kevin Sawicki
ee9128268e Rename atom.icns to electron.icns 2016-04-01 16:12:12 -07:00
Kevin Sawicki
ce95747a25 atom.asar -> electron.asar 2016-04-01 16:12:12 -07:00
Kevin Sawicki
c036986cc4 atom.gyp -> electron.gyp 2016-04-01 16:11:40 -07:00
Kevin Sawicki
ef08138a8d Merge pull request #4969 from atom/null-dialog-callback
Add dialog callback fallback
2016-04-01 16:11:09 -07:00
Zeke Sikelianos
2853356b10 use alt, not option 2016-04-01 15:48:12 -07:00
Zeke Sikelianos
b92e86301a use cross-platform accelerator in globalShorcut documentation 2016-04-01 14:54:25 -07:00
Zeke Sikelianos
ac419038c6 use example accelerators that align with best practices 2016-04-01 14:09:01 -07:00
Kevin Sawicki
400efa1b7d Fallback to using the last argument as the callback 2016-04-01 12:54:06 -07:00
Kevin Sawicki
b2ad0a05d7 Merge pull request #4956 from atom/default-app-asar
Store default_app in .asar archive
2016-04-01 12:52:51 -07:00
Kevin Sawicki
5221154653 Remove logging 2016-04-01 12:40:32 -07:00
Kevin Sawicki
464dad3135 Store default_app in .asar archive 2016-04-01 12:40:32 -07:00
Alexandru Rosianu
ff7bb1e6cb Add squirrel-updates-server link in the docs
Add link to Aluxian/squirrel-updates-server in the docs page for autoUpdater
2016-04-01 14:28:52 +03:00
Cheng Zhao
4b9b630e80 Merge pull request #4982 from atom/fix-windows
Fix various problems on Windows build
2016-04-01 16:57:27 +09:00
Cheng Zhao
b35f4c1805 spec: Fix failing test due to path delimiter 2016-04-01 16:42:44 +09:00
Cheng Zhao
247b3f3605 Fix the background color in test app 2016-04-01 16:35:19 +09:00
Cheng Zhao
576b54320a Fix compilation errors on Windows 2016-04-01 16:34:20 +09:00
Cheng Zhao
6f7a98d7c9 Merge pull request #4981 from atom/member-object-reference
Remote object should be referenced by its members
2016-04-01 16:11:21 +09:00
Cheng Zhao
39d2b95a33 Reference the remote object in its prototype chain's methods 2016-04-01 15:46:01 +09:00
Cheng Zhao
b9ead472a5 spec: Remote object should be referenced by methods in its prototype chain 2016-04-01 15:35:34 +09:00
Cheng Zhao
4ebb01f8c9 Remote object's members should reference itself 2016-04-01 15:26:30 +09:00
Cheng Zhao
f36851fcff spec: Remote object should be referenced by its members 2016-04-01 15:05:05 +09:00
Cheng Zhao
0416e65b8b Merge pull request #4917 from deepak1556/new_window_disposition_patch
browser: fix disposition value for new-window event
2016-04-01 13:52:29 +09:00
deepak1556
e14c91771b removed redundant delegation 2016-04-01 08:14:29 +05:30
deepak1556
7e366dd5c8 Update libchromiumcontent 2016-04-01 08:14:29 +05:30
deepak1556
e0fe478ae7 decide early on render initiated window creations 2016-04-01 08:14:29 +05:30
Robo
7016fbe258 browser: fix disposition value for new-window event 2016-04-01 08:14:29 +05:30
Cheng Zhao
7353fb4296 Merge pull request #4955 from atom/remove-node-integration-disable-path
Remove path for nodeIntegration value of 'disable'
2016-04-01 11:14:30 +09:00
Cheng Zhao
7023528042 Merge pull request #4909 from atom/standard
Use `standard` JavaScript Style
2016-04-01 11:13:56 +09:00
Kevin Sawicki
1eddaecef8 Merge pull request #4964 from jwheare/app-command-docs
Improve app-command docs, list arguments and explain command string
2016-03-31 15:45:16 -07:00
Kevin Sawicki
389b2b5cdd Merge pull request #4963 from preco21/document-fixes-2
Docs: Improve docs styles
2016-03-31 15:44:31 -07:00
Kevin Sawicki
f87e417f7f Merge pull request #4962 from erkyrath/doc-issue-4884
Added information about the enabled, visible, and checked properties
2016-03-31 15:43:22 -07:00
Kevin Sawicki
9e2dd13f9a Merge pull request #4959 from atom/check-url-before-opening
Only open http/https links in new-window example
2016-03-31 15:41:33 -07:00
Jessica Lord
ccbbf35696 Merge pull request #4970 from felixrieseberg/dialog-note
Add "remote" note to dialog docs
2016-03-31 11:20:08 -07:00
Felix Rieseberg
ae5a6e61c5 📝 Add "remote" note to dialog docs
Ref #4943
2016-03-31 09:54:01 -07:00
Kevin Sawicki
f033f259b4 Only check for nodeIntegration being true 2016-03-31 08:33:38 -07:00
Kevin Sawicki
daa09ea9e7 Remove path for nodeIntgration value of 'disable' 2016-03-31 08:33:38 -07:00
Daniel Pham
6e46753499 Don't emit 'will-quit' when 'app.exit()' is called. Fixes #4643 2016-03-31 10:18:18 -04:00
Cheng Zhao
293ca4ef55 Merge pull request #4929 from deepak1556/url_request_fetch_job_patch
protocol: return status of ReadRawData instead of relying on SetStatus
2016-03-31 19:37:28 +09:00
Cheng Zhao
07fc0880fb Merge pull request #4926 from preco21/master
Docs: Update Korean docs as upstream
2016-03-31 19:31:29 +09:00
Cheng Zhao
303290bfb4 Merge pull request #4965 from atom/docs-get-locale
docs: Add notes on app.getLocale
2016-03-31 17:38:39 +09:00
Cheng Zhao
e23faceba0 docs: Add notes on app.getLocale 2016-03-31 17:22:09 +09:00
James Wheare
d4a14bc215 Improve app-command docs, list arguments and explain command string 2016-03-31 08:56:49 +01:00
Cheng Zhao
996ad10344 Merge pull request #4902 from hdwong/master
fix translation
2016-03-31 16:02:39 +09:00
Plusb Preco
546ad643e4 📝 Add missing docs
[ci skip]
2016-03-31 14:30:14 +09:00
Plusb Preco
a648528f43 📝 Normailze note markers
* Normalize note markers syntax `__` to `**`

[ci skip]
2016-03-31 14:22:28 +09:00
Plusb Preco
346ef9df0c 📝 Update docs styles
* Adjust line length to `80`
* Normalize whitespaces

[ci skip]
2016-03-31 14:16:14 +09:00
Plusb Preco
f7e5c65802 📝 Update Korean docs as upstream
[ci skip]
2016-03-31 14:03:35 +09:00
Andrew Plotkin
cfd2cdb9c4 Added information about the enabled, visible, and checked properties --
when they can be set and what they mean.

Also tidied up the grammar and clarified wording.
2016-03-30 23:57:28 -04:00
Cheng Zhao
72878d0de6 Merge pull request #4901 from yucheng-inc/master
translations   zh-CN    doc
2016-03-31 11:23:01 +09:00
Cheng Zhao
be5e787edf Merge pull request #4885 from ArekSredzki/patch-1
Added electron-release-server link to the docs
2016-03-31 11:07:14 +09:00
Cheng Zhao
c220753c60 Merge pull request #4896 from felixrieseberg/default-protocol-handler
Enable Electron to set/unset itself as default protocol handler (OS X, Windows)
2016-03-31 10:38:57 +09:00
Cheng Zhao
0e3737423b Merge pull request #4843 from jwheare/mac-swipe-events
OSX: Expose 3-finger swipe events in browser-window
2016-03-31 10:37:27 +09:00
Cheng Zhao
c307478d5d Merge pull request #4892 from deepak1556/v8_util_patch
common: use v8::private symbols as identifiers for object properties
2016-03-31 10:22:23 +09:00
Cheng Zhao
afb82fcc1f Update native-mate for #4892 2016-03-31 10:21:21 +09:00
Zeke Sikelianos
252121ac70 give anonymous function a name 2016-03-30 17:00:35 -07:00
Zeke Sikelianos
9efd29d059 fix a minor style issue 2016-03-30 17:00:35 -07:00
Zeke Sikelianos
d5e8bb7f12 derp 2016-03-30 17:00:35 -07:00
Zeke Sikelianos
7c58f7fb02 eradicate all per-file eslint globals 2016-03-30 17:00:34 -07:00
Zeke Sikelianos
aadc0bee25 do not lint on windows CI 2016-03-30 17:00:34 -07:00
Zeke Sikelianos
0d11b755db say we are linting 2016-03-30 17:00:34 -07:00
Zeke Sikelianos
afbc914f8b try to fix CI linting 2016-03-30 17:00:34 -07:00
Zeke Sikelianos
47a61e9f27 use window.location instead of location 2016-03-30 17:00:34 -07:00
Zeke Sikelianos
6425ef4261 restrict mocha scope to /spec; break out link tasks 2016-03-30 17:00:34 -07:00
Zeke Sikelianos
b5afad9da7 avoid using eslint comment exceptions 2016-03-30 17:00:34 -07:00
Zeke Sikelianos
1a18151eff remove eslint from devDependencies 2016-03-30 17:00:34 -07:00
Zeke Sikelianos
0fd0887407 use standard.env.mocha instead of a list of globals 2016-03-30 17:00:34 -07:00
Zeke Sikelianos
71f8ba6f7a update CONTRIBUTING doc 2016-03-30 17:00:34 -07:00
Zeke Sikelianos
e156faea5c replace eslint with standard 2016-03-30 17:00:33 -07:00
Zeke Sikelianos
6f845373a7 do not return and assign 2016-03-30 17:00:33 -07:00
Zeke Sikelianos
98b4353ef8 replace snazzy with standard; autoformat package.json 2016-03-30 17:00:33 -07:00
Zeke Sikelianos
42e7ee2b4a finish standardizing! 2016-03-30 17:00:33 -07:00
Zeke Sikelianos
4e2f1311e0 replace __proto__ with Object.setPrototype 2016-03-30 17:00:33 -07:00
Zeke Sikelianos
2c3cacdc08 standardize by hand 2016-03-30 17:00:33 -07:00
Zeke Sikelianos
e6698102c9 standardize by hand 2016-03-30 17:00:33 -07:00
Zeke Sikelianos
cfdfdc8ccc standardize by hand 2016-03-30 17:00:33 -07:00
Zeke Sikelianos
fd0f9519f1 remove useless constructors 2016-03-30 17:00:33 -07:00
Zeke Sikelianos
14fb3c4598 throw error if it exists 2016-03-30 17:00:33 -07:00
Zeke Sikelianos
c5f70c8d99 dance around error checking with this one weird trick 2016-03-30 17:00:32 -07:00
Zeke Sikelianos
5e4696f4a7 standardize more 2016-03-30 17:00:32 -07:00
Zeke Sikelianos
9db733a4ff mostly more globals 2016-03-30 17:00:32 -07:00
Zeke Sikelianos
c4b6cf4a8e do more manual cleanup and specify globals 2016-03-30 17:00:32 -07:00
Zeke Sikelianos
f47fa25e39 tiptoe 2016-03-30 17:00:32 -07:00
Zeke Sikelianos
68510cbe49 standardize more 2016-03-30 17:00:32 -07:00
Zeke Sikelianos
3a55f0d1f7 set standard.globals 2016-03-30 17:00:32 -07:00
Zeke Sikelianos
09635ae50e reduce ignore list in favor of one-liner ignores 2016-03-30 17:00:32 -07:00
Zeke Sikelianos
67d189474c autoformat more files 2016-03-30 17:00:32 -07:00
Zeke Sikelianos
2fb92076b6 standard-format has done its work; on to snazzy 2016-03-30 17:00:32 -07:00
Zeke Sikelianos
7404b848a2 tell standard to ignore /vendor directory 2016-03-30 17:00:31 -07:00
Zeke Sikelianos
f35f362272 autoformat more files 2016-03-30 17:00:31 -07:00
Zeke Sikelianos
06b556c34c ignore more files that are confusing standard-format 2016-03-30 17:00:31 -07:00
Zeke Sikelianos
bd9b0b8ed3 wrap conditional, because return can only be used in a function 2016-03-30 17:00:31 -07:00
Zeke Sikelianos
3855a774ab autoformat more easy files 2016-03-30 17:00:31 -07:00
Zeke Sikelianos
67fa250020 standardize asar.js by hand 2016-03-30 17:00:31 -07:00
Zeke Sikelianos
c845ea8372 autoformat more easy files 2016-03-30 17:00:31 -07:00
Zeke Sikelianos
80f7c82f93 finish standardizing crash reporter 2016-03-30 17:00:31 -07:00
Zeke Sikelianos
f61010df96 do not standardize rpc-server.js because reasons
standard-format freaks out on this line:

let obj = new (Function.prototype.bind.apply(constructor,
[null].concat(args)))

http://stackoverflow.com/questions/1606797/use-of-apply-with-new-operato
r-is-this-possible
2016-03-30 17:00:31 -07:00
Zeke Sikelianos
ca7b492b97 tiptoeing along, keeping the suite passing 2016-03-30 17:00:31 -07:00
Zeke Sikelianos
ee181294b3 manual syntax fixes on rpc server 2016-03-30 17:00:30 -07:00
Zeke Sikelianos
4d4f479721 manually standardize this tricky file 2016-03-30 17:00:30 -07:00
Zeke Sikelianos
4794385fac first pass at standardizing; suite still passing! 2016-03-30 17:00:30 -07:00
Zeke Sikelianos
f25c3d33b6 mention standard in coding style doc 2016-03-30 17:00:05 -07:00
Zeke Sikelianos
6e31e51292 add standard-format to devDeps 2016-03-30 17:00:05 -07:00
Kevin Sawicki
dd23b09569 Only open http/https links 2016-03-30 16:55:10 -07:00
Kevin Sawicki
8bcede8019 Merge pull request #4887 from sergeybekrin/master
Improve error reporting when passing invalid argument types for dialog API methods
2016-03-30 16:34:42 -07:00
Sergey Bekrin
4ac08870d0 Tweak error messages for dialog API 2016-03-30 23:07:13 +03:00
Kevin Sawicki
ad67070f23 Merge pull request #4861 from OctoHuman/master
Fix alert()
2016-03-30 12:40:41 -07:00
Zeke Sikelianos
839ab07fd4 Merge pull request #4947 from preco21/document-fixes
Docs: Update docs styles
2016-03-29 20:38:42 -07:00
Plusb Preco
c4a2329665 📝 Update docs styles
* Adjust line length to `80`
* Change platform marker `*` to `_`
* Enhance a note section

[ci skip]
2016-03-30 10:57:42 +09:00
Plusb Preco
edbb2b4a26 📝 Update Korean docs as upstream
[ci skip]
2016-03-30 10:42:59 +09:00
Zeke Sikelianos
7dbf07edfc Merge pull request #4941 from atom/black-background
Add "black background?" to FAQ
2016-03-29 16:31:51 -07:00
Felix Rieseberg
ff2d005058 Add "black background?" to FAQ
Closes #4937
2016-03-29 15:06:05 -07:00
Felix Rieseberg
1231360b2f Add API: RemoveAsDefaultProtocolHandler 2016-03-28 15:31:01 -07:00
Kevin Sawicki
664f59a8eb Merge pull request #4921 from roramirez/curl_build_linux
add curl package into Ubuntu section missing for the build
2016-03-28 10:59:40 -07:00
Kevin Sawicki
534fa7073e Merge pull request #4920 from PierBover/master
Update desktop-environment-integration.md
2016-03-28 10:44:15 -07:00
Pier Bover
116aa2f483 Update desktop-environment-integration.md 2016-03-28 11:41:16 -06:00
Kevin Sawicki
48cea8aa35 Merge pull request #4923 from guatedude2/master
Update power-monitor.md
2016-03-28 09:36:01 -07:00
Alejandro Gonzalez Sole
ab685ac335 Update power-monitor.md
Updated docs in power-monitor to reflect windows only events
2016-03-27 23:03:34 -04:00
deepak1556
73201e419d protocol: return status of ReadRawData instead of relying on SetStatus 2016-03-28 02:09:56 +05:30
Cheng Zhao
4ebd24d128 Merge pull request #4927 from atom/node-5.9.1
Upgrade to Node v5.9.1
2016-03-27 21:35:20 +09:00
Cheng Zhao
a4d2dd9b4d Export symbols of node::Environment 2016-03-27 20:36:39 +09:00
Cheng Zhao
e401335ebb Get rid of the global_env 2016-03-27 19:21:12 +09:00
Cheng Zhao
e5886dda9b Avoid re-evaluating internal modules 2016-03-27 19:16:26 +09:00
Cheng Zhao
896ea7b79d Do not create dummy node environment
There is a bug in V8 that using Private in a dummy environment would
result in crash.
2016-03-27 19:16:26 +09:00
Cheng Zhao
70f9cb098f Use Environment::KickNextTick 2016-03-27 19:13:44 +09:00
Cheng Zhao
d83cb53997 Type of native array has changed 2016-03-27 19:13:44 +09:00
Cheng Zhao
f23729acdb Upgrade to node v5.9.1 2016-03-27 19:13:44 +09:00
Plusb Preco
2ffe891cc8 📝 Update Korean docs as upstream
[ci skip]
2016-03-27 18:07:58 +09:00
Cheng Zhao
5a3552f577 Merge pull request #4854 from preco21/master
Docs: Update Korean docs as upstream
2016-03-27 14:47:50 +09:00
Cheng Zhao
75f0942057 Bump v0.37.3 2016-03-27 12:16:12 +09:00
Cheng Zhao
247a63efe3 Merge pull request #4869 from atom/fix-set-destructor
Run callback of setDestructor immediately when GC happens
2016-03-27 10:35:28 +09:00
Rodrigo Ramírez Norambuena
c4128e6b4b add curl package into Ubuntu section missing for the build 2016-03-25 23:47:47 -03:00
Pier Bover
a3f30ca822 Update desktop-environment-integration.md 2016-03-25 16:26:14 -06:00
Kevin Sawicki
19931397ac Merge pull request #4883 from atom/repl
Add repl option in default app
2016-03-24 20:06:14 -07:00
Kevin Sawicki
09710d6c47 Don't quit on window-all-closed when in repl mode 2016-03-24 16:02:02 -07:00
Kevin Sawicki
832ac97088 Exit process when repl exits 2016-03-24 16:02:02 -07:00
Kevin Sawicki
8685f8e6c8 Add repl run script 2016-03-24 16:02:02 -07:00
Kevin Sawicki
e49eae4047 Document -i/--interactive option 2016-03-24 16:02:02 -07:00
Kevin Sawicki
0066833887 Add repl CLI option 2016-03-24 16:02:02 -07:00
Kevin Sawicki
4a1e060832 Merge pull request #4911 from atom/link-newline
Put link on same line as name
2016-03-24 16:01:07 -07:00
Kevin Sawicki
8feb0f0440 Put link on same line as name 2016-03-24 15:57:42 -07:00
Kevin Sawicki
8ce1ca4590 Merge pull request #4910 from atom/update-structure-doc
Update source tree docs for new layout
2016-03-24 15:57:31 -07:00
Kevin Sawicki
8839cc51c2 Update source tree docs for new layout 2016-03-24 14:47:31 -07:00
小奔奔
f7a82987f4 fix translation 2016-03-24 15:30:46 +08:00
wujingke
ff3e29041e Merge pull request #9 from heyunjiang/master
modify the latest files
2016-03-24 14:29:48 +08:00
Felix Rieseberg
d2567b0381 Add API: SetASDefaultProtocolHandler
This PR adds an API enabling Electron to set itself as the default
protocol handler for a custom porotocl on both oS X and Windows.

For details, please see `docs/app.md`.

Closes #4857
2016-03-23 22:12:17 -07:00
Robo
5fccbfc7c6 common: use v8::private symbols as identifiers for object properties 2016-03-24 01:24:01 +05:30
James Wheare
8482109dea Switch to a single OS X swipe event with a direction argument 2016-03-23 15:20:11 +00:00
heyunjiang
0bd45c7d75 modify 2016.3.23 2016-03-23 16:11:23 +08:00
Sergey Bekrin
7f78781800 Improve error reporting when using invalid argument types for dialog API methods 2016-03-23 10:44:11 +03:00
Plusb Preco
8939c6ac12 📝 Update Korean readme as upstream
[ci skip]
2016-03-23 09:42:14 +09:00
Plusb Preco
c0f13103a4 📝 Update Korean docs as upstream
[ci skip]
2016-03-23 09:39:03 +09:00
Arek Sredzki
951bd745aa Added electron-release-server link to the docs
By request from a couple users, I've added a link to the electron-release-server, that makes using the auto-updater much easier.
2016-03-22 16:35:03 -07:00
Kevin Sawicki
6041c7edf9 Merge pull request #4872 from atom/destructured-assignment
Destructuring assignment
2016-03-22 13:57:42 -07:00
Kevin Sawicki
2d32956903 Destructure objects 2016-03-22 13:11:42 -07:00
Kevin Sawicki
4127b524d5 Destructure params directly 2016-03-22 13:11:42 -07:00
Kevin Sawicki
43746727aa Use direct params instead of rest params 2016-03-22 13:11:42 -07:00
Kevin Sawicki
4f4dc2f4d8 Use destructuring assigment 2016-03-22 13:11:42 -07:00
Kevin Sawicki
baa566adae Merge pull request #4851 from k0kubun/app-doc-set-name
Document `app.setName()`
2016-03-22 09:35:49 -07:00
Plusb Preco
8fac75f4ee 📝 Update Korean docs as upstream
[ci skip]
2016-03-22 13:48:14 +09:00
Takashi Kokubun
8cf4574198 Document app.setName()
[ci skip]
2016-03-22 11:01:23 +09:00
Jessica Lord
b4f1a63f64 Merge pull request #4864 from miniak/fix-menu-api-doc
Fix Menu documentation
2016-03-21 13:40:50 -07:00
Kevin Sawicki
8cff36967e Merge pull request #4871 from atom/add-more-camel-case-options
Add minWidth and maxWidth to ints array
2016-03-21 11:12:35 -07:00
Kevin Sawicki
cbfe8b9228 Add minWidth and maxWidth to ints array 2016-03-21 09:12:47 -07:00
Cheng Zhao
52d09e9600 Run callback of setDestructor immediately when GC happens
Fix #4733.
2016-03-21 21:42:12 +09:00
Cheng Zhao
a52285596e Merge pull request #4846 from atom/rest-parameters
Use rest parameters
2016-03-21 21:03:28 +09:00
Cheng Zhao
e08b48ab48 Merge pull request #4840 from atom/undefined-menu-accelerator
Undefined menu accelerator
2016-03-21 21:02:44 +09:00
Cheng Zhao
663e42070f Merge pull request #4845 from atom/node-version-file
Add .node-version pinned to 5.1.1
2016-03-21 21:02:03 +09:00
Cheng Zhao
43cb48295b Merge pull request #4831 from atom/docs-cleanup
[WIP] Docs cleanup
2016-03-21 20:57:26 +09:00
Jessica Lord
4abed1f83f Merge pull request #4853 from preco21/patch-9
Docs: Correct link anchor
2016-03-20 21:38:24 -07:00
Jessica Lord
dd1cfdd31c Merge pull request #4860 from chadluo/master
fix link
2016-03-20 21:30:34 -07:00
Milan Burda
f84c41f684 Fix Menu documentation 2016-03-20 19:05:18 +01:00
OctoHuman
116d61185a Refix alert() 2016-03-20 03:40:12 -05:00
OctoHuman
9f6541228d Fix alert() 2016-03-20 02:09:30 -05:00
chadluo
a89e79a7ed fix link 2016-03-20 14:20:43 +11:00
Plusb Preco
d73dc0958b 📝 Update Korean docs as upstream
[ci skip]
2016-03-20 04:04:39 +09:00
Plusb Preco
70baf86ce2 📝 Correct link anchor 2016-03-20 03:36:27 +09:00
Kevin Sawicki
a53c7529c1 Remove unneeded slice call 2016-03-18 11:54:34 -07:00
Kevin Sawicki
8889c29866 Use rest parameters 2016-03-18 11:51:02 -07:00
Kevin Sawicki
99d6afb3a1 Add .node-version pinned to 5.1.1 2016-03-18 11:11:56 -07:00
Zeke Sikelianos
827730144b style nit 2016-03-18 10:53:49 -07:00
Kevin Sawicki
e05804848f Merge pull request #4829 from atom/deprecated-browser-window-options
Report deprecated BrowserWindow options
2016-03-18 09:36:49 -07:00
Kevin Sawicki
6aa452cda4 Set _setDeprecatedOptionsCheck on exports 2016-03-18 09:06:03 -07:00
Kevin Sawicki
7668c1ea0b Use deprecate.warn instead of deprecate.log 2016-03-18 09:02:58 -07:00
James Wheare
03319a5426 OSX: Capture 3-finger swipe events in NativeWindow 2016-03-18 15:21:19 +00:00
Zeke Sikelianos
344dda4029 ignore set menu item fields 2016-03-17 16:20:23 -07:00
Zeke Sikelianos
e9ba5abe03 test for null accelerator too 2016-03-17 16:14:31 -07:00
Zeke Sikelianos
87395cdef8 add failing spec for undefined accelerator 2016-03-17 16:09:16 -07:00
Kevin Sawicki
737ffd8d7c Improve deprecated message on webPreferences options 2016-03-17 13:37:08 -07:00
Kevin Sawicki
c31882749d Correct typos in comments 2016-03-17 13:37:08 -07:00
Kevin Sawicki
90d815ce6c Add todo about removing hyphenated options 2016-03-17 13:37:08 -07:00
Kevin Sawicki
3e7501579f Add camel case versions to ints array 2016-03-17 13:37:08 -07:00
Kevin Sawicki
a14380ed01 Set webPrereferences from features tring 2016-03-17 13:37:07 -07:00
Kevin Sawicki
2acfb8ad82 node-integration -> nodeIntegration 2016-03-17 13:37:07 -07:00
Kevin Sawicki
15397bf879 Report deprecated BrowserWindow options 2016-03-17 13:37:07 -07:00
Kevin Sawicki
1b6e01ce6d Add missing semicolons 2016-03-17 13:37:07 -07:00
Kevin Sawicki
dfd13cf4ca persistented -> persisted 2016-03-17 13:37:07 -07:00
Kevin Sawicki
1e8e8f18b4 Add failing specs for deprecated options usage 2016-03-17 13:37:07 -07:00
Kevin Sawicki
5c9b19b508 web-preferences -> webPreferences 2016-03-17 13:37:07 -07:00
Cheng Zhao
67db92d500 Merge pull request #4821 from yucheng-inc/master
translations   zh-CN    doc
2016-03-17 22:55:01 +09:00
Cheng Zhao
38d99950f8 Merge pull request #4837 from atom/breakpad-server
List breakpad server implementations in crashReporter docs
2016-03-17 22:54:52 +09:00
Cheng Zhao
cbd37ad3b9 docs: List breakpad server implementations 2016-03-17 22:29:32 +09:00
Cheng Zhao
912ec1437b Merge pull request #4812 from thanpolas/patch-1
More info for crash reporter form type and payload
2016-03-17 22:24:10 +09:00
Cheng Zhao
242be31440 Merge pull request #4805 from atom/automatically-set-app-model-id
Automatically set app user model ID
2016-03-17 22:21:29 +09:00
Cheng Zhao
48f1eb4584 Merge pull request #4836 from atom/get-native-handle-osx
Make it clear that image.getNativeHandle is OS X only
2016-03-17 22:21:21 +09:00
Cheng Zhao
939d69df6e Throw error with message of "Not implemented". 2016-03-17 22:01:31 +09:00
Cheng Zhao
f8b9a66ead docs: Make it clear image.getNativeHandle is OS X only 2016-03-17 21:55:44 +09:00
Cheng Zhao
081ab17e13 Merge pull request #4791 from atom/nativeimage-as-nsimage
Convert NativeImage instances to OS-specific representations
2016-03-17 21:49:46 +09:00
Cheng Zhao
75ec7a057a Update brightray for #4681 2016-03-17 21:45:13 +09:00
Zeke Sikelianos
01980dea11 s/troubles/problems/ 2016-03-17 00:03:24 -07:00
Zeke Sikelianos
5acfa8611a link to gyp 2016-03-16 13:15:34 -07:00
Paul Betts
e94da877c2 Fix compile oopses on non-OS X 2016-03-16 12:49:34 -07:00
Paul Betts
148014f99a Fix spec failure 2016-03-16 12:42:23 -07:00
Paul Betts
fa197ad583 Fix failing test 2016-03-16 12:40:28 -07:00
Zeke Sikelianos
6503f32ef9 add another link to ninja 2016-03-16 09:47:12 -07:00
Zeke Sikelianos
da47b569e8 link to the ninja website 2016-03-16 09:42:33 -07:00
Zeke Sikelianos
0d8994d81d improve wording in the FAQ 2016-03-16 09:37:04 -07:00
scycbx
c3f343e6c4 Merge pull request #8 from heyunjiang/master
final first
2016-03-16 16:02:22 +08:00
heyunjiang
25931d16ab modify 2days ago update 2files 2016-03-16 15:56:52 +08:00
heyunjiang
7bcb99f823 add last three files first 2016-03-16 15:41:12 +08:00
heyunjiang
3eac767e72 add build-instructions three first 2016-03-16 11:54:33 +08:00
heyunjiang
12f218c747 add build-system-overview first 2016-03-16 10:26:49 +08:00
Thanasis Polychronakis
492269a0fd More info for crash reporter form type and payload 2016-03-15 15:49:34 +02:00
Cheng Zhao
141f909b68 Merge pull request #4803 from yucheng-inc/master
translations   zh-CN    doc
2016-03-15 21:21:49 +09:00
Cheng Zhao
e50ba35871 Merge pull request #4777 from deepak1556/webview_background_patch
webview: allow setting background color
2016-03-15 21:12:04 +09:00
Cheng Zhao
98be7b6299 Merge pull request #4804 from deepak1556/devtools_workspace_patch
devtools: update filesystem api
2016-03-15 21:09:54 +09:00
Cheng Zhao
dbb8a6bf52 Update brightray for atom/brightray#204 2016-03-15 21:08:43 +09:00
scycbx
ce855c5685 Merge pull request #7 from heyunjiang/master
add web-contents first
2016-03-15 17:10:34 +08:00
heyunjiang
b105bf59c1 add last api files first 2016-03-15 17:03:48 +08:00
heyunjiang
c2c91b6477 add three render process's files first 2016-03-15 15:11:28 +08:00
heyunjiang
3c007d1333 add tray first 2016-03-15 14:00:40 +08:00
Paul Betts
665d3166ed Update the tests 2016-03-14 21:00:58 -07:00
Paul Betts
3ee4790dab Automatically set app user model ID
We shouldn't ask users to figure out this piece of Windows Arcana when
they're using Squirrel, let's just do it automatically.
2016-03-14 20:36:48 -07:00
heyunjiang
ae701977c6 add web-contents first 2016-03-15 11:13:43 +08:00
Paul Betts
f59752bf4f Update the docs to match 2016-03-14 19:51:37 -07:00
Paul Betts
d344c1e408 AsNativeRepresentation => getNativeHandle 2016-03-14 19:50:31 -07:00
Paul Betts
e3e6cd6fd8 Remove type parameter 2016-03-14 19:48:40 -07:00
Robo
cdc7b8d15e devtools: fix filesyatem api usage and use prefs to track filesystem paths 2016-03-15 07:51:36 +05:30
scycbx
cc4da371ff Merge pull request #6 from heyunjiang/master
add session end 3.15
2016-03-15 09:48:37 +08:00
Robo
fd53a4b24d modify default background for all render views 2016-03-14 19:26:20 +05:30
Robo
f8f3fba433 webview: allow setting background color 2016-03-14 15:01:36 +05:30
Cheng Zhao
e92d002eec Bump v0.37.2 2016-03-14 17:22:09 +09:00
Cheng Zhao
17f97bed30 Merge pull request #4793 from atom/gtk-dialog-extension
Add extension to filename automatically for GTK+ save dialog
2016-03-14 17:21:49 +09:00
Cheng Zhao
c2797e1864 Replace extension with the one in filter 2016-03-14 17:08:32 +09:00
heyunjiang
06a8db8a66 add protocol && session first 2016-03-14 15:43:04 +08:00
Cheng Zhao
81a16b424f Add extension to filename automatically for GTK+ save dialog 2016-03-14 16:28:01 +09:00
Cheng Zhao
73a5f323e7 Merge pull request #4788 from deepak1556/find_in_page_patch
webcontents: provide position of match with found-in-page event
2016-03-14 15:03:38 +09:00
Cheng Zhao
152e6af4b4 spec: Add test case for #4785 2016-03-14 14:54:45 +09:00
Cheng Zhao
5bc400e31f Merge pull request #4792 from atom/shutdown-v8
Leak the JavascriptEnvironment on exit
2016-03-14 14:34:24 +09:00
Cheng Zhao
9a13d559e9 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
about this can be found at https://github.com/atom/electron/issues/4767.

On the other handle there is actually no need to gracefully shutdown V8
on exit in the main process, we already ensured all necessary resources get
cleaned up, and it would make quitting faster.
2016-03-14 13:59:31 +09:00
Paul Betts
63d9174822 🔥 build warning on Win32 2016-03-13 20:27:44 -07:00
Paul Betts
248ac5c37b Add unit tests 2016-03-13 20:25:49 -07:00
Paul Betts
7233c83874 Linting 2016-03-13 20:18:03 -07:00
Paul Betts
5dea4b9b1c Add documentation 2016-03-13 20:11:43 -07:00
Paul Betts
262abc43f8 First hack at being able to return NSImage pointers 2016-03-13 20:08:53 -07:00
Paul Betts
b3da5370c0 Add a new method to get the representation of an image 2016-03-13 20:08:09 -07:00
Cheng Zhao
92a9c49a77 Update brightray for atom/brightray#203 2016-03-14 10:41:32 +09:00
Cheng Zhao
b428b2e1d5 Merge pull request #4787 from deepak1556/permission_handler_patch
browser: fix retrieving webcontents from associated process id
2016-03-14 10:40:59 +09:00
Robo
8378cbb1e8 webcontents: provide position of match with found-in-page event 2016-03-14 06:49:45 +05:30
Robo
48064ee7e9 browser: fix retrieving webcontents from associated process id 2016-03-14 04:14:04 +05:30
heyunjiang
d96836e608 add power-save-blocker first 2016-03-13 22:06:19 +08:00
Cheng Zhao
b2059ec8af Merge pull request #4774 from twolfson/dev/add.location.to.window.open.sqwished
Added support for window.location on window.open windows
2016-03-13 22:22:48 +09:00
Cheng Zhao
a2d86c998f Merge pull request #4773 from preco21/master
Docs: Update Korean docs as upstream
2016-03-13 22:02:45 +09:00
Cheng Zhao
4a6186bfa0 Merge pull request #4763 from HR/patch-3
Fix broken/outdated link and push up the version
2016-03-13 20:43:53 +09:00
heyunjiang
29609b6e5d add powerMonitor first 2016-03-13 14:15:11 +08:00
Cheng Zhao
dd158e172f Merge pull request #4743 from atom/clean-up-this-wrappers
Use arrow functions instead of CoffeeScript this wrapper functions
2016-03-13 13:17:30 +09:00
Cheng Zhao
bc9c48261a Merge pull request #4775 from atom/delay-load-powrprof
Delay loading powrprof.dll
2016-03-13 11:38:39 +09:00
Cheng Zhao
d96e03c402 Bump v0.37.1 2016-03-13 10:11:26 +09:00
Cheng Zhao
78c66da9e8 Update brightray: dealy loading powrprof.dll 2016-03-13 10:11:15 +09:00
Cheng Zhao
c036e8fa3b Merge pull request #4769 from bbondy/master
Fix libffmpeg.dylib path for install_name_tool
2016-03-13 09:39:42 +09:00
Todd Wolfson
7569d180c9 Added support for window.location on window.open windows 2016-03-12 18:05:01 -06:00
Plusb Preco
96d271e57c 📝 Update Korean docs as upstream
[ci skip]
2016-03-13 06:10:00 +09:00
Brian R. Bondy
c937568846 Fix libffmpeg.dylib path for install_name_tool 2016-03-12 10:16:26 -05:00
Cheng Zhao
b10f196d16 Bump v0.37.0 2016-03-12 09:54:10 +09:00
Habib Rehman
0e1bb98913 Fix broken/outdated link and push up the version 2016-03-12 00:26:29 +00:00
Cheng Zhao
71fb684069 spec: Skip webview.executeJavaScript in Travis on OS X
It is very easy to get timeout.
2016-03-12 09:18:12 +09:00
Cheng Zhao
a8d34ebac9 Merge pull request #4757 from atom/no-copy-system-libraries
Do not copy system libraries on Linux
2016-03-12 09:15:28 +09:00
Kevin Sawicki
3556507ab9 Use arrow functions for this binding 2016-03-11 14:08:14 -08:00
Kevin Sawicki
28e9d87d86 Add back return in getter 2016-03-11 11:25:56 -08:00
Kevin Sawicki
0e5e230c03 Remove lint errors due to rebase 2016-03-11 11:25:56 -08:00
Kevin Sawicki
3c11f5dc4d Remove returns from event handlers 2016-03-11 11:25:56 -08:00
Kevin Sawicki
0ee3446109 Use undefined instead of void 0 2016-03-11 11:25:56 -08:00
Kevin Sawicki
a3f08c9b51 Use arrow functions to replace old CoffeeScript => this wrappers 2016-03-11 11:25:56 -08:00
Kevin Sawicki
100ea975bd Merge pull request #4761 from atom/appveyor-badge
Add AppVeyor badge to README
2016-03-11 11:25:49 -08:00
Kevin Sawicki
a95d0078b5 Link to root build page 2016-03-11 09:39:12 -08:00
Kevin Sawicki
c2b1f630f6 Add AppVeyor badge 2016-03-11 09:37:56 -08:00
Kevin Sawicki
1346122d35 Merge pull request #4744 from atom/remove-unneeded-results-collecting
Remove unneeded results collecting/returning
2016-03-11 09:36:02 -08:00
Kevin Sawicki
6b1748d6d6 Don't collect results from delegate.menuWillShow 2016-03-11 08:55:48 -08:00
Kevin Sawicki
3a08aa37de Don't collect results from Menu::_callMenuWillShow 2016-03-11 08:55:48 -08:00
Kevin Sawicki
93939089ec Don't collect results in Menu.setApplicationMenu 2016-03-11 08:55:48 -08:00
Kevin Sawicki
3a1e837f8b Don't collect results in exit event callback 2016-03-11 08:55:47 -08:00
Kevin Sawicki
5ed6c7714b Don't return attributes from from WebViewImpl::setupWebViewAttributes 2016-03-11 08:55:47 -08:00
Cheng Zhao
0f620a5393 Do not copy system libraries on Linux 2016-03-11 22:29:03 +09:00
Cheng Zhao
cd327e65cb Revert "Bump v0.37.0"
This reverts commit aebfbf7782.

We have troubles with linux-ia32 release.
2016-03-11 22:20:11 +09:00
Cheng Zhao
aebfbf7782 Bump v0.37.0 2016-03-11 21:47:32 +09:00
Cheng Zhao
6aec1e6949 Merge pull request #4714 from atom/chrome49
Upgrade to Chrome 49
2016-03-11 21:39:52 +09:00
Cheng Zhao
ead94b7b1f Bump v0.36.11 2016-03-11 20:09:19 +09:00
Cheng Zhao
5f63df248a Fix the chrome version 2016-03-11 19:53:41 +09:00
Plusb Preco
288ef13fb5 📝 Update Korean docs as upstream
[ci skip]

📝 Update Korean docs as upstream

[ci skip]
2016-03-11 19:37:03 +09:00
Cheng Zhao
4765445b4f Merge pull request #4752 from yucheng-inc/master
translations   zh-CN    doc
2016-03-11 19:36:41 +09:00
Cheng Zhao
03ec5ced05 Merge pull request #4751 from maxbeatty/window-blur
Add blur method to window
2016-03-11 19:15:51 +09:00
heyunjiang
3e04884a57 add menu.md first 2016-03-11 17:25:38 +08:00
heyunjiang
fe248ac03f add ipc-main first 2016-03-11 16:05:02 +08:00
scycbx
e2e18200fb Merge pull request #5 from heyunjiang/master
update && add
2016-03-11 15:45:26 +08:00
heyunjiang
328583575d modify again and add dialog.md 2016-03-11 15:09:08 +08:00
Max Beatty
704b8335aa Add blur method to window ref #4724 2016-03-10 21:45:51 -08:00
heyunjiang
d25d1f3f8b add content-tracing && update browser-window 2016-03-11 11:53:04 +08:00
Cheng Zhao
d564727583 spec: Increase timeout for executeJavaScript 2016-03-11 11:17:02 +09:00
Cheng Zhao
83809cef09 Update to master branch of brightray and libchromiumcontent 2016-03-11 10:47:15 +09:00
Cheng Zhao
256c2684ee spec: Do not enter fullscreen in travis on OS X
It is too flaky
2016-03-11 10:36:08 +09:00
Cheng Zhao
abd466ee4a Merge pull request #4700 from ArekSredzki/async-document-hidden
Cache browser visibility state & emit visibilitychange event on change
2016-03-11 10:19:06 +09:00
Arek Sredzki
fcc1f4d7ed Finalized browser-window show & hide events, added tests & fixed os x implementation 2016-03-10 13:51:31 -08:00
Arek Sredzki
c1267b2320 Added 'show' & 'hide' events to browser-window, fixed visibilitychange event in renderer 2016-03-10 13:51:31 -08:00
Arek Sredzki
ee61ab2d26 Cache browser visibility state & emit visibilitychange event on change
Fixes #3788
2016-03-10 13:51:31 -08:00
heyunjiang
0ec7f35c24 finish browser-window first 2016-03-10 23:12:57 +08:00
Cheng Zhao
8e19edd1b5 Move toolchain related configures into one place 2016-03-10 22:40:09 +09:00
Robo
ed2103a49f update sysroot image revisions 2016-03-10 17:34:42 +05:30
Robo
dfe1641d1e set path for pkg-config when using sysroot 2016-03-10 17:34:42 +05:30
Robo
91951472bf use sysroot by default on linux 2016-03-10 17:34:42 +05:30
Robo
e27e3d641c linux: optionaly allow building x64 targets with sysroot 2016-03-10 17:34:42 +05:30
Cheng Zhao
60f40a6704 Fix linking error for Release build on Linux 2016-03-10 21:01:45 +09:00
Cheng Zhao
0794980d01 pdf.dll is not shipped any more 2016-03-10 17:36:11 +09:00
Cheng Zhao
cadd1969d9 Fix compilation errors on Windows 2016-03-10 17:06:23 +09:00
Cheng Zhao
20466bad8f Fix cpplint warnings 2016-03-10 17:06:23 +09:00
Cheng Zhao
89f17e0baf Create complete URLRequestContextGetter for URLRequestFetchJob
The trivial one is causing crashes.
2016-03-10 17:06:23 +09:00
Paul Betts
e3af5de7d7 Update pdf_to_emf_converter 2016-03-10 17:06:23 +09:00
Paul Betts
f4ec369873 More boring fixups 2016-03-10 17:06:22 +09:00
Paul Betts
1c01e4955f Modifiers moved under UI 2016-03-10 17:06:22 +09:00
Paul Betts
7b60ef6261 SetIsDraftMode no longer a thing, see https://groups.google.com/a/chromium.org/forum/m/#!topic/chromium-checkins/6qohfKmEYyg 2016-03-10 17:06:22 +09:00
Paul Betts
e835111195 More type fixups 2016-03-10 17:06:22 +09:00
Paul Betts
12e9b7ab88 Use assignment operator since both sides are scoped now 2016-03-10 17:06:22 +09:00
Paul Betts
60a2495b30 Update Get() => get(), Set() => reset() 2016-03-10 17:06:22 +09:00
Paul Betts
a737baafbf We don't need Metro 2016-03-10 17:06:22 +09:00
Cheng Zhao
d36b8bca86 Fix compilation errors on Linux 2016-03-10 17:06:22 +09:00
Cheng Zhao
044daee086 Update printing code to latest 2016-03-10 17:06:22 +09:00
Cheng Zhao
bfc6d77bb3 Pending renderer process no longer has render view attached 2016-03-10 17:06:22 +09:00
Cheng Zhao
6de9c4332f Fix passing Promise with remote
Somehow using value.then.bind(value) would result in infinite loop,
could be bug of Chromium.
2016-03-10 17:06:22 +09:00
Cheng Zhao
dd4d3db47b Fix node integration not working 2016-03-10 17:06:21 +09:00
Cheng Zhao
a31cbd24a1 Final pieces of int16 and .Pass() 2016-03-10 17:06:21 +09:00
Cheng Zhao
f29d633563 Fix cpplint warnings 2016-03-10 17:06:21 +09:00
Cheng Zhao
5fae63a2f5 Fix compilation errors on OS X 2016-03-10 17:06:21 +09:00
Paul Betts
4503aafe64 int32 => int32_t 2016-03-10 17:06:21 +09:00
Paul Betts
d2944c62a5 basictypes.h => macros.h 2016-03-10 17:06:21 +09:00
Paul Betts
7f15a77f3c startup helper is renamed 2016-03-10 17:06:21 +09:00
Paul Betts
8d021f2596 Goodbye pdf.dll 2016-03-10 17:06:21 +09:00
Cheng Zhao
3600645575 Fix the compilation errors from brightray and crashpad 2016-03-10 17:06:21 +09:00
Cheng Zhao
30643cf118 Update crashpad to lastest branch 2016-03-10 17:06:21 +09:00
Cheng Zhao
9bc9a1a2bd Upgrade to Chrome 49 2016-03-10 17:06:20 +09:00
Cheng Zhao
377a8eefb2 Merge pull request #4722 from atom/colocate-js
[WIP] Colocate JavaScript in root lib folder
2016-03-10 17:05:34 +09:00
Cheng Zhao
1ee4caae2d Merge pull request #4736 from preco21/patch-7
Docs: Adjust 80 chars per line
2016-03-10 16:55:10 +09:00
Plusb Preco
ebf509bbe4 📝 Adjust 80 chars per line
[ci skip]
2016-03-10 16:54:07 +09:00
Plusb Preco
4c45c80fb4 📝 Update as upstream 2016-03-10 16:36:50 +09:00
Cheng Zhao
b40a0e6e0c Merge pull request #4725 from phamdaniel/doc-app-focus
Document 'app.focus()'
2016-03-10 16:29:33 +09:00
heyunjiang
51f60d8d73 add window.open 2016-03-09 23:23:22 +08:00
Daniel Pham
0b8c2545b9 📝 Document 'app.focus()'
[ci skip]
2016-03-09 09:03:38 -05:00
Cheng Zhao
5efb88e7ea Merge pull request #4723 from yucheng-inc/master
translations   zh-CN    doc
2016-03-09 21:45:40 +09:00
heyunjiang
937668097a web-view-tag first finish 2016-03-09 17:00:01 +08:00
wujingke
da0a1eac24 Merge pull request #3 from heyunjiang/master
api doc 4th
2016-03-09 09:35:24 +08:00
Kevin Sawicki
c3b058cea3 Update path to ipc.js 2016-03-08 11:22:58 -08:00
Kevin Sawicki
2e9fd7ce77 Update common api path 2016-03-08 11:22:13 -08:00
Kevin Sawicki
4c9f5b71f7 Run eslint over lib folder 2016-03-08 11:14:22 -08:00
Kevin Sawicki
418efbe660 Remove unneeded resolve calls 2016-03-08 11:14:22 -08:00
Kevin Sawicki
006c77a00f Update requires paths 2016-03-08 11:14:22 -08:00
Kevin Sawicki
f109591d03 Look for JS in lib dir 2016-03-08 11:14:21 -08:00
Kevin Sawicki
c47ad29124 Move default_app to root of repo 2016-03-08 11:14:21 -08:00
Kevin Sawicki
6e3cb9e8eb Update paths for new JS location 2016-03-08 11:14:21 -08:00
Kevin Sawicki
70aa9b06ee Move JavaScript to root lib/ folder 2016-03-08 11:14:21 -08:00
heyunjiang
c8a2246952 complete command line switch && add enviroment variables 2016-03-08 20:40:54 +08:00
heyunjiang
d35996b4a0 position modify 2016-03-08 19:57:53 +08:00
Cheng Zhao
a9c40de393 Merge pull request #4680 from atom/resizable-linux
Respect initial resizable window option on Linux
2016-03-08 19:46:40 +09:00
Cheng Zhao
549cccfce4 Merge pull request #4715 from dongjoon-hyun/fix_typos_in_comments
Fix typos in comments.
2016-03-08 19:45:05 +09:00
Cheng Zhao
1da75f5c18 Merge pull request #4712 from atom/mq-map-selectors-to-roles
Map missing selectors to roles
2016-03-08 19:44:26 +09:00
Cheng Zhao
68c413c391 Merge pull request #4674 from atom/normalize-native-image-paths
Normalize native image paths
2016-03-08 18:59:56 +09:00
wujingke
83111ad84c Merge pull request #2 from heyunjiang/master
add api doc begin 2.5
2016-03-08 16:36:32 +08:00
heyunjiang
89328c873c add api doc begin 2.5 2016-03-08 16:30:09 +08:00
Dongjoon Hyun
0c92d44077 Fix typos in comments. 2016-03-07 20:22:03 -08:00
wujingke
6f221cb6b1 Merge pull request #1 from heyunjiang/master
menuItem add
2016-03-08 11:01:55 +08:00
heyunjiang
11f64b714d menuItem add 2016-03-08 10:47:23 +08:00
Kevin Sawicki
4c23e3950a Add missing semicolon 2016-03-07 16:45:15 -08:00
Kevin Sawicki
44376374b0 path -> paths 2016-03-07 16:45:14 -08:00
Kevin Sawicki
022c2c0d8c absolute_path -> normalize_path 2016-03-07 16:45:14 -08:00
Kevin Sawicki
0dba0b9cad MakePathAbsolute -> NormalizePath 2016-03-07 16:45:14 -08:00
Kevin Sawicki
97930fcd84 Add specs for more image path cases 2016-03-07 16:45:14 -08:00
Kevin Sawicki
9c88a5c1ab Check ReferencesParent before calling MakeAbsoluteFilePath 2016-03-07 16:45:14 -08:00
Kevin Sawicki
7692edf50e Assert image size as well 2016-03-07 16:45:14 -08:00
Kevin Sawicki
8215d661ca Add api- prefix to spec 2016-03-07 16:45:14 -08:00
Kevin Sawicki
8f820e09be Use template string and arrow functions 2016-03-07 16:45:14 -08:00
Kevin Sawicki
145d5abe80 Mention explicit using original path on failures 2016-03-07 16:45:14 -08:00
Kevin Sawicki
b90c0c7895 Use MakeAbsoluteFilePath when creating native image from path 2016-03-07 16:45:13 -08:00
Kevin Sawicki
dda7740399 Add failing spec for native image path normalization 2016-03-07 16:45:13 -08:00
Kevin Sawicki
3f4455a79d Merge pull request #4713 from atom/mq-doc-actions
Link to OS X Cocoa Event Handling guide on actions
2016-03-07 16:40:23 -08:00
Machisté N. Quintana
f47851f1e7 📝 🎨 Hard wrap 2016-03-07 16:19:00 -08:00
Machisté N. Quintana
eb064240f8 📝 Link to OS X Cocoa Event Handling guide on actions 2016-03-07 16:11:58 -08:00
Kevin Sawicki
7b881ebc23 Merge pull request #4711 from atom/realpath-asar-unpacked-specs
Add specs for realpath of unpacked asar path
2016-03-07 16:10:50 -08:00
Machisté N. Quintana
2bfc7aa152 Add mapping for performZoom 2016-03-07 16:01:46 -08:00
Machisté N. Quintana
eae5cc9d2c 🎨 [ci skip] 2016-03-07 15:53:09 -08:00
Machisté N. Quintana
03434f45bb Map webContents.delete to role 2016-03-07 15:50:33 -08:00
Machisté N. Quintana
4ded709307 Map selectors for delete and pasteAndMatchStyle to roles 2016-03-07 15:42:32 -08:00
Kevin Sawicki
4b6639c9fd Add missing done param 2016-03-07 15:30:33 -08:00
Kevin Sawicki
4b65610d40 Add specs for realpath of unpacked asar path 2016-03-07 15:27:21 -08:00
Kevin Sawicki
755c1f5238 Merge pull request #4706 from atom/update-styleguide
Remove CoffeeScript from styleguide
2016-03-07 13:59:07 -08:00
Kevin Sawicki
04c8bc38b2 Tweak lint sentence 2016-03-07 13:58:49 -08:00
Kevin Sawicki
ad3f4a26fd Restore setting resizable property from ctor on Windows 2016-03-07 13:53:57 -08:00
Kevin Sawicki
7de37859f0 Set resizable on Linux from InitWithOptions 2016-03-07 13:48:33 -08:00
Kevin Sawicki
993b878925 🎨 2016-03-07 10:37:01 -08:00
Kevin Sawicki
38acc7090b Contrain size in ctor on non-resizable windows 2016-03-07 10:11:30 -08:00
Kevin Sawicki
4ec79d5d18 Add Linux exclusion to describe 2016-03-07 09:53:20 -08:00
Kevin Sawicki
1c68aae43e Mention npm run lint 2016-03-07 09:46:05 -08:00
Kevin Sawicki
686af28f54 Mention indent and semicolons 2016-03-07 09:45:13 -08:00
Kevin Sawicki
6725523042 Remove CoffeeScript from styleguide 2016-03-07 09:43:04 -08:00
Cheng Zhao
aa8dbbf6b6 Merge pull request #4695 from dongjoon-hyun/fix_link_name
Fix link name.
2016-03-07 10:31:49 +09:00
Cheng Zhao
0e2ac2d802 Merge pull request #4646 from phamdaniel/dark-mode
Add API to check OSX's Dark theme
2016-03-07 09:53:03 +09:00
Daniel Pham
68b453770b 🍎 Rename 'isDarkModeEnabled' to 'isDarkMode' 2016-03-06 10:55:47 -05:00
Cheng Zhao
2a0be28111 Merge pull request #4682 from phamdaniel/ismaximized
Fix `isMaximized()` in window for when resizable is set to false on OSX
2016-03-06 19:23:46 +09:00
Dongjoon Hyun
f9f20957a4 Fix link name. 2016-03-05 23:28:39 -08:00
Cheng Zhao
d93ccd47a8 Merge pull request #4670 from atom/cmd-backtick-order
Use sendAction for cycling windows
2016-03-06 16:17:38 +09:00
Cheng Zhao
e152b8850c Merge pull request #4665 from christoth/christoth-webview-flexbox
Use flexbox layout for browserplugin
2016-03-06 15:36:20 +09:00
Cheng Zhao
5bb2c2c5c9 Merge pull request #4666 from SLiNv/zh-CN-documentation
Add Pepper Flash doc and match doc style
2016-03-06 15:36:05 +09:00
Cheng Zhao
816b10d8f3 Merge pull request #4694 from atom/common-accelerator
Remove duplicated keyboard code
2016-03-06 15:31:59 +09:00
Cheng Zhao
b7a40f3097 docs: Add missing key codes 2016-03-06 15:12:04 +09:00
Cheng Zhao
2515425cd5 Remove duplicated keyboard code 2016-03-06 15:04:05 +09:00
Cheng Zhao
a0c39c64cc Merge pull request #4686 from atom/fullscreen-logic
Improve fullscreen related logic code
2016-03-05 22:20:43 +09:00
Cheng Zhao
114801d412 Remove the duplicate logic on OS X 2016-03-05 21:54:41 +09:00
Cheng Zhao
2be368bded SetFullScreen should not work at all when not fullscreenable
This follows the logic of OS X.
2016-03-05 21:38:06 +09:00
Cheng Zhao
f5d79677fa Merge branch 'will-fullscreen' of https://github.com/MaxWhere/electron 2016-03-05 21:30:41 +09:00
Cheng Zhao
5f95fea3e2 docs: OS X also has progress bar 2016-03-05 21:20:02 +09:00
Cheng Zhao
c0b87c1a62 Merge pull request #4656 from princejwesley/menu-item-click
Add platform predicate for menu item action
2016-03-05 21:13:59 +09:00
Cheng Zhao
054c55a9bb Merge pull request #4683 from atom/fix-select-certificate
Fix passing certificate to select-client-certificate's callback
2016-03-05 19:47:27 +09:00
Cheng Zhao
23b92ef9ec Fix passing certificate to select-client-certificate's callback 2016-03-05 18:57:46 +09:00
Daniel Pham
d5f5cdb45a :apple:Fix 'isMaximized()' for non resizable windows 2016-03-05 01:39:48 -05:00
Cheng Zhao
33978455b8 Bump v0.36.10 2016-03-05 12:00:06 +09:00
Cheng Zhao
2bd167663d Merge pull request #4678 from atom/writable-member-functions
Make remote member functions writable/configurable
2016-03-05 11:56:56 +09:00
Kevin Sawicki
bda5bb4a74 Add missing semicolon 2016-03-04 16:15:04 -08:00
Kevin Sawicki
67edcc8f91 Initially set resizable property on Linux 2016-03-04 16:12:58 -08:00
Kevin Sawicki
73f6162f5c Enable resizable spec on Linux 2016-03-04 16:12:14 -08:00
Kevin Sawicki
fe9e026f9e getObjectMemebers -> getObjectMembers 2016-03-04 15:57:21 -08:00
Kevin Sawicki
3230927f10 Mention deleting 2016-03-04 15:56:18 -08:00
Kevin Sawicki
f460d81dd0 Allow remote member functions to be deleted 2016-03-04 15:51:17 -08:00
Kevin Sawicki
610a503188 Make member functions writable 2016-03-04 15:49:46 -08:00
Kevin Sawicki
a9e22801e9 Add failing spec for reassigning remote function 2016-03-04 15:44:50 -08:00
Kevin Sawicki
ee1f69062e Merge pull request #4675 from atom/report-error-in-enumerate-devices-spec
Always call done callback in enumerateDevices spec
2016-03-04 14:42:21 -08:00
Kevin Sawicki
20e9a87158 Don't run mediaDevices spec on Linux CI 2016-03-04 13:23:12 -08:00
Kevin Sawicki
a4e04e6083 Always call done callback 2016-03-04 12:29:50 -08:00
Daniel Pham
63294892f0 Rename dark-mode-changed to platform-theme-changed 2016-03-03 23:58:58 -05:00
Kevin Sawicki
be67dca686 Use _cycleWindows selector to implement cmd-` 2016-03-03 20:53:58 -08:00
Daniel Pham
b1eefbdcd9 Simplify the isDarkModeEnabled check 2016-03-03 23:48:30 -05:00
christoth
fed77d1837 Use flexbox layout for browserplugin 2016-03-03 17:22:20 -05:00
Victor Zhu
b46fc8bc4c Add Pepper Flash doc and match doc style
- Add Pepper Flash plugin documentation
- Use and  match the same documentaion style for other CN docs.
- Fix some typos and grammar.
2016-03-03 15:42:14 -05:00
Cheng Zhao
b4c48664f8 Merge pull request #4635 from akameco/master
Fix JP docs tranlation
2016-03-03 21:00:46 +09:00
Plusb Preco
b6958e5221 Update as upstream
[ci skip]
2016-03-03 20:56:46 +09:00
Prince J Wesley
f02affbc18 🐛 Add platform predicate for menu item action 2016-03-03 08:38:32 +05:30
Cheng Zhao
46c6233b62 Merge pull request #4630 from preco21/patch-6
Docs: Cleanup docs
2016-03-03 11:37:48 +09:00
Cheng Zhao
d6144d63fb Merge pull request #4629 from RacioN/master
Update docs-translations/jp/README.md tranlation.
2016-03-03 11:32:40 +09:00
Daniel Pham
c4049cb393 🍎 Add 'dark-mode-changed' event to app api 2016-03-01 15:43:38 -05:00
Daniel Pham
eaac67ac60 🍎 Add 'isDarkModeEnabled' to app api 2016-03-01 13:12:21 -05:00
akameco
9c7bb0b370 Fix JP docs tranlation 2016-03-01 01:41:46 +09:00
Plusb Preco
24ae9b0ea9 Cleanup docs
* Adjust 80 chars per line
* Line feed after header
2016-02-29 01:38:32 +09:00
RacioN
2d11b1d9eb Update read me tranlation 2016-02-28 20:55:47 +09:00
RacioN
e3dde12c45 Update read me tranlation 2016-02-28 20:50:16 +09:00
RacioN
681a772f5f Add list 2016-02-28 20:42:14 +09:00
Cheng Zhao
5839d7dcd5 Merge pull request #4623 from parro-it/patch-1
Removed duplicate `isDevToolsFocused` entry
2016-02-28 10:41:27 +08:00
brenca
a06392459e Making fullsceenable work on Linux 2016-02-27 22:37:42 +01:00
Andrea Parodi
fd11b7e7db Removed duplicate isDevToolsFocused entry 2016-02-27 20:34:51 +01:00
Heilig Benedek
bb42c85df8 resolve update conflicts 2016-02-27 03:23:10 +01:00
Heilig Benedek
bb0ac688b2 Reverted SetFullscreenable disabling maximize button on Windows and removed that from the docs. 2016-02-27 03:07:53 +01:00
Cheng Zhao
7de97a55f7 Merge pull request #4609 from MaxWhere/framesubscriber-fix
🐎 framesubscriber speed and quality improvement
2016-02-26 23:21:42 +08:00
Cheng Zhao
b25c8ca621 Merge pull request #4616 from deepak1556/media_device_enumeration_patch
browser: allow enumeration of media device labels
2016-02-26 22:07:35 +08:00
Cheng Zhao
db46e9c203 Merge pull request #4596 from felixrieseberg/ci-docs
Add Headless CI Tutorial
2016-02-26 21:32:03 +08:00
Cheng Zhao
ebfc127628 Merge pull request #4522 from deepak1556/async_execute_javascript_patch
webContents: provide responses for executeJavscript method
2016-02-26 21:17:47 +08:00
gellert
070772b4b9 Added special key identifiers for OSX and Windows 2016-02-26 20:22:46 +08:00
Cheng Zhao
d9ad51e989 Merge pull request #4607 from rglyall/master
Fix Menu template API example
2016-02-26 20:13:40 +08:00
Robo
fce641aab6 browser: allow enumeration of media device labels 2016-02-26 16:31:20 +05:30
Cheng Zhao
a21e095a59 Merge pull request #4515 from deepak1556/ipc_value_conversion_patch
ipc: allow passing date instances
2016-02-26 16:16:33 +08:00
Cheng Zhao
a67b29d8d2 Bump v0.36.9 2016-02-26 02:18:27 +00:00
Cheng Zhao
795ac86266 Merge pull request #4608 from atom/harfbuzz
Use harfbuzz 1.06
2016-02-26 09:51:13 +08:00
Cheng Zhao
8a744255fa Update libchromiumcontent, use harfbuzz 1.06
Close #4513.
2016-02-26 09:23:39 +08:00
Felix Rieseberg
a3b8e81c21 📝 Add Headless CI Tutorial 2016-02-25 17:14:43 -08:00
Heilig Benedek
4bfa03e5f4 Removed an include no longer needed 2016-02-26 02:13:17 +01:00
Heilig Benedek
3f0d598a59 Merge atom/master 2016-02-26 02:05:57 +01:00
Robo
1235907835 run webframe methods for webview in its context 2016-02-26 05:14:45 +05:30
Heilig Benedek
9a0372b61b Removed size_ since it's not needed anymore 2016-02-25 23:48:58 +01:00
Robert Lyall
6f45678e9c Fix Menu template API example 2016-02-25 18:28:03 +00:00
Cheng Zhao
0ea80f674b Merge pull request #4595 from dongjoon-hyun/rename_function_filter_accelerator
Rename function `FilterAccecelator` to `FilterAccelerator` in `submenu.cc`
2016-02-25 21:18:57 +08:00
Cheng Zhao
316e6850ae Merge pull request #4592 from miniak/fix-url-request-converter-crash
Fix crash in mate::Converter<const net::URLRequest*>::ToV8
2016-02-25 21:11:43 +08:00
Robo
8386baf267 add spec 2016-02-25 11:46:30 +05:30
Robo
a734326907 track async api requests 2016-02-25 11:45:59 +05:30
Robo
2b547bd44a webContents: provide responses for executeJavscript method 2016-02-25 11:45:59 +05:30
Robo
a1a17b7ee8 use v8::Object::Get 2016-02-25 11:21:21 +05:30
Cheng Zhao
d00490271b Merge pull request #4518 from deepak1556/webview_host_window_patch
webview: api to get host browser window
2016-02-25 12:26:53 +08:00
Dongjoon Hyun
fee56df400 Rename function FilterAccecelator to FilterAccelerator in submenu_button.cc. 2016-02-24 11:15:21 -08:00
Milan Burda
d2b48b2aa7 Fix crash in mate::Converter<const net::URLRequest*>::ToV8
The net::URLRequest::url() method calls vector<GURL>::back(), which is undefined when the url_chain is empty
2016-02-24 14:01:26 +01:00
Robo
467870deb6 use builtin method 2016-02-24 16:30:23 +05:30
Robo
6fcc197db8 webview: api to get webcontents and associated host webcontents 2016-02-24 11:55:15 +05:30
Cheng Zhao
f3c7965cea Merge pull request #4588 from atom/fix-protocol-crash
Revert  #4551
2016-02-24 13:48:33 +08:00
Cheng Zhao
8ff30a2abc Revert "protocol: respect requests from partition"
This reverts commit 85800256de.
2016-02-24 13:25:30 +08:00
Cheng Zhao
bb1e4c2208 Revert "add docs"
This reverts commit bdfc19ad20.
2016-02-24 13:25:22 +08:00
Cheng Zhao
820c72af55 Merge pull request #4560 from magicae/magica-translate-docs-to-zh_CN
docs: update zh-CN docs translation [WIP]
2016-02-24 13:06:17 +08:00
Cheng Zhao
a63193c826 Merge pull request #4551 from deepak1556/protocol_session_patch
protocol: respect requests from partition
2016-02-24 12:03:37 +08:00
Cheng Zhao
3a3a95b0a9 Merge pull request #4581 from atom/linux-menu-fix
Notify the global menu bar when window is mapped
2016-02-23 20:41:50 +08:00
Robo
367d12402a ipc: allow passing date instances 2016-02-23 16:23:15 +05:30
Cheng Zhao
49f995925c Notify the global menu bar when window is mapped 2016-02-23 15:43:32 +08:00
Robo
bdfc19ad20 add docs 2016-02-23 12:54:20 +05:30
Cheng Zhao
1b3b35926a Merge pull request #4580 from kanatapple/master
docs: update jp doc ipc-renderer.md
2016-02-23 15:11:07 +08:00
Yasunari Fujieda
23268531ae docs: update jp doc ipc-renderer.md 2016-02-23 15:10:38 +09:00
Cheng Zhao
f47ae3c02f Merge pull request #4579 from jin5354/master
docs: update zh-CN doc debugging-main-process.md
2016-02-23 14:08:46 +08:00
Cheng Zhao
9c6ab6f1e0 Merge pull request #4566 from yamatoya/master
Update as upstream
2016-02-23 13:39:34 +08:00
jin5354
331bc42d57 docs: update zh-CN doc debugging-main-process.md
update zh-CN doc debugging-main-process.md to be up-to-date with
English ver.
2016-02-23 10:00:28 +08:00
Heilig Benedek
39bb670719 Revert will-enter-full-screen event, matching osx fullscreen: false behaviour on windows instead 2016-02-22 10:23:56 +01:00
Cheng Zhao
537ead8917 Merge pull request #4570 from atom/cleanup-remote
Cleanup code of remote module
2016-02-22 16:10:55 +08:00
Cheng Zhao
96b2705bd3 Fix render-view-deleted being emitted twice 2016-02-22 15:24:19 +08:00
Cheng Zhao
6753fcc1b4 Get rid of the ATOM_BROWSER_RELEASE_RENDER_VIEW event 2016-02-22 15:24:19 +08:00
Cheng Zhao
593a79ce20 Separate renderer functions by renderer process ID
Close #4324.
2016-02-22 15:24:18 +08:00
Cheng Zhao
d4c954870a Remove a few CoffeeScript generated junks 2016-02-22 15:24:18 +08:00
Cheng Zhao
59d6e7d6ef ObjectsRegistry no longer needs to send events 2016-02-22 15:24:18 +08:00
Cheng Zhao
2b04af4349 No longer need to count the references in webContents
All remote objects are now cached in renderer process, so there is
always only one reference to one remote object for each webContents.
2016-02-22 15:24:18 +08:00
Cheng Zhao
fe7462b352 No longer needs cache for methods of remote
Refs #4517.
2016-02-22 13:05:58 +08:00
Cheng Zhao
c65cfadd09 v8Util.createObjectWithName is no longer used 2016-02-22 13:05:58 +08:00
Cheng Zhao
34658473c9 Merge pull request #4568 from atom/remote-proto
Keep prototype chain in remote objects
2016-02-22 13:04:34 +08:00
Cheng Zhao
f610e332b3 spec: Tests for remote ES6 class 2016-02-22 12:35:51 +08:00
Cheng Zhao
67324ce732 Keep the prototype chain in remote objects 2016-02-22 12:35:51 +08:00
Takahito Yamatoya
9e1da8f097 Update as upstream 2016-02-22 00:59:18 +09:00
Cheng Zhao
361b9cad0f Merge pull request #4564 from dongjoon-hyun/rename_const_persist_prefix
Rename constant `PERSIST_PERFIX` to `PERSIST_PREFIX` in `session.js`.
2016-02-21 21:53:41 +08:00
Plusb Preco
f63532fa95 📝 Update as upstream
[ci skip]
2016-02-21 21:15:36 +08:00
Cheng Zhao
4a47deafc2 Merge pull request #4558 from cesine/update/deps
a new version of asar is out 0.10.0
2016-02-21 19:04:06 +08:00
Cheng Zhao
cad26fa606 Merge pull request #4517 from deepak1556/remote_browser_window_patch
remote: return webcontents instance from cache
2016-02-21 17:54:48 +08:00
Dongjoon Hyun
078c7bf8ab Rename constant PERSIST_PERFIX to PERSIST_PREFIX in session.js. 2016-02-21 00:16:53 -08:00
Magica
a05e98f463 Translate auto-updater.md in commit 45739ce434 2016-02-21 14:09:34 +08:00
Magica
f64dc5f57d Translate app.md in commit 45739ce434 2016-02-21 13:49:51 +08:00
Magica
1db72f8010 Translate accelerator.md of 45739ce434 2016-02-20 18:51:04 +08:00
Magica
060d06d396 Translate electron-faq.md#45739ce434ec3c3eb190d35d3948b702b54706cd 2016-02-20 17:00:58 +08:00
Magica
a737e15ddb Update README.md to 45739ce434 2016-02-20 16:09:56 +08:00
cesine
e45e246027 a new version of asar is out 0.10.0 2016-02-19 23:24:56 -05:00
Kevin Sawicki
45739ce434 Merge pull request #4547 from Rafaelgfirmino/master
Translated
2016-02-19 11:22:15 -08:00
Kevin Sawicki
777ff450cf Merge pull request #4543 from baconface/patch-2
Changed session to app to reflect rest of document
2016-02-19 11:21:10 -08:00
Robo
85800256de protocol: respect requests from partition 2016-02-19 19:39:01 +05:30
Cheng Zhao
4b18317e7c Bump v0.36.8 2016-02-19 14:38:36 +08:00
Cheng Zhao
54a7eefa28 Merge pull request #4548 from atom/free-ffmpeg
Provide ffmpeg binaries without proprietary codecs
2016-02-19 14:37:09 +08:00
Lee Dohm
bd2c13527d Merge pull request #4528 from atom/wl-templates
Add issue template
2016-02-18 20:49:42 -08:00
Cheng Zhao
daffb4881e Create and upload free version of ffmpeg 2016-02-19 12:06:48 +08:00
Cheng Zhao
cd30308711 Update libchromiumcontent with free version of ffmpeg 2016-02-19 12:06:48 +08:00
Rafael G Firmino
632c18ab37 Translated 2016-02-18 22:51:23 -02:00
Brad Metcalf
2a6fcf48e5 Changed session to app to reflect rest of document 2016-02-18 13:41:22 -06:00
Kevin Sawicki
d5f4a32435 Merge pull request #4524 from atom/update-default-app-styles
Match default app styles to website styles
2016-02-18 10:47:45 -08:00
Kevin Sawicki
d3c6075841 Use background color as border color 2016-02-18 10:15:44 -08:00
Kevin Sawicki
1c37731065 under -> in 2016-02-18 10:15:44 -08:00
Kevin Sawicki
9b373f2e15 on -> to learn 2016-02-18 10:15:44 -08:00
Kevin Sawicki
4d011057b0 Only change background on hover 2016-02-18 10:15:44 -08:00
Kevin Sawicki
de37de1785 Add docs sentence in new paragraph 2016-02-18 10:15:43 -08:00
Kevin Sawicki
1520b2271a Remove v before version 2016-02-18 10:15:43 -08:00
Kevin Sawicki
793527f82e Update header style 2016-02-18 10:15:43 -08:00
Kevin Sawicki
db1c29f2f9 Remove parens around version 2016-02-18 10:15:43 -08:00
Kevin Sawicki
d48a61fdff Tweak holder styles 2016-02-18 10:15:43 -08:00
Kevin Sawicki
c4859c3dc6 Use colors from Electron site 2016-02-18 10:15:43 -08:00
Lee Dohm
cc6ba0fd10 Remove all but prompts for version numbers 2016-02-18 08:57:31 -08:00
Plusb Preco
8ce3ab1e26 📝 Update as upstream
[ci skip]
2016-02-18 23:35:29 +08:00
Cheng Zhao
68f48c9456 docs: Add note on Chrome version when using widevine
Refs #4519.
2016-02-18 23:28:19 +08:00
Cheng Zhao
aa03a9d0ef Merge pull request #4534 from apoco/menu-documentation
Link to Menu documentation
2016-02-18 20:14:08 +08:00
Robo
0d77fd4a2c remote: return webcontents instance from cache 2016-02-18 17:40:10 +05:30
Cheng Zhao
35815387ab Ship ffmpeg in dist, close #4536 2016-02-18 18:57:31 +08:00
Cheng Zhao
a8cd435e30 Merge pull request #4538 from atom/cmd-tilde
mac: Simulate the behavior of cmd+~ when OS X didn't handle it
2016-02-18 18:57:04 +08:00
Cheng Zhao
0446f07884 Merge pull request #4508 from atom/open-external-without-activation
Allow shell.openExternal to open URLs in the background
2016-02-18 18:40:22 +08:00
Cheng Zhao
12569f2c9d mac: Simulate the behavior of cmd+~ when OS X didn't handle it 2016-02-18 18:32:13 +08:00
Jacob Page
9c9759a683 Link to Menu documentation
Added link to documentation about `Menu` objects
2016-02-17 21:30:01 -08:00
Cheng Zhao
25156dbd53 Merge pull request #4532 from atom/no-drop-capacities
Update libchromiumcontent, fix #3666
2016-02-18 13:01:18 +08:00
Cheng Zhao
1e894df102 Update libchromiumcontent, fix #3666 2016-02-18 12:14:25 +08:00
Cheng Zhao
b13a2fe260 Merge pull request #4531 from atom/fix-win32-specs
spec: Fix failing tests on Windows
2016-02-18 12:12:32 +08:00
Cheng Zhao
651264d098 spec: Fix failing tests on Windows 2016-02-18 11:39:35 +08:00
Cheng Zhao
5f42429af1 Merge pull request #4523 from atom/spec-clean-up
Clean up specs post CoffeeScript conversion
2016-02-18 11:15:37 +08:00
Cheng Zhao
233961ea29 Merge pull request #4530 from atom/shared-ffmpeg
Link with ffmpeg dynamically
2016-02-18 11:13:57 +08:00
Wliu
1f248e6ea6 📝 Move Electron and OS versions above the description
[ci skip]
2016-02-17 21:41:14 -05:00
Wliu
f81f4479b6 Drastically simplify the template
[ci skip]
2016-02-17 21:29:36 -05:00
Heilig Benedek
2610aa60e9 🎨 lint fix 2016-02-18 01:19:41 +01:00
Heilig Benedek
7bf17f2541 Improved frame subscriber - now we only use framesubscription events as an event, and we copy from the backing store directly (instead of accessing it through a videoframe) 2016-02-18 01:15:00 +01:00
Wliu
a252b9b570 Initial ISSUE_TEMPLATE draft 2016-02-17 16:31:26 -05:00
Kevin Sawicki
31028ab636 Update var declarations 2016-02-17 09:27:25 -08:00
Kevin Sawicki
54d7c580bd Remove unneeded returns 2016-02-17 09:08:34 -08:00
Kevin Sawicki
8a9395101e Remove unused results 2016-02-17 09:08:34 -08:00
Kevin Sawicki
12adaa0570 Remove unneeded returns 2016-02-17 09:08:34 -08:00
Kevin Sawicki
e63c3c727a Add newlines between describe/it blocks 2016-02-17 09:08:34 -08:00
Kevin Sawicki
709661156a Use const for requires 2016-02-17 09:08:34 -08:00
Kevin Sawicki
b3ac48cf52 Handle argument parsing in C++ 2016-02-17 09:05:21 -08:00
Kevin Sawicki
3f42909ecf Call OpenExternal with new true default to activate arg 2016-02-17 08:56:59 -08:00
Kevin Sawicki
04517caf36 Add missing semicolon 2016-02-17 08:56:59 -08:00
Kevin Sawicki
5e5313d8b1 Return value from bindings method 2016-02-17 08:56:59 -08:00
Kevin Sawicki
42041cd402 Use markdown list for new options param 2016-02-17 08:56:59 -08:00
Kevin Sawicki
f5bed87199 without_activation -> activate 2016-02-17 08:56:58 -08:00
Ben Gotow
52db43eee5 Fix linter error 2016-02-17 08:56:58 -08:00
Ben Gotow
d8679b3899 Allow openExternal to open URLs in the background #3224 2016-02-17 08:56:58 -08:00
Cheng Zhao
3d3fc18a3a Update libchromiumcontent to use shared ffmpeg 2016-02-17 23:23:36 +08:00
Cheng Zhao
7fece7e9b3 Link with ffmpeg 2016-02-17 22:21:14 +08:00
Cheng Zhao
57f322a818 Merge pull request #4509 from caibirdme/feature-translate-into-Chinese
tanslate file-object.md
2016-02-17 19:38:57 +08:00
deenjun
28635e5f2c remove original English text 2016-02-17 14:54:57 +08:00
Cheng Zhao
723acfa1a1 Merge pull request #4510 from atom/skip-eslint
Skip eslint on our Windows build machine for now
2016-02-17 12:07:51 +08:00
Cheng Zhao
01ede11cb8 Skip eslint on our Windows build machine for now 2016-02-17 10:54:44 +08:00
Cheng Zhao
c02a49a1db Merge pull request #4507 from atom/mb-add-deprecation-handler-api
Add API for custom handling of deprecations
2016-02-17 10:51:30 +08:00
deenjun
baf44c7a41 tanslate file-object.md 2016-02-17 10:42:59 +08:00
Cheng Zhao
7810f4293f Merge pull request #4447 from KevinMartin/patch-3
Add ability to specify v8 flags in package.json
2016-02-17 10:42:29 +08:00
Kevin Jose Martin
ee0cac7d54 Remove command line switches, add v8 flags 2016-02-16 21:23:13 -05:00
Plusb Preco
407bef5727 📝 Update as upstream
[ci skip]
2016-02-17 09:37:09 +08:00
Max Brunsfeld
3e3e593366 👕 Add missing semicolons 2016-02-16 15:28:33 -08:00
Max Brunsfeld
ccef805e9b Add API for custom handling of deprecations 2016-02-16 15:21:32 -08:00
Kevin Sawicki
175449f096 Merge pull request #4503 from x87/master
fixed typo in the russian translation of README.md
2016-02-16 12:52:37 -08:00
Seemann
2346caf6fb fixed typo in the russian translation of README.md 2016-02-16 23:19:20 +03:00
Kevin Sawicki
73518cdc8d Merge pull request #4501 from dmnlk/feature/add_community_jp
add Japanese Elecron Community
2016-02-16 10:45:30 -08:00
dmnlk
959c08a1ec add Japanese Electron Community 2016-02-17 02:28:10 +09:00
Cheng Zhao
0ba86b9716 docs: Make variable names follow previous example 2016-02-16 23:10:05 +08:00
Cheng Zhao
18e7825ff3 Merge pull request #4498 from destan/patch-2
add a new platform definition for linux
2016-02-16 23:08:34 +08:00
Destan Sarpkaya
afacca252e add a new platform definition for linux
On Linux in order for changes made to individual `MenuItem`s to take effect, you have to call `setContextMenu` again

Regarding https://github.com/atom/electron/issues/1473
2016-02-16 16:24:05 +02:00
Cheng Zhao
61a9316f67 Merge pull request #4496 from cesine/update/deps
fix dependencies badge  which shows out of date
2016-02-16 22:18:51 +08:00
Cheng Zhao
e47a815c38 Merge pull request #4482 from lukeapage/patch-7
spelling fixes and americanisms
2016-02-16 20:22:31 +08:00
Cheng Zhao
25ac6f0f37 Merge pull request #4480 from apoco/single-instance-clarification
makeSingleInstance clarification
2016-02-16 20:17:18 +08:00
Cheng Zhao
5b4f29e7ed Merge pull request #4471 from rsezille/master
Docs: Start french translation
2016-02-16 16:22:55 +08:00
Cheng Zhao
aaca93046c spec: Give beginFrameSubscription test more time to run 2016-02-16 16:20:15 +08:00
Cheng Zhao
bce11c8913 Merge commit 'd76f6fe' 2016-02-16 16:15:59 +08:00
Cheng Zhao
44260634af Merge pull request #4364 from atom/launch-url-or-file-directly-from-cli
Launch URL or HTML file directly
2016-02-16 16:13:10 +08:00
Cheng Zhao
7ca09de386 Merge remote-tracking branch 'origin/dont-write-empty-dev-tools-extensions-file' 2016-02-16 12:30:42 +08:00
Cheng Zhao
55642d257d Merge pull request #4494 from pra85/patch-3
docs: fix a minor typo
2016-02-16 12:28:08 +08:00
Plusb Preco
81ffde3c2a 📝 Update as upstream
[ci skip]
2016-02-16 12:20:21 +08:00
Cheng Zhao
95d8716ffa Merge pull request #4497 from atom/docs-revise
Improve the IPC related docs
2016-02-16 12:20:00 +08:00
Cheng Zhao
fded8d80b1 docs: Remove unnecessary "properties: " suffix 2016-02-16 12:11:05 +08:00
Cheng Zhao
2b406ccaf7 Optional => optional 2016-02-16 11:54:41 +08:00
Cheng Zhao
f58bab70c5 docs: Improve the docs on sharing data 2016-02-16 11:52:47 +08:00
Cheng Zhao
b8e8e4c930 docs: Cleanup the IPC docs 2016-02-16 11:34:39 +08:00
cesine
2aff0c47d0 ⬆️ 👕 updated to eslint 2.1.0
Verified migration doc (nothing to be done)
http://eslint.org/docs/user-guide/migrating-to-2.0.0

And made sure the eslint tasks passed
2016-02-15 22:30:29 -05:00
Cheng Zhao
63578f9d2b Merge pull request #4392 from madarche/doc-howto-share-objects
Document different techniques to share objects
2016-02-16 11:18:20 +08:00
Cheng Zhao
40a0a6aa8e Merge pull request #4495 from atom/frame-subscriber
Use weak pointer instead of manual bookkeeping
2016-02-16 11:13:11 +08:00
Cheng Zhao
d035fc2816 Merge pull request #4453 from lukeapage/patch-6
Docs - clarify ipc arguments
2016-02-16 11:08:35 +08:00
Cheng Zhao
3c4043fd39 spec: Skip autoUpdater tests in MAS build 2016-02-16 11:00:36 +08:00
Cheng Zhao
66bb6a8534 Use weak pointer instead of manual bookkeeping 2016-02-16 10:44:10 +08:00
Cheng Zhao
ed1966ac76 spec: Bring back beginFrameSubscription test 2016-02-16 10:30:18 +08:00
Prayag Verma
367a3524b9 docs: fix a minor typo
Remove extra `will`
2016-02-16 07:51:14 +05:30
Cheng Zhao
1232a285e6 Merge pull request #4451 from MaxWhere/framesubscriber-fix
Fixing FrameSubscriber memory issue
2016-02-16 10:20:44 +08:00
Cheng Zhao
f3f6fa958e Merge pull request #4449 from deepak1556/permission_helper_media_patch
browser: handle desktop capture devices in media permission request
2016-02-15 23:12:57 +08:00
Cheng Zhao
08e5c1f6fe Merge branch 'webcontent_invalid_loadurl_patch' of https://github.com/deepak1556/atom-shell into deepak1556-webcontent_invalid_loadurl_patch 2016-02-15 21:14:54 +08:00
Cheng Zhao
e244d0db0c Merge pull request #4421 from atom/dialog-icon-on-mac
Support configurable dialog icon on Mac
2016-02-15 16:48:43 +07:00
Cheng Zhao
7c7e6ffc77 Fix broken links in desktop-environment-integration.md
Close #4404.
2016-02-15 16:36:01 +08:00
Cheng Zhao
18f31d7db9 Merge pull request #4398 from LartSimZ/master
Fix for issue #4369
2016-02-15 15:30:06 +07:00
Luke Page
a141d6b3d4 spelling fixes and americanisms 2016-02-15 06:51:20 +01:00
Luke Page
2c6e5d0464 Clarify arguments sent via ipc 2016-02-15 06:29:52 +01:00
Jacob Page
17603d5dfb makeSingleInstance clarification
Removed callback return value from the sample code for makeSingleInstance because it appears to not be used for anything.
2016-02-14 19:13:11 -08:00
Cheng Zhao
09b658b50a Merge pull request #4361 from ShiningRay/patch-2
translate remote.md into Chinese
2016-02-15 09:13:02 +07:00
Plusb Preco
f63d8b4d5e 📝 Update as upstream
[ci skip]
2016-02-15 10:05:29 +08:00
Remi Sezille
ef290ffcf2 Add styleguide in french
[ci skip]
2016-02-13 19:28:12 +01:00
Remi Sezille
efd25efaf4 Add FAQ
[ci skip]
2016-02-13 18:20:34 +01:00
Remi Sezille
a69341f551 Fix line length wrap
[ci skip]
2016-02-13 18:19:49 +01:00
Remi Sezille
940c325e7f Add french docs link on main README
[ci skip]
2016-02-13 11:32:47 +01:00
Remi Sezille
adf89a1e0e Translate README in french
[ci skip]
2016-02-13 11:29:08 +01:00
Yuya Ochiai
d76f6fe8e0 :memo:🏁 Add icon overlays in taskbar to docs
[ci skip]
2016-02-13 17:34:12 +09:00
Kevin Sawicki
440eccb7ee Merge pull request #4455 from preco21/patch-5
Remove unnecessary line feeds
2016-02-12 09:38:27 -08:00
Plusb Preco
e71eeda73c Remove unnecessary line feeds
[ci skip]
2016-02-12 22:38:08 +09:00
Marc-Aurèle DARCHE
2677dc6844 Fix: add missing fragment in FAQ section URL 2016-02-12 13:50:15 +01:00
Heilig Benedek
f36e2841bf Don't fire callbacks after we end the subscription 2016-02-12 13:30:11 +01:00
Heilig Benedek
91c96559fa Fixing the problem related to FrameSubscriber 2016-02-12 02:18:13 +01:00
Kevin Sawicki
03dd94d2b2 Merge pull request #4450 from HR/patch-1
Fix electron binary relative path
2016-02-11 17:00:05 -08:00
Heilig Benedek
a2b0e30714 Merge pull request #5 from atom/master
update as upstream
2016-02-12 01:57:08 +01:00
Habib Rehman
3adcaa7681 Fix electron binary relative path
The relative path for Electron's binary is Contents/MacOS/Electron
2016-02-12 00:11:02 +00:00
Robo
c09ff40916 browser: handle desktop capture devices in media permission request 2016-02-12 05:07:06 +05:30
Kevin Sawicki
9d6344704e Merge pull request #4382 from atom/throw-explicit-error-when-webview-api-is-unavailable
Throw explicit error when WebView API isn't ready
2016-02-11 13:34:01 -08:00
Kevin Sawicki
042825e8fb emmitted -> emitted 2016-02-11 13:32:34 -08:00
Kevin Sawicki
9609b36b3c Add missing semicolon 2016-02-11 13:28:33 -08:00
Kevin Sawicki
da6ebac742 Use assert.throws 2016-02-11 13:28:33 -08:00
Kevin Sawicki
bad4816976 Expand error message 2016-02-11 13:28:33 -08:00
Kevin Sawicki
674af4211c Use interpolated string 2016-02-11 13:28:33 -08:00
Kevin Sawicki
42a8674cea Add missing semicolon 2016-02-11 13:28:33 -08:00
Kevin Sawicki
8cacd0b931 Throw custom error when WebView API is unavailable 2016-02-11 13:28:33 -08:00
Kevin Sawicki
6bc48ba123 Add failing spec for custom error message 2016-02-11 13:28:33 -08:00
Kevin Sawicki
a4d21cadfa Format webview spec post CoffeeScript conversion 2016-02-11 13:28:33 -08:00
Kevin Sawicki
174a492cdb Merge pull request #4430 from atom/dont-crash-when-missing-ipc-channel
Don't crash when IPC channel is missing
2016-02-11 13:28:08 -08:00
Kevin Sawicki
704bd4d191 Improve error message 2016-02-11 13:25:58 -08:00
Kevin Sawicki
3e399d09d7 Match existing function style 2016-02-11 13:25:58 -08:00
Kevin Sawicki
c94f1fc857 Throw error when IPC channel is missing 2016-02-11 13:25:58 -08:00
Kevin Sawicki
cead84d5d1 Add failing spec 2016-02-11 13:25:57 -08:00
Kevin Sawicki
4828835998 Clean up returns after CoffeeScript migration 2016-02-11 13:25:57 -08:00
Kevin Sawicki
55d4db1387 🎨 2016-02-11 13:25:57 -08:00
Kevin Jose Martin
dbb4e21684 Fix index increment 2016-02-11 15:41:36 -05:00
Kevin Jose Martin
6d2ad5ae58 Add ability to specify command line switches in package.json 2016-02-11 15:34:19 -05:00
Robo
5a8bebc2f8 browser: emit did-fail-load for invalid url 2016-02-12 01:52:42 +05:30
Kevin Sawicki
fd30ed0edd Merge pull request #4439 from atom/add-more-npm-scripts
Add more npm scripts
2016-02-11 11:29:46 -08:00
Kevin Sawicki
a8e6e24e58 Sort scripts keys 2016-02-11 11:28:20 -08:00
Kevin Sawicki
03482a4427 Add build script 2016-02-11 11:28:20 -08:00
Kevin Sawicki
16594d6ed0 Add bootstrap script 2016-02-11 11:28:20 -08:00
Kevin Sawicki
38e8208639 Merge pull request #4350 from atom/dont-use-es6-class-for-auto-updater
Don't use ES6 class for auto updater
2016-02-11 11:27:10 -08:00
Heilig Benedek
f8fd5dc2a3 Merge pull request #4 from atom/master
update as upstream
2016-02-11 02:36:10 +01:00
Kevin Sawicki
3ab14e14e9 Add initial auto updater specs 2016-02-09 14:54:18 -08:00
Kevin Sawicki
7da4c3acf7 Use const for util require 2016-02-09 14:54:18 -08:00
Kevin Sawicki
6617592224 Remove lint errors 2016-02-09 14:54:18 -08:00
Kevin Sawicki
c842ca1f12 Don't use ES6 class for AutoUpdater windows class 2016-02-09 14:54:17 -08:00
Kevin Sawicki
3af20729bd Merge pull request #4363 from Vj3k0/master
Adding support to write RTF to clipboard.
2016-02-09 13:23:47 -08:00
Heilig Benedek
157a290e38 📝 Adding documentation for will-enter-full-screen event 2016-02-09 02:41:19 +01:00
gellert
664f95a7b4 fixes osx request call 2016-02-09 01:39:27 +01:00
Heilig Benedek
a8ae14e94f Introducing a will-enter-full-screen event that's cancellable 2016-02-09 01:17:05 +01:00
Heilig Benedek
d5bdb17144 Merge pull request #3 from atom/master
update as upstream
2016-02-09 00:52:19 +01:00
Kevin Sawicki
756aeffe03 Set icon on NSAlert when specified 2016-02-08 15:18:05 -08:00
Paul Betts
1d0179b192 Merge pull request #4406 from adam-lynch/patch-4
Docs: app: small process.argv clarification
2016-02-07 22:40:34 +01:00
Adam Lynch
5911c45b54 Docs: app: small process.argv clarification 2016-02-07 17:31:37 +00:00
Michael Vasseur
702455674b Using node::Buffer::Copy() instead of node::Buffer::New() to copy the handle bytes to buffer make the buffer really contains the data. 2016-02-07 10:20:38 +01:00
Marc-Aurèle DARCHE
fa734d7824 Document different techniques to share objects
This has been discussed in
2016-02-06 19:57:21 +01:00
Kevin Sawicki
18631df88b Merge pull request #4378 from markisadesignerd/ipc-renderer-doc-typo
📝 Fixing typo in ipc-renderer
2016-02-05 10:10:26 -08:00
Vjekoslav Ratkajec
d0d336eee7 Merge remote-tracking branch 'upstream/master' 2016-02-05 09:11:24 +01:00
Vjekoslav Ratkajec
252b12be13 Add readRtf feature with appropriate spec test. Docs updated as well. 2016-02-05 09:06:21 +01:00
Kevin Sawicki
027b5345f8 Merge pull request #4367 from atom/remove-resedit
Remove ResEdit link from docs
2016-02-04 13:37:15 -08:00
Kevin Sawicki
bf03be3541 Remove ResEdit links from translations 2016-02-04 13:32:13 -08:00
Kevin Sawicki
45ce16b73f Remove ResEdit 2016-02-04 13:29:32 -08:00
Kevin Sawicki
fa4ad9d95f Tweak help message for new path options 2016-02-04 10:45:52 -08:00
Vjekoslav Ratkajec
acd5d40ab0 Adding support to write RTF to clipboard. 2016-02-04 19:38:47 +01:00
Kevin Sawicki
f482ea4902 loadPackagePath -> loadApplicationPackage 2016-02-04 10:35:17 -08:00
Kevin Sawicki
b74dd43ff5 Support opening file: URLs directly 2016-02-04 10:34:36 -08:00
Kevin Sawicki
312182e0bd Add support for launching HTML files directly 2016-02-04 10:33:22 -08:00
Kevin Sawicki
69687c92e9 Add support for launching http URL directly 2016-02-04 10:26:11 -08:00
Kevin Sawicki
2e96cab6aa Extract helper function to load specified app 2016-02-04 10:07:19 -08:00
Kevin Sawicki
8df3856c8f Use const for fs/path requires 2016-02-04 09:16:40 -08:00
Kevin Sawicki
2b5cbe825a Merge pull request #4356 from chris-ls/patch-1
Clarify overlay description
2016-02-04 09:09:44 -08:00
ShiningRay
55950281e8 translate 2016-02-04 23:07:13 +08:00
ShiningRay
6c8d9a5ccf translate 2016-02-04 23:07:07 +08:00
ShiningRay
e9aa24e340 fix broken link 2016-02-04 18:10:26 +08:00
chris-ls
48c6692311 Clarify overlay description
'16px' is ambiguous and not clear (4 x 4 px? or 16 x 16px)
2016-02-04 15:36:41 +13:00
Kevin Sawicki
00261a5571 Remove lint warnings 2016-02-03 17:17:11 -08:00
Kevin Sawicki
adfa4844d1 Don't return anything from will-quit handler 2016-02-03 17:15:28 -08:00
Kevin Sawicki
6252511b7f Delete extensions file when there are no loaded extensions 2016-02-03 17:12:09 -08:00
Kevin Sawicki
5714ae0b73 Add failing spec for dev tools extensions file 2016-02-03 17:11:12 -08:00
Kevin Sawicki
8bd07af5e5 Correct typo in comment 2016-02-03 16:22:16 -08:00
Mark Potnick
b9e2806042 Fixing typo 2016-02-03 15:15:13 -05:00
Kevin Sawicki
a0792237a0 Merge pull request #4339 from ShiningRay/patch-1
fix typo
2016-02-03 09:56:49 -08:00
Cheng Zhao
ff6bf92ee4 Merge pull request #4329 from atom/reliable-shutdown
Emit exit event reliably in renderer process
2016-02-03 12:07:39 +08:00
Cheng Zhao
5b8b167cbb Merge pull request #4333 from Rafaelgfirmino/master
translation for pt_BR
2016-02-03 11:49:34 +08:00
ShiningRay
86ed7ca725 fix typo
Broswer -> Browser
2016-02-03 11:37:20 +08:00
Rafael Firmino
77d005c5c8 translation for pt_BR 2016-02-02 17:02:43 -02:00
Cheng Zhao
47de3f3f24 Fix failing specs 2016-02-03 00:05:27 +08:00
Cheng Zhao
bc196c016b Do process.emit('exit') in WillReleaseScriptContext 2016-02-02 23:47:19 +08:00
Cheng Zhao
ffcf609de1 Ensure only main frame get notifications 2016-02-02 23:44:33 +08:00
Cheng Zhao
4b67ff9534 Override WillReleaseScriptContext 2016-02-02 23:38:49 +08:00
Cheng Zhao
808b02edda Merge pull request #4325 from atom/download-item-cleanup
Cleanup DownloadItem related code
2016-02-02 20:36:54 +08:00
Cheng Zhao
50d69fd9bb Get rid of SavePathData 2016-02-02 20:11:39 +08:00
Cheng Zhao
eaa60e9c17 Destroy the item once item is downloaded 2016-02-02 19:54:41 +08:00
Cheng Zhao
12d311fd29 Gracefully destroy downloadItem 2016-02-02 19:52:09 +08:00
Cheng Zhao
65cf85808f Calling cancel() should destroy the downloadItem 2016-02-02 19:05:58 +08:00
Cheng Zhao
f1f91828ba Rely on OnDownloadDestroyed to destroy downloadItem 2016-02-02 18:49:43 +08:00
Cheng Zhao
f624800881 Merge pull request #4314 from deepak1556/download_cancel_patch
fix crash when default download is canceled
2016-02-02 18:40:44 +08:00
Robo
2819af9586 fix lifetime of downloadItem class when defaultdownload canceled 2016-02-02 15:54:51 +05:30
Cheng Zhao
fabd897d49 Merge pull request #4320 from runinspring/patch-1
Update app.md
2016-02-02 14:34:34 +08:00
ZhangYu
c69971c381 Update app.md 2016-02-02 13:59:02 +08:00
Cheng Zhao
b2d44a94ce Merge pull request #4312 from deepak1556/host_resolver_cache_clear_patch
session: api to clear host resolver cache
2016-02-02 13:49:35 +08:00
Rafael Dantas
aadb131bc7 Update Portuguse docs translation 2016-02-02 10:23:07 +08:00
Plusb Preco
683f9745ad 📝 Update as upstream
[ci skip]
2016-02-02 10:12:42 +08:00
Cheng Zhao
1a3c01efca Update native-mate for #4307 2016-02-02 10:11:04 +08:00
Robo
ce2ea963b9 session: api to clear host resolver cache 2016-02-02 02:06:49 +05:30
Kevin Sawicki
9341f9a6bc Merge pull request #4309 from diracdeltas/fix/use-strict
Fix 'user strict' typo
2016-02-01 12:36:24 -08:00
yan
035c1dd5a1 Fix 'user strict' typo 2016-02-01 11:46:02 -08:00
Robo
045e42a10c fix crash when default download is canceled 2016-02-02 00:26:37 +05:30
Cheng Zhao
a575192c5f Merge pull request #4305 from atom/remove-unnecessary-methods
Remove a few unneeded overrides
2016-02-01 21:37:24 +08:00
Cheng Zhao
7d68ca21c8 No need of DefaultWebContentsDelegate 2016-02-01 21:09:12 +08:00
Cheng Zhao
159fb857f4 No need to override RequestToLockMouse in CommonWebContentsDelegate 2016-02-01 21:05:29 +08:00
Cheng Zhao
69f93a7528 Merge pull request #4223 from deepak1556/notification_disable_patch
session: add setPermissionRequestHandler api
2016-02-01 20:51:22 +08:00
Robo
ff5fb512b8 use mediastreamdevicescontroller from brightray to enumerate available devices 2016-02-01 17:45:53 +05:30
Robo
b575cd0ef9 add fullscreen permission type 2016-02-01 16:22:05 +05:30
Cheng Zhao
9d2cc4f2cc Merge pull request #4302 from pra85/patch-1
docs: fix minor typo
2016-02-01 18:46:42 +08:00
Cheng Zhao
6c282775a9 Merge pull request #4301 from ragingwind/set-icon-crash
Fix type cast of sharedApplication
2016-02-01 18:46:20 +08:00
Robo
45eada306f add pointerlock permission type 2016-02-01 15:13:49 +05:30
Prayag Verma
d8086b6532 docs: fix minor typo
Replace `an` with `a`
2016-02-01 14:40:36 +05:30
Cheng Zhao
e450d1586e Merge pull request #4288 from MaxWhere/master
Adding cursor-changed event to webContents
2016-02-01 17:03:16 +08:00
ragingwind
d2ec311c55 Fix type cast of sharedApplication 2016-02-01 17:17:22 +09:00
Robo
db26dcaf4c expose handler from session and remove permission-request event 2016-02-01 12:23:51 +05:30
Heilig Benedek
745253a369 Quick fix for the memory leak + docs 2016-02-01 07:17:58 +01:00
Cheng Zhao
7fdff522d6 Merge pull request #4292 from be5invis/patch-1
Add link to BrowserWindow::setMenu in docs/api/menu.md
2016-02-01 13:19:59 +08:00
Cheng Zhao
e16154889a Merge pull request #4291 from yamatoya/master
📝 Update as upstream
2016-02-01 13:11:01 +08:00
Cheng Zhao
ea2f170b7d Merge pull request #4289 from wgrafael/patch-1
PT/BR Docs Translation: update the "janelas" to "windows"
2016-02-01 13:10:26 +08:00
Plusb Preco
d471952adf 📝 Update as upstream
[ci skip]
2016-02-01 12:56:24 +08:00
Cheng Zhao
457c7f55e6 Merge pull request #4271 from thingsinjars/master
🍎 Add 'Hide' to App API for OS X only
2016-02-01 12:54:07 +08:00
Robo
04c3e083fb remove unnecessary getter 2016-02-01 00:43:29 +05:30
Belleve Invis
1d629640bf Add link to BrowserWindow::setMenu 2016-02-01 00:28:44 +08:00
Heilig Benedek
066c189249 Renamed some cursor types to their CSS names and added a way to handle custom cursors properly. 2016-01-31 17:00:14 +01:00
Takahito Yamatoya
0f539adab9 📝 Update as upstream
[ci skip]
2016-02-01 00:20:36 +09:00
wgrafael
07721c28b6 update the "janelas" to "windows"
System Operation windows and not literal windows!
2016-01-31 00:02:06 -02:00
Heilig Benedek
61e0219e91 Added documentation, restructured the files to fit better with electron's style and fixed a typo in keyboard_util's name. 2016-01-31 02:27:14 +01:00
Simon Madine
f9efdc4435 🍎 Add Show to API for OS X 2016-01-30 22:30:38 +01:00
Robo
f7556de9fb add spec for new permissions 2016-01-30 19:10:52 +05:30
Cheng Zhao
0aa0efa439 Do not print warning for FILE_ERROR_NOT_FOUND
Close #4282.
2016-01-30 20:49:35 +08:00
Robo
2a278ceb8f delegate to permission manager for other permissions 2016-01-30 16:49:18 +05:30
Heilig Benedek
0c9174bc7c Introduced the cursor-changed event with one parameter - the name of the cursor type 2016-01-30 06:33:55 +01:00
Cheng Zhao
9d8e23c822 Bump v0.36.7 2016-01-30 13:20:46 +08:00
Cheng Zhao
11e2058136 Merge pull request #4281 from atom/fix-object-destroyed
Fix the occasional `Object has been destroyed` exception in the main process
2016-01-30 13:20:09 +08:00
Cheng Zhao
d2c757e2a5 Merge pull request #4277 from lukeadams/osx-min-version-bump
OS X min version bump (10.8=>10.9)
2016-01-30 13:02:24 +08:00
Cheng Zhao
3f68b2f227 Check whether sender is destroyed before calling sender.send
Fix #4279.
2016-01-30 12:58:21 +08:00
Cheng Zhao
5d16257c2d Fix "Object has been destroyed" error in "page-title-updated" event
Close #4249.
2016-01-30 12:20:28 +08:00
Cheng Zhao
899294a040 win: Don't close the handle since we already closed the fd
Fix #4266.
2016-01-30 11:47:22 +08:00
Heilig Benedek
e22cb0ca9f Merge pull request #1 from atom/master
update as upstream
2016-01-30 00:14:40 +01:00
Simon Madine
6a643ec3c8 Only add Hide if OS_X is defined 2016-01-29 22:51:06 +01:00
Kevin Sawicki
d89bda5c68 Merge pull request #4274 from petrfelzmann/doc-bullets-formatting
fix bullets formatting in documentation
2016-01-29 13:08:13 -08:00
Kevin Sawicki
2194640d20 Merge pull request #4275 from baconface/patch-1
Added missing angle bracket to replace() method
2016-01-29 13:07:29 -08:00
Luke Adams
1002d0de74 Bump minimum OSX version to 10.9 (documentation) 2016-01-29 14:03:49 -06:00
Luke Adams
839612c9ae Bump minimum OSX version to 10.9 2016-01-29 13:57:48 -06:00
Brad Metcalf
bdc2b2559c Added missing angle bracket to replace() method 2016-01-29 13:27:47 -06:00
Petr Felzmann
0169f31feb fix bullets formatting in documentation 2016-01-29 20:10:18 +01:00
Simon Madine
7a370ccd0f 🍎 Add 'Hide' to App API for OS X only 2016-01-29 16:09:54 +01:00
Robo
f32bf08eb3 add spec 2016-01-29 15:23:28 +05:30
Robo
85e13333c3 webview: add permission-request event 2016-01-29 15:23:28 +05:30
Cheng Zhao
30b35644f6 Bump v0.36.6 2016-01-29 12:43:35 +08:00
Cheng Zhao
a26cbf640c docs: cryptographic algorithms used by Electron
Fix #3995.
2016-01-29 12:38:50 +08:00
Cheng Zhao
367590a32f Merge pull request #4264 from atom/revert-3918
Revert "renderer: dont fork the process when there is server redirect"
2016-01-29 12:17:52 +08:00
Cheng Zhao
77cf30f758 Revert "renderer: dont fork the process when there is server redirect"
This reverts commit ab9d1bf97e.
2016-01-29 11:52:31 +08:00
Plusb Preco
0fe829cff7 📝 Update as upstream
[ci skip]
2016-01-29 09:17:34 +08:00
Cheng Zhao
8348910483 Merge pull request #4260 from fbukevin/master
Finished current entries translation of Guides part into zh-TW
2016-01-29 09:14:14 +08:00
fbukevin
8309e38ce9 translate zh-TW tutorial using-pepper-flash-plugin.md 2016-01-28 23:37:16 +08:00
fbukevin
15ce59be64 translate zh-TW tutorial devtools-extension.md 2016-01-28 23:23:19 +08:00
fbukevin
93f268cbd1 translate zh-TW tutorial using-selenium-and-webdriver.md 2016-01-28 22:52:57 +08:00
fbukevin
3b9fb6f9e6 translate zh-TW tutorial debugging-main-process.md 2016-01-28 22:40:13 +08:00
Cheng Zhao
516b01e398 win: Call _close before close file handle
Fix #4258.
2016-01-28 22:38:53 +08:00
fbukevin
7d54bb54cd translate zh-TW tutorial using-native-node-modules.md 2016-01-28 22:17:48 +08:00
fbukevin
4305e98fcb translate zh-TW tutorial mac-app-store-submission-guide.md 2016-01-28 21:16:59 +08:00
Paul Betts
05aeceeb52 Always fall back to OpenFolderViaShell when trying to reveal a file
We should always fallback to OpenFolderViaShell when revealing a file fails,
since this API seems to be highly subject to Random Bad Things happening to
you.
2016-01-28 19:05:16 +08:00
Cheng Zhao
d195cc3796 docs: uploadData is optional 2016-01-28 18:59:58 +08:00
Cheng Zhao
f820b0db83 docs: Revise the webRequest and protocol docs 2016-01-28 18:59:07 +08:00
Cheng Zhao
30ff18ac64 Merge branch 'webrequest_upload_data_patch' of https://github.com/deepak1556/atom-shell into deepak1556-webrequest_upload_data_patch 2016-01-28 18:41:39 +08:00
fbukevin
223b440bc8 prepare for retaining "Guides" pages 2016-01-28 18:20:39 +08:00
Veck Hsiao
3c9e08faf1 finished translate application-packaging.md 2016-01-28 18:15:44 +08:00
fbukevin
1da13625d1 WIP: docs-translations/zh-TW/tutorial/application-packaging.md 2016-01-28 16:46:28 +08:00
fbukevin
e6fbb0adfa translate zh-TW tutorial application-distribution.md 2016-01-28 14:20:35 +08:00
Plusb Preco
172fc91768 📝 Update as upstream
[ci skip]
2016-01-28 10:44:45 +08:00
Cheng Zhao
e9d00b1fc0 Merge pull request #4247 from deepak1556/common_exports_patch
common: export hideInternalModules
2016-01-27 23:20:59 +08:00
Cheng Zhao
c4df96df67 Update brightray to fix compilation error 2016-01-27 23:19:22 +08:00
Robo
a6bcc5d110 common: export hideInternalModules 2016-01-27 18:44:47 +05:30
Robo
dc0151099c session: provide uploadData with webrequest api when available 2016-01-27 18:39:40 +05:30
Cheng Zhao
3ca941a949 Update brightray for #4223 2016-01-27 21:03:23 +08:00
Cheng Zhao
ab96150016 Merge pull request #4246 from fbukevin/master
Add Traditional Chinese Translation Page
2016-01-27 20:12:41 +08:00
Cheng Zhao
f32a486441 Merge pull request #4245 from yamatoya/master
Add Japanes translated docs.
2016-01-27 20:12:14 +08:00
Cheng Zhao
3a5949d66a Merge pull request #4244 from vaenow/patch-1
Update application-distribution.md
2016-01-27 20:11:45 +08:00
Cheng Zhao
1ce85a69b9 Merge pull request #4235 from Bipsync/master
Autoupdate: Fixed crash after update is downloaded on windows
2016-01-27 20:03:51 +08:00
Veck Hsiao
8011578e8c Add Traditional Chinese Translation Page
supported-platforms.md
2016-01-27 14:48:06 +08:00
Takahito Yamatoya
4ab6846123 :memo:Add Japanes translated docs.
[ci skip]
2016-01-27 15:17:24 +09:00
Wen Luo
b01d677086 Update application-distribution.md
Remove duplicated words.
2016-01-27 11:41:03 +08:00
Paul P
cbf11f38ca remove unused variable 2016-01-26 14:55:31 +00:00
Paul P
864449db89 prevent assignment to constant variable (url) 2016-01-26 14:44:46 +00:00
Cheng Zhao
2c7717d98e Merge pull request #4233 from atom/update-node
Ignore errors happened in Node's stdout/stdin stream
2016-01-26 20:50:23 +08:00
Cheng Zhao
f87edba7fb Merge pull request #4231 from yamatoya/master
:memo:Add Japanes translated docs.
2016-01-26 20:32:01 +08:00
Cheng Zhao
d0587a9c52 spec: process.stdout.write 2016-01-26 20:26:42 +08:00
Cheng Zhao
205b2455f2 Update node 2016-01-26 20:23:32 +08:00
Takahito Yamatoya
ab8e6650bd :memo:Add Japanes translated docs.
[ci skip]
2016-01-26 18:17:42 +09:00
Cheng Zhao
4c43be2148 docs: Add more on the "electron.xxx" undefined question 2016-01-26 17:00:12 +08:00
Plusb Preco
2af7c37d13 📝 Update as upstream
[ci skip]
2016-01-26 11:29:19 +08:00
Cheng Zhao
b461969114 docs: Add "require('electron').xxx is undefined." to FAQ 2016-01-25 18:47:46 +08:00
Cheng Zhao
a34618866f Merge pull request #4221 from yamatoya/master
Add Japanes translated docs.
2016-01-25 18:21:46 +08:00
Takahito Yamatoya
d8c8214f33 Add Japanes translated docs. 2016-01-25 18:10:34 +09:00
Cheng Zhao
a83aee90e5 No need to use scoped_nsobject for id 2016-01-25 15:15:58 +08:00
Cheng Zhao
059d97e1aa Merge pull request #4181 from bengotow/scroll-touch-events
Extend NativeWindow to track touch-based scroll events on OS X
2016-01-25 14:47:54 +08:00
Cheng Zhao
58127e3d52 Merge pull request #4217 from yamatoya/master
Add Japanes translated docs, improve a doc style.
2016-01-24 22:42:51 +08:00
Cheng Zhao
253a4f226f Merge pull request #4211 from ragingwind/dock-seticon
Add app.dock.setIcon to change icon of dock
2016-01-24 22:36:28 +08:00
Cheng Zhao
93cdc91f1a Merge pull request #4206 from ragingwind/paramter-consistency
Update name of paramter for consistency
2016-01-24 22:11:01 +08:00
Cheng Zhao
e1e58b642e Merge pull request #4182 from deepak1556/debugger_api_patch
browser: add webContents.debugger api
2016-01-24 21:43:18 +08:00
Cheng Zhao
7761815339 Merge branch 'bg-color-pr' of https://github.com/evgenyzinoviev/electron 2016-01-24 21:33:53 +08:00
Takahito Yamatoya
42493a7ed3 Add Japanes translated docs, improve a doc style. 2016-01-24 19:47:12 +09:00
Cheng Zhao
45798d1933 Merge pull request #4215 from atom/fix-fullscreenable
Add tests for "-able" options and methods
2016-01-24 15:20:16 +08:00
Cheng Zhao
cc560a3900 spec: Fix failing tests on Windows 2016-01-24 14:31:37 +08:00
Cheng Zhao
8239f69139 spec: hasShadow state 2016-01-24 14:31:37 +08:00
Cheng Zhao
c33e8de676 spec: Improve the test for resizable 2016-01-24 14:31:37 +08:00
Cheng Zhao
c41de501cb spec: Test the -able methods 2016-01-24 14:31:37 +08:00
Cheng Zhao
010cc3276a Simplify the setStyleMask calls 2016-01-24 14:31:37 +08:00
Cheng Zhao
239bfe970c Make hasShadow work on Windows/Linux 2016-01-24 14:31:37 +08:00
Cheng Zhao
d704b3f7ba Reorgnize how attributes work 2016-01-24 14:31:37 +08:00
Cheng Zhao
ae7e96f181 Fix fullscreenable on EL Capitan 2016-01-24 14:31:36 +08:00
Cheng Zhao
5372b6cd91 Fullscreenable => FullScreenable 2016-01-24 14:31:36 +08:00
Plusb Preco
d6f2b7c982 📝 Update as upstream
* Update as upstream
* Fix typos
* Improve grammar
[ci skip]
2016-01-24 14:31:23 +08:00
Cheng Zhao
6ab236f9c0 Merge pull request #4204 from yamatoya/master
Add Japanes translated docs.
2016-01-24 14:28:59 +08:00
ragingwind
7229d2462a Add app.dock.setIcon to change icon of dock 2016-01-24 08:30:14 +09:00
ragingwind
09966aec38 Update name of paramter for consistency 2016-01-23 22:59:05 +09:00
Takahito Yamatoya
85df3157c7 Add Japanes translated docs. 2016-01-23 20:03:10 +09:00
Cheng Zhao
31624995bc Merge pull request #4202 from evgenyzinoviev/shadow-pr
Added hasShadow option to BrowserWindow on OS X
2016-01-22 23:56:38 -08:00
Cheng Zhao
8cabe0f008 Merge pull request #4156 from evgenyzinoviev/windows-pr
Improvements in BrowserWindow
2016-01-22 23:42:41 -08:00
Robo
d938dd68b0 wrap debugger for lazy initialization 2016-01-23 09:32:21 +05:30
evgenyzinoviev
000af78d41 doc fix 2016-01-23 01:37:18 +01:00
evgenyzinoviev
e071e4f310 doc updated 2016-01-23 01:20:42 +01:00
evgenyzinoviev
ff41b4a267 added hasShadow option to BrowserWindow (osx) 2016-01-23 01:16:08 +01:00
evgenyzinoviev
2fcd3ce7cd Support alpha in backgroundColor 2016-01-23 00:55:08 +01:00
evgenyzinoviev
85991d312a mac: SetResizable fix 2016-01-22 23:44:17 +01:00
evgenyzinoviev
3182504969 maximizable, fullscreenable docs 2016-01-22 23:32:09 +01:00
evgenyzinoviev
ef51e4e108 maximizable and fullscreenable 2016-01-22 23:21:46 +01:00
Cheng Zhao
9b28b0e943 Merge pull request #4198 from atom/default-popup-x-y
Cleanup the Menu::popup code
2016-01-22 13:33:14 -07:00
Cheng Zhao
984462be44 Remove Menu::Popup 2016-01-22 11:59:08 -07:00
Cheng Zhao
d1051b55cc docs: Default value of positioningItem 2016-01-22 11:32:14 -07:00
Cheng Zhao
2d8e5e3a16 docs: Default parameter for Menu.popup 2016-01-22 11:29:26 -07:00
Cheng Zhao
ca77c95c6d No more need to override Menu::Popup 2016-01-22 11:27:17 -07:00
Cheng Zhao
0e3a3d0748 views: Remove PopupAtPoint 2016-01-22 11:25:16 -07:00
Cheng Zhao
5f195a789a mac: Remove duplicate code of Popup 2016-01-22 11:17:12 -07:00
Cheng Zhao
360266ba5b positioningItem => positioning_item 2016-01-22 10:51:51 -07:00
Cheng Zhao
ea9b0cfed0 Merge pull request #4192 from evgenyzinoviev/menu-pr
Menu.popup: specify positioning item (OS X)
2016-01-22 10:49:17 -07:00
Cheng Zhao
985131d25e Merge pull request #4190 from ragingwind/strict-compare
Using strict comparation
2016-01-22 09:48:40 -07:00
Robo
3a60ab386c add spec 2016-01-22 19:10:48 +05:30
Robo
df5bad3f89 fix api and docs 2016-01-22 10:27:25 +05:30
evgenyzinoviev
072ab0ddea specify positioning item for popup menus 2016-01-22 03:18:27 +01:00
Ben Gotow
d186dceb4b Add correct window check for wheel events. See description
Tested that with two windows, events are fired on the correct BrowserWindow instance and not both, and that scrolling a window which is in the background works properly.
2016-01-21 16:36:48 -08:00
Ben Gotow
e96e674201 Properly clean up NSEvent monitor 2016-01-21 16:31:31 -08:00
Ben Gotow
d492ff45d5 Rename up/down => begin/end 2016-01-21 16:31:09 -08:00
ragingwind
63ae73b281 Using strict comparation 2016-01-22 09:04:59 +09:00
Cheng Zhao
a230a89de4 Bump v0.36.5 2016-01-21 17:04:38 -07:00
Cheng Zhao
b039741c6b Merge pull request #3902 from bengotow/asar-perf
Add env var to export a hint file to optimize ASAR ordering
2016-01-21 16:46:49 -07:00
Jessica Lord
b614c484dc Merge pull request #4189 from atom/update-accelerator
Use Alt in OS X 'Hide Others' menu item accelerator
2016-01-21 16:14:14 -07:00
Jessica Lord
980bc7bf32 Use Alt in accelerator 2016-01-21 15:48:06 -07:00
Ben Gotow
ed34e33fbf Fix typos in environment-variables.md 2016-01-21 14:46:08 -08:00
Ben Gotow
b9d62d2cab Turn on logging via a command line env var 2016-01-21 14:46:08 -08:00
Jessica Lord
1b8200ea34 Merge pull request #4188 from Rosey/update-menu-doc
📝 Use correct shortcut for 'Hide Others' menu item example
2016-01-21 15:45:49 -07:00
Ben Gotow
a3b6f69772 Log ASAR file access to build ordering hint file
This is a work in progress—need to make this behavior optional via a new flag.
2016-01-21 14:45:22 -08:00
Cheng Zhao
21f5e27a5e Merge pull request #4161 from gabriel/master
Support backgroundColor for window on mac
2016-01-21 15:42:21 -07:00
Rose Robertson
859d9763e9 📝 Use correct shortcut for 'Hide Others' menu item example
As per https://support.apple.com/en-gb/HT201236, the correct keyboard shortcut
for hiding all but the current window is Command-Option(Alt)-H.
2016-01-21 14:31:18 -08:00
Plusb Preco
4b02a8ead0 📝 Update as upstream
[ci skip]
2016-01-21 15:23:07 -07:00
Cheng Zhao
bbf622187c Merge pull request #4178 from deepak1556/webview_blinkfeatures_attributes_patch
webview: add blinkfeatures attribute
2016-01-21 15:03:33 -07:00
Cheng Zhao
a98d576b48 Merge pull request #4177 from deepak1556/default_download_dir_patch
browser: change location of default download dir
2016-01-21 14:54:21 -07:00
Cheng Zhao
56e8ddbdaf Merge pull request #4186 from CharlieHess/webview-load-url
Expose loadURL for the webview tag.
2016-01-21 14:53:32 -07:00
Cheng Zhao
000625e23f Merge pull request #4163 from deepak1556/web_preferences_fonts_patch
browser: add font related settings to webpreferences
2016-01-21 14:35:30 -07:00
Charlie Hess
7192a8517b Expose loadURL for the webview tag. 2016-01-21 13:31:35 -08:00
Cheng Zhao
4cf5982e92 Update brightray for #4169 2016-01-21 14:08:10 -07:00
Gabriel Handford
239baa3e9a Support backgroundColor for window on mac 2016-01-21 11:07:33 -08:00
Robo
0e2323c9c8 browser: add webContents.debugger api 2016-01-21 23:52:23 +05:30
Ben Gotow
bd2252ea55 Extend NativeWindow to track touch-based scroll events on OS X
In N1, we want to implement the famous "swipe to archive" action on threads in the user's inbox. Chrome exposes `scroll` and `wheel` events, but these aren't sufficient to implement the interaction because the element needs to "snap" when the user lifts their fingers from the trackpad, not when they / we stop receiving `wheel` / `scroll` events. These events may stop before the user lifts their fingers, or continue after the user has lifted their fingers if they had enough momentum for the gesture to continue.

This exposes BrowserWindow `scroll-touch-down` and `scroll-touch-up`, which fire immeditaely when the user touches two fingers to the trackpad, and again when the user lifts their fingers. Combined with the existing wheel event should allow for "swipe-to-archive" and other similar interactions.

Note: This is only implemented on Mac OS X and the events don't fire unless you're using a trackpad!

Related: #1486, #2683, https://github.com/nylas/N1/issues/541
2016-01-21 09:40:21 -08:00
Kevin Sawicki
fda480d1aa Merge pull request #4172 from atom/enable-eslint-rules
Enable more eslint rules
2016-01-21 09:56:07 -07:00
Kevin Sawicki
3a55647ae3 Add WebView to globals 2016-01-21 09:32:22 -07:00
Kevin Sawicki
b46d8ec91b Enable no-undef eslint rule 2016-01-21 09:32:22 -07:00
Kevin Sawicki
e9b3a51703 Add missing fs require 2016-01-21 09:32:22 -07:00
Kevin Sawicki
669b815758 Add missing semicolons 2016-01-21 09:32:22 -07:00
Kevin Sawicki
b5cf352312 Add globals to eslint config 2016-01-21 09:32:22 -07:00
Kevin Sawicki
b399455808 Run cpplint from lint npm script 2016-01-21 09:32:21 -07:00
Kevin Sawicki
16b4b58de1 e -> error 2016-01-21 09:32:21 -07:00
Kevin Sawicki
b1f679ff6d Clean up semicolon lint errors 2016-01-21 09:32:21 -07:00
Kevin Sawicki
70bcb0ac5a Clean up no-unused-vars lint errors 2016-01-21 09:32:21 -07:00
Kevin Sawicki
ccce284a5b Clean up no-empty lint errors 2016-01-21 09:32:21 -07:00
Kevin Sawicki
4f4456bde8 Clean up indent eslint errors 2016-01-21 09:32:21 -07:00
Kevin Sawicki
45ddbb6d67 Clean up no-unreachable lint errors 2016-01-21 09:32:21 -07:00
Kevin Sawicki
fbfbf2158a Add npm run lint script 2016-01-21 09:32:21 -07:00
Robo
fab34b400e webview: add blinkfeatures attribute 2016-01-21 15:43:41 +05:30
Robo
c14dd71df1 browser: change location of default download dir 2016-01-21 13:51:37 +05:30
Robo
8a00406862 browser: add font related settings to webpreferences 2016-01-21 13:30:05 +05:30
Cheng Zhao
2e8a2c3a7f Merge pull request #4170 from arniu/patch-1
Update coding-style.md
2016-01-20 15:47:32 -07:00
Cheng Zhao
2fba39d719 Merge pull request #4166 from ragingwind/patch-1
Add Korean community
2016-01-20 15:34:31 -07:00
Cheng Zhao
40557083f0 Merge pull request #4164 from deepak1556/menu_toggle_crash_patch
browser: fix crash when switching to sibling menu from submenus
2016-01-20 15:32:53 -07:00
Cheng Zhao
ee2d2cc532 Merge pull request #4165 from yamatoya/master
Add Japanes translated docs.
2016-01-20 15:28:17 -07:00
Kevin Sawicki
cac8466fb1 Merge pull request #4168 from atom/cpplint-utility-folder
Run cpplint on utility folder
2016-01-20 10:00:50 -07:00
Cheng Zhao
5bd2d4b08d docs: win.destroy() is safe 2016-01-20 09:46:38 -07:00
Kevin Sawicki
8140adb6bc Remove trailing whitespace 2016-01-20 09:43:32 -07:00
Kevin Sawicki
5d249e2a94 Run cpplint on utility folder 2016-01-20 09:43:32 -07:00
Cheng Zhao
54b5369215 Merge pull request #4158 from atom/desktop-capturer-error-message
Fix error calling desktopCapturer.getSources twice
2016-01-20 09:42:51 -07:00
Hailin Tseng
f1ef24b359 Update coding-style.md 2016-01-21 00:03:41 +08:00
Jimmy Moon
9a82c5a1c0 Add Korean community 2016-01-20 19:05:35 +09:00
Takahito Yamatoya
a874abd5a8 Add Japanes translated docs. 2016-01-20 16:09:01 +09:00
Robo
65325dc63f browser: fix crash when switching to sibling menu from submenus 2016-01-20 10:54:12 +05:30
Cheng Zhao
af3def91f2 Merge pull request #4146 from yamatoya/master
Add Japanes translated docs.
2016-01-19 12:12:41 -08:00
Kevin Sawicki
b014eea8d3 Tweak spec description 2016-01-19 11:05:57 -08:00
Kevin Sawicki
517dce443b Remove unused errorMessage reference 2016-01-19 11:02:12 -08:00
Kevin Sawicki
c719b252cb Add failing spec 2016-01-19 10:57:18 -08:00
Kevin Sawicki
fb3ab9e1f1 Use const and remove extra returns 2016-01-19 10:54:12 -08:00
Kevin Sawicki
01e1d0dfef Merge pull request #4153 from sunaiwen/patch-1
Update debugging-main-process.md
2016-01-19 10:12:26 -08:00
Kevin Sawicki
d3186a9665 Merge pull request #4150 from hamxiaoz/patch-1
Fix a broken link
2016-01-19 10:10:17 -08:00
evgenyzinoviev
fd5c249cb8 fix for windows 2016-01-19 16:58:19 +01:00
evgenyzinoviev
0a79204abb IsMovable to return true on Linux 2016-01-19 16:44:04 +01:00
evgenyzinoviev
c3049e1e99 docs updated 2016-01-19 16:14:59 +01:00
evgenyzinoviev
2a554cb138 added or/and improved closable, minimizable, movable, resizable features for windows on os x and windows 2016-01-19 16:14:57 +01:00
Takahito Yamatoya
140bc4effc Add Japanes translated docs. 2016-01-19 17:23:17 +09:00
Niven Su
b9c9da3f4e Update debugging-main-process.md
fix doc typo
2016-01-19 13:49:49 +08:00
Andrew Zheng
b4aaaed843 Fix a broken link
The reference-style link uses a relative path, which doesn't work well on the main site http://electron.atom.io/.
2016-01-18 13:50:33 -08:00
Takahito Yamatoya
fc42e97144 Add Japanes translated docs. 2016-01-18 23:38:44 +09:00
Cheng Zhao
7842a657d0 Merge pull request #4142 from Rokt33r/patch-2
Update frameless-window.md
2016-01-18 18:33:03 +08:00
Dick Choi
2907c4f068 Update frameless-window.md
`-title-bar-style` => `titleBarStyle“

https://github.com/atom/electron/blob/master/docs/api/browser-window.md#class-browserwindow
2016-01-18 18:35:14 +09:00
Cheng Zhao
307add22b2 Merge pull request #4138 from yamatoya/master
Add Japanes translated docs.
2016-01-18 15:37:07 +08:00
Takahito Yamatoya
def1477466 Add Japanes translated docs. 2016-01-18 01:00:28 +09:00
Cheng Zhao
40a93f1374 Merge pull request #4135 from atom/add-npm-start
Add npm start script
2016-01-17 14:33:28 +08:00
Kevin Sawicki
4e183df997 Add npm start script 2016-01-16 12:31:09 -08:00
Cheng Zhao
6f1fe2e478 Merge pull request #4133 from yamatoya/master
Update Japanese translated docs.
2016-01-17 00:11:52 +08:00
Takahito Yamatoya
6ecacd18be Update Japanese translated docs. 2016-01-17 01:02:02 +09:00
Cheng Zhao
3b62ce7fa6 modules.exports => module.exports 2016-01-16 14:26:01 +08:00
Cheng Zhao
775e475d5c Merge pull request #4131 from etiktin/add_is_DWM_enabled
Add API for checking if DWM composition (Aero Glass) is enabled
2016-01-16 14:16:22 +08:00
Cheng Zhao
5a83f94524 Merge pull request #4126 from atom/add-eslint
Run eslint on CI
2016-01-16 13:26:07 +08:00
Cheng Zhao
25afcf2673 Merge pull request #4121 from atom/format-coffee-helpers
Format leftover CoffeeScript helpers
2016-01-16 13:24:26 +08:00
Eran Tiktin
f42d283fcd Add documentation 2016-01-16 07:18:20 +02:00
Eran Tiktin
83b36ce40b Add API for checking if AeroGlass/DWM is enabled
Resolves #1020
2016-01-16 06:27:44 +02:00
Cheng Zhao
712f11a9a3 Merge pull request #4112 from evgenyzinoviev/resize-animate-pr
Animate window resizing on OS X
2016-01-16 12:12:00 +08:00
Cheng Zhao
b132c0dde8 Update brightray, close #4124 2016-01-16 11:43:46 +08:00
Cheng Zhao
d779f8d898 Merge pull request #4129 from etiktin/fix_4127
Fix freeing asar fd on Windows
2016-01-16 11:41:28 +08:00
Eran Tiktin
85449e953e Fix Windows crash when trying to free asar fd 2016-01-16 03:48:07 +02:00
Kevin Sawicki
0fe539f2c3 Remove unneeded semicolon 2016-01-15 15:30:07 -08:00
Kevin Sawicki
ae20292322 Add missing { 2016-01-15 15:30:07 -08:00
Kevin Sawicki
f830af49c2 Use ES6 style class 2016-01-15 15:30:01 -08:00
Kevin Sawicki
503cd04c75 Disable linebreak-style rule 2016-01-15 14:58:46 -08:00
Kevin Sawicki
da120d8874 Lint entire atom folder 2016-01-15 14:43:23 -08:00
Kevin Sawicki
2869869a99 Combine duplicate eslint keys 2016-01-15 14:40:37 -08:00
Kevin Sawicki
1d3e7dc6e4 Run eslint on CI 2016-01-15 14:38:07 -08:00
Kevin Sawicki
b87599a6a2 Rename eslintrc-src to eslintrc-base 2016-01-15 14:37:51 -08:00
Kevin Sawicki
5fc671f522 Add back v8Util binding 2016-01-15 14:29:36 -08:00
Kevin Sawicki
aab2821122 Use ES6 style class 2016-01-15 14:28:12 -08:00
Kevin Sawicki
aab1568682 Use ES6 style class 2016-01-15 14:16:38 -08:00
Kevin Sawicki
02f055b784 Use ES6 style class 2016-01-15 14:12:57 -08:00
Kevin Sawicki
756f8039e5 Lint spec js files 2016-01-15 14:02:05 -08:00
Kevin Sawicki
0a3331a07c Add eslint dev dependency 2016-01-15 13:52:42 -08:00
Kevin Sawicki
4db4d409a7 Add initial eslint script 2016-01-15 13:52:18 -08:00
Kevin Sawicki
ad3376b9dc Add initial eslint config 2016-01-15 13:37:03 -08:00
Kevin Sawicki
caf7cf5582 Use const instead of var 2016-01-15 11:46:52 -08:00
Eran Tiktin
b9789ef191 Merge pull request #11 from atom/master
Update from upstream
2016-01-15 21:00:37 +02:00
Kevin Sawicki
79f1029d59 Remove unneeded .constructor segments 2016-01-15 10:29:00 -08:00
Kevin Sawicki
34030d7b2b Use util.inherits instead of CoffeeScript's extend function 2016-01-15 10:17:45 -08:00
Kevin Sawicki
2b95aeba3c Declare vars one per line 2016-01-15 10:17:45 -08:00
Kevin Sawicki
2833db78ad Use [].inclues where appropriate 2016-01-15 10:17:45 -08:00
Kevin Sawicki
c2d473cf65 Remove unneeded [].indexOf fallback 2016-01-15 10:17:45 -08:00
Kevin Sawicki
1b0da44f38 Merge pull request #4122 from atom/remove-cpp-lint-warning
Fix lint errors in archive.cc
2016-01-15 10:17:16 -08:00
Kevin Sawicki
741d148776 Add missing semicolon 2016-01-15 10:09:19 -08:00
Kevin Sawicki
b119704ea9 Use 2 space indent instead of 3 2016-01-15 10:05:35 -08:00
evgenyzinoviev
64f310168c code style fix 2016-01-15 17:40:42 +01:00
evgenyzinoviev
b75dccb0be arguments handing rewritten, doc updated 2016-01-15 17:31:31 +01:00
Cheng Zhao
63278aeec2 Merge pull request #4118 from Ivshti/patch-1
Ensure we close FD on Windows
2016-01-15 23:58:57 +08:00
Cheng Zhao
d6e2db22b3 Merge pull request #4116 from 0b61d29/patch-1
Spelling: bellow → below
2016-01-15 23:33:25 +08:00
Cheng Zhao
7e7175b6a5 Merge pull request #4113 from importcjj/master
fix incorrect markdown tag
2016-01-15 23:32:39 +08:00
Cheng Zhao
0937144849 Merge pull request #4111 from evgenyzinoviev/movable
Added an option to prevent a window from being moved on OS X
2016-01-15 23:24:22 +08:00
evgenyzinoviev
4b0119f996 added a note that this option is only implemented on osx 2016-01-15 16:02:23 +01:00
Ivo Georgiev
7586078d0a Ensure we close FD on Windows 2016-01-15 16:54:29 +02:00
Florian Hämmerle
187cb54c25 spelling: bellow -> below 2016-01-15 13:43:44 +01:00
Cheng Zhao
233e2d7288 Merge pull request #4082 from atom/web-contents-lifetime
Fix some junk output when running tests
2016-01-15 17:24:47 +08:00
Cheng Zhao
9ccc7ee30d Small ajustments on lifetime of webContents 2016-01-15 16:36:35 +08:00
Cheng Zhao
63c646242a spec: Group session.cookies tests 2016-01-15 16:36:35 +08:00
Cheng Zhao
60d44b3b04 spec: Remove annoying outputs from savePage test 2016-01-15 16:36:35 +08:00
Cheng Zhao
c10c419f1d No need to call sender.callbacks.remove
The IDWeakMap automatically removes the key when object is garbage
collected.
2016-01-15 16:36:35 +08:00
Cheng Zhao
3875b30fcf Merge pull request #4109 from atom/const
[WIP] Use `const` for requires
2016-01-15 16:32:07 +08:00
Importcjj
a5cc105311 fix incorrect markdown tag 2016-01-15 15:26:16 +08:00
evgenyzinoviev
f93d890874 Fix doc 2016-01-15 06:00:06 +01:00
evgenyzinoviev
2598b00b41 Animate window resizing on OS X 2016-01-15 05:59:58 +01:00
evgenyzinoviev
cda88db77c Added option to prevent a window from being moved on OS X 2016-01-15 03:58:57 +01:00
Jessica Lord
003de0debe Clean up variable declarations 2016-01-14 18:07:29 -08:00
Jessica Lord
5a4a8e1fa7 🔥 stray ref 2016-01-14 17:03:55 -08:00
Jessica Lord
ae2893ceaa Inline var 2016-01-14 15:44:33 -08:00
Jessica Lord
5412ecdcc1 Use const 2016-01-14 14:52:05 -08:00
Jessica Lord
ab8908a4af Use const 2016-01-14 14:41:46 -08:00
Jessica Lord
1779701445 Use const 2016-01-14 14:40:12 -08:00
Jessica Lord
3a0fb42737 Use const 2016-01-14 14:33:45 -08:00
Jessica Lord
9103253f62 Use const 2016-01-14 14:26:10 -08:00
902 changed files with 44918 additions and 17901 deletions

1
.gitignore vendored
View File

@@ -6,6 +6,7 @@
/external_binaries/
/out/
/vendor/brightray/vendor/download/
/vendor/debian_wheezy_amd64-sysroot/
/vendor/debian_wheezy_arm-sysroot/
/vendor/debian_wheezy_i386-sysroot/
/vendor/python_26/

8
.gitmodules vendored
View File

@@ -1,21 +1,21 @@
[submodule "vendor/brightray"]
path = vendor/brightray
url = https://github.com/atom/brightray.git
url = https://github.com/electron/brightray.git
[submodule "vendor/node"]
path = vendor/node
url = https://github.com/atom/node.git
url = https://github.com/electron/node.git
[submodule "vendor/depot_tools"]
path = vendor/depot_tools
url = https://chromium.googlesource.com/chromium/tools/depot_tools.git
[submodule "vendor/breakpad"]
path = vendor/breakpad
url = https://github.com/atom/chromium-breakpad.git
url = https://github.com/electron/chromium-breakpad.git
[submodule "vendor/native_mate"]
path = vendor/native_mate
url = https://github.com/zcbenz/native-mate.git
[submodule "vendor/crashpad"]
path = vendor/crashpad
url = https://github.com/atom/crashpad.git
url = https://github.com/electron/crashpad.git
[submodule "vendor/requests"]
path = vendor/requests
url = https://github.com/kennethreitz/requests

1
.node-version Normal file
View File

@@ -0,0 +1 @@
v6.1.0

View File

@@ -19,8 +19,7 @@ matrix:
- os: linux
env: TARGET_ARCH=ia32
allow_failures:
- env: TARGET_ARCH=arm
- env: TARGET_ARCH=ia32
- os: osx
script: './script/cibuild'

View File

@@ -1,24 +1,46 @@
# Contributor Code of Conduct
# Contributor Covenant Code of Conduct
As contributors and maintainers of this project, and in the interest of fostering an open and welcoming community, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
## Our Pledge
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, or nationality.
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
- The use of sexualized language or imagery
- Personal attacks
- Trolling or insulting/derogatory comments
- Public or private harassment
- Publishing other's private information, such as physical or electronic addresses, without explicit permission
- Other unethical or unprofessional conduct
* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
By adopting this Code of Conduct, project maintainers commit themselves to fairly and consistently applying these principles to every aspect of managing this project. Project maintainers who do not follow or enforce the Code of Conduct may be permanently removed from the project team.
## Scope
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community.
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting a project maintainer at [atom@github.com](mailto:atom@github.com). All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. Maintainers are obligated to maintain confidentiality with regard to the reporter of an incident.
## Enforcement
This Code of Conduct is adapted from the Contributor Covenant, version 1.3.0, available from http://contributor-covenant.org/version/1/3/0/
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [electron@github.com](mailto:electron@github.com). All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/

View File

@@ -1,10 +1,10 @@
# Electron에 기여하기
:+1::tada: 먼저, 이 프로젝트에 기여해주셔서 감사합니다! :tada::+1:
:+1::tada: 먼저, 기여에 관심을 가져주셔서 감사합니다! :tada::+1:
이 프로젝트는 기여자 규약 [행동강령](CODE_OF_CONDUCT.md)을 준수합니다. 따라서 이
이 프로젝트는 기여자 규약 [행동강령](CODE_OF_CONDUCT.md)을 준수합니다. 따라서 이
프로젝트의 개발에 참여하려면 이 규약을 지켜야 합니다. 받아들일 수 없는 행위를 발견했을
경우 atom@github.com로 보고 하십시오.
경우 atom@github.com로 보고하세요.
다음 항목들은 Electron에 기여하는 가이드라인을 제시합니다.
참고로 이 항목들은 그저 가이드라인에 불과하며 규칙이 아닙니다. 따라서 스스로의 적절한
@@ -12,7 +12,7 @@
## 이슈 제출
* [여기](https://github.com/atom/electron/issues/new)에서 새로운 이슈를 만들 수
* [여기](https://github.com/electron/electron/issues/new)에서 새로운 이슈를 만들 수
있습니다. 하지만 이슈를 작성하기 전에 아래의 항목들을 숙지하고 가능한한 이슈 보고에
대해 최대한 많은 정보와 자세한 설명을 포함해야 합니다. 가능하다면 다음 항목을 포함해야
합니다:
@@ -23,18 +23,18 @@
* 추가로 다음 사항을 준수하면 이슈를 해결하는데 큰 도움이 됩니다:
* 스크린샷 또는 GIF 애니메이션 이미지들
* 터미널에 출력된 에러의 내용 또는 개발자 도구, 알림창에 뜬 내용
* [Cursory search](https://github.com/atom/electron/issues?utf8=✓&q=is%3Aissue+)를
* [Cursory search](https://github.com/electron/electron/issues?utf8=✓&q=is%3Aissue+)를
통해 이미 비슷한 내용의 이슈가 등록되어있는지 확인
## Pull Request 하기
* 가능한한 스크린샷과 GIF 애니메이션 이미지를 pull request에 추가
* CoffeeScript, JavaScript, C++과 Python등
[참조문서에 정의된 코딩스타일](/docs-translations/ko-KR/development/coding-style.md)을
* JavaScript, C++과 Python등
[참조 문서에 정의된 코딩스타일](/docs-translations/ko-KR/development/coding-style.md)을
준수
* [문서 스타일 가이드](/docs-translations/ko-KR/styleguide.md)에 따라 문서를
[Markdown](https://daringfireball.net/projects/markdown) 형식으로 작성.
* 짧은, 현재 시제 커밋 메시지 사용. [커밋 메시지 스타일 가이드](#Git-커밋-메시지)를
* 짧은, 현재 시제 커밋 메시지 사용. [커밋 메시지 스타일 가이드](#git-커밋-메시지)를
참고하세요
## 스타일 가이드
@@ -58,7 +58,7 @@
### Git 커밋 메시지
* 현재 시제 사용 ("Added feature" 대신 "Add feature" 사용)
* 필수적 분위기(imperative mood) 사용 ("Moves cursor to..." 대신 "Move cursor to..." 사용)
* 명령법(imperative mood) 사용 ("Moves cursor to..." 대신 "Move cursor to..." 사용)
* 첫 줄은 72자에 맞추거나 그 보다 적게 제한
* 자유롭게 필요에 따라 이슈나 PR링크를 참조
* 단순한 문서 변경일 경우 `[ci skip]`을 커밋 메시지에 추가

View File

@@ -12,7 +12,7 @@ propose changes to this document in a pull request.
## Submitting Issues
* You can create an issue [here](https://github.com/atom/electron/issues/new),
* You can create an issue [here](https://github.com/electron/electron/issues/new),
but before doing that please read the notes below and include as many details as
possible with your report. If you can, please include:
* The version of Electron you are using
@@ -22,13 +22,13 @@ possible with your report. If you can, please include:
* Other things that will help resolve your issue:
* Screenshots and animated GIFs
* Error output that appears in your terminal, dev tools or as an alert
* Perform a [cursory search](https://github.com/atom/electron/issues?utf8=✓&q=is%3Aissue+)
* Perform a [cursory search](https://github.com/electron/electron/issues?utf8=✓&q=is%3Aissue+)
to see if a similar issue has already been submitted
## Submitting Pull Requests
* Include screenshots and animated GIFs in your pull request whenever possible.
* Follow the CoffeeScript, JavaScript, C++ and Python [coding style defined in docs](/docs/development/coding-style.md).
* Follow the JavaScript, C++, and Python [coding style defined in docs](/docs/development/coding-style.md).
* Write documentation in [Markdown](https://daringfireball.net/projects/markdown).
See the [Documentation Styleguide](/docs/styleguide.md).
* Use short, present tense commit messages. See [Commit Message Styleguide](#git-commit-messages).

2
ISSUE_TEMPLATE.md Normal file
View File

@@ -0,0 +1,2 @@
* Electron version:
* Operating system:

View File

@@ -1,30 +1,30 @@
[![Electron Logo](http://electron.atom.io/images/electron-logo.svg)](http://electron.atom.io/)
[![Build Status](https://travis-ci.org/atom/electron.svg?branch=master)](https://travis-ci.org/atom/electron)
[![devDependency Status](https://david-dm.org/atom/electron/dev-status.svg)](https://david-dm.org/atom/electron#info=devDependencies)
[![Travis Build Status](https://travis-ci.org/electron/electron.svg?branch=master)](https://travis-ci.org/electron/electron)
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/kvxe4byi7jcxbe26/branch/master?svg=true)](https://ci.appveyor.com/project/Atom/electron)
[![devDependency Status](https://david-dm.org/electron/electron/dev-status.svg)](https://david-dm.org/electron/electron#info=devDependencies)
[![Join the Electron Community on Slack](http://atom-slack.herokuapp.com/badge.svg)](http://atom-slack.herokuapp.com/)
### [Electron](https://github.com/atom/electron/) 한국어 참조문서
:zap: *프레임워크 이름이 Atom Shell에서 Electron으로 변경되었습니다* :zap:
### [Electron](https://github.com/electron/electron/) 한국어 참조 문서
Electron 프레임워크는 JavaScript, HTML 그리고 CSS를 사용하여
Cross-Platform 데스크톱 어플리케이션을 개발할 수 있도록 해주는 프레임워크입니다.
[Node.js](https://nodejs.org/)와 [Chromium](http://www.chromium.org)을 기반으로
만들어졌으며 [Atom Editor](https://github.com/atom/atom)에 사용되고 있습니다.
더 많은 어플리케이션은 [이곳](http://electron.atom.io/apps)에서 확인하세요.
Electron에 대한 중요한 알림을 받고 싶다면 Twitter에서
[@ElectronJS](https://twitter.com/electronjs)를 팔로우 하세요.
이 프로젝트는 기여자 규약 [행동강령](CODE_OF_CONDUCT.md)을 준수합니다. 따라서 이
이 프로젝트는 기여자 규약 [행동강령](CODE_OF_CONDUCT.md)을 준수합니다. 따라서 이
프로젝트의 개발에 참여하려면 이 규약을 지켜야 합니다. 받아들일 수 없는 행위를 발견했을
경우 atom@github.com로 보고 하십시오.
경우 electron@github.com로 보고하세요.
## 다운로드
Linux, Windows, OS X 용으로 미리 빌드된 Electron 바이너리와 디버그 심볼이 준비되어
있습니다. [releases](https://github.com/atom/electron/releases) 페이지에서 받아 볼
수 있습니다.
있습니다. [releases](https://github.com/electron/electron/releases) 페이지에서
받아 볼 수 있습니다.
또한 [`npm`](https://docs.npmjs.com/)을 통해 미리 빌드된 Electron 바이너리를 설치할
수도 있습니다:
@@ -43,24 +43,26 @@ npm install electron-prebuilt --save-dev
## 참조 문서
[Docs](https://github.com/atom/electron/tree/master/docs/README.md)에 개발 지침과
API 레퍼런스가 있습니다. Electron을 빌드 하는 방법과 프로젝트에 기여하는법 또한 문서에
포함되어 있으니 참고하시기 바랍니다.
[Docs](https://github.com/electron/electron/tree/master/docs-translations/ko-KR/README.md)에
개발 지침과 API 레퍼런스가 있습니다. Electron을 빌드 하는 방법과 프로젝트에 기여하는법
또한 문서에 포함되어 있으니 참고하시기 바랍니다.
## 참조 문서 (번역)
- [브라질 포르투갈어](https://github.com/atom/electron/tree/master/docs-translations/pt-BR)
- [한국어](https://github.com/atom/electron/tree/master/docs-translations/ko-KR)
- [일본어](https://github.com/atom/electron/tree/master/docs-translations/jp)
- [스페인어](https://github.com/atom/electron/tree/master/docs-translations/es)
- [중국어 간체](https://github.com/atom/electron/tree/master/docs-translations/zh-CN)
- [중국어 번체](https://github.com/atom/electron/tree/master/docs-translations/zh-TW)
- [우크라이나](https://github.com/atom/electron/tree/master/docs-translations/uk-UA)
- [러시아](https://github.com/atom/electron/tree/master/docs-translations/ru-RU)
- [브라질 포르투갈어](https://github.com/electron/electron/tree/master/docs-translations/pt-BR)
- [한국어](https://github.com/electron/electron/tree/master/docs-translations/ko-KR)
- [일본어](https://github.com/electron/electron/tree/master/docs-translations/jp)
- [스페인어](https://github.com/electron/electron/tree/master/docs-translations/es)
- [중국어 간체](https://github.com/electron/electron/tree/master/docs-translations/zh-CN)
- [중국어 번체](https://github.com/electron/electron/tree/master/docs-translations/zh-TW)
- [터키](https://github.com/electron/electron/tree/master/docs-translations/tr-TR)
- [우크라이나](https://github.com/electron/electron/tree/master/docs-translations/uk-UA)
- [러시아어](https://github.com/electron/electron/tree/master/docs-translations/ru-RU)
- [프랑스어](https://github.com/electron/electron/tree/master/docs-translations/fr-FR)
## 시작하기
[`atom/electron-quick-start`](https://github.com/atom/electron-quick-start)
[`electron/electron-quick-start`](https://github.com/electron/electron-quick-start)
저장소를 클론하여 Electron을 간단히 접해볼 수 있습니다.
## 커뮤니티
@@ -70,8 +72,9 @@ API 레퍼런스가 있습니다. Electron을 빌드 하는 방법과 프로젝
- Atom 포럼의 [`electron`](http://discuss.atom.io/c/electron) 카테고리
- Freenode 채팅의 `#atom-shell` 채널
- Slack의 [`Atom`](http://atom-slack.herokuapp.com/) 채널
- [`electron-br`](https://electron-br.slack.com) *(브라질 포르투갈어)*
- [`electron-br`](https://electron-br.slack.com) *(브라질)* 커뮤니티
- [`electron-kr`](http://www.meetup.com/electron-kr/) *(한국)* 커뮤니티
- [`electron-jp`](https://electron-jp-slackin.herokuapp.com/) *(일본)* 커뮤니티
[awesome-electron](https://github.com/sindresorhus/awesome-electron) 프로젝트에
커뮤니티가 운영중인 유용한 예 어플리케이션과 도구, 리소스가 있으니 한번 참고해 보시기
바랍니다.
커뮤니티가 운영중인 유용한 예 어플리케이션과 도구, 리소스가 있으니 참고하기 바랍니다.

View File

@@ -1,27 +1,26 @@
[![Electron Logo](http://electron.atom.io/images/electron-logo.svg)](http://electron.atom.io/)
[![Build Status](https://travis-ci.org/atom/electron.svg?branch=master)](https://travis-ci.org/atom/electron)
[![devDependency Status](https://david-dm.org/atom/electron/dev-status.svg)](https://david-dm.org/atom/electron#info=devDependencies)
[![Travis Build Status](https://travis-ci.org/electron/electron.svg?branch=master)](https://travis-ci.org/electron/electron)
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/kvxe4byi7jcxbe26/branch/master?svg=true)](https://ci.appveyor.com/project/Atom/electron)
[![devDependency Status](https://david-dm.org/electron/electron/dev-status.svg)](https://david-dm.org/electron/electron#info=devDependencies)
[![Join the Electron Community on Slack](http://atom-slack.herokuapp.com/badge.svg)](http://atom-slack.herokuapp.com/)
:zap: *Formerly known as Atom Shell* :zap:
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 in the [Atom
editor](https://github.com/atom/atom).
[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).
Follow [@ElectronJS](https://twitter.com/electronjs) on Twitter for important
announcements.
This project adheres to the Contributor Covenant [code of conduct](CODE_OF_CONDUCT.md).
By participating, you are expected to uphold this code. Please report unacceptable
behavior to atom@github.com.
behavior to electron@github.com.
## Downloads
Prebuilt binaries and debug symbols of Electron for Linux, Windows and OS X can
be found on the [releases](https://github.com/atom/electron/releases) page.
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:
@@ -41,23 +40,25 @@ npm install electron-prebuilt --save-dev
## Documentation
Guides and the API reference are located in the
[docs](https://github.com/atom/electron/tree/master/docs) directory. It also
[docs](https://github.com/electron/electron/tree/master/docs) directory. It also
contains documents describing how to build and contribute to Electron.
## Documentation Translations
- [Brazilian Portuguese](https://github.com/atom/electron/tree/master/docs-translations/pt-BR)
- [Korean](https://github.com/atom/electron/tree/master/docs-translations/ko-KR)
- [Japanese](https://github.com/atom/electron/tree/master/docs-translations/jp)
- [Spanish](https://github.com/atom/electron/tree/master/docs-translations/es)
- [Simplified Chinese](https://github.com/atom/electron/tree/master/docs-translations/zh-CN)
- [Traditional Chinese](https://github.com/atom/electron/tree/master/docs-translations/zh-TW)
- [Ukrainian](https://github.com/atom/electron/tree/master/docs-translations/uk-UA)
- [Russian](https://github.com/atom/electron/tree/master/docs-translations/ru-RU)
- [Brazilian Portuguese](https://github.com/electron/electron/tree/master/docs-translations/pt-BR)
- [Korean](https://github.com/electron/electron/tree/master/docs-translations/ko-KR)
- [Japanese](https://github.com/electron/electron/tree/master/docs-translations/jp)
- [Spanish](https://github.com/electron/electron/tree/master/docs-translations/es)
- [Simplified Chinese](https://github.com/electron/electron/tree/master/docs-translations/zh-CN)
- [Traditional Chinese](https://github.com/electron/electron/tree/master/docs-translations/zh-TW)
- [Turkish](https://github.com/electron/electron/tree/master/docs-translations/tr-TR)
- [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)
## Quick Start
Clone and run the [`atom/electron-quick-start`](https://github.com/atom/electron-quick-start)
Clone and run the [`electron/electron-quick-start`](https://github.com/electron/electron-quick-start)
repository to see a minimal Electron app in action.
## Community
@@ -69,6 +70,8 @@ forums
- `#atom-shell` channel on Freenode
- [`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)*
Check out [awesome-electron](https://github.com/sindresorhus/awesome-electron)
for a community maintained list of useful example apps, tools and resources.

View File

@@ -2,6 +2,8 @@
# http://www.appveyor.com/docs/appveyor-yml
version: "{build}"
os: Visual Studio 2015
init:
- git config --global core.autocrlf input
@@ -10,7 +12,7 @@ platform:
- x64
install:
- cmd: SET PATH=C:\Program Files (x86)\MSBuild\12.0\bin\;%PATH%
- cmd: SET PATH=C:\Program Files (x86)\MSBuild\14.0\bin\;%PATH%
- cmd: SET PATH=C:\python27;%PATH%
- cmd: python script/cibuild

View File

@@ -89,11 +89,9 @@ content::PepperPluginInfo CreateWidevineCdmInfo(const base::FilePath& path,
// Add the supported codecs as if they came from the component manifest.
std::vector<std::string> codecs;
codecs.push_back(kCdmSupportedCodecVorbis);
codecs.push_back(kCdmSupportedCodecVp8);
codecs.push_back(kCdmSupportedCodecVp9);
#if defined(USE_PROPRIETARY_CODECS)
codecs.push_back(kCdmSupportedCodecAac);
codecs.push_back(kCdmSupportedCodecAvc1);
#endif // defined(USE_PROPRIETARY_CODECS)
std::string codec_string = base::JoinString(
@@ -126,7 +124,7 @@ void ConvertStringWithSeparatorToVector(std::vector<std::string>* vec,
void AddPepperFlashFromCommandLine(
std::vector<content::PepperPluginInfo>* plugins) {
auto command_line = base::CommandLine::ForCurrentProcess();
auto flash_path = command_line->GetSwitchValueNative(
base::FilePath flash_path = command_line->GetSwitchValuePath(
switches::kPpapiFlashPath);
if (flash_path.empty())
return;
@@ -134,20 +132,19 @@ void AddPepperFlashFromCommandLine(
auto flash_version = command_line->GetSwitchValueASCII(
switches::kPpapiFlashVersion);
plugins->push_back(
CreatePepperFlashInfo(base::FilePath(flash_path), flash_version));
plugins->push_back(CreatePepperFlashInfo(flash_path, flash_version));
}
#if defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS)
void AddWidevineCdmFromCommandLine(
std::vector<content::PepperPluginInfo>* plugins) {
auto command_line = base::CommandLine::ForCurrentProcess();
auto widevine_cdm_path = command_line->GetSwitchValueNative(
base::FilePath widevine_cdm_path = command_line->GetSwitchValuePath(
switches::kWidevineCdmPath);
if (widevine_cdm_path.empty())
return;
if (!base::PathExists(base::FilePath(widevine_cdm_path)))
if (!base::PathExists(widevine_cdm_path))
return;
auto widevine_cdm_version = command_line->GetSwitchValueASCII(
@@ -155,7 +152,7 @@ void AddWidevineCdmFromCommandLine(
if (widevine_cdm_version.empty())
return;
plugins->push_back(CreateWidevineCdmInfo(base::FilePath(widevine_cdm_path),
plugins->push_back(CreateWidevineCdmInfo(widevine_cdm_path,
widevine_cdm_version));
}
#endif
@@ -182,14 +179,8 @@ base::string16 AtomContentClient::GetLocalizedString(int message_id) const {
void AtomContentClient::AddAdditionalSchemes(
std::vector<url::SchemeWithType>* standard_schemes,
std::vector<url::SchemeWithType>* referrer_schemes,
std::vector<std::string>* savable_schemes) {
std::vector<std::string> schemes;
ConvertStringWithSeparatorToVector(&schemes, ",",
switches::kRegisterStandardSchemes);
if (!schemes.empty()) {
for (const std::string& scheme : schemes)
standard_schemes->push_back({scheme.c_str(), url::SCHEME_WITHOUT_PORT});
}
standard_schemes->push_back({"chrome-extension", url::SCHEME_WITHOUT_PORT});
}

View File

@@ -25,6 +25,7 @@ class AtomContentClient : public brightray::ContentClient {
base::string16 GetLocalizedString(int message_id) const override;
void AddAdditionalSchemes(
std::vector<url::SchemeWithType>* standard_schemes,
std::vector<url::SchemeWithType>* referrer_schemes,
std::vector<std::string>* savable_schemes) override;
void AddPepperPlugins(
std::vector<content::PepperPluginInfo>* plugins) override;

View File

@@ -5,7 +5,7 @@
#ifndef ATOM_APP_ATOM_LIBRARY_MAIN_H_
#define ATOM_APP_ATOM_LIBRARY_MAIN_H_
#include "base/basictypes.h"
#include "build/build_config.h"
#if defined(OS_MACOSX)
extern "C" {

View File

@@ -15,8 +15,9 @@
#include "atom/app/atom_main_delegate.h"
#include "atom/common/crash_reporter/win/crash_service_main.h"
#include "base/environment.h"
#include "base/process/launch.h"
#include "base/win/windows_version.h"
#include "content/public/app/startup_helper_win.h"
#include "content/public/app/sandbox_helper_win.h"
#include "sandbox/win/src/sandbox_types.h"
#include "ui/gfx/win/dpi.h"
#elif defined(OS_LINUX) // defined(OS_WIN)
@@ -34,7 +35,6 @@
namespace {
const char* kRunAsNode = "ELECTRON_RUN_AS_NODE";
const char* kOldRunAsNode = "ATOM_SHELL_INTERNAL_RUN_AS_NODE";
bool IsEnvSet(const char* name) {
#if defined(OS_WIN)
@@ -47,50 +47,6 @@ bool IsEnvSet(const char* name) {
#endif
}
bool IsRunAsNode() {
return IsEnvSet(kRunAsNode) || IsEnvSet(kOldRunAsNode);
}
#if defined(OS_WIN)
// Win8.1 supports monitor-specific DPI scaling.
bool SetProcessDpiAwarenessWrapper(PROCESS_DPI_AWARENESS value) {
typedef HRESULT(WINAPI *SetProcessDpiAwarenessPtr)(PROCESS_DPI_AWARENESS);
SetProcessDpiAwarenessPtr set_process_dpi_awareness_func =
reinterpret_cast<SetProcessDpiAwarenessPtr>(
GetProcAddress(GetModuleHandleA("user32.dll"),
"SetProcessDpiAwarenessInternal"));
if (set_process_dpi_awareness_func) {
HRESULT hr = set_process_dpi_awareness_func(value);
if (SUCCEEDED(hr)) {
VLOG(1) << "SetProcessDpiAwareness succeeded.";
return true;
} else if (hr == E_ACCESSDENIED) {
LOG(ERROR) << "Access denied error from SetProcessDpiAwareness. "
"Function called twice, or manifest was used.";
}
}
return false;
}
// This function works for Windows Vista through Win8. Win8.1 must use
// SetProcessDpiAwareness[Wrapper].
BOOL SetProcessDPIAwareWrapper() {
typedef BOOL(WINAPI *SetProcessDPIAwarePtr)(VOID);
SetProcessDPIAwarePtr set_process_dpi_aware_func =
reinterpret_cast<SetProcessDPIAwarePtr>(
GetProcAddress(GetModuleHandleA("user32.dll"),
"SetProcessDPIAware"));
return set_process_dpi_aware_func &&
set_process_dpi_aware_func();
}
void EnableHighDPISupport() {
if (!SetProcessDpiAwarenessWrapper(PROCESS_SYSTEM_DPI_AWARE)) {
SetProcessDPIAwareWrapper();
}
}
#endif
} // namespace
#if defined(OS_WIN)
@@ -98,14 +54,11 @@ int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE, wchar_t* cmd, int) {
int argc = 0;
wchar_t** wargv = ::CommandLineToArgvW(::GetCommandLineW(), &argc);
// Make output work in console if we are not in cygiwn.
if (!IsEnvSet("TERM") && !IsEnvSet("ELECTRON_NO_ATTACH_CONSOLE")) {
AttachConsole(ATTACH_PARENT_PROCESS);
bool run_as_node = IsEnvSet(kRunAsNode);
FILE* dontcare;
freopen_s(&dontcare, "CON", "w", stdout);
freopen_s(&dontcare, "CON", "w", stderr);
}
// Make sure the output is printed to console.
if (run_as_node || !IsEnvSet("ELECTRON_NO_ATTACH_CONSOLE"))
base::RouteStdioToConsole(false);
// Convert argv to to UTF8
char** argv = new char*[argc];
@@ -141,12 +94,12 @@ int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE, wchar_t* cmd, int) {
}
}
if (IsRunAsNode()) {
if (run_as_node) {
// Now that argv conversion is done, we can finally start.
base::AtExitManager atexit_manager;
base::i18n::InitializeICU();
return atom::NodeMain(argc, argv);
} else if (IsEnvSet("ATOM_SHELL_INTERNAL_CRASH_SERVICE")) {
} else if (IsEnvSet("ELECTRON_INTERNAL_CRASH_SERVICE")) {
return crash_service::Main(cmd);
}
@@ -154,23 +107,18 @@ int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE, wchar_t* cmd, int) {
content::InitializeSandboxInfo(&sandbox_info);
atom::AtomMainDelegate delegate;
// We don't want to set DPI awareness on pre-Win7 because we don't support
// DirectWrite there. GDI fonts are kerned very badly, so better to leave
// DPI-unaware and at effective 1.0. See also ShouldUseDirectWrite().
if (base::win::GetVersion() >= base::win::VERSION_WIN7)
EnableHighDPISupport();
content::ContentMainParams params(&delegate);
params.instance = instance;
params.sandbox_info = &sandbox_info;
atom::AtomCommandLine::Init(argc, argv);
atom::AtomCommandLine::InitW(argc, wargv);
return content::ContentMain(params);
}
#elif defined(OS_LINUX) // defined(OS_WIN)
int main(int argc, const char* argv[]) {
if (IsRunAsNode()) {
if (IsEnvSet(kRunAsNode)) {
base::i18n::InitializeICU();
base::AtExitManager atexit_manager;
return atom::NodeMain(argc, const_cast<char**>(argv));
@@ -187,7 +135,7 @@ int main(int argc, const char* argv[]) {
#else // defined(OS_LINUX)
int main(int argc, const char* argv[]) {
if (IsRunAsNode()) {
if (IsEnvSet(kRunAsNode)) {
return AtomInitializeICUandStartNode(argc, const_cast<char**>(argv));
}

View File

@@ -9,6 +9,7 @@
#include "atom/app/atom_content_client.h"
#include "atom/browser/atom_browser_client.h"
#include "atom/browser/relauncher.h"
#include "atom/common/google_api_key.h"
#include "atom/renderer/atom_renderer_client.h"
#include "atom/utility/atom_content_utility_client.h"
@@ -25,11 +26,20 @@ namespace atom {
namespace {
const char* kRelauncherProcess = "relauncher";
bool IsBrowserProcess(base::CommandLine* cmd) {
std::string process_type = cmd->GetSwitchValueASCII(switches::kProcessType);
return process_type.empty();
}
#if defined(OS_WIN)
void InvalidParameterHandler(const wchar_t*, const wchar_t*, const wchar_t*,
unsigned int, uintptr_t) {
// noop.
}
#endif
} // namespace
AtomMainDelegate::AtomMainDelegate() {
@@ -61,7 +71,7 @@ bool AtomMainDelegate::BasicStartupComplete(int* exit_code) {
#endif // !defined(OS_WIN)
// Only enable logging when --enable-logging is specified.
scoped_ptr<base::Environment> env(base::Environment::Create());
std::unique_ptr<base::Environment> env(base::Environment::Create());
if (!command_line->HasSwitch(switches::kEnableLogging) &&
!env->HasVar("ELECTRON_ENABLE_LOGGING")) {
settings.logging_dest = logging::LOG_NONE;
@@ -83,6 +93,15 @@ bool AtomMainDelegate::BasicStartupComplete(int* exit_code) {
chrome::RegisterPathProvider();
#if defined(OS_MACOSX)
SetUpBundleOverrides();
#endif
#if defined(OS_WIN)
// Ignore invalid parameter errors.
_set_invalid_parameter_handler(InvalidParameterHandler);
#endif
return brightray::MainDelegate::BasicStartupComplete(exit_code);
}
@@ -90,7 +109,7 @@ void AtomMainDelegate::PreSandboxStartup() {
brightray::MainDelegate::PreSandboxStartup();
// Set google API key.
scoped_ptr<base::Environment> env(base::Environment::Create());
std::unique_ptr<base::Environment> env(base::Environment::Create());
if (!env->HasVar("GOOGLE_API_KEY"))
env->SetVar("GOOGLE_API_KEY", GOOGLEAPIS_API_KEY);
@@ -98,10 +117,6 @@ void AtomMainDelegate::PreSandboxStartup() {
std::string process_type = command_line->GetSwitchValueASCII(
switches::kProcessType);
if (process_type == switches::kUtilityProcess) {
AtomContentUtilityClient::PreSandboxStartup();
}
// Only append arguments for browser process.
if (!IsBrowserProcess(command_line))
return;
@@ -134,8 +149,29 @@ content::ContentUtilityClient* AtomMainDelegate::CreateContentUtilityClient() {
return utility_client_.get();
}
scoped_ptr<brightray::ContentClient> AtomMainDelegate::CreateContentClient() {
return scoped_ptr<brightray::ContentClient>(new AtomContentClient).Pass();
int AtomMainDelegate::RunProcess(
const std::string& process_type,
const content::MainFunctionParams& main_function_params) {
if (process_type == kRelauncherProcess)
return relauncher::RelauncherMain(main_function_params);
else
return -1;
}
#if defined(OS_MACOSX)
bool AtomMainDelegate::ShouldSendMachPort(const std::string& process_type) {
return process_type != kRelauncherProcess;
}
bool AtomMainDelegate::DelaySandboxInitialization(
const std::string& process_type) {
return process_type == kRelauncherProcess;
}
#endif
std::unique_ptr<brightray::ContentClient>
AtomMainDelegate::CreateContentClient() {
return std::unique_ptr<brightray::ContentClient>(new AtomContentClient);
}
} // namespace atom

View File

@@ -5,6 +5,8 @@
#ifndef ATOM_APP_ATOM_MAIN_DELEGATE_H_
#define ATOM_APP_ATOM_MAIN_DELEGATE_H_
#include <string>
#include "brightray/common/main_delegate.h"
#include "brightray/common/content_client.h"
@@ -22,19 +24,30 @@ class AtomMainDelegate : public brightray::MainDelegate {
content::ContentBrowserClient* CreateContentBrowserClient() override;
content::ContentRendererClient* CreateContentRendererClient() override;
content::ContentUtilityClient* CreateContentUtilityClient() override;
int RunProcess(
const std::string& process_type,
const content::MainFunctionParams& main_function_params) override;
#if defined(OS_MACOSX)
bool ShouldSendMachPort(const std::string& process_type) override;
bool DelaySandboxInitialization(const std::string& process_type) override;
#endif
// brightray::MainDelegate:
scoped_ptr<brightray::ContentClient> CreateContentClient() override;
std::unique_ptr<brightray::ContentClient> CreateContentClient() override;
#if defined(OS_MACOSX)
void OverrideChildProcessPath() override;
void OverrideFrameworkBundlePath() override;
#endif
private:
#if defined(OS_MACOSX)
void SetUpBundleOverrides();
#endif
brightray::ContentClient content_client_;
scoped_ptr<content::ContentBrowserClient> browser_client_;
scoped_ptr<content::ContentRendererClient> renderer_client_;
scoped_ptr<content::ContentUtilityClient> utility_client_;
std::unique_ptr<content::ContentBrowserClient> browser_client_;
std::unique_ptr<content::ContentRendererClient> renderer_client_;
std::unique_ptr<content::ContentUtilityClient> utility_client_;
DISALLOW_COPY_AND_ASSIGN(AtomMainDelegate);
};

View File

@@ -7,7 +7,10 @@
#include "base/mac/bundle_locations.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/mac/foundation_util.h"
#include "base/mac/scoped_nsautorelease_pool.h"
#include "base/path_service.h"
#include "base/strings/sys_string_conversions.h"
#include "brightray/common/application_info.h"
#include "brightray/common/mac/main_application_bundle.h"
#include "content/public/common/content_paths.h"
@@ -48,4 +51,15 @@ void AtomMainDelegate::OverrideChildProcessPath() {
PathService::Override(content::CHILD_PROCESS_EXE, helper_path);
}
void AtomMainDelegate::SetUpBundleOverrides() {
base::mac::ScopedNSAutoreleasePool pool;
NSBundle* bundle = brightray::MainApplicationBundle();
std::string base_bundle_id =
base::SysNSStringToUTF8([bundle bundleIdentifier]);
NSString* team_id = [bundle objectForInfoDictionaryKey:@"ElectronTeamID"];
if (team_id)
base_bundle_id = base::SysNSStringToUTF8(team_id) + "." + base_bundle_id;
base::mac::SetBaseBundleID(base_bundle_id.c_str());
}
} // namespace atom

View File

@@ -7,8 +7,9 @@
#include "atom/app/uv_task_runner.h"
#include "atom/browser/javascript_environment.h"
#include "atom/browser/node_debugger.h"
#include "base/command_line.h"
#include "atom/common/node_includes.h"
#include "base/command_line.h"
#include "base/feature_list.h"
#include "base/thread_task_runner_handle.h"
#include "gin/array_buffer.h"
#include "gin/public/isolate_holder.h"
@@ -27,6 +28,11 @@ int NodeMain(int argc, char *argv[]) {
scoped_refptr<UvTaskRunner> uv_task_runner(new UvTaskRunner(loop));
base::ThreadTaskRunnerHandle handle(uv_task_runner);
// Initialize feature list.
std::unique_ptr<base::FeatureList> feature_list(new base::FeatureList);
feature_list->InitializeFromCommandLine("", "");
base::FeatureList::SetInstance(std::move(feature_list));
gin::V8Initializer::LoadV8Snapshot();
gin::V8Initializer::LoadV8Natives();
JavascriptEnvironment gin_env;

View File

@@ -14,16 +14,22 @@
#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"
#include "atom/common/native_mate_converters/callback.h"
#include "atom/common/native_mate_converters/net_converter.h"
#include "atom/common/native_mate_converters/file_path_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/value_converter.h"
#include "atom/common/node_includes.h"
#include "atom/common/options_switches.h"
#include "base/command_line.h"
#include "base/environment.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/path_service.h"
#include "base/strings/string_util.h"
#include "brightray/browser/brightray_paths.h"
#include "chrome/common/chrome_paths.h"
#include "content/public/browser/client_certificate_delegate.h"
@@ -34,6 +40,7 @@
#include "native_mate/object_template_builder.h"
#include "net/ssl/ssl_cert_request_info.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/gfx/image/image.h"
#if defined(OS_WIN)
#include "base/strings/utf_string_conversions.h"
@@ -103,6 +110,8 @@ int GetPathConstant(const std::string& name) {
return chrome::DIR_USER_PICTURES;
else if (name == "videos")
return chrome::DIR_USER_VIDEOS;
else if (name == "pepperFlashSystemPlugin")
return chrome::FILE_PEPPER_FLASH_SYSTEM_PLUGIN;
else
return -1;
}
@@ -129,19 +138,20 @@ void OnClientCertificateSelected(
std::shared_ptr<content::ClientCertificateDelegate> delegate,
mate::Arguments* args) {
mate::Dictionary cert_data;
if (!(args->Length() == 1 && args->GetNext(&cert_data))) {
if (!args->GetNext(&cert_data)) {
args->ThrowError();
return;
}
std::string encoded_data;
cert_data.Get("data", &encoded_data);
v8::Local<v8::Object> data;
if (!cert_data.Get("data", &data))
return;
auto certs =
net::X509Certificate::CreateCertificateListFromBytes(
encoded_data.data(), encoded_data.size(),
net::X509Certificate::FORMAT_AUTO);
delegate->ContinueWithCertificate(certs[0].get());
auto certs = net::X509Certificate::CreateCertificateListFromBytes(
node::Buffer::Data(data), node::Buffer::Length(data),
net::X509Certificate::FORMAT_AUTO);
if (certs.size() > 0)
delegate->ContinueWithCertificate(certs[0].get());
}
void PassLoginInformation(scoped_refptr<LoginHandler> login_handler,
@@ -153,12 +163,46 @@ void PassLoginInformation(scoped_refptr<LoginHandler> login_handler,
login_handler->CancelAuth();
}
#if defined(USE_NSS_CERTS)
int ImportIntoCertStore(
CertificateManagerModel* model,
const base::DictionaryValue& options) {
std::string file_data, cert_path;
base::string16 password;
net::CertificateList imported_certs;
int rv = -1;
options.GetString("certificate", &cert_path);
options.GetString("password", &password);
if (!cert_path.empty()) {
if (base::ReadFileToString(base::FilePath(cert_path), &file_data)) {
auto module = model->cert_db()->GetPublicModule();
rv = model->ImportFromPKCS12(module,
file_data,
password,
true,
&imported_certs);
if (imported_certs.size() > 1) {
auto it = imported_certs.begin();
++it; // skip first which would be the client certificate.
for (; it != imported_certs.end(); ++it)
rv &= model->SetCertTrust(it->get(),
net::CA_CERT,
net::NSSCertDatabase::TRUSTED_SSL);
}
}
}
return rv;
}
#endif
} // namespace
App::App() {
App::App(v8::Isolate* isolate) {
static_cast<AtomBrowserClient*>(AtomBrowserClient::Get())->set_delegate(this);
Browser::Get()->AddObserver(this);
content::GpuDataManager::GetInstance()->AddObserver(this);
Init(isolate);
}
App::~App() {
@@ -210,13 +254,23 @@ void App::OnFinishLaunching() {
Emit("ready");
}
void App::OnLogin(LoginHandler* login_handler) {
#if defined(OS_MACOSX)
void App::OnContinueUserActivity(
bool* prevent_default,
const std::string& type,
const base::DictionaryValue& user_info) {
*prevent_default = Emit("continue-activity", type, user_info);
}
#endif
void App::OnLogin(LoginHandler* login_handler,
const base::DictionaryValue& request_details) {
v8::Locker locker(isolate());
v8::HandleScope handle_scope(isolate());
bool prevent_default = Emit(
"login",
WebContents::CreateFrom(isolate(), login_handler->GetWebContents()),
login_handler->request(),
request_details,
login_handler->auth_info(),
base::Bind(&PassLoginInformation, make_scoped_refptr(login_handler)));
@@ -225,9 +279,25 @@ void App::OnLogin(LoginHandler* login_handler) {
login_handler->CancelAuth();
}
void App::OnCreateWindow(const GURL& target_url,
const std::string& frame_name,
WindowOpenDisposition disposition,
int render_process_id,
int render_frame_id) {
v8::Locker locker(isolate());
v8::HandleScope handle_scope(isolate());
content::RenderFrameHost* rfh =
content::RenderFrameHost::FromID(render_process_id, render_frame_id);
content::WebContents* web_contents =
content::WebContents::FromRenderFrameHost(rfh);
if (web_contents) {
auto api_web_contents = WebContents::CreateFrom(isolate(), web_contents);
api_web_contents->OnCreateWindow(target_url, frame_name, disposition);
}
}
void App::AllowCertificateError(
int pid,
int fid,
content::WebContents* web_contents,
int cert_error,
const net::SSLInfo& ssl_info,
const GURL& request_url,
@@ -237,9 +307,6 @@ void App::AllowCertificateError(
bool expired_previous_decision,
const base::Callback<void(bool)>& callback,
content::CertificateRequestResultType* request) {
auto rfh = content::RenderFrameHost::FromID(pid, fid);
auto web_contents = content::WebContents::FromRenderFrameHost(rfh);
v8::Locker locker(isolate());
v8::HandleScope handle_scope(isolate());
bool prevent_default = Emit("certificate-error",
@@ -257,7 +324,7 @@ void App::AllowCertificateError(
void App::SelectClientCertificate(
content::WebContents* web_contents,
net::SSLCertRequestInfo* cert_request_info,
scoped_ptr<content::ClientCertificateDelegate> delegate) {
std::unique_ptr<content::ClientCertificateDelegate> delegate) {
std::shared_ptr<content::ClientCertificateDelegate>
shared_delegate(delegate.release());
bool prevent_default =
@@ -293,27 +360,26 @@ base::FilePath App::GetPath(mate::Arguments* args, const std::string& name) {
void App::SetPath(mate::Arguments* args,
const std::string& name,
const base::FilePath& path) {
if (!path.IsAbsolute()) {
args->ThrowError("path must be absolute");
return;
}
bool succeed = false;
int key = GetPathConstant(name);
if (key >= 0)
succeed = PathService::Override(key, path);
succeed = PathService::OverrideAndCreateIfNeeded(key, path, true, false);
if (!succeed)
args->ThrowError("Failed to set path");
}
void App::SetDesktopName(const std::string& desktop_name) {
#if defined(OS_LINUX)
scoped_ptr<base::Environment> env(base::Environment::Create());
std::unique_ptr<base::Environment> env(base::Environment::Create());
env->SetVar("CHROME_DESKTOP", desktop_name);
#endif
}
void App::AllowNTLMCredentialsForAllDomains(bool should_allow) {
auto browser_context = static_cast<AtomBrowserContext*>(
AtomBrowserMainParts::Get()->browser_context());
browser_context->AllowNTLMCredentialsForAllDomains(should_allow);
}
std::string App::GetLocale() {
return l10n_util::GetApplicationLocale("");
}
@@ -340,10 +406,99 @@ bool App::MakeSingleInstance(
}
}
mate::ObjectTemplateBuilder App::GetObjectTemplateBuilder(
v8::Isolate* isolate) {
void App::ReleaseSingleInstance() {
if (process_singleton_.get()) {
process_singleton_->Cleanup();
process_singleton_.reset();
}
}
bool App::Relaunch(mate::Arguments* js_args) {
// Parse parameters.
bool override_argv = false;
base::FilePath exec_path;
relauncher::StringVector args;
mate::Dictionary options;
if (js_args->GetNext(&options)) {
if (options.Get("execPath", &exec_path) | options.Get("args", &args))
override_argv = true;
}
if (!override_argv) {
#if defined(OS_WIN)
const relauncher::StringVector& argv = atom::AtomCommandLine::wargv();
#else
const relauncher::StringVector& argv = atom::AtomCommandLine::argv();
#endif
return relauncher::RelaunchApp(argv);
}
relauncher::StringVector argv;
argv.reserve(1 + args.size());
if (exec_path.empty()) {
base::FilePath current_exe_path;
PathService::Get(base::FILE_EXE, &current_exe_path);
argv.push_back(current_exe_path.value());
} else {
argv.push_back(exec_path.value());
}
argv.insert(argv.end(), args.begin(), args.end());
return relauncher::RelaunchApp(argv);
}
void App::DisableHardwareAcceleration(mate::Arguments* args) {
if (Browser::Get()->is_ready()) {
args->ThrowError("app.disableHardwareAcceleration() can only be called "
"before app is ready");
return;
}
content::GpuDataManager::GetInstance()->DisableHardwareAcceleration();
}
#if defined(USE_NSS_CERTS)
void App::ImportCertificate(
const base::DictionaryValue& options,
const net::CompletionCallback& callback) {
auto browser_context = AtomBrowserMainParts::Get()->browser_context();
if (!certificate_manager_model_) {
std::unique_ptr<base::DictionaryValue> copy = options.CreateDeepCopy();
CertificateManagerModel::Create(browser_context,
base::Bind(&App::OnCertificateManagerModelCreated,
base::Unretained(this),
base::Passed(&copy),
callback));
return;
}
int rv = ImportIntoCertStore(certificate_manager_model_.get(), options);
callback.Run(rv);
}
void App::OnCertificateManagerModelCreated(
std::unique_ptr<base::DictionaryValue> options,
const net::CompletionCallback& callback,
std::unique_ptr<CertificateManagerModel> model) {
certificate_manager_model_ = std::move(model);
int rv = ImportIntoCertStore(certificate_manager_model_.get(),
*(options.get()));
callback.Run(rv);
}
#endif
// static
mate::Handle<App> App::Create(v8::Isolate* isolate) {
return mate::CreateHandle(isolate, new App(isolate));
}
// static
void App::BuildPrototype(
v8::Isolate* isolate, v8::Local<v8::ObjectTemplate> prototype) {
auto browser = base::Unretained(Browser::Get());
return mate::ObjectTemplateBuilder(isolate)
mate::ObjectTemplateBuilder(isolate, prototype)
.SetMethod("quit", base::Bind(&Browser::Quit, browser))
.SetMethod("exit", base::Bind(&Browser::Exit, browser))
.SetMethod("focus", base::Bind(&Browser::Focus, browser))
@@ -358,6 +513,20 @@ mate::ObjectTemplateBuilder App::GetObjectTemplateBuilder(
base::Bind(&Browser::ClearRecentDocuments, browser))
.SetMethod("setAppUserModelId",
base::Bind(&Browser::SetAppUserModelID, browser))
.SetMethod("isDefaultProtocolClient",
base::Bind(&Browser::IsDefaultProtocolClient, browser))
.SetMethod("setAsDefaultProtocolClient",
base::Bind(&Browser::SetAsDefaultProtocolClient, browser))
.SetMethod("removeAsDefaultProtocolClient",
base::Bind(&Browser::RemoveAsDefaultProtocolClient, browser))
#if defined(OS_MACOSX)
.SetMethod("hide", base::Bind(&Browser::Hide, browser))
.SetMethod("show", base::Bind(&Browser::Show, browser))
.SetMethod("setUserActivity",
base::Bind(&Browser::SetUserActivity, browser))
.SetMethod("getCurrentActivityType",
base::Bind(&Browser::GetCurrentActivityType, browser))
#endif
#if defined(OS_WIN)
.SetMethod("setUserTasks",
base::Bind(&Browser::SetUserTasks, browser))
@@ -365,15 +534,15 @@ mate::ObjectTemplateBuilder App::GetObjectTemplateBuilder(
.SetMethod("setPath", &App::SetPath)
.SetMethod("getPath", &App::GetPath)
.SetMethod("setDesktopName", &App::SetDesktopName)
.SetMethod("allowNTLMCredentialsForAllDomains",
&App::AllowNTLMCredentialsForAllDomains)
.SetMethod("getLocale", &App::GetLocale)
.SetMethod("makeSingleInstance", &App::MakeSingleInstance);
}
// static
mate::Handle<App> App::Create(v8::Isolate* isolate) {
return CreateHandle(isolate, new App);
#if defined(USE_NSS_CERTS)
.SetMethod("importCertificate", &App::ImportCertificate)
#endif
.SetMethod("makeSingleInstance", &App::MakeSingleInstance)
.SetMethod("releaseSingleInstance", &App::ReleaseSingleInstance)
.SetMethod("relaunch", &App::Relaunch)
.SetMethod("disableHardwareAcceleration",
&App::DisableHardwareAcceleration);
}
} // namespace api
@@ -386,8 +555,8 @@ namespace {
void AppendSwitch(const std::string& switch_string, mate::Arguments* args) {
auto command_line = base::CommandLine::ForCurrentProcess();
if (switch_string == atom::switches::kPpapiFlashPath ||
switch_string == atom::switches::kClientCertificate ||
if (base::EndsWith(switch_string, "-path",
base::CompareCase::INSENSITIVE_ASCII) ||
switch_string == switches::kLogNetLog) {
base::FilePath path;
args->GetNext(&path);
@@ -433,6 +602,8 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
dict.SetMethod("dockBounce", &DockBounce);
dict.SetMethod("dockCancelBounce",
base::Bind(&Browser::DockCancelBounce, browser));
dict.SetMethod("dockDownloadFinished",
base::Bind(&Browser::DockDownloadFinished, browser));
dict.SetMethod("dockSetBadgeText",
base::Bind(&Browser::DockSetBadgeText, browser));
dict.SetMethod("dockGetBadgeText",
@@ -440,6 +611,7 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
dict.SetMethod("dockHide", base::Bind(&Browser::DockHide, browser));
dict.SetMethod("dockShow", base::Bind(&Browser::DockShow, browser));
dict.SetMethod("dockSetMenu", &DockSetMenu);
dict.SetMethod("dockSetIcon", base::Bind(&Browser::DockSetIcon, browser));
#endif
}

View File

@@ -14,6 +14,11 @@
#include "chrome/browser/process_singleton.h"
#include "content/public/browser/gpu_data_manager_observer.h"
#include "native_mate/handle.h"
#include "net/base/completion_callback.h"
#if defined(USE_NSS_CERTS)
#include "chrome/browser/certificate_manager_model.h"
#endif
namespace base {
class FilePath;
@@ -28,15 +33,32 @@ namespace atom {
namespace api {
class App : public AtomBrowserClient::Delegate,
public mate::EventEmitter,
public mate::EventEmitter<App>,
public BrowserObserver,
public content::GpuDataManagerObserver {
public:
static mate::Handle<App> Create(v8::Isolate* isolate);
static void BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::ObjectTemplate> prototype);
// Called when window with disposition needs to be created.
void OnCreateWindow(const GURL& target_url,
const std::string& frame_name,
WindowOpenDisposition disposition,
int render_process_id,
int render_frame_id);
#if defined(USE_NSS_CERTS)
void OnCertificateManagerModelCreated(
std::unique_ptr<base::DictionaryValue> options,
const net::CompletionCallback& callback,
std::unique_ptr<CertificateManagerModel> model);
#endif
protected:
App();
virtual ~App();
explicit App(v8::Isolate* isolate);
~App() override;
// BrowserObserver:
void OnBeforeQuit(bool* prevent_default) override;
@@ -48,12 +70,18 @@ class App : public AtomBrowserClient::Delegate,
void OnActivate(bool has_visible_windows) override;
void OnWillFinishLaunching() override;
void OnFinishLaunching() override;
void OnLogin(LoginHandler* login_handler) override;
void OnLogin(LoginHandler* login_handler,
const base::DictionaryValue& request_details) override;
#if defined(OS_MACOSX)
void OnContinueUserActivity(
bool* prevent_default,
const std::string& type,
const base::DictionaryValue& user_info) override;
#endif
// content::ContentBrowserClient:
void AllowCertificateError(
int render_process_id,
int render_frame_id,
content::WebContents* web_contents,
int cert_error,
const net::SSLInfo& ssl_info,
const GURL& request_url,
@@ -66,15 +94,11 @@ class App : public AtomBrowserClient::Delegate,
void SelectClientCertificate(
content::WebContents* web_contents,
net::SSLCertRequestInfo* cert_request_info,
scoped_ptr<content::ClientCertificateDelegate> delegate) override;
std::unique_ptr<content::ClientCertificateDelegate> delegate) override;
// content::GpuDataManagerObserver:
void OnGpuProcessCrashed(base::TerminationStatus exit_code) override;
// mate::Wrappable:
mate::ObjectTemplateBuilder GetObjectTemplateBuilder(
v8::Isolate* isolate) override;
private:
// Get/Set the pre-defined path in PathService.
base::FilePath GetPath(mate::Arguments* args, const std::string& name);
@@ -83,12 +107,22 @@ class App : public AtomBrowserClient::Delegate,
const base::FilePath& path);
void SetDesktopName(const std::string& desktop_name);
void AllowNTLMCredentialsForAllDomains(bool should_allow);
std::string GetLocale();
bool MakeSingleInstance(
const ProcessSingleton::NotificationCallback& callback);
std::string GetLocale();
void ReleaseSingleInstance();
bool Relaunch(mate::Arguments* args);
void DisableHardwareAcceleration(mate::Arguments* args);
#if defined(USE_NSS_CERTS)
void ImportCertificate(const base::DictionaryValue& options,
const net::CompletionCallback& callback);
#endif
scoped_ptr<ProcessSingleton> process_singleton_;
std::unique_ptr<ProcessSingleton> process_singleton_;
#if defined(USE_NSS_CERTS)
std::unique_ptr<CertificateManagerModel> certificate_manager_model_;
#endif
DISALLOW_COPY_AND_ASSIGN(App);
};

View File

@@ -34,8 +34,9 @@ namespace atom {
namespace api {
AutoUpdater::AutoUpdater() {
AutoUpdater::AutoUpdater(v8::Isolate* isolate) {
auto_updater::AutoUpdater::SetDelegate(this);
Init(isolate);
}
AutoUpdater::~AutoUpdater() {
@@ -78,12 +79,10 @@ void AutoUpdater::OnWindowAllClosed() {
QuitAndInstall();
}
mate::ObjectTemplateBuilder AutoUpdater::GetObjectTemplateBuilder(
v8::Isolate* isolate) {
return mate::ObjectTemplateBuilder(isolate)
.SetMethod("setFeedURL", &auto_updater::AutoUpdater::SetFeedURL)
.SetMethod("checkForUpdates", &auto_updater::AutoUpdater::CheckForUpdates)
.SetMethod("quitAndInstall", &AutoUpdater::QuitAndInstall);
void AutoUpdater::SetFeedURL(const std::string& url, mate::Arguments* args) {
auto_updater::AutoUpdater::HeaderMap headers;
args->GetNext(&headers);
auto_updater::AutoUpdater::SetFeedURL(url, headers);
}
void AutoUpdater::QuitAndInstall() {
@@ -102,7 +101,16 @@ void AutoUpdater::QuitAndInstall() {
// static
mate::Handle<AutoUpdater> AutoUpdater::Create(v8::Isolate* isolate) {
return CreateHandle(isolate, new AutoUpdater);
return mate::CreateHandle(isolate, new AutoUpdater(isolate));
}
// static
void AutoUpdater::BuildPrototype(
v8::Isolate* isolate, v8::Local<v8::ObjectTemplate> prototype) {
mate::ObjectTemplateBuilder(isolate, prototype)
.SetMethod("checkForUpdates", &auto_updater::AutoUpdater::CheckForUpdates)
.SetMethod("setFeedURL", &AutoUpdater::SetFeedURL)
.SetMethod("quitAndInstall", &AutoUpdater::QuitAndInstall);
}
} // namespace api

View File

@@ -10,21 +10,25 @@
#include "atom/browser/api/event_emitter.h"
#include "atom/browser/auto_updater.h"
#include "atom/browser/window_list_observer.h"
#include "native_mate/arguments.h"
#include "native_mate/handle.h"
namespace atom {
namespace api {
class AutoUpdater : public mate::EventEmitter,
class AutoUpdater : public mate::EventEmitter<AutoUpdater>,
public auto_updater::Delegate,
public WindowListObserver {
public:
static mate::Handle<AutoUpdater> Create(v8::Isolate* isolate);
static void BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::ObjectTemplate> prototype);
protected:
AutoUpdater();
virtual ~AutoUpdater();
explicit AutoUpdater(v8::Isolate* isolate);
~AutoUpdater() override;
// Delegate implementations.
void OnError(const std::string& error) override;
@@ -39,11 +43,8 @@ class AutoUpdater : public mate::EventEmitter,
// WindowListObserver:
void OnWindowAllClosed() override;
// mate::Wrappable implementations:
mate::ObjectTemplateBuilder GetObjectTemplateBuilder(
v8::Isolate* isolate) override;
private:
void SetFeedURL(const std::string& url, mate::Arguments* args);
void QuitAndInstall();
DISALLOW_COPY_AND_ASSIGN(AutoUpdater);

View File

@@ -53,13 +53,7 @@ scoped_refptr<TracingController::TraceDataSink> GetTraceDataSink(
void StopRecording(const base::FilePath& path,
const CompletionCallback& callback) {
TracingController::GetInstance()->DisableRecording(
GetTraceDataSink(path, callback));
}
void CaptureMonitoringSnapshot(const base::FilePath& path,
const CompletionCallback& callback) {
TracingController::GetInstance()->CaptureMonitoringSnapshot(
TracingController::GetInstance()->StopTracing(
GetTraceDataSink(path, callback));
}
@@ -70,13 +64,8 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
dict.SetMethod("getCategories", base::Bind(
&TracingController::GetCategories, controller));
dict.SetMethod("startRecording", base::Bind(
&TracingController::EnableRecording, controller));
&TracingController::StartTracing, controller));
dict.SetMethod("stopRecording", &StopRecording);
dict.SetMethod("startMonitoring", base::Bind(
&TracingController::EnableMonitoring, controller));
dict.SetMethod("stopMonitoring", base::Bind(
&TracingController::DisableMonitoring, controller));
dict.SetMethod("captureMonitoringSnapshot", &CaptureMonitoringSnapshot);
dict.SetMethod("getTraceBufferUsage", base::Bind(
&TracingController::GetTraceBufferUsage, controller));
dict.SetMethod("setWatchEvent", base::Bind(

View File

@@ -47,7 +47,7 @@ struct Converter<net::CanonicalCookie> {
dict.Set("secure", val.IsSecure());
dict.Set("httpOnly", val.IsHttpOnly());
dict.Set("session", !val.IsPersistent());
if (!val.IsPersistent())
if (val.IsPersistent())
dict.Set("expirationDate", val.ExpiryDate().ToDoubleT());
return dict.GetHandle();
}
@@ -112,7 +112,7 @@ void RunCallbackInUI(const base::Closure& callback) {
}
// Remove cookies from |list| not matching |filter|, and pass it to |callback|.
void FilterCookies(scoped_ptr<base::DictionaryValue> filter,
void FilterCookies(std::unique_ptr<base::DictionaryValue> filter,
const Cookies::GetCallback& callback,
const net::CookieList& list) {
net::CookieList result;
@@ -125,7 +125,7 @@ void FilterCookies(scoped_ptr<base::DictionaryValue> filter,
// Receives cookies matching |filter| in IO thread.
void GetCookiesOnIO(scoped_refptr<net::URLRequestContextGetter> getter,
scoped_ptr<base::DictionaryValue> filter,
std::unique_ptr<base::DictionaryValue> filter,
const Cookies::GetCallback& callback) {
std::string url;
filter->GetString("url", &url);
@@ -133,12 +133,12 @@ void GetCookiesOnIO(scoped_refptr<net::URLRequestContextGetter> getter,
auto filtered_callback =
base::Bind(FilterCookies, base::Passed(&filter), callback);
net::CookieMonster* monster = GetCookieStore(getter)->GetCookieMonster();
// Empty url will match all url cookies.
if (url.empty())
monster->GetAllCookiesAsync(filtered_callback);
GetCookieStore(getter)->GetAllCookiesAsync(filtered_callback);
else
monster->GetAllCookiesForURLAsync(GURL(url), filtered_callback);
GetCookieStore(getter)->GetAllCookiesForURLAsync(GURL(url),
filtered_callback);
}
// Removes cookie with |url| and |name| in IO thread.
@@ -157,12 +157,14 @@ void OnSetCookie(const Cookies::SetCallback& callback, bool success) {
// Sets cookie with |details| in IO thread.
void SetCookieOnIO(scoped_refptr<net::URLRequestContextGetter> getter,
scoped_ptr<base::DictionaryValue> details,
std::unique_ptr<base::DictionaryValue> details,
const Cookies::SetCallback& callback) {
std::string url, name, value, domain, path;
bool secure = false;
bool http_only = false;
double creation_date;
double expiration_date;
double last_access_date;
details->GetString("url", &url);
details->GetString("name", &name);
details->GetString("value", &value);
@@ -171,6 +173,13 @@ void SetCookieOnIO(scoped_refptr<net::URLRequestContextGetter> getter,
details->GetBoolean("secure", &secure);
details->GetBoolean("httpOnly", &http_only);
base::Time creation_time;
if (details->GetDouble("creationDate", &creation_date)) {
creation_time = (creation_date == 0) ?
base::Time::UnixEpoch() :
base::Time::FromDoubleT(creation_date);
}
base::Time expiration_time;
if (details->GetDouble("expirationDate", &expiration_date)) {
expiration_time = (expiration_date == 0) ?
@@ -178,15 +187,26 @@ void SetCookieOnIO(scoped_refptr<net::URLRequestContextGetter> getter,
base::Time::FromDoubleT(expiration_date);
}
GetCookieStore(getter)->GetCookieMonster()->SetCookieWithDetailsAsync(
GURL(url), name, value, domain, path, expiration_time, secure, http_only,
false, net::COOKIE_PRIORITY_DEFAULT, base::Bind(OnSetCookie, callback));
base::Time last_access_time;
if (details->GetDouble("lastAccessDate", &last_access_date)) {
last_access_time = (last_access_date == 0) ?
base::Time::UnixEpoch() :
base::Time::FromDoubleT(last_access_date);
}
GetCookieStore(getter)->SetCookieWithDetailsAsync(
GURL(url), name, value, domain, path, creation_time,
expiration_time, last_access_time, secure, http_only,
net::CookieSameSite::DEFAULT_MODE, false,
net::COOKIE_PRIORITY_DEFAULT, base::Bind(OnSetCookie, callback));
}
} // namespace
Cookies::Cookies(content::BrowserContext* browser_context)
: request_context_getter_(browser_context->GetRequestContext()) {
Cookies::Cookies(v8::Isolate* isolate,
content::BrowserContext* browser_context)
: request_context_getter_(browser_context->GetRequestContext()) {
Init(isolate);
}
Cookies::~Cookies() {
@@ -194,7 +214,7 @@ Cookies::~Cookies() {
void Cookies::Get(const base::DictionaryValue& filter,
const GetCallback& callback) {
scoped_ptr<base::DictionaryValue> copied(filter.CreateDeepCopy());
std::unique_ptr<base::DictionaryValue> copied(filter.CreateDeepCopy());
auto getter = make_scoped_refptr(request_context_getter_);
content::BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
@@ -211,7 +231,7 @@ void Cookies::Remove(const GURL& url, const std::string& name,
void Cookies::Set(const base::DictionaryValue& details,
const SetCallback& callback) {
scoped_ptr<base::DictionaryValue> copied(details.CreateDeepCopy());
std::unique_ptr<base::DictionaryValue> copied(details.CreateDeepCopy());
auto getter = make_scoped_refptr(request_context_getter_);
content::BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
@@ -222,7 +242,7 @@ void Cookies::Set(const base::DictionaryValue& details,
mate::Handle<Cookies> Cookies::Create(
v8::Isolate* isolate,
content::BrowserContext* browser_context) {
return mate::CreateHandle(isolate, new Cookies(browser_context));
return mate::CreateHandle(isolate, new Cookies(isolate, browser_context));
}
// static

View File

@@ -46,8 +46,8 @@ class Cookies : public mate::TrackableObject<Cookies> {
v8::Local<v8::ObjectTemplate> prototype);
protected:
explicit Cookies(content::BrowserContext* browser_context);
~Cookies();
Cookies(v8::Isolate* isolate, content::BrowserContext* browser_context);
~Cookies() override;
void Get(const base::DictionaryValue& filter, const GetCallback& callback);
void Remove(const GURL& url, const std::string& name,

View File

@@ -0,0 +1,189 @@
// 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_debugger.h"
#include <string>
#include "atom/browser/atom_browser_main_parts.h"
#include "atom/common/native_mate_converters/callback.h"
#include "atom/common/native_mate_converters/value_converter.h"
#include "atom/common/node_includes.h"
#include "base/json/json_reader.h"
#include "base/json/json_writer.h"
#include "content/public/browser/devtools_agent_host.h"
#include "content/public/browser/web_contents.h"
#include "native_mate/dictionary.h"
#include "native_mate/object_template_builder.h"
using content::DevToolsAgentHost;
namespace atom {
namespace api {
namespace {
// The wrapDebugger funtion which is implemented in JavaScript.
using WrapDebuggerCallback = base::Callback<void(v8::Local<v8::Value>)>;
WrapDebuggerCallback g_wrap_debugger;
} // namespace
Debugger::Debugger(v8::Isolate* isolate, content::WebContents* web_contents)
: web_contents_(web_contents),
previous_request_id_(0) {
Init(isolate);
}
Debugger::~Debugger() {
}
void Debugger::AgentHostClosed(DevToolsAgentHost* agent_host,
bool replaced_with_another_client) {
std::string detach_reason = "target closed";
if (replaced_with_another_client)
detach_reason = "replaced with devtools";
Emit("detach", detach_reason);
}
void Debugger::DispatchProtocolMessage(DevToolsAgentHost* agent_host,
const std::string& message) {
DCHECK(agent_host == agent_host_.get());
std::unique_ptr<base::Value> parsed_message(base::JSONReader::Read(message));
if (!parsed_message->IsType(base::Value::TYPE_DICTIONARY))
return;
base::DictionaryValue* dict =
static_cast<base::DictionaryValue*>(parsed_message.get());
int id;
if (!dict->GetInteger("id", &id)) {
std::string method;
if (!dict->GetString("method", &method))
return;
base::DictionaryValue* params_value = nullptr;
base::DictionaryValue params;
if (dict->GetDictionary("params", &params_value))
params.Swap(params_value);
Emit("message", method, params);
} else {
auto send_command_callback = pending_requests_[id];
pending_requests_.erase(id);
if (send_command_callback.is_null())
return;
base::DictionaryValue* error_body = nullptr;
base::DictionaryValue error;
if (dict->GetDictionary("error", &error_body))
error.Swap(error_body);
base::DictionaryValue* result_body = nullptr;
base::DictionaryValue result;
if (dict->GetDictionary("result", &result_body))
result.Swap(result_body);
send_command_callback.Run(error, result);
}
}
void Debugger::Attach(mate::Arguments* args) {
std::string protocol_version;
args->GetNext(&protocol_version);
if (!protocol_version.empty() &&
!DevToolsAgentHost::IsSupportedProtocolVersion(protocol_version)) {
args->ThrowError("Requested protocol version is not supported");
return;
}
agent_host_ = DevToolsAgentHost::GetOrCreateFor(web_contents_);
if (!agent_host_.get()) {
args->ThrowError("No target available");
return;
}
if (agent_host_->IsAttached()) {
args->ThrowError("Another debugger is already attached to this target");
return;
}
agent_host_->AttachClient(this);
}
bool Debugger::IsAttached() {
return agent_host_.get() ? agent_host_->IsAttached() : false;
}
void Debugger::Detach() {
if (!agent_host_.get())
return;
agent_host_->DetachClient();
AgentHostClosed(agent_host_.get(), false);
agent_host_ = nullptr;
}
void Debugger::SendCommand(mate::Arguments* args) {
if (!agent_host_.get())
return;
std::string method;
if (!args->GetNext(&method)) {
args->ThrowError();
return;
}
base::DictionaryValue command_params;
args->GetNext(&command_params);
SendCommandCallback callback;
args->GetNext(&callback);
base::DictionaryValue request;
int request_id = ++previous_request_id_;
pending_requests_[request_id] = callback;
request.SetInteger("id", request_id);
request.SetString("method", method);
if (!command_params.empty())
request.Set("params", command_params.DeepCopy());
std::string json_args;
base::JSONWriter::Write(request, &json_args);
agent_host_->DispatchProtocolMessage(json_args);
}
// static
mate::Handle<Debugger> Debugger::Create(
v8::Isolate* isolate,
content::WebContents* web_contents) {
auto handle = mate::CreateHandle(
isolate, new Debugger(isolate, web_contents));
g_wrap_debugger.Run(handle.ToV8());
return handle;
}
// static
void Debugger::BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::ObjectTemplate> prototype) {
mate::ObjectTemplateBuilder(isolate, prototype)
.SetMethod("attach", &Debugger::Attach)
.SetMethod("isAttached", &Debugger::IsAttached)
.SetMethod("detach", &Debugger::Detach)
.SetMethod("sendCommand", &Debugger::SendCommand);
}
void SetWrapDebugger(const WrapDebuggerCallback& callback) {
g_wrap_debugger = callback;
}
} // namespace api
} // namespace atom
namespace {
void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
v8::Local<v8::Context> context, void* priv) {
v8::Isolate* isolate = context->GetIsolate();
mate::Dictionary dict(isolate, exports);
dict.SetMethod("_setWrapDebugger", &atom::api::SetWrapDebugger);
}
} // namespace
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_browser_debugger, Initialize);

View File

@@ -0,0 +1,75 @@
// 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_DEBUGGER_H_
#define ATOM_BROWSER_API_ATOM_API_DEBUGGER_H_
#include <map>
#include <string>
#include "atom/browser/api/trackable_object.h"
#include "base/callback.h"
#include "base/values.h"
#include "content/public/browser/devtools_agent_host_client.h"
#include "native_mate/handle.h"
namespace content {
class DevToolsAgentHost;
class WebContents;
}
namespace mate {
class Arguments;
}
namespace atom {
namespace api {
class Debugger: public mate::TrackableObject<Debugger>,
public content::DevToolsAgentHostClient {
public:
using SendCommandCallback =
base::Callback<void(const base::DictionaryValue&,
const base::DictionaryValue&)>;
static mate::Handle<Debugger> Create(
v8::Isolate* isolate, content::WebContents* web_contents);
// mate::TrackableObject:
static void BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::ObjectTemplate> prototype);
protected:
Debugger(v8::Isolate* isolate, content::WebContents* web_contents);
~Debugger() override;
// content::DevToolsAgentHostClient:
void AgentHostClosed(content::DevToolsAgentHost* agent_host,
bool replaced_with_another_client) override;
void DispatchProtocolMessage(content::DevToolsAgentHost* agent_host,
const std::string& message) override;
private:
using PendingRequestMap = std::map<int, SendCommandCallback>;
void Attach(mate::Arguments* args);
bool IsAttached();
void Detach();
void SendCommand(mate::Arguments* args);
content::WebContents* web_contents_; // Weak Reference.
scoped_refptr<content::DevToolsAgentHost> agent_host_;
PendingRequestMap pending_requests_;
int previous_request_id_;
DISALLOW_COPY_AND_ASSIGN(Debugger);
};
} // namespace api
} // namespace atom
#endif // ATOM_BROWSER_API_ATOM_API_DEBUGGER_H_

View File

@@ -5,7 +5,6 @@
#include "atom/browser/api/atom_api_desktop_capturer.h"
#include "atom/common/api/atom_api_native_image.h"
#include "atom/common/node_includes.h"
#include "atom/common/native_mate_converters/gfx_converter.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/media/desktop_media_list.h"
@@ -14,6 +13,8 @@
#include "third_party/webrtc/modules/desktop_capture/screen_capturer.h"
#include "third_party/webrtc/modules/desktop_capture/window_capturer.h"
#include "atom/common/node_includes.h"
namespace mate {
template<>
@@ -37,7 +38,8 @@ namespace atom {
namespace api {
DesktopCapturer::DesktopCapturer() {
DesktopCapturer::DesktopCapturer(v8::Isolate* isolate) {
Init(isolate);
}
DesktopCapturer::~DesktopCapturer() {
@@ -59,12 +61,12 @@ void DesktopCapturer::StartHandling(bool capture_window,
options.set_disable_effects(false);
#endif
scoped_ptr<webrtc::ScreenCapturer> screen_capturer(
std::unique_ptr<webrtc::ScreenCapturer> screen_capturer(
capture_screen ? webrtc::ScreenCapturer::Create(options) : nullptr);
scoped_ptr<webrtc::WindowCapturer> window_capturer(
std::unique_ptr<webrtc::WindowCapturer> window_capturer(
capture_window ? webrtc::WindowCapturer::Create(options) : nullptr);
media_list_.reset(new NativeDesktopMediaList(screen_capturer.Pass(),
window_capturer.Pass()));
media_list_.reset(new NativeDesktopMediaList(
std::move(screen_capturer), std::move(window_capturer)));
media_list_->SetThumbnailSize(thumbnail_size);
media_list_->StartUpdating(this);
@@ -87,19 +89,19 @@ void DesktopCapturer::OnSourceThumbnailChanged(int index) {
bool DesktopCapturer::OnRefreshFinished() {
Emit("finished", media_list_->GetSources());
media_list_.reset();
return false;
}
mate::ObjectTemplateBuilder DesktopCapturer::GetObjectTemplateBuilder(
v8::Isolate* isolate) {
return mate::ObjectTemplateBuilder(isolate)
.SetMethod("startHandling", &DesktopCapturer::StartHandling);
}
// static
mate::Handle<DesktopCapturer> DesktopCapturer::Create(v8::Isolate* isolate) {
return mate::CreateHandle(isolate, new DesktopCapturer);
return mate::CreateHandle(isolate, new DesktopCapturer(isolate));
}
// static
void DesktopCapturer::BuildPrototype(
v8::Isolate* isolate, v8::Local<v8::ObjectTemplate> prototype) {
mate::ObjectTemplateBuilder(isolate, prototype)
.SetMethod("startHandling", &DesktopCapturer::StartHandling);
}
} // namespace api

View File

@@ -14,18 +14,21 @@ namespace atom {
namespace api {
class DesktopCapturer: public mate::EventEmitter,
class DesktopCapturer: public mate::EventEmitter<DesktopCapturer>,
public DesktopMediaListObserver {
public:
static mate::Handle<DesktopCapturer> Create(v8::Isolate* isolate);
static void BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::ObjectTemplate> prototype);
void StartHandling(bool capture_window,
bool capture_screen,
const gfx::Size& thumbnail_size);
protected:
DesktopCapturer();
~DesktopCapturer();
explicit DesktopCapturer(v8::Isolate* isolate);
~DesktopCapturer() override;
// DesktopMediaListObserver overrides.
void OnSourceAdded(int index) override;
@@ -36,11 +39,7 @@ class DesktopCapturer: public mate::EventEmitter,
bool OnRefreshFinished() override;
private:
// mate::Wrappable:
mate::ObjectTemplateBuilder GetObjectTemplateBuilder(
v8::Isolate* isolate) override;
scoped_ptr<DesktopMediaList> media_list_;
std::unique_ptr<DesktopMediaList> media_list_;
DISALLOW_COPY_AND_ASSIGN(DesktopCapturer);
};

View File

@@ -67,6 +67,7 @@ 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,
@@ -77,17 +78,18 @@ void ShowOpenDialog(const std::string& title,
if (mate::Converter<file_dialog::OpenDialogCallback>::FromV8(args->isolate(),
peek,
&callback)) {
file_dialog::ShowOpenDialog(window, title, default_path, filters,
properties, callback);
file_dialog::ShowOpenDialog(window, title, button_label, default_path,
filters, properties, callback);
} else {
std::vector<base::FilePath> paths;
if (file_dialog::ShowOpenDialog(window, title, default_path, filters,
properties, &paths))
if (file_dialog::ShowOpenDialog(window, title, button_label, default_path,
filters, properties, &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,
@@ -97,11 +99,12 @@ void ShowSaveDialog(const std::string& title,
if (mate::Converter<file_dialog::SaveDialogCallback>::FromV8(args->isolate(),
peek,
&callback)) {
file_dialog::ShowSaveDialog(window, title, default_path, filters, callback);
file_dialog::ShowSaveDialog(window, title, button_label, default_path,
filters, callback);
} else {
base::FilePath path;
if (file_dialog::ShowSaveDialog(window, title, default_path, filters,
&path))
if (file_dialog::ShowSaveDialog(window, title, button_label, default_path,
filters, &path))
args->Return(path);
}
}

View File

@@ -12,6 +12,7 @@
#include "atom/common/native_mate_converters/gurl_converter.h"
#include "atom/common/node_includes.h"
#include "base/memory/linked_ptr.h"
#include "base/message_loop/message_loop.h"
#include "base/strings/utf_string_conversions.h"
#include "native_mate/dictionary.h"
#include "net/base/filename_util.h"
@@ -24,6 +25,9 @@ struct Converter<content::DownloadItem::DownloadState> {
content::DownloadItem::DownloadState state) {
std::string download_state;
switch (state) {
case content::DownloadItem::IN_PROGRESS:
download_state = "progressing";
break;
case content::DownloadItem::COMPLETE:
download_state = "completed";
break;
@@ -47,66 +51,91 @@ namespace atom {
namespace api {
namespace {
// The wrapDownloadItem funtion which is implemented in JavaScript
using WrapDownloadItemCallback = base::Callback<void(v8::Local<v8::Value>)>;
WrapDownloadItemCallback g_wrap_download_item;
char kDownloadItemSavePathKey[] = "DownloadItemSavePathKey";
std::map<uint32_t, linked_ptr<v8::Global<v8::Value>>> g_download_item_objects;
std::map<uint32, linked_ptr<v8::Global<v8::Value>>> g_download_item_objects;
} // namespace
DownloadItem::SavePathData::SavePathData(const base::FilePath& path) :
path_(path) {
}
const base::FilePath& DownloadItem::SavePathData::path() {
return path_;
}
DownloadItem::DownloadItem(content::DownloadItem* download_item) :
download_item_(download_item) {
DownloadItem::DownloadItem(v8::Isolate* isolate,
content::DownloadItem* download_item)
: download_item_(download_item) {
download_item_->AddObserver(this);
Init(isolate);
AttachAsUserData(download_item);
}
DownloadItem::~DownloadItem() {
if (download_item_)
OnDownloadDestroyed(download_item_);
if (download_item_) {
// Destroyed by either garbage collection or destroy().
download_item_->RemoveObserver(this);
download_item_->Remove();
}
// Remove from the global map.
auto iter = g_download_item_objects.find(weak_map_id());
if (iter != g_download_item_objects.end())
g_download_item_objects.erase(iter);
}
void DownloadItem::OnDownloadUpdated(content::DownloadItem* item) {
download_item_->IsDone() ? Emit("done", item->GetState()) : Emit("updated");
if (download_item_->IsDone()) {
Emit("done", item->GetState());
// Destroy the item once item is downloaded.
base::MessageLoop::current()->PostTask(FROM_HERE, GetDestroyClosure());
} else {
Emit("updated", item->GetState());
}
}
void DownloadItem::OnDownloadDestroyed(content::DownloadItem* download_item) {
download_item_->RemoveObserver(this);
auto iter = g_download_item_objects.find(download_item_->GetId());
if (iter != g_download_item_objects.end())
g_download_item_objects.erase(iter);
download_item_ = nullptr;
// Destroy the native class immediately when downloadItem is destroyed.
delete this;
}
int64 DownloadItem::GetReceivedBytes() {
void DownloadItem::Pause() {
download_item_->Pause();
}
bool DownloadItem::IsPaused() const {
return download_item_->IsPaused();
}
void DownloadItem::Resume() {
download_item_->Resume();
}
bool DownloadItem::CanResume() const {
return download_item_->CanResume();
}
void DownloadItem::Cancel() {
download_item_->Cancel(true);
download_item_->Remove();
}
int64_t DownloadItem::GetReceivedBytes() const {
return download_item_->GetReceivedBytes();
}
int64 DownloadItem::GetTotalBytes() {
int64_t DownloadItem::GetTotalBytes() const {
return download_item_->GetTotalBytes();
}
const GURL& DownloadItem::GetURL() {
return download_item_->GetURL();
}
std::string DownloadItem::GetMimeType() {
std::string DownloadItem::GetMimeType() const {
return download_item_->GetMimeType();
}
bool DownloadItem::HasUserGesture() {
bool DownloadItem::HasUserGesture() const {
return download_item_->HasUserGesture();
}
std::string DownloadItem::GetFilename() {
std::string DownloadItem::GetFilename() const {
return base::UTF16ToUTF8(net::GenerateFileName(GetURL(),
GetContentDisposition(),
std::string(),
@@ -115,24 +144,28 @@ std::string DownloadItem::GetFilename() {
std::string()).LossyDisplayName());
}
std::string DownloadItem::GetContentDisposition() {
std::string DownloadItem::GetContentDisposition() const {
return download_item_->GetContentDisposition();
}
const GURL& DownloadItem::GetURL() const {
return download_item_->GetURL();
}
content::DownloadItem::DownloadState DownloadItem::GetState() const {
return download_item_->GetState();
}
bool DownloadItem::IsDone() const {
return download_item_->IsDone();
}
void DownloadItem::SetSavePath(const base::FilePath& path) {
download_item_->SetUserData(UserDataKey(), new SavePathData(path));
save_path_ = path;
}
void DownloadItem::Pause() {
download_item_->Pause();
}
void DownloadItem::Resume() {
download_item_->Resume();
}
void DownloadItem::Cancel() {
download_item_->Cancel(true);
base::FilePath DownloadItem::GetSavePath() const {
return save_path_;
}
// static
@@ -141,43 +174,41 @@ void DownloadItem::BuildPrototype(v8::Isolate* isolate,
mate::ObjectTemplateBuilder(isolate, prototype)
.MakeDestroyable()
.SetMethod("pause", &DownloadItem::Pause)
.SetMethod("isPaused", &DownloadItem::IsPaused)
.SetMethod("resume", &DownloadItem::Resume)
.SetMethod("canResume", &DownloadItem::CanResume)
.SetMethod("cancel", &DownloadItem::Cancel)
.SetMethod("getReceivedBytes", &DownloadItem::GetReceivedBytes)
.SetMethod("getTotalBytes", &DownloadItem::GetTotalBytes)
.SetMethod("getURL", &DownloadItem::GetURL)
.SetMethod("getMimeType", &DownloadItem::GetMimeType)
.SetMethod("hasUserGesture", &DownloadItem::HasUserGesture)
.SetMethod("getFilename", &DownloadItem::GetFilename)
.SetMethod("getContentDisposition", &DownloadItem::GetContentDisposition)
.SetMethod("setSavePath", &DownloadItem::SetSavePath);
.SetMethod("getURL", &DownloadItem::GetURL)
.SetMethod("getState", &DownloadItem::GetState)
.SetMethod("isDone", &DownloadItem::IsDone)
.SetMethod("setSavePath", &DownloadItem::SetSavePath)
.SetMethod("getSavePath", &DownloadItem::GetSavePath);
}
// static
mate::Handle<DownloadItem> DownloadItem::Create(
v8::Isolate* isolate, content::DownloadItem* item) {
auto handle = mate::CreateHandle(isolate, new DownloadItem(item));
auto existing = TrackableObject::FromWrappedClass(isolate, item);
if (existing)
return mate::CreateHandle(isolate, static_cast<DownloadItem*>(existing));
auto handle = mate::CreateHandle(isolate, new DownloadItem(isolate, item));
g_wrap_download_item.Run(handle.ToV8());
g_download_item_objects[item->GetId()] = make_linked_ptr(
// Reference this object in case it got garbage collected.
g_download_item_objects[handle->weak_map_id()] = make_linked_ptr(
new v8::Global<v8::Value>(isolate, handle.ToV8()));
return handle;
}
// static
void* DownloadItem::UserDataKey() {
return &kDownloadItemSavePathKey;
}
void ClearWrapDownloadItem() {
g_wrap_download_item.Reset();
}
void SetWrapDownloadItem(const WrapDownloadItemCallback& callback) {
g_wrap_download_item = callback;
// Cleanup the wrapper on exit.
atom::AtomBrowserMainParts::Get()->RegisterDestructionCallback(
base::Bind(ClearWrapDownloadItem));
}
} // namespace api

View File

@@ -20,43 +20,39 @@ namespace api {
class DownloadItem : public mate::TrackableObject<DownloadItem>,
public content::DownloadItem::Observer {
public:
class SavePathData : public base::SupportsUserData::Data {
public:
explicit SavePathData(const base::FilePath& path);
const base::FilePath& path();
private:
base::FilePath path_;
};
static mate::Handle<DownloadItem> Create(v8::Isolate* isolate,
content::DownloadItem* item);
static void* UserDataKey();
// mate::TrackableObject:
static void BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::ObjectTemplate> prototype);
void Pause();
bool IsPaused() const;
void Resume();
bool CanResume() const;
void Cancel();
int64_t GetReceivedBytes() const;
int64_t GetTotalBytes() const;
std::string GetMimeType() const;
bool HasUserGesture() const;
std::string GetFilename() const;
std::string GetContentDisposition() const;
const GURL& GetURL() const;
content::DownloadItem::DownloadState GetState() const;
bool IsDone() const;
void SetSavePath(const base::FilePath& path);
base::FilePath GetSavePath() const;
protected:
explicit DownloadItem(content::DownloadItem* download_item);
DownloadItem(v8::Isolate* isolate, content::DownloadItem* download_item);
~DownloadItem();
// Override content::DownloadItem::Observer methods
void OnDownloadUpdated(content::DownloadItem* download) override;
void OnDownloadDestroyed(content::DownloadItem* download) override;
void Pause();
void Resume();
void Cancel();
int64 GetReceivedBytes();
int64 GetTotalBytes();
std::string GetMimeType();
bool HasUserGesture();
std::string GetFilename();
std::string GetContentDisposition();
const GURL& GetURL();
void SetSavePath(const base::FilePath& path);
private:
base::FilePath save_path_;
content::DownloadItem* download_item_;
DISALLOW_COPY_AND_ASSIGN(DownloadItem);

View File

@@ -19,7 +19,8 @@ namespace atom {
namespace api {
GlobalShortcut::GlobalShortcut() {
GlobalShortcut::GlobalShortcut(v8::Isolate* isolate) {
Init(isolate);
}
GlobalShortcut::~GlobalShortcut() {
@@ -66,20 +67,21 @@ void GlobalShortcut::UnregisterAll() {
GlobalShortcutListener::GetInstance()->UnregisterAccelerators(this);
}
mate::ObjectTemplateBuilder GlobalShortcut::GetObjectTemplateBuilder(
v8::Isolate* isolate) {
return mate::ObjectTemplateBuilder(isolate)
// static
mate::Handle<GlobalShortcut> GlobalShortcut::Create(v8::Isolate* isolate) {
return mate::CreateHandle(isolate, new GlobalShortcut(isolate));
}
// static
void GlobalShortcut::BuildPrototype(
v8::Isolate* isolate, v8::Local<v8::ObjectTemplate> prototype) {
mate::ObjectTemplateBuilder(isolate, prototype)
.SetMethod("register", &GlobalShortcut::Register)
.SetMethod("isRegistered", &GlobalShortcut::IsRegistered)
.SetMethod("unregister", &GlobalShortcut::Unregister)
.SetMethod("unregisterAll", &GlobalShortcut::UnregisterAll);
}
// static
mate::Handle<GlobalShortcut> GlobalShortcut::Create(v8::Isolate* isolate) {
return CreateHandle(isolate, new GlobalShortcut);
}
} // namespace api
} // namespace atom

View File

@@ -23,13 +23,12 @@ class GlobalShortcut : public extensions::GlobalShortcutListener::Observer,
public:
static mate::Handle<GlobalShortcut> Create(v8::Isolate* isolate);
protected:
GlobalShortcut();
~GlobalShortcut() override;
static void BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::ObjectTemplate> prototype);
// mate::Wrappable implementations:
mate::ObjectTemplateBuilder GetObjectTemplateBuilder(
v8::Isolate* isolate) override;
protected:
explicit GlobalShortcut(v8::Isolate* isolate);
~GlobalShortcut() override;
private:
typedef std::map<ui::Accelerator, base::Closure> AcceleratorCallbackMap;

View File

@@ -19,7 +19,7 @@ namespace atom {
namespace api {
Menu::Menu()
Menu::Menu(v8::Isolate* isolate)
: model_(new AtomMenuModel(this)),
parent_(NULL) {
}
@@ -28,7 +28,7 @@ Menu::~Menu() {
}
void Menu::AfterInit(v8::Isolate* isolate) {
mate::Dictionary wrappable(isolate, GetWrapper(isolate));
mate::Dictionary wrappable(isolate, GetWrapper());
mate::Dictionary delegate;
if (!wrappable.Get("delegate", &delegate))
return;
@@ -169,8 +169,7 @@ void Menu::BuildPrototype(v8::Isolate* isolate,
.SetMethod("isItemCheckedAt", &Menu::IsItemCheckedAt)
.SetMethod("isEnabledAt", &Menu::IsEnabledAt)
.SetMethod("isVisibleAt", &Menu::IsVisibleAt)
.SetMethod("_popup", &Menu::Popup)
.SetMethod("_popupAt", &Menu::PopupAt);
.SetMethod("popupAt", &Menu::PopupAt);
}
} // namespace api

View File

@@ -20,7 +20,7 @@ namespace api {
class Menu : public mate::TrackableObject<Menu>,
public AtomMenuModel::Delegate {
public:
static mate::Wrappable* Create();
static mate::WrappableBase* Create(v8::Isolate* isolate);
static void BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::ObjectTemplate> prototype);
@@ -36,7 +36,7 @@ class Menu : public mate::TrackableObject<Menu>,
AtomMenuModel* model() const { return model_.get(); }
protected:
Menu();
explicit Menu(v8::Isolate* isolate);
~Menu() override;
// mate::Wrappable:
@@ -51,10 +51,11 @@ class Menu : public mate::TrackableObject<Menu>,
void ExecuteCommand(int command_id, int event_flags) override;
void MenuWillShow(ui::SimpleMenuModel* source) override;
virtual void Popup(Window* window) = 0;
virtual void PopupAt(Window* window, int x, int y) = 0;
virtual void PopupAt(Window* window,
int x = -1, int y = -1,
int positioning_item = 0) = 0;
scoped_ptr<AtomMenuModel> model_;
std::unique_ptr<AtomMenuModel> model_;
Menu* parent_;
private:

View File

@@ -17,10 +17,9 @@ namespace api {
class MenuMac : public Menu {
protected:
MenuMac();
explicit MenuMac(v8::Isolate* isolate);
void Popup(Window* window) override;
void PopupAt(Window* window, int x, int y) override;
void PopupAt(Window* window, int x, int y, int positioning_item = 0) override;
base::scoped_nsobject<AtomMenuController> menu_controller_;

View File

@@ -7,6 +7,8 @@
#include "atom/browser/native_window.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/web_contents.h"
#include "atom/common/node_includes.h"
@@ -15,58 +17,57 @@ namespace atom {
namespace api {
MenuMac::MenuMac() {
MenuMac::MenuMac(v8::Isolate* isolate) : Menu(isolate) {
}
void MenuMac::Popup(Window* window) {
void MenuMac::PopupAt(Window* window, int x, int y, int positioning_item) {
NativeWindow* native_window = window->window();
if (!native_window)
return;
content::WebContents* web_contents = native_window->web_contents();
if (!web_contents)
return;
NSWindow* nswindow = native_window->GetNativeWindow();
base::scoped_nsobject<AtomMenuController> menu_controller(
[[AtomMenuController alloc] initWithModel:model_.get()]);
// Fake out a context menu event.
NSEvent* currentEvent = [NSApp currentEvent];
NSPoint position = [nswindow mouseLocationOutsideOfEventStream];
NSTimeInterval eventTime = [currentEvent timestamp];
NSEvent* clickEvent = [NSEvent mouseEventWithType:NSRightMouseDown
location:position
modifierFlags:NSRightMouseDownMask
timestamp:eventTime
windowNumber:[nswindow windowNumber]
context:nil
eventNumber:0
clickCount:1
pressure:1.0];
// Show the menu.
[NSMenu popUpContextMenu:[menu_controller menu]
withEvent:clickEvent
forView:web_contents->GetContentNativeView()];
}
void MenuMac::PopupAt(Window* window, int x, int y) {
NativeWindow* native_window = window->window();
if (!native_window)
return;
content::WebContents* web_contents = native_window->web_contents();
brightray::InspectableWebContents* web_contents =
native_window->inspectable_web_contents();
if (!web_contents)
return;
base::scoped_nsobject<AtomMenuController> menu_controller(
[[AtomMenuController alloc] initWithModel:model_.get()]);
NSMenu* menu = [menu_controller menu];
NSView* view = web_contents->GetContentNativeView();
NSView* view = web_contents->GetView()->GetNativeView();
// Which menu item to show.
NSMenuItem* item = nil;
if (positioning_item < [menu numberOfItems] && positioning_item >= 0)
item = [menu itemAtIndex:positioning_item];
// (-1, -1) means showing on mouse location.
NSPoint position;
if (x == -1 || y == -1) {
NSWindow* nswindow = native_window->GetNativeWindow();
position = [view convertPoint:[nswindow mouseLocationOutsideOfEventStream]
fromView:nil];
} else {
position = NSMakePoint(x, [view frame].size.height - y);
}
// If no preferred item is specified, try to show all of the menu items.
if (!positioning_item) {
CGFloat windowBottom = CGRectGetMinY([view window].frame);
CGFloat lowestMenuPoint = windowBottom + position.y - [menu size].height;
CGFloat screenBottom = CGRectGetMinY([view window].screen.frame);
CGFloat distanceFromBottom = lowestMenuPoint - screenBottom;
if (distanceFromBottom < 0)
position.y = position.y - distanceFromBottom + 4;
}
// Place the menu left of cursor if it is overflowing off right of screen.
CGFloat windowLeft = CGRectGetMinX([view window].frame);
CGFloat rightmostMenuPoint = windowLeft + position.x + [menu size].width;
CGFloat screenRight = CGRectGetMaxX([view window].screen.frame);
if (rightmostMenuPoint > screenRight)
position.x = position.x - [menu size].width;
// Show the menu.
[menu popUpMenuPositioningItem:[menu itemAtIndex:0]
atLocation:NSMakePoint(x, [view frame].size.height - y)
inView:view];
[menu popUpMenuPositioningItem:item atLocation:position inView:view];
}
// static
@@ -87,8 +88,8 @@ void Menu::SendActionToFirstResponder(const std::string& action) {
}
// static
mate::Wrappable* Menu::Create() {
return new MenuMac();
mate::WrappableBase* Menu::Create(v8::Isolate* isolate) {
return new MenuMac(isolate);
}
} // namespace api

View File

@@ -13,14 +13,10 @@ namespace atom {
namespace api {
MenuViews::MenuViews() {
MenuViews::MenuViews(v8::Isolate* isolate) : Menu(isolate) {
}
void MenuViews::Popup(Window* window) {
PopupAtPoint(window, gfx::Screen::GetNativeScreen()->GetCursorScreenPoint());
}
void MenuViews::PopupAt(Window* window, int x, int y) {
void MenuViews::PopupAt(Window* window, int x, int y, int positioning_item) {
NativeWindow* native_window = static_cast<NativeWindow*>(window->window());
if (!native_window)
return;
@@ -31,25 +27,30 @@ void MenuViews::PopupAt(Window* window, int x, int y) {
if (!view)
return;
gfx::Point origin = view->GetViewBounds().origin();
PopupAtPoint(window, gfx::Point(origin.x() + x, origin.y() + y));
}
// (-1, -1) means showing on mouse location.
gfx::Point location;
if (x == -1 || y == -1) {
location = gfx::Screen::GetScreen()->GetCursorScreenPoint();
} else {
gfx::Point origin = view->GetViewBounds().origin();
location = gfx::Point(origin.x() + x, origin.y() + y);
}
void MenuViews::PopupAtPoint(Window* window, const gfx::Point& point) {
// Show the menu.
views::MenuRunner menu_runner(
model(),
views::MenuRunner::CONTEXT_MENU | views::MenuRunner::HAS_MNEMONICS);
ignore_result(menu_runner.RunMenuAt(
static_cast<NativeWindowViews*>(window->window())->widget(),
NULL,
gfx::Rect(point, gfx::Size()),
gfx::Rect(location, gfx::Size()),
views::MENU_ANCHOR_TOPLEFT,
ui::MENU_SOURCE_MOUSE));
}
// static
mate::Wrappable* Menu::Create() {
return new MenuViews();
mate::WrappableBase* Menu::Create(v8::Isolate* isolate) {
return new MenuViews(isolate);
}
} // namespace api

View File

@@ -14,15 +14,12 @@ namespace api {
class MenuViews : public Menu {
public:
MenuViews();
explicit MenuViews(v8::Isolate* isolate);
protected:
void Popup(Window* window) override;
void PopupAt(Window* window, int x, int y) override;
void PopupAt(Window* window, int x, int y, int positioning_item = 0) override;
private:
void PopupAtPoint(Window* window, const gfx::Point& point);
DISALLOW_COPY_AND_ASSIGN(MenuViews);
};

View File

@@ -14,8 +14,9 @@ namespace atom {
namespace api {
PowerMonitor::PowerMonitor() {
PowerMonitor::PowerMonitor(v8::Isolate* isolate) {
base::PowerMonitor::Get()->AddObserver(this);
Init(isolate);
}
PowerMonitor::~PowerMonitor() {
@@ -46,7 +47,13 @@ v8::Local<v8::Value> PowerMonitor::Create(v8::Isolate* isolate) {
return v8::Null(isolate);
}
return CreateHandle(isolate, new PowerMonitor).ToV8();
return mate::CreateHandle(isolate, new PowerMonitor(isolate)).ToV8();
}
// static
void PowerMonitor::BuildPrototype(
v8::Isolate* isolate, v8::Local<v8::ObjectTemplate> prototype) {
mate::ObjectTemplateBuilder(isolate, prototype);
}
} // namespace api

View File

@@ -19,8 +19,11 @@ class PowerMonitor : public mate::TrackableObject<PowerMonitor>,
public:
static v8::Local<v8::Value> Create(v8::Isolate* isolate);
static void BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::ObjectTemplate> prototype);
protected:
PowerMonitor();
explicit PowerMonitor(v8::Isolate* isolate);
~PowerMonitor() override;
// base::PowerObserver implementations:

View File

@@ -37,9 +37,10 @@ namespace atom {
namespace api {
PowerSaveBlocker::PowerSaveBlocker()
PowerSaveBlocker::PowerSaveBlocker(v8::Isolate* isolate)
: current_blocker_type_(
content::PowerSaveBlocker::kPowerSaveBlockPreventAppSuspension) {
content::PowerSaveBlocker::kPowerSaveBlockPreventAppSuspension) {
Init(isolate);
}
PowerSaveBlocker::~PowerSaveBlocker() {
@@ -69,7 +70,7 @@ void PowerSaveBlocker::UpdatePowerSaveBlocker() {
}
if (!power_save_blocker_ || new_blocker_type != current_blocker_type_) {
scoped_ptr<content::PowerSaveBlocker> new_blocker =
std::unique_ptr<content::PowerSaveBlocker> new_blocker =
content::PowerSaveBlocker::Create(
new_blocker_type,
content::PowerSaveBlocker::kReasonOther,
@@ -97,17 +98,18 @@ bool PowerSaveBlocker::IsStarted(int id) {
return power_save_blocker_types_.find(id) != power_save_blocker_types_.end();
}
mate::ObjectTemplateBuilder PowerSaveBlocker::GetObjectTemplateBuilder(
v8::Isolate* isolate) {
return mate::ObjectTemplateBuilder(isolate)
.SetMethod("start", &PowerSaveBlocker::Start)
.SetMethod("stop", &PowerSaveBlocker::Stop)
.SetMethod("isStarted", &PowerSaveBlocker::IsStarted);
// static
mate::Handle<PowerSaveBlocker> PowerSaveBlocker::Create(v8::Isolate* isolate) {
return mate::CreateHandle(isolate, new PowerSaveBlocker(isolate));
}
// static
mate::Handle<PowerSaveBlocker> PowerSaveBlocker::Create(v8::Isolate* isolate) {
return CreateHandle(isolate, new PowerSaveBlocker);
void PowerSaveBlocker::BuildPrototype(
v8::Isolate* isolate, v8::Local<v8::ObjectTemplate> prototype) {
mate::ObjectTemplateBuilder(isolate, prototype)
.SetMethod("start", &PowerSaveBlocker::Start)
.SetMethod("stop", &PowerSaveBlocker::Stop)
.SetMethod("isStarted", &PowerSaveBlocker::IsStarted);
}
} // namespace api

View File

@@ -24,13 +24,12 @@ class PowerSaveBlocker : public mate::TrackableObject<PowerSaveBlocker> {
public:
static mate::Handle<PowerSaveBlocker> Create(v8::Isolate* isolate);
protected:
PowerSaveBlocker();
~PowerSaveBlocker() override;
static void BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::ObjectTemplate> prototype);
// mate::Wrappable implementations:
mate::ObjectTemplateBuilder GetObjectTemplateBuilder(
v8::Isolate* isolate) override;
protected:
explicit PowerSaveBlocker(v8::Isolate* isolate);
~PowerSaveBlocker() override;
private:
void UpdatePowerSaveBlocker();
@@ -38,7 +37,7 @@ class PowerSaveBlocker : public mate::TrackableObject<PowerSaveBlocker> {
bool Stop(int id);
bool IsStarted(int id);
scoped_ptr<content::PowerSaveBlocker> power_save_blocker_;
std::unique_ptr<content::PowerSaveBlocker> power_save_blocker_;
// Currnet blocker type used by |power_save_blocker_|
content::PowerSaveBlocker::PowerSaveBlockerType current_blocker_type_;

View File

@@ -5,16 +5,20 @@
#include "atom/browser/api/atom_api_protocol.h"
#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/net/url_request_async_asar_job.h"
#include "atom/browser/net/url_request_buffer_job.h"
#include "atom/browser/net/url_request_fetch_job.h"
#include "atom/browser/net/url_request_string_job.h"
#include "atom/common/native_mate_converters/callback.h"
#include "atom/common/native_mate_converters/net_converter.h"
#include "atom/common/native_mate_converters/value_converter.h"
#include "atom/common/node_includes.h"
#include "atom/common/options_switches.h"
#include "base/command_line.h"
#include "base/strings/string_util.h"
#include "content/public/browser/child_process_security_policy.h"
#include "native_mate/dictionary.h"
#include "url/url_util.h"
using content::BrowserThread;
@@ -22,42 +26,11 @@ namespace atom {
namespace api {
Protocol::Protocol(AtomBrowserContext* browser_context)
: request_context_getter_(browser_context->GetRequestContext()),
job_factory_(browser_context->job_factory()) {
CHECK(job_factory_);
}
mate::ObjectTemplateBuilder Protocol::GetObjectTemplateBuilder(
v8::Isolate* isolate) {
return mate::ObjectTemplateBuilder(isolate)
.SetMethod("registerStandardSchemes", &Protocol::RegisterStandardSchemes)
.SetMethod("registerServiceWorkerSchemes",
&Protocol::RegisterServiceWorkerSchemes)
.SetMethod("registerStringProtocol",
&Protocol::RegisterProtocol<URLRequestStringJob>)
.SetMethod("registerBufferProtocol",
&Protocol::RegisterProtocol<URLRequestBufferJob>)
.SetMethod("registerFileProtocol",
&Protocol::RegisterProtocol<URLRequestAsyncAsarJob>)
.SetMethod("registerHttpProtocol",
&Protocol::RegisterProtocol<URLRequestFetchJob>)
.SetMethod("unregisterProtocol", &Protocol::UnregisterProtocol)
.SetMethod("isProtocolHandled", &Protocol::IsProtocolHandled)
.SetMethod("interceptStringProtocol",
&Protocol::InterceptProtocol<URLRequestStringJob>)
.SetMethod("interceptBufferProtocol",
&Protocol::InterceptProtocol<URLRequestBufferJob>)
.SetMethod("interceptFileProtocol",
&Protocol::InterceptProtocol<URLRequestAsyncAsarJob>)
.SetMethod("interceptHttpProtocol",
&Protocol::InterceptProtocol<URLRequestFetchJob>)
.SetMethod("uninterceptProtocol", &Protocol::UninterceptProtocol);
}
void Protocol::RegisterStandardSchemes(
const std::vector<std::string>& schemes) {
atom::AtomBrowserClient::SetCustomSchemes(schemes);
Protocol::Protocol(v8::Isolate* isolate, AtomBrowserContext* browser_context)
: request_context_getter_(static_cast<brightray::URLRequestContextGetter*>(
browser_context->GetRequestContext())),
weak_factory_(this) {
Init(isolate);
}
void Protocol::RegisterServiceWorkerSchemes(
@@ -72,30 +45,37 @@ void Protocol::UnregisterProtocol(
content::BrowserThread::PostTaskAndReplyWithResult(
content::BrowserThread::IO, FROM_HERE,
base::Bind(&Protocol::UnregisterProtocolInIO,
base::Unretained(this), scheme),
request_context_getter_, scheme),
base::Bind(&Protocol::OnIOCompleted,
base::Unretained(this), callback));
GetWeakPtr(), callback));
}
// static
Protocol::ProtocolError Protocol::UnregisterProtocolInIO(
scoped_refptr<brightray::URLRequestContextGetter> request_context_getter,
const std::string& scheme) {
if (!job_factory_->HasProtocolHandler(scheme))
auto job_factory = static_cast<AtomURLRequestJobFactory*>(
request_context_getter->job_factory());
if (!job_factory->HasProtocolHandler(scheme))
return PROTOCOL_NOT_REGISTERED;
job_factory_->SetProtocolHandler(scheme, nullptr);
job_factory->SetProtocolHandler(scheme, nullptr);
return PROTOCOL_OK;
}
void Protocol::IsProtocolHandled(const std::string& scheme,
const BooleanCallback& callback) {
const BooleanCallback& callback) {
content::BrowserThread::PostTaskAndReplyWithResult(
content::BrowserThread::IO, FROM_HERE,
base::Bind(&Protocol::IsProtocolHandledInIO,
base::Unretained(this), scheme),
request_context_getter_, scheme),
callback);
}
bool Protocol::IsProtocolHandledInIO(const std::string& scheme) {
return job_factory_->IsHandledProtocol(scheme);
// static
bool Protocol::IsProtocolHandledInIO(
scoped_refptr<brightray::URLRequestContextGetter> request_context_getter,
const std::string& scheme) {
return request_context_getter->job_factory()->IsHandledProtocol(scheme);
}
void Protocol::UninterceptProtocol(
@@ -105,18 +85,18 @@ void Protocol::UninterceptProtocol(
content::BrowserThread::PostTaskAndReplyWithResult(
content::BrowserThread::IO, FROM_HERE,
base::Bind(&Protocol::UninterceptProtocolInIO,
base::Unretained(this), scheme),
request_context_getter_, scheme),
base::Bind(&Protocol::OnIOCompleted,
base::Unretained(this), callback));
GetWeakPtr(), callback));
}
// static
Protocol::ProtocolError Protocol::UninterceptProtocolInIO(
scoped_refptr<brightray::URLRequestContextGetter> request_context_getter,
const std::string& scheme) {
if (!original_protocols_.contains(scheme))
return PROTOCOL_NOT_INTERCEPTED;
job_factory_->ReplaceProtocol(scheme,
original_protocols_.take_and_erase(scheme));
return PROTOCOL_OK;
return static_cast<AtomURLRequestJobFactory*>(
request_context_getter->job_factory())->UninterceptProtocol(scheme) ?
PROTOCOL_OK : PROTOCOL_NOT_INTERCEPTED;
}
void Protocol::OnIOCompleted(
@@ -147,10 +127,44 @@ std::string Protocol::ErrorCodeToString(ProtocolError error) {
}
}
AtomURLRequestJobFactory* Protocol::GetJobFactoryInIO() const {
request_context_getter_->GetURLRequestContext(); // Force init.
return static_cast<AtomURLRequestJobFactory*>(
static_cast<brightray::URLRequestContextGetter*>(
request_context_getter_.get())->job_factory());
}
// static
mate::Handle<Protocol> Protocol::Create(
v8::Isolate* isolate, AtomBrowserContext* browser_context) {
return mate::CreateHandle(isolate, new Protocol(browser_context));
return mate::CreateHandle(isolate, new Protocol(isolate, browser_context));
}
// static
void Protocol::BuildPrototype(
v8::Isolate* isolate, v8::Local<v8::ObjectTemplate> prototype) {
mate::ObjectTemplateBuilder(isolate, prototype)
.SetMethod("registerServiceWorkerSchemes",
&Protocol::RegisterServiceWorkerSchemes)
.SetMethod("registerStringProtocol",
&Protocol::RegisterProtocol<URLRequestStringJob>)
.SetMethod("registerBufferProtocol",
&Protocol::RegisterProtocol<URLRequestBufferJob>)
.SetMethod("registerFileProtocol",
&Protocol::RegisterProtocol<URLRequestAsyncAsarJob>)
.SetMethod("registerHttpProtocol",
&Protocol::RegisterProtocol<URLRequestFetchJob>)
.SetMethod("unregisterProtocol", &Protocol::UnregisterProtocol)
.SetMethod("isProtocolHandled", &Protocol::IsProtocolHandled)
.SetMethod("interceptStringProtocol",
&Protocol::InterceptProtocol<URLRequestStringJob>)
.SetMethod("interceptBufferProtocol",
&Protocol::InterceptProtocol<URLRequestBufferJob>)
.SetMethod("interceptFileProtocol",
&Protocol::InterceptProtocol<URLRequestAsyncAsarJob>)
.SetMethod("interceptHttpProtocol",
&Protocol::InterceptProtocol<URLRequestFetchJob>)
.SetMethod("uninterceptProtocol", &Protocol::UninterceptProtocol);
}
} // namespace api
@@ -159,13 +173,24 @@ mate::Handle<Protocol> Protocol::Create(
namespace {
void RegisterStandardSchemes(
const std::vector<std::string>& schemes) {
auto policy = content::ChildProcessSecurityPolicy::GetInstance();
for (const auto& scheme : schemes) {
url::AddStandardScheme(scheme.c_str(), url::SCHEME_WITHOUT_PORT);
policy->RegisterWebSafeScheme(scheme);
}
auto command_line = base::CommandLine::ForCurrentProcess();
command_line->AppendSwitchASCII(atom::switches::kStandardSchemes,
base::JoinString(schemes, ","));
}
void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
v8::Local<v8::Context> context, void* priv) {
v8::Isolate* isolate = context->GetIsolate();
mate::Dictionary dict(isolate, exports);
auto browser_context = static_cast<atom::AtomBrowserContext*>(
atom::AtomBrowserMainParts::Get()->browser_context());
dict.Set("protocol", atom::api::Protocol::Create(isolate, browser_context));
dict.SetMethod("registerStandardSchemes", &RegisterStandardSchemes);
}
} // namespace

View File

@@ -9,43 +9,40 @@
#include <map>
#include <vector>
#include "atom/browser/api/trackable_object.h"
#include "atom/browser/atom_browser_context.h"
#include "atom/browser/net/atom_url_request_job_factory.h"
#include "base/callback.h"
#include "base/containers/scoped_ptr_hash_map.h"
#include "base/memory/weak_ptr.h"
#include "content/public/browser/browser_thread.h"
#include "native_mate/arguments.h"
#include "native_mate/dictionary.h"
#include "native_mate/handle.h"
#include "native_mate/wrappable.h"
#include "net/url_request/url_request_context.h"
namespace net {
class URLRequest;
class URLRequestContextGetter;
namespace base {
class DictionaryValue;
}
namespace atom {
class AtomBrowserContext;
class AtomURLRequestJobFactory;
namespace api {
class Protocol : public mate::Wrappable {
class Protocol : public mate::TrackableObject<Protocol> {
public:
using Handler =
base::Callback<void(const net::URLRequest*, v8::Local<v8::Value>)>;
base::Callback<void(const base::DictionaryValue&, v8::Local<v8::Value>)>;
using CompletionCallback = base::Callback<void(v8::Local<v8::Value>)>;
using BooleanCallback = base::Callback<void(bool)>;
static mate::Handle<Protocol> Create(
v8::Isolate* isolate, AtomBrowserContext* browser_context);
protected:
explicit Protocol(AtomBrowserContext* browser_context);
static void BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::ObjectTemplate> prototype);
// mate::Wrappable implementations:
virtual mate::ObjectTemplateBuilder GetObjectTemplateBuilder(
v8::Isolate* isolate);
protected:
Protocol(v8::Isolate* isolate, AtomBrowserContext* browser_context);
private:
// Possible errors.
@@ -77,21 +74,18 @@ class Protocol : public mate::Wrappable {
net::URLRequest* request,
net::NetworkDelegate* network_delegate) const override {
RequestJob* request_job = new RequestJob(request, network_delegate);
request_job->SetHandlerInfo(isolate_, request_context_, handler_);
request_job->SetHandlerInfo(isolate_, request_context_.get(), handler_);
return request_job;
}
private:
v8::Isolate* isolate_;
net::URLRequestContextGetter* request_context_;
scoped_refptr<net::URLRequestContextGetter> request_context_;
Protocol::Handler handler_;
DISALLOW_COPY_AND_ASSIGN(CustomProtocolHandler);
};
// Register schemes to standard scheme list.
void RegisterStandardSchemes(const std::vector<std::string>& schemes);
// Register schemes that can handle service worker.
void RegisterServiceWorkerSchemes(const std::vector<std::string>& schemes);
@@ -105,19 +99,24 @@ class Protocol : public mate::Wrappable {
content::BrowserThread::PostTaskAndReplyWithResult(
content::BrowserThread::IO, FROM_HERE,
base::Bind(&Protocol::RegisterProtocolInIO<RequestJob>,
base::Unretained(this), scheme, handler),
request_context_getter_, isolate(), scheme, handler),
base::Bind(&Protocol::OnIOCompleted,
base::Unretained(this), callback));
GetWeakPtr(), callback));
}
template<typename RequestJob>
ProtocolError RegisterProtocolInIO(const std::string& scheme,
const Handler& handler) {
if (job_factory_->IsHandledProtocol(scheme))
static ProtocolError RegisterProtocolInIO(
scoped_refptr<brightray::URLRequestContextGetter> request_context_getter,
v8::Isolate* isolate,
const std::string& scheme,
const Handler& handler) {
auto job_factory = static_cast<AtomURLRequestJobFactory*>(
request_context_getter->job_factory());
if (job_factory->IsHandledProtocol(scheme))
return PROTOCOL_REGISTERED;
scoped_ptr<CustomProtocolHandler<RequestJob>> protocol_handler(
std::unique_ptr<CustomProtocolHandler<RequestJob>> protocol_handler(
new CustomProtocolHandler<RequestJob>(
isolate(), request_context_getter_, handler));
if (job_factory_->SetProtocolHandler(scheme, protocol_handler.Pass()))
isolate, request_context_getter.get(), handler));
if (job_factory->SetProtocolHandler(scheme, std::move(protocol_handler)))
return PROTOCOL_OK;
else
return PROTOCOL_FAIL;
@@ -125,12 +124,16 @@ class Protocol : public mate::Wrappable {
// Unregister the protocol handler that handles |scheme|.
void UnregisterProtocol(const std::string& scheme, mate::Arguments* args);
ProtocolError UnregisterProtocolInIO(const std::string& scheme);
static ProtocolError UnregisterProtocolInIO(
scoped_refptr<brightray::URLRequestContextGetter> request_context_getter,
const std::string& scheme);
// Whether the protocol has handler registered.
void IsProtocolHandled(const std::string& scheme,
const BooleanCallback& callback);
bool IsProtocolHandledInIO(const std::string& scheme);
static bool IsProtocolHandledInIO(
scoped_refptr<brightray::URLRequestContextGetter> request_context_getter,
const std::string& scheme);
// Replace the protocol handler with a new one.
template<typename RequestJob>
@@ -142,32 +145,36 @@ class Protocol : public mate::Wrappable {
content::BrowserThread::PostTaskAndReplyWithResult(
content::BrowserThread::IO, FROM_HERE,
base::Bind(&Protocol::InterceptProtocolInIO<RequestJob>,
base::Unretained(this), scheme, handler),
request_context_getter_, isolate(), scheme, handler),
base::Bind(&Protocol::OnIOCompleted,
base::Unretained(this), callback));
GetWeakPtr(), callback));
}
template<typename RequestJob>
ProtocolError InterceptProtocolInIO(const std::string& scheme,
const Handler& handler) {
if (!job_factory_->IsHandledProtocol(scheme))
static ProtocolError InterceptProtocolInIO(
scoped_refptr<brightray::URLRequestContextGetter> request_context_getter,
v8::Isolate* isolate,
const std::string& scheme,
const Handler& handler) {
auto job_factory = static_cast<AtomURLRequestJobFactory*>(
request_context_getter->job_factory());
if (!job_factory->IsHandledProtocol(scheme))
return PROTOCOL_NOT_REGISTERED;
// It is possible a protocol is handled but can not be intercepted.
if (!job_factory_->HasProtocolHandler(scheme))
if (!job_factory->HasProtocolHandler(scheme))
return PROTOCOL_FAIL;
if (ContainsKey(original_protocols_, scheme))
return PROTOCOL_INTERCEPTED;
scoped_ptr<CustomProtocolHandler<RequestJob>> protocol_handler(
std::unique_ptr<CustomProtocolHandler<RequestJob>> protocol_handler(
new CustomProtocolHandler<RequestJob>(
isolate(), request_context_getter_, handler));
original_protocols_.set(
scheme,
job_factory_->ReplaceProtocol(scheme, protocol_handler.Pass()));
isolate, request_context_getter.get(), handler));
if (!job_factory->InterceptProtocol(scheme, std::move(protocol_handler)))
return PROTOCOL_INTERCEPTED;
return PROTOCOL_OK;
}
// Restore the |scheme| to its original protocol handler.
void UninterceptProtocol(const std::string& scheme, mate::Arguments* args);
ProtocolError UninterceptProtocolInIO(const std::string& scheme);
static ProtocolError UninterceptProtocolInIO(
scoped_refptr<brightray::URLRequestContextGetter> request_context_getter,
const std::string& scheme);
// Convert error code to JS exception and call the callback.
void OnIOCompleted(const CompletionCallback& callback, ProtocolError error);
@@ -175,15 +182,14 @@ class Protocol : public mate::Wrappable {
// Convert error code to string.
std::string ErrorCodeToString(ProtocolError error);
net::URLRequestContextGetter* request_context_getter_;
AtomURLRequestJobFactory* GetJobFactoryInIO() const;
// Map that stores the original protocols of schemes.
using OriginalProtocolsMap = base::ScopedPtrHashMap<
std::string,
scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>>;
OriginalProtocolsMap original_protocols_;
base::WeakPtr<Protocol> GetWeakPtr() {
return weak_factory_.GetWeakPtr();
}
AtomURLRequestJobFactory* job_factory_; // weak ref
scoped_refptr<brightray::URLRequestContextGetter> request_context_getter_;
base::WeakPtrFactory<Protocol> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(Protocol);
};

View File

@@ -0,0 +1,87 @@
// 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_render_process_preferences.h"
#include "atom/browser/api/atom_api_web_contents.h"
#include "atom/browser/atom_browser_client.h"
#include "atom/common/native_mate_converters/value_converter.h"
#include "atom/common/node_includes.h"
#include "content/public/browser/render_process_host.h"
#include "native_mate/dictionary.h"
#include "native_mate/object_template_builder.h"
namespace atom {
namespace api {
namespace {
bool IsWebContents(v8::Isolate* isolate, content::RenderProcessHost* process) {
content::WebContents* web_contents =
static_cast<AtomBrowserClient*>(AtomBrowserClient::Get())->
GetWebContentsFromProcessID(process->GetID());
if (!web_contents)
return false;
auto api_web_contents = WebContents::CreateFrom(isolate, web_contents);
auto type = api_web_contents->GetType();
return type == WebContents::Type::BROWSER_WINDOW ||
type == WebContents::Type::WEB_VIEW;
}
} // namespace
RenderProcessPreferences::RenderProcessPreferences(
v8::Isolate* isolate,
const atom::RenderProcessPreferences::Predicate& predicate)
: preferences_(predicate) {
Init(isolate);
}
RenderProcessPreferences::~RenderProcessPreferences() {
}
int RenderProcessPreferences::AddEntry(const base::DictionaryValue& entry) {
return preferences_.AddEntry(entry);
}
void RenderProcessPreferences::RemoveEntry(int id) {
preferences_.RemoveEntry(id);
}
// static
void RenderProcessPreferences::BuildPrototype(
v8::Isolate* isolate, v8::Local<v8::ObjectTemplate> prototype) {
mate::ObjectTemplateBuilder(isolate, prototype)
.SetMethod("addEntry", &RenderProcessPreferences::AddEntry)
.SetMethod("removeEntry", &RenderProcessPreferences::RemoveEntry);
}
// static
mate::Handle<RenderProcessPreferences>
RenderProcessPreferences::ForAllWebContents(v8::Isolate* isolate) {
return mate::CreateHandle(
isolate,
new RenderProcessPreferences(isolate,
base::Bind(&IsWebContents, isolate)));
}
} // namespace api
} // namespace atom
namespace {
void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
v8::Local<v8::Context> context, void* priv) {
mate::Dictionary dict(context->GetIsolate(), exports);
dict.SetMethod("forAllWebContents",
&atom::api::RenderProcessPreferences::ForAllWebContents);
}
} // namespace
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_browser_render_process_preferences,
Initialize)

View File

@@ -0,0 +1,44 @@
// Copyright (c) 2016 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef ATOM_BROWSER_API_ATOM_API_RENDER_PROCESS_PREFERENCES_H_
#define ATOM_BROWSER_API_ATOM_API_RENDER_PROCESS_PREFERENCES_H_
#include "atom/browser/render_process_preferences.h"
#include "native_mate/handle.h"
#include "native_mate/wrappable.h"
namespace atom {
namespace api {
class RenderProcessPreferences
: public mate::Wrappable<RenderProcessPreferences> {
public:
static mate::Handle<RenderProcessPreferences>
ForAllWebContents(v8::Isolate* isolate);
static void BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::ObjectTemplate> prototype);
int AddEntry(const base::DictionaryValue& entry);
void RemoveEntry(int id);
protected:
RenderProcessPreferences(
v8::Isolate* isolate,
const atom::RenderProcessPreferences::Predicate& predicate);
~RenderProcessPreferences() override;
private:
atom::RenderProcessPreferences preferences_;
DISALLOW_COPY_AND_ASSIGN(RenderProcessPreferences);
};
} // namespace api
} // namespace atom
#endif // ATOM_BROWSER_API_ATOM_API_RENDER_PROCESS_PREFERENCES_H_

View File

@@ -47,9 +47,10 @@ std::vector<std::string> MetricsToArray(uint32_t metrics) {
} // namespace
Screen::Screen(gfx::Screen* screen) : screen_(screen) {
displays_ = screen_->GetAllDisplays();
Screen::Screen(v8::Isolate* isolate, gfx::Screen* screen)
: screen_(screen) {
screen_->AddObserver(this);
Init(isolate);
}
Screen::~Screen() {
@@ -65,7 +66,7 @@ gfx::Display Screen::GetPrimaryDisplay() {
}
std::vector<gfx::Display> Screen::GetAllDisplays() {
return displays_;
return screen_->GetAllDisplays();
}
gfx::Display Screen::GetDisplayNearestPoint(const gfx::Point& point) {
@@ -77,39 +78,18 @@ gfx::Display Screen::GetDisplayMatching(const gfx::Rect& match_rect) {
}
void Screen::OnDisplayAdded(const gfx::Display& new_display) {
displays_.push_back(new_display);
Emit("display-added", new_display);
}
void Screen::OnDisplayRemoved(const gfx::Display& old_display) {
auto iter = FindById(&displays_, old_display.id());
if (iter == displays_.end())
return;
displays_.erase(iter);
Emit("display-removed", old_display);
}
void Screen::OnDisplayMetricsChanged(const gfx::Display& display,
uint32_t changed_metrics) {
auto iter = FindById(&displays_, display.id());
if (iter == displays_.end())
return;
*iter = display;
Emit("display-metrics-changed", display, MetricsToArray(changed_metrics));
}
mate::ObjectTemplateBuilder Screen::GetObjectTemplateBuilder(
v8::Isolate* isolate) {
return mate::ObjectTemplateBuilder(isolate)
.SetMethod("getCursorScreenPoint", &Screen::GetCursorScreenPoint)
.SetMethod("getPrimaryDisplay", &Screen::GetPrimaryDisplay)
.SetMethod("getAllDisplays", &Screen::GetAllDisplays)
.SetMethod("getDisplayNearestPoint", &Screen::GetDisplayNearestPoint)
.SetMethod("getDisplayMatching", &Screen::GetDisplayMatching);
}
// static
v8::Local<v8::Value> Screen::Create(v8::Isolate* isolate) {
if (!Browser::Get()->is_ready()) {
@@ -119,14 +99,25 @@ v8::Local<v8::Value> Screen::Create(v8::Isolate* isolate) {
return v8::Null(isolate);
}
gfx::Screen* screen = gfx::Screen::GetNativeScreen();
gfx::Screen* screen = gfx::Screen::GetScreen();
if (!screen) {
isolate->ThrowException(v8::Exception::Error(mate::StringToV8(
isolate, "Failed to get screen information")));
return v8::Null(isolate);
}
return mate::CreateHandle(isolate, new Screen(screen)).ToV8();
return mate::CreateHandle(isolate, new Screen(isolate, screen)).ToV8();
}
// static
void Screen::BuildPrototype(
v8::Isolate* isolate, v8::Local<v8::ObjectTemplate> prototype) {
mate::ObjectTemplateBuilder(isolate, prototype)
.SetMethod("getCursorScreenPoint", &Screen::GetCursorScreenPoint)
.SetMethod("getPrimaryDisplay", &Screen::GetPrimaryDisplay)
.SetMethod("getAllDisplays", &Screen::GetAllDisplays)
.SetMethod("getDisplayNearestPoint", &Screen::GetDisplayNearestPoint)
.SetMethod("getDisplayMatching", &Screen::GetDisplayMatching);
}
} // namespace api

View File

@@ -21,14 +21,17 @@ namespace atom {
namespace api {
class Screen : public mate::EventEmitter,
class Screen : public mate::EventEmitter<Screen>,
public gfx::DisplayObserver {
public:
static v8::Local<v8::Value> Create(v8::Isolate* isolate);
static void BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::ObjectTemplate> prototype);
protected:
explicit Screen(gfx::Screen* screen);
virtual ~Screen();
Screen(v8::Isolate* isolate, gfx::Screen* screen);
~Screen() override;
gfx::Point GetCursorScreenPoint();
gfx::Display GetPrimaryDisplay();
@@ -42,13 +45,8 @@ class Screen : public mate::EventEmitter,
void OnDisplayMetricsChanged(const gfx::Display& display,
uint32_t changed_metrics) override;
// mate::Wrappable:
mate::ObjectTemplateBuilder GetObjectTemplateBuilder(
v8::Isolate* isolate) override;
private:
gfx::Screen* screen_;
std::vector<gfx::Display> displays_;
DISALLOW_COPY_AND_ASSIGN(Screen);
};

View File

@@ -9,24 +9,26 @@
#include "atom/browser/api/atom_api_cookies.h"
#include "atom/browser/api/atom_api_download_item.h"
#include "atom/browser/api/atom_api_web_contents.h"
#include "atom/browser/api/atom_api_protocol.h"
#include "atom/browser/api/atom_api_web_request.h"
#include "atom/browser/api/save_page_handler.h"
#include "atom/browser/atom_browser_context.h"
#include "atom/browser/atom_browser_main_parts.h"
#include "atom/browser/atom_permission_manager.h"
#include "atom/browser/net/atom_cert_verifier.h"
#include "atom/common/native_mate_converters/callback.h"
#include "atom/common/native_mate_converters/content_converter.h"
#include "atom/common/native_mate_converters/gurl_converter.h"
#include "atom/common/native_mate_converters/file_path_converter.h"
#include "atom/common/native_mate_converters/net_converter.h"
#include "atom/common/node_includes.h"
#include "base/files/file_path.h"
#include "base/prefs/pref_service.h"
#include "base/guid.h"
#include "components/prefs/pref_service.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/thread_task_runner_handle.h"
#include "brightray/browser/net/devtools_network_conditions.h"
#include "brightray/browser/net/devtools_network_controller.h"
#include "brightray/browser/net/devtools_network_controller_handle.h"
#include "chrome/common/pref_names.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/storage_partition.h"
@@ -34,6 +36,9 @@
#include "native_mate/object_template_builder.h"
#include "net/base/load_flags.h"
#include "net/disk_cache/disk_cache.h"
#include "net/dns/host_cache.h"
#include "net/http/http_auth_handler_factory.h"
#include "net/http/http_auth_preferences.h"
#include "net/proxy/proxy_service.h"
#include "net/proxy/proxy_config_service_fixed.h"
#include "net/url_request/url_request_context.h"
@@ -46,12 +51,12 @@ namespace {
struct ClearStorageDataOptions {
GURL origin;
uint32 storage_types = StoragePartition::REMOVE_DATA_MASK_ALL;
uint32 quota_types = StoragePartition::QUOTA_MANAGED_STORAGE_MASK_ALL;
uint32_t storage_types = StoragePartition::REMOVE_DATA_MASK_ALL;
uint32_t quota_types = StoragePartition::QUOTA_MANAGED_STORAGE_MASK_ALL;
};
uint32 GetStorageMask(const std::vector<std::string>& storage_types) {
uint32 storage_mask = 0;
uint32_t GetStorageMask(const std::vector<std::string>& storage_types) {
uint32_t storage_mask = 0;
for (const auto& it : storage_types) {
auto type = base::ToLowerASCII(it);
if (type == "appcache")
@@ -74,8 +79,8 @@ uint32 GetStorageMask(const std::vector<std::string>& storage_types) {
return storage_mask;
}
uint32 GetQuotaMask(const std::vector<std::string>& quota_types) {
uint32 quota_mask = 0;
uint32_t GetQuotaMask(const std::vector<std::string>& quota_types) {
uint32_t quota_mask = 0;
for (const auto& it : quota_types) {
auto type = base::ToLowerASCII(it);
if (type == "temporary")
@@ -188,7 +193,7 @@ class ResolveProxyHelper {
// Start the request.
int result = proxy_service->ResolveProxy(
url, net::LOAD_NORMAL, &proxy_info_, completion_callback,
url, "GET", net::LOAD_NORMAL, &proxy_info_, completion_callback,
&pac_req_, nullptr, net::BoundNetLog());
// Completed synchronously.
@@ -269,15 +274,43 @@ void SetProxyInIO(net::URLRequestContextGetter* getter,
RunCallbackInUI(callback);
}
void ClearHostResolverCacheInIO(
const scoped_refptr<net::URLRequestContextGetter>& context_getter,
const base::Closure& callback) {
auto request_context = context_getter->GetURLRequestContext();
auto cache = request_context->host_resolver()->GetHostCache();
if (cache) {
cache->clear();
DCHECK_EQ(0u, cache->size());
if (!callback.is_null())
RunCallbackInUI(callback);
}
}
void AllowNTLMCredentialsForDomainsInIO(
const scoped_refptr<net::URLRequestContextGetter>& context_getter,
const std::string& domains) {
auto request_context = context_getter->GetURLRequestContext();
auto auth_handler = request_context->http_auth_handler_factory();
if (auth_handler) {
auto auth_preferences = const_cast<net::HttpAuthPreferences*>(
auth_handler->http_auth_preferences());
if (auth_preferences)
auth_preferences->set_server_whitelist(domains);
}
}
} // namespace
Session::Session(AtomBrowserContext* browser_context)
: browser_context_(browser_context) {
AttachAsUserData(browser_context);
Session::Session(v8::Isolate* isolate, AtomBrowserContext* browser_context)
: devtools_network_emulation_client_id_(base::GenerateGUID()),
browser_context_(browser_context) {
// Observe DownloadManger to get download notifications.
content::BrowserContext::GetDownloadManager(browser_context)->
AddObserver(this);
Init(isolate);
AttachAsUserData(browser_context);
}
Session::~Session() {
@@ -287,13 +320,15 @@ Session::~Session() {
void Session::OnDownloadCreated(content::DownloadManager* manager,
content::DownloadItem* item) {
auto web_contents = item->GetWebContents();
if (SavePageHandler::IsSavePageTypes(item->GetMimeType()))
if (item->IsSavePackageDownload())
return;
v8::Locker locker(isolate());
v8::HandleScope handle_scope(isolate());
bool prevent_default = Emit(
"will-download",
DownloadItem::Create(isolate(), item),
api::WebContents::CreateFrom(isolate(), web_contents));
item->GetWebContents());
if (prevent_default) {
item->Cancel(true);
item->Remove();
@@ -350,7 +385,7 @@ void Session::SetDownloadPath(const base::FilePath& path) {
}
void Session::EnableNetworkEmulation(const mate::Dictionary& options) {
scoped_ptr<brightray::DevToolsNetworkConditions> conditions;
std::unique_ptr<brightray::DevToolsNetworkConditions> conditions;
bool offline = false;
double latency, download_throughput, upload_throughput;
if (options.Get("offline", &offline) && offline) {
@@ -365,25 +400,19 @@ void Session::EnableNetworkEmulation(const mate::Dictionary& options) {
download_throughput,
upload_throughput));
}
auto controller = browser_context_->GetDevToolsNetworkController();
BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
base::Bind(&brightray::DevToolsNetworkController::SetNetworkState,
base::Unretained(controller),
std::string(),
base::Passed(&conditions)));
browser_context_->network_controller_handle()->SetNetworkState(
devtools_network_emulation_client_id_, std::move(conditions));
browser_context_->network_delegate()->SetDevToolsNetworkEmulationClientId(
devtools_network_emulation_client_id_);
}
void Session::DisableNetworkEmulation() {
scoped_ptr<brightray::DevToolsNetworkConditions> conditions(
new brightray::DevToolsNetworkConditions(false));
auto controller = browser_context_->GetDevToolsNetworkController();
BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
base::Bind(&brightray::DevToolsNetworkController::SetNetworkState,
base::Unretained(controller),
std::string(),
base::Passed(&conditions)));
std::unique_ptr<brightray::DevToolsNetworkConditions> conditions;
browser_context_->network_controller_handle()->SetNetworkState(
devtools_network_emulation_client_id_, std::move(conditions));
browser_context_->network_delegate()->SetDevToolsNetworkEmulationClientId(
std::string());
}
void Session::SetCertVerifyProc(v8::Local<v8::Value> val,
@@ -397,6 +426,35 @@ void Session::SetCertVerifyProc(v8::Local<v8::Value> val,
browser_context_->cert_verifier()->SetVerifyProc(proc);
}
void Session::SetPermissionRequestHandler(v8::Local<v8::Value> val,
mate::Arguments* args) {
AtomPermissionManager::RequestHandler handler;
if (!(val->IsNull() || mate::ConvertFromV8(args->isolate(), val, &handler))) {
args->ThrowError("Must pass null or function");
return;
}
auto permission_manager = static_cast<AtomPermissionManager*>(
browser_context()->GetPermissionManager());
permission_manager->SetPermissionRequestHandler(handler);
}
void Session::ClearHostResolverCache(mate::Arguments* args) {
base::Closure callback;
args->GetNext(&callback);
BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
base::Bind(&ClearHostResolverCacheInIO,
make_scoped_refptr(browser_context_->GetRequestContext()),
callback));
}
void Session::AllowNTLMCredentialsForDomains(const std::string& domains) {
BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
base::Bind(&AllowNTLMCredentialsForDomainsInIO,
make_scoped_refptr(browser_context_->GetRequestContext()),
domains));
}
v8::Local<v8::Value> Session::Cookies(v8::Isolate* isolate) {
if (cookies_.IsEmpty()) {
auto handle = atom::api::Cookies::Create(isolate, browser_context());
@@ -405,6 +463,14 @@ v8::Local<v8::Value> Session::Cookies(v8::Isolate* isolate) {
return v8::Local<v8::Value>::New(isolate, cookies_);
}
v8::Local<v8::Value> Session::Protocol(v8::Isolate* isolate) {
if (protocol_.IsEmpty()) {
auto handle = atom::api::Protocol::Create(isolate, browser_context());
protocol_.Reset(isolate, handle.ToV8());
}
return v8::Local<v8::Value>::New(isolate, protocol_);
}
v8::Local<v8::Value> Session::WebRequest(v8::Isolate* isolate) {
if (web_request_.IsEmpty()) {
auto handle = atom::api::WebRequest::Create(isolate, browser_context());
@@ -420,7 +486,8 @@ mate::Handle<Session> Session::CreateFrom(
if (existing)
return mate::CreateHandle(isolate, static_cast<Session*>(existing));
auto handle = mate::CreateHandle(isolate, new Session(browser_context));
auto handle = mate::CreateHandle(
isolate, new Session(isolate, browser_context));
g_wrap_session.Run(handle.ToV8());
return handle;
}
@@ -448,20 +515,18 @@ void Session::BuildPrototype(v8::Isolate* isolate,
.SetMethod("enableNetworkEmulation", &Session::EnableNetworkEmulation)
.SetMethod("disableNetworkEmulation", &Session::DisableNetworkEmulation)
.SetMethod("setCertificateVerifyProc", &Session::SetCertVerifyProc)
.SetMethod("setPermissionRequestHandler",
&Session::SetPermissionRequestHandler)
.SetMethod("clearHostResolverCache", &Session::ClearHostResolverCache)
.SetMethod("allowNTLMCredentialsForDomains",
&Session::AllowNTLMCredentialsForDomains)
.SetProperty("cookies", &Session::Cookies)
.SetProperty("protocol", &Session::Protocol)
.SetProperty("webRequest", &Session::WebRequest);
}
void ClearWrapSession() {
g_wrap_session.Reset();
}
void SetWrapSession(const WrapSessionCallback& callback) {
g_wrap_session = callback;
// Cleanup the wrapper on exit.
atom::AtomBrowserMainParts::Get()->RegisterDestructionCallback(
base::Bind(ClearWrapSession));
}
} // namespace api

View File

@@ -58,7 +58,7 @@ class Session: public mate::TrackableObject<Session>,
v8::Local<v8::ObjectTemplate> prototype);
protected:
explicit Session(AtomBrowserContext* browser_context);
Session(v8::Isolate* isolate, AtomBrowserContext* browser_context);
~Session();
// content::DownloadManager::Observer:
@@ -76,13 +76,22 @@ class Session: public mate::TrackableObject<Session>,
void EnableNetworkEmulation(const mate::Dictionary& options);
void DisableNetworkEmulation();
void SetCertVerifyProc(v8::Local<v8::Value> proc, mate::Arguments* args);
void SetPermissionRequestHandler(v8::Local<v8::Value> val,
mate::Arguments* args);
void ClearHostResolverCache(mate::Arguments* args);
void AllowNTLMCredentialsForDomains(const std::string& domains);
v8::Local<v8::Value> Cookies(v8::Isolate* isolate);
v8::Local<v8::Value> Protocol(v8::Isolate* isolate);
v8::Local<v8::Value> WebRequest(v8::Isolate* isolate);
// Cached object.
v8::Global<v8::Value> cookies_;
v8::Global<v8::Value> protocol_;
v8::Global<v8::Value> web_request_;
// The X-DevTools-Emulate-Network-Conditions-Client-Id.
std::string devtools_network_emulation_client_id_;
scoped_refptr<AtomBrowserContext> browser_context_;
DISALLOW_COPY_AND_ASSIGN(Session);

View File

@@ -0,0 +1,76 @@
// 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_system_preferences.h"
#include "atom/common/native_mate_converters/callback.h"
#include "atom/common/native_mate_converters/value_converter.h"
#include "atom/common/node_includes.h"
#include "native_mate/dictionary.h"
#if defined(OS_WIN)
#include "ui/base/win/shell.h"
#endif
namespace atom {
namespace api {
SystemPreferences::SystemPreferences(v8::Isolate* isolate) {
Init(isolate);
}
SystemPreferences::~SystemPreferences() {
}
#if defined(OS_WIN)
bool SystemPreferences::IsAeroGlassEnabled() {
return ui::win::IsAeroGlassEnabled();
}
#endif
#if !defined(OS_MACOSX)
bool SystemPreferences::IsDarkMode() {
return false;
}
#endif
// static
mate::Handle<SystemPreferences> SystemPreferences::Create(
v8::Isolate* isolate) {
return mate::CreateHandle(isolate, new SystemPreferences(isolate));
}
// static
void SystemPreferences::BuildPrototype(
v8::Isolate* isolate, v8::Local<v8::ObjectTemplate> prototype) {
mate::ObjectTemplateBuilder(isolate, prototype)
#if defined(OS_WIN)
.SetMethod("isAeroGlassEnabled", &SystemPreferences::IsAeroGlassEnabled)
#elif defined(OS_MACOSX)
.SetMethod("subscribeNotification",
&SystemPreferences::SubscribeNotification)
.SetMethod("unsubscribeNotification",
&SystemPreferences::UnsubscribeNotification)
.SetMethod("getUserDefault", &SystemPreferences::GetUserDefault)
#endif
.SetMethod("isDarkMode", &SystemPreferences::IsDarkMode);
}
} // namespace api
} // namespace atom
namespace {
void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
v8::Local<v8::Context> context, void* priv) {
v8::Isolate* isolate = context->GetIsolate();
mate::Dictionary dict(isolate, exports);
dict.Set("systemPreferences", atom::api::SystemPreferences::Create(isolate));
}
} // namespace
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_browser_system_preferences, Initialize);

View File

@@ -0,0 +1,57 @@
// 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_SYSTEM_PREFERENCES_H_
#define ATOM_BROWSER_API_ATOM_API_SYSTEM_PREFERENCES_H_
#include <string>
#include "atom/browser/api/event_emitter.h"
#include "base/callback.h"
#include "native_mate/handle.h"
namespace base {
class DictionaryValue;
}
namespace atom {
namespace api {
class SystemPreferences : public mate::EventEmitter<SystemPreferences> {
public:
static mate::Handle<SystemPreferences> Create(v8::Isolate* isolate);
static void BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::ObjectTemplate> prototype);
#if defined(OS_MACOSX)
using NotificationCallback = base::Callback<
void(const std::string&, const base::DictionaryValue&)>;
#endif
#if defined(OS_WIN)
bool IsAeroGlassEnabled();
#elif defined(OS_MACOSX)
int SubscribeNotification(const std::string& name,
const NotificationCallback& callback);
void UnsubscribeNotification(int id);
v8::Local<v8::Value> GetUserDefault(const std::string& name,
const std::string& type);
#endif
bool IsDarkMode();
protected:
explicit SystemPreferences(v8::Isolate* isolate);
~SystemPreferences() override;
private:
DISALLOW_COPY_AND_ASSIGN(SystemPreferences);
};
} // namespace api
} // namespace atom
#endif // ATOM_BROWSER_API_ATOM_API_SYSTEM_PREFERENCES_H_

View File

@@ -0,0 +1,102 @@
// 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_system_preferences.h"
#include <map>
#import <Cocoa/Cocoa.h>
#include "atom/browser/mac/dict_util.h"
#include "atom/common/native_mate_converters/value_converter.h"
#include "atom/common/native_mate_converters/gurl_converter.h"
#include "base/strings/sys_string_conversions.h"
#include "base/values.h"
#include "net/base/mac/url_conversions.h"
namespace atom {
namespace api {
namespace {
int g_next_id = 0;
// The map to convert |id| to |int|.
std::map<int, id> g_id_map;
} // namespace
int SystemPreferences::SubscribeNotification(
const std::string& name, const NotificationCallback& callback) {
int request_id = g_next_id++;
__block NotificationCallback copied_callback = callback;
g_id_map[request_id] = [[NSDistributedNotificationCenter defaultCenter]
addObserverForName:base::SysUTF8ToNSString(name)
object:nil
queue:nil
usingBlock:^(NSNotification* notification) {
std::unique_ptr<base::DictionaryValue> user_info =
NSDictionaryToDictionaryValue(notification.userInfo);
if (user_info) {
copied_callback.Run(
base::SysNSStringToUTF8(notification.name),
*user_info);
} else {
copied_callback.Run(
base::SysNSStringToUTF8(notification.name),
base::DictionaryValue());
}
}
];
return request_id;
}
void SystemPreferences::UnsubscribeNotification(int request_id) {
auto iter = g_id_map.find(request_id);
if (iter != g_id_map.end()) {
id observer = iter->second;
[[NSDistributedNotificationCenter defaultCenter] removeObserver:observer];
g_id_map.erase(iter);
}
}
v8::Local<v8::Value> SystemPreferences::GetUserDefault(
const std::string& name, const std::string& type) {
NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
NSString* key = base::SysUTF8ToNSString(name);
if (type == "string") {
return mate::StringToV8(isolate(),
base::SysNSStringToUTF8([defaults stringForKey:key]));
} else if (type == "boolean") {
return v8::Boolean::New(isolate(), [defaults boolForKey:key]);
} else if (type == "float") {
return v8::Number::New(isolate(), [defaults floatForKey:key]);
} else if (type == "integer") {
return v8::Integer::New(isolate(), [defaults integerForKey:key]);
} else if (type == "double") {
return v8::Number::New(isolate(), [defaults doubleForKey:key]);
} else if (type == "url") {
return mate::ConvertToV8(isolate(),
net::GURLWithNSURL([defaults URLForKey:key]));
} else if (type == "array") {
return mate::ConvertToV8(isolate(),
*NSArrayToListValue([defaults arrayForKey:key]));
} else if (type == "dictionary") {
return mate::ConvertToV8(isolate(),
*NSDictionaryToDictionaryValue([defaults dictionaryForKey:key]));
} else {
return v8::Undefined(isolate());
}
}
bool SystemPreferences::IsDarkMode() {
NSString* mode = [[NSUserDefaults standardUserDefaults]
stringForKey:@"AppleInterfaceStyle"];
return [mode isEqualToString:@"Dark"];
}
} // namespace api
} // namespace atom

View File

@@ -9,6 +9,7 @@
#include "atom/browser/api/atom_api_menu.h"
#include "atom/browser/browser.h"
#include "atom/browser/ui/tray_icon.h"
#include "atom/common/api/atom_api_native_image.h"
#include "atom/common/native_mate_converters/gfx_converter.h"
#include "atom/common/native_mate_converters/image_converter.h"
#include "atom/common/native_mate_converters/string16_converter.h"
@@ -22,9 +23,9 @@ namespace atom {
namespace api {
Tray::Tray(const gfx::Image& image)
Tray::Tray(v8::Isolate* isolate, mate::Handle<NativeImage> image)
: tray_icon_(TrayIcon::Create()) {
tray_icon_->SetImage(image);
SetImage(isolate, image);
tray_icon_->AddObserver(this);
}
@@ -32,13 +33,14 @@ Tray::~Tray() {
}
// static
mate::Wrappable* Tray::New(v8::Isolate* isolate, const gfx::Image& image) {
mate::WrappableBase* Tray::New(v8::Isolate* isolate,
mate::Handle<NativeImage> image) {
if (!Browser::Get()->is_ready()) {
isolate->ThrowException(v8::Exception::Error(mate::StringToV8(
isolate, "Cannot create Tray before app is ready")));
return nullptr;
}
return new Tray(image);
return new Tray(isolate, image);
}
void Tray::OnClicked(const gfx::Rect& bounds, int modifiers) {
@@ -94,29 +96,38 @@ void Tray::OnDragEnded() {
Emit("drag-end");
}
void Tray::SetImage(mate::Arguments* args, const gfx::Image& image) {
tray_icon_->SetImage(image);
void Tray::SetImage(v8::Isolate* isolate, mate::Handle<NativeImage> image) {
#if defined(OS_WIN)
tray_icon_->SetImage(image->GetHICON(GetSystemMetrics(SM_CXSMICON)));
#else
tray_icon_->SetImage(image->image());
#endif
}
void Tray::SetPressedImage(mate::Arguments* args, const gfx::Image& image) {
tray_icon_->SetPressedImage(image);
void Tray::SetPressedImage(v8::Isolate* isolate,
mate::Handle<NativeImage> image) {
#if defined(OS_WIN)
tray_icon_->SetPressedImage(image->GetHICON(GetSystemMetrics(SM_CXSMICON)));
#else
tray_icon_->SetPressedImage(image->image());
#endif
}
void Tray::SetToolTip(mate::Arguments* args, const std::string& tool_tip) {
void Tray::SetToolTip(const std::string& tool_tip) {
tray_icon_->SetToolTip(tool_tip);
}
void Tray::SetTitle(mate::Arguments* args, const std::string& title) {
void Tray::SetTitle(const std::string& title) {
tray_icon_->SetTitle(title);
}
void Tray::SetHighlightMode(mate::Arguments* args, bool highlight) {
void Tray::SetHighlightMode(bool highlight) {
tray_icon_->SetHighlightMode(highlight);
}
void Tray::DisplayBalloon(mate::Arguments* args,
const mate::Dictionary& options) {
gfx::Image icon;
mate::Handle<NativeImage> icon;
options.Get("icon", &icon);
base::string16 title, content;
if (!options.Get("title", &title) ||
@@ -125,7 +136,14 @@ void Tray::DisplayBalloon(mate::Arguments* args,
return;
}
tray_icon_->DisplayBalloon(icon, title, content);
#if defined(OS_WIN)
tray_icon_->DisplayBalloon(
icon.IsEmpty() ? NULL : icon->GetHICON(GetSystemMetrics(SM_CXSMICON)),
title, content);
#else
tray_icon_->DisplayBalloon(
icon.IsEmpty() ? gfx::Image() : icon->image(), title, content);
#endif
}
void Tray::PopUpContextMenu(mate::Arguments* args) {
@@ -136,7 +154,8 @@ void Tray::PopUpContextMenu(mate::Arguments* args) {
tray_icon_->PopUpContextMenu(pos, menu.IsEmpty() ? nullptr : menu->model());
}
void Tray::SetContextMenu(mate::Arguments* args, Menu* menu) {
void Tray::SetContextMenu(v8::Isolate* isolate, mate::Handle<Menu> menu) {
menu_.Reset(isolate, menu.ToV8());
tray_icon_->SetContextMenu(menu->model());
}
@@ -162,7 +181,7 @@ void Tray::BuildPrototype(v8::Isolate* isolate,
.SetMethod("setHighlightMode", &Tray::SetHighlightMode)
.SetMethod("displayBalloon", &Tray::DisplayBalloon)
.SetMethod("popUpContextMenu", &Tray::PopUpContextMenu)
.SetMethod("_setContextMenu", &Tray::SetContextMenu);
.SetMethod("setContextMenu", &Tray::SetContextMenu);
}
} // namespace api

View File

@@ -11,6 +11,7 @@
#include "atom/browser/api/trackable_object.h"
#include "atom/browser/ui/tray_icon_observer.h"
#include "base/memory/scoped_ptr.h"
#include "native_mate/handle.h"
namespace gfx {
class Image;
@@ -28,17 +29,19 @@ class TrayIcon;
namespace api {
class Menu;
class NativeImage;
class Tray : public mate::TrackableObject<Tray>,
public TrayIconObserver {
public:
static mate::Wrappable* New(v8::Isolate* isolate, const gfx::Image& image);
static mate::WrappableBase* New(
v8::Isolate* isolate, mate::Handle<NativeImage> image);
static void BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::ObjectTemplate> prototype);
protected:
explicit Tray(const gfx::Image& image);
Tray(v8::Isolate* isolate, mate::Handle<NativeImage> image);
~Tray() override;
// TrayIconObserver:
@@ -54,19 +57,20 @@ class Tray : public mate::TrackableObject<Tray>,
void OnDragExited() override;
void OnDragEnded() override;
void SetImage(mate::Arguments* args, const gfx::Image& image);
void SetPressedImage(mate::Arguments* args, const gfx::Image& image);
void SetToolTip(mate::Arguments* args, const std::string& tool_tip);
void SetTitle(mate::Arguments* args, const std::string& title);
void SetHighlightMode(mate::Arguments* args, bool highlight);
void SetImage(v8::Isolate* isolate, mate::Handle<NativeImage> image);
void SetPressedImage(v8::Isolate* isolate, mate::Handle<NativeImage> image);
void SetToolTip(const std::string& tool_tip);
void SetTitle(const std::string& title);
void SetHighlightMode(bool highlight);
void DisplayBalloon(mate::Arguments* args, const mate::Dictionary& options);
void PopUpContextMenu(mate::Arguments* args);
void SetContextMenu(mate::Arguments* args, Menu* menu);
void SetContextMenu(v8::Isolate* isolate, mate::Handle<Menu> menu);
private:
v8::Local<v8::Object> ModifiersToObject(v8::Isolate* isolate, int modifiers);
scoped_ptr<TrayIcon> tray_icon_;
v8::Global<v8::Object> menu_;
std::unique_ptr<TrayIcon> tray_icon_;
DISALLOW_COPY_AND_ASSIGN(Tray);
};

View File

@@ -7,16 +7,23 @@
#include <set>
#include <string>
#include "atom/browser/api/atom_api_debugger.h"
#include "atom/browser/api/atom_api_session.h"
#include "atom/browser/api/atom_api_window.h"
#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"
#include "atom/browser/web_contents_permission_helper.h"
#include "atom/browser/web_contents_preferences.h"
#include "atom/browser/web_view_guest_delegate.h"
#include "atom/common/api/api_messages.h"
#include "atom/common/api/event_emitter_caller.h"
#include "atom/common/color_util.h"
#include "atom/common/mouse_util.h"
#include "atom/common/native_mate_converters/blink_converter.h"
#include "atom/common/native_mate_converters/callback.h"
#include "atom/common/native_mate_converters/content_converter.h"
@@ -26,12 +33,14 @@
#include "atom/common/native_mate_converters/image_converter.h"
#include "atom/common/native_mate_converters/string16_converter.h"
#include "atom/common/native_mate_converters/value_converter.h"
#include "atom/common/options_switches.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "brightray/browser/inspectable_web_contents.h"
#include "brightray/browser/inspectable_web_contents_view.h"
#include "chrome/browser/printing/print_view_manager_basic.h"
#include "chrome/browser/printing/print_preview_message_handler.h"
#include "content/browser/renderer_host/render_widget_host_impl.h"
#include "content/common/view_messages.h"
#include "content/public/browser/favicon_status.h"
#include "content/public/browser/native_web_keyboard_event.h"
@@ -41,6 +50,7 @@
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/render_widget_host.h"
#include "content/public/browser/render_widget_host_view.h"
#include "content/public/browser/resource_request_details.h"
#include "content/public/browser/service_worker_context.h"
@@ -54,6 +64,7 @@
#include "net/url_request/static_http_user_agent_settings.h"
#include "net/url_request/url_request_context.h"
#include "third_party/WebKit/public/web/WebInputEvent.h"
#include "third_party/WebKit/public/web/WebFindOptions.h"
#include "ui/base/l10n/l10n_util.h"
#include "atom/common/node_includes.h"
@@ -135,7 +146,7 @@ struct Converter<net::HttpResponseHeaders*> {
net::HttpResponseHeaders* headers) {
base::DictionaryValue response_headers;
if (headers) {
void* iter = nullptr;
size_t iter = 0;
std::string key;
std::string value;
while (headers->EnumerateHeaderLines(&iter, &key, &value)) {
@@ -145,9 +156,9 @@ struct Converter<net::HttpResponseHeaders*> {
if (response_headers.GetList(key, &values))
values->AppendString(value);
} else {
scoped_ptr<base::ListValue> values(new base::ListValue());
std::unique_ptr<base::ListValue> values(new base::ListValue());
values->AppendString(value);
response_headers.Set(key, values.Pass());
response_headers.Set(key, std::move(values));
}
}
}
@@ -176,6 +187,39 @@ struct Converter<content::SavePageType> {
}
};
template<>
struct Converter<atom::api::WebContents::Type> {
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate,
atom::api::WebContents::Type val) {
using Type = atom::api::WebContents::Type;
std::string type = "";
switch (val) {
case Type::BACKGROUND_PAGE: type = "backgroundPage"; break;
case Type::BROWSER_WINDOW: type = "window"; break;
case Type::REMOTE: type = "remote"; break;
case Type::WEB_VIEW: type = "webview"; break;
default: break;
}
return mate::ConvertToV8(isolate, type);
}
static bool FromV8(v8::Isolate* isolate, v8::Local<v8::Value> val,
atom::api::WebContents::Type* out) {
using Type = atom::api::WebContents::Type;
std::string type;
if (!ConvertFromV8(isolate, val, &type))
return false;
if (type == "webview") {
*out = Type::WEB_VIEW;
} else if (type == "backgroundPage") {
*out = Type::BACKGROUND_PAGE;
} else {
return false;
}
return true;
}
};
} // namespace mate
@@ -206,20 +250,38 @@ content::ServiceWorkerContext* GetServiceWorkerContext(
} // namespace
WebContents::WebContents(content::WebContents* web_contents)
WebContents::WebContents(v8::Isolate* isolate,
content::WebContents* web_contents)
: content::WebContentsObserver(web_contents),
type_(REMOTE) {
AttachAsUserData(web_contents);
embedder_(nullptr),
type_(REMOTE),
request_id_(0),
background_throttling_(true) {
web_contents->SetUserAgentOverride(GetBrowserContext()->GetUserAgent());
Init(isolate);
AttachAsUserData(web_contents);
}
WebContents::WebContents(v8::Isolate* isolate,
const mate::Dictionary& options)
: request_id_(0) {
// Whether it is a guest WebContents.
bool is_guest = false;
options.Get("isGuest", &is_guest);
type_ = is_guest ? WEB_VIEW : BROWSER_WINDOW;
: embedder_(nullptr),
type_(BROWSER_WINDOW),
request_id_(0),
background_throttling_(true) {
// Read options.
options.Get("backgroundThrottling", &background_throttling_);
// FIXME(zcbenz): We should read "type" parameter for better design, but
// on Windows we have encountered a compiler bug that if we read "type"
// from |options| and then set |type_|, a memory corruption will happen
// and Electron will soon crash.
// Remvoe this after we upgraded to use VS 2015 Update 3.
bool b = false;
if (options.Get("isGuest", &b) && b)
type_ = WEB_VIEW;
else if (options.Get("isBackgroundPage", &b) && b)
type_ = BACKGROUND_PAGE;
// Obtain the session.
std::string partition;
@@ -239,9 +301,10 @@ WebContents::WebContents(v8::Isolate* isolate,
session_.Reset(isolate, session.ToV8());
content::WebContents* web_contents;
if (is_guest) {
content::SiteInstance* site_instance = content::SiteInstance::CreateForURL(
session->browser_context(), GURL("chrome-guest://fake-host"));
if (IsGuest()) {
scoped_refptr<content::SiteInstance> site_instance =
content::SiteInstance::CreateForURL(
session->browser_context(), GURL("chrome-guest://fake-host"));
content::WebContents::CreateParams params(
session->browser_context(), site_instance);
guest_delegate_.reset(new WebViewGuestDelegate);
@@ -253,44 +316,59 @@ WebContents::WebContents(v8::Isolate* isolate,
}
Observe(web_contents);
AttachAsUserData(web_contents);
InitWithWebContents(web_contents);
InitWithWebContents(web_contents, session->browser_context());
managed_web_contents()->GetView()->SetDelegate(this);
// Save the preferences in C++.
new WebContentsPreferences(web_contents, options);
// Intialize permission helper.
WebContentsPermissionHelper::CreateForWebContents(web_contents);
// Intialize security state client.
AtomSecurityStateModelClient::CreateForWebContents(web_contents);
web_contents->SetUserAgentOverride(GetBrowserContext()->GetUserAgent());
if (is_guest) {
if (IsGuest()) {
guest_delegate_->Initialize(this);
NativeWindow* owner_window = nullptr;
WebContents* embedder = nullptr;
if (options.Get("embedder", &embedder) && embedder) {
if (options.Get("embedder", &embedder_) && embedder_) {
// New WebContents's owner_window is the embedder's owner_window.
auto relay = NativeWindowRelay::FromWebContents(embedder->web_contents());
auto relay =
NativeWindowRelay::FromWebContents(embedder_->web_contents());
if (relay)
owner_window = relay->window.get();
}
if (owner_window)
SetOwnerWindow(owner_window);
}
Init(isolate);
AttachAsUserData(web_contents);
}
WebContents::~WebContents() {
// The webview's lifetime is completely controlled by GuestViewManager, so
// it is always destroyed by calling webview.destroy(), we need to make
// sure the "destroyed" event is emitted manually.
if (type_ == WEB_VIEW && managed_web_contents())
// The destroy() is called.
if (managed_web_contents()) {
// For webview we need to tell content module to do some cleanup work before
// destroying it.
if (type_ == WEB_VIEW)
guest_delegate_->Destroy();
// The WebContentsDestroyed will not be called automatically because we
// unsubscribe from webContents before destroying it. So we have to manually
// call it here to make sure "destroyed" event is emitted.
RenderViewDeleted(web_contents()->GetRenderViewHost());
WebContentsDestroyed();
}
}
bool WebContents::AddMessageToConsole(content::WebContents* source,
int32 level,
int32_t level,
const base::string16& message,
int32 line_no,
int32_t line_no,
const base::string16& source_id) {
if (type_ == BROWSER_WINDOW) {
return false;
@@ -300,20 +378,13 @@ bool WebContents::AddMessageToConsole(content::WebContents* source,
}
}
bool WebContents::ShouldCreateWebContents(
content::WebContents* web_contents,
int route_id,
int main_frame_route_id,
WindowContainerType window_container_type,
const std::string& frame_name,
const GURL& target_url,
const std::string& partition_id,
content::SessionStorageNamespace* session_storage_namespace) {
void WebContents::OnCreateWindow(const GURL& target_url,
const std::string& frame_name,
WindowOpenDisposition disposition) {
if (type_ == BROWSER_WINDOW)
Emit("-new-window", target_url, frame_name, NEW_FOREGROUND_TAB);
Emit("-new-window", target_url, frame_name, disposition);
else
Emit("new-window", target_url, frame_name, NEW_FOREGROUND_TAB);
return false;
Emit("new-window", target_url, frame_name, disposition);
}
content::WebContents* WebContents::OpenURLFromTab(
@@ -350,7 +421,7 @@ void WebContents::MoveContents(content::WebContents* source,
void WebContents::CloseContents(content::WebContents* source) {
Emit("close");
if (type_ == BROWSER_WINDOW)
if (type_ == BROWSER_WINDOW && owner_window())
owner_window()->CloseContents(source);
}
@@ -358,6 +429,11 @@ void WebContents::ActivateContents(content::WebContents* source) {
Emit("activate");
}
void WebContents::UpdateTargetURL(content::WebContents* source,
const GURL& url) {
Emit("update-target-url", url);
}
bool WebContents::IsPopupOrPanel(const content::WebContents* source) const {
return type_ == BROWSER_WINDOW;
}
@@ -365,19 +441,29 @@ bool WebContents::IsPopupOrPanel(const content::WebContents* source) const {
void WebContents::HandleKeyboardEvent(
content::WebContents* source,
const content::NativeWebKeyboardEvent& event) {
if (event.windowsKeyCode == ui::VKEY_ESCAPE && is_html_fullscreen()) {
// Escape exits tabbed fullscreen mode.
ExitFullscreenModeForTab(source);
} else if (type_ == BROWSER_WINDOW) {
owner_window()->HandleKeyboardEvent(source, event);
} else if (type_ == WEB_VIEW && guest_delegate_) {
if (type_ == WEB_VIEW && embedder_) {
// Send the unhandled keyboard events back to the embedder.
guest_delegate_->HandleKeyboardEvent(source, event);
embedder_->HandleKeyboardEvent(source, event);
} else {
// Go to the default keyboard handling.
CommonWebContentsDelegate::HandleKeyboardEvent(source, event);
}
}
void WebContents::EnterFullscreenModeForTab(content::WebContents* source,
const GURL& origin) {
auto permission_helper =
WebContentsPermissionHelper::FromWebContents(source);
auto callback = base::Bind(&WebContents::OnEnterFullscreenModeForTab,
base::Unretained(this), source, origin);
permission_helper->RequestFullscreenPermission(callback);
}
void WebContents::OnEnterFullscreenModeForTab(content::WebContents* source,
const GURL& origin,
bool allowed) {
if (!allowed)
return;
CommonWebContentsDelegate::EnterFullscreenModeForTab(source, origin);
Emit("enter-html-full-screen");
}
@@ -389,22 +475,24 @@ void WebContents::ExitFullscreenModeForTab(content::WebContents* source) {
void WebContents::RendererUnresponsive(content::WebContents* source) {
Emit("unresponsive");
if (type_ == BROWSER_WINDOW)
if (type_ == BROWSER_WINDOW && owner_window())
owner_window()->RendererUnresponsive(source);
}
void WebContents::RendererResponsive(content::WebContents* source) {
Emit("responsive");
if (type_ == BROWSER_WINDOW)
if (type_ == BROWSER_WINDOW && owner_window())
owner_window()->RendererResponsive(source);
}
bool WebContents::HandleContextMenu(const content::ContextMenuParams& params) {
if (!params.custom_context.is_pepper_menu)
return false;
if (params.custom_context.is_pepper_menu) {
Emit("pepper-context-menu", std::make_pair(params, web_contents()));
web_contents()->NotifyContextMenuClosed(params.custom_context);
} else {
Emit("context-menu", std::make_pair(params, web_contents()));
}
Emit("pepper-context-menu", std::make_pair(params, web_contents()));
web_contents()->NotifyContextMenuClosed(params.custom_context);
return true;
}
@@ -427,6 +515,7 @@ void WebContents::FindReply(content::WebContents* web_contents,
result.Set("requestId", request_id);
result.Set("selectionArea", selection_rect);
result.Set("finalUpdate", final_update);
result.Set("activeMatchOrdinal", active_match_ordinal);
Emit("found-in-page", result);
} else if (final_update) {
result.Set("requestId", request_id);
@@ -436,23 +525,46 @@ void WebContents::FindReply(content::WebContents* web_contents,
}
}
bool WebContents::CheckMediaAccessPermission(
content::WebContents* web_contents,
const GURL& security_origin,
content::MediaStreamType type) {
return true;
}
void WebContents::RequestMediaAccessPermission(
content::WebContents* web_contents,
const content::MediaStreamRequest& request,
const content::MediaResponseCallback& callback) {
auto permission_helper =
WebContentsPermissionHelper::FromWebContents(web_contents);
permission_helper->RequestMediaAccessPermission(request, callback);
}
void WebContents::RequestToLockMouse(
content::WebContents* web_contents,
bool user_gesture,
bool last_unlocked_by_target) {
auto permission_helper =
WebContentsPermissionHelper::FromWebContents(web_contents);
permission_helper->RequestPointerLockPermission(user_gesture);
}
std::unique_ptr<content::BluetoothChooser> WebContents::RunBluetoothChooser(
content::RenderFrameHost* frame,
const content::BluetoothChooser::EventHandler& event_handler) {
std::unique_ptr<BluetoothChooser> bluetooth_chooser(
new BluetoothChooser(this, event_handler));
return std::move(bluetooth_chooser);
}
void WebContents::BeforeUnloadFired(const base::TimeTicks& proceed_time) {
// Do nothing, we override this method just to avoid compilation error since
// there are two virtual functions named BeforeUnloadFired.
}
void WebContents::RenderViewDeleted(content::RenderViewHost* render_view_host) {
int process_id = render_view_host->GetProcess()->GetID();
Emit("render-view-deleted", process_id);
// process.emit('ATOM_BROWSER_RELEASE_RENDER_VIEW', processId);
// Tell the rpc server that a render view has been deleted and we need to
// release all objects owned by it.
v8::Locker locker(isolate());
v8::HandleScope handle_scope(isolate());
node::Environment* env = node::Environment::GetCurrent(isolate());
mate::EmitEvent(isolate(), env->process_object(),
"ATOM_BROWSER_RELEASE_RENDER_VIEW", process_id);
Emit("render-view-deleted", render_view_host->GetProcess()->GetID());
}
void WebContents::RenderProcessGone(base::TerminationStatus status) {
@@ -467,11 +579,11 @@ void WebContents::PluginCrashed(const base::FilePath& plugin_path,
Emit("plugin-crashed", info.name, info.version);
}
void WebContents::MediaStartedPlaying() {
void WebContents::MediaStartedPlaying(const MediaPlayerId& id) {
Emit("media-started-playing");
}
void WebContents::MediaPaused() {
void WebContents::MediaStoppedPlaying(const MediaPlayerId& id) {
Emit("media-paused");
}
@@ -501,18 +613,21 @@ void WebContents::DidFinishLoad(content::RenderFrameHost* render_frame_host,
void WebContents::DidFailProvisionalLoad(
content::RenderFrameHost* render_frame_host,
const GURL& url,
int error_code,
const base::string16& error_description,
int code,
const base::string16& description,
bool was_ignored_by_handler) {
Emit("did-fail-provisional-load", error_code, error_description, url);
bool is_main_frame = !render_frame_host->GetParent();
Emit("did-fail-provisional-load", code, description, url, is_main_frame);
Emit("did-fail-load", code, description, url, is_main_frame);
}
void WebContents::DidFailLoad(content::RenderFrameHost* render_frame_host,
const GURL& validated_url,
const GURL& url,
int error_code,
const base::string16& error_description,
bool was_ignored_by_handler) {
Emit("did-fail-load", error_code, error_description, validated_url);
bool is_main_frame = !render_frame_host->GetParent();
Emit("did-fail-load", error_code, error_description, url, is_main_frame);
}
void WebContents::DidStartLoading() {
@@ -532,7 +647,8 @@ void WebContents::DidGetResourceResponseStart(
details.http_response_code,
details.method,
details.referrer,
details.headers.get());
details.headers.get(),
ResourceTypeToString(details.resource_type));
}
void WebContents::DidGetRedirectForResourceRequest(
@@ -578,6 +694,10 @@ void WebContents::DidUpdateFaviconURL(
Emit("page-favicon-updated", unique_urls);
}
void WebContents::DevToolsReloadPage() {
Emit("devtools-reload-page");
}
void WebContents::DevToolsFocused() {
Emit("devtools-focused");
}
@@ -589,6 +709,11 @@ void WebContents::DevToolsOpened() {
isolate(), managed_web_contents()->GetDevToolsWebContents());
devtools_web_contents_.Reset(isolate(), handle.ToV8());
// Set inspected tabID.
base::FundamentalValue tab_id(ID());
managed_web_contents()->CallClientFunction(
"DevToolsAPI.setInspectedTabId", &tab_id, nullptr, nullptr);
// Inherit owner window in devtools.
if (owner_window())
handle->SetOwnerWindow(managed_web_contents()->GetDevToolsWebContents(),
@@ -611,24 +736,33 @@ 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_CODE(ViewHostMsg_SetCursor, OnCursorChange,
handled = false)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
return handled;
}
// There are three ways of destroying a webContents:
// 1. call webContents.destory();
// 2. garbage collection;
// 3. user closes the window of webContents;
// For webview only #1 will happen, for BrowserWindow both #1 and #3 may
// happen. The #2 should never happen for webContents, because webview is
// managed by GuestViewManager, and BrowserWindow's webContents is managed
// by api::Window.
// For #1, the destructor will do the cleanup work and we only need to make
// sure "destroyed" event is emitted. For #3, the content::WebContents will
// be destroyed on close, and WebContentsDestroyed would be called for it, so
// we need to make sure the api::WebContents is also deleted.
void WebContents::WebContentsDestroyed() {
// The RenderViewDeleted was not called when the WebContents is destroyed.
RenderViewDeleted(web_contents()->GetRenderViewHost());
// This event is only for internal use, which is emitted when WebContents is
// being destroyed.
Emit("will-destroy");
// Cleanup relationships with other parts.
RemoveFromWeakMap();
if (type_ == WEB_VIEW)
guest_delegate_->Destroy();
// We can not call Destroy here because we need to call Emit first, but we
// also do not want any method to be used, so just mark as destroyed here.
@@ -650,11 +784,24 @@ int WebContents::GetID() const {
return web_contents()->GetRenderProcessHost()->GetID();
}
WebContents::Type WebContents::GetType() const {
return type_;
}
bool WebContents::Equal(const WebContents* web_contents) const {
return GetID() == web_contents->GetID();
}
void WebContents::LoadURL(const GURL& url, const mate::Dictionary& options) {
if (!url.is_valid()) {
Emit("did-fail-load",
static_cast<int>(net::ERR_INVALID_URL),
net::ErrorToShortString(net::ERR_INVALID_URL),
url.possibly_invalid_spec(),
true);
return;
}
content::NavigationController::LoadURLParams params(url);
GURL http_referrer;
@@ -674,6 +821,25 @@ void WebContents::LoadURL(const GURL& url, const mate::Dictionary& options) {
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);
}
// For the same reason we can only disable hidden here.
const auto host = static_cast<content::RenderWidgetHostImpl*>(
view->GetRenderWidgetHost());
host->disable_hidden_ = !background_throttling_;
}
void WebContents::DownloadURL(const GURL& url) {
@@ -697,6 +863,14 @@ bool WebContents::IsLoading() const {
return web_contents()->IsLoading();
}
bool WebContents::IsLoadingMainFrame() const {
// Comparing site instances works because Electron always creates a new site
// instance when navigating, regardless of origin. See AtomBrowserClient.
return (web_contents()->GetLastCommittedURL().is_empty() ||
web_contents()->GetSiteInstance() !=
web_contents()->GetPendingSiteInstance()) && IsLoading();
}
bool WebContents::IsWaitingForResponse() const {
return web_contents()->IsWaitingForResponse();
}
@@ -753,14 +927,20 @@ void WebContents::OpenDevTools(mate::Arguments* args) {
if (type_ == REMOTE)
return;
bool detach = false;
if (type_ == WEB_VIEW) {
detach = true;
std::string state;
if (type_ == WEB_VIEW || !owner_window()) {
state = "detach";
} else if (args && args->Length() == 1) {
bool detach = false;
mate::Dictionary options;
args->GetNext(&options) && options.Get("detach", &detach);
if (args->GetNext(&options)) {
options.Get("mode", &state);
options.Get("detach", &detach);
if (state.empty() && detach)
state = "detach";
}
}
managed_web_contents()->SetCanDock(!detach);
managed_web_contents()->SetDockState(state);
managed_web_contents()->ShowDevTools();
}
@@ -939,8 +1119,8 @@ void WebContents::ReplaceMisspelling(const base::string16& word) {
web_contents()->ReplaceMisspelling(word);
}
uint32 WebContents::FindInPage(mate::Arguments* args) {
uint32 request_id = GetNextRequestId();
uint32_t WebContents::FindInPage(mate::Arguments* args) {
uint32_t request_id = GetNextRequestId();
base::string16 search_text;
blink::WebFindOptions options;
if (!args->GetNext(&search_text) || search_text.empty()) {
@@ -958,6 +1138,14 @@ void WebContents::StopFindInPage(content::StopFindAction action) {
web_contents()->StopFinding(action);
}
void WebContents::ShowDefinitionForSelection() {
#if defined(OS_MACOSX)
const auto view = web_contents()->GetRenderWidgetHostView();
if (view)
view->ShowDefinitionForSelection();
#endif
}
void WebContents::Focus() {
web_contents()->Focus();
}
@@ -966,9 +1154,10 @@ void WebContents::TabTraverse(bool reverse) {
web_contents()->FocusThroughTabTraversal(reverse);
}
bool WebContents::SendIPCMessage(const base::string16& channel,
bool WebContents::SendIPCMessage(bool all_frames,
const base::string16& channel,
const base::ListValue& args) {
return Send(new AtomViewMsg_Message(routing_id(), channel, args));
return Send(new AtomViewMsg_Message(routing_id(), all_frames, channel, args));
}
void WebContents::SendInputEvent(v8::Isolate* isolate,
@@ -1009,9 +1198,9 @@ void WebContents::BeginFrameSubscription(
const FrameSubscriber::FrameCaptureCallback& callback) {
const auto view = web_contents()->GetRenderWidgetHostView();
if (view) {
scoped_ptr<FrameSubscriber> frame_subscriber(new FrameSubscriber(
isolate(), view->GetVisibleViewportSize(), callback));
view->BeginFrameSubscription(frame_subscriber.Pass());
std::unique_ptr<FrameSubscriber> frame_subscriber(new FrameSubscriber(
isolate(), view, callback));
view->BeginFrameSubscription(std::move(frame_subscriber));
}
}
@@ -1021,16 +1210,24 @@ void WebContents::EndFrameSubscription() {
view->EndFrameSubscription();
}
void WebContents::OnCursorChange(const content::WebCursor& cursor) {
content::WebCursor::CursorInfo info;
cursor.GetCursorInfo(&info);
if (cursor.IsCustom()) {
Emit("cursor-changed", CursorTypeToString(info),
gfx::Image::CreateFrom1xBitmap(info.custom_image),
info.image_scale_factor);
} else {
Emit("cursor-changed", CursorTypeToString(info));
}
}
void WebContents::SetSize(const SetSizeParams& params) {
if (guest_delegate_)
guest_delegate_->SetSize(params);
}
void WebContents::SetAllowTransparency(bool allow) {
if (guest_delegate_)
guest_delegate_->SetAllowTransparency(allow);
}
bool WebContents::IsGuest() const {
return type_ == WEB_VIEW;
}
@@ -1048,10 +1245,20 @@ v8::Local<v8::Value> WebContents::GetOwnerBrowserWindow() {
return v8::Null(isolate());
}
int32_t WebContents::ID() const {
return weak_map_id();
}
v8::Local<v8::Value> WebContents::Session(v8::Isolate* isolate) {
return v8::Local<v8::Value>::New(isolate, session_);
}
content::WebContents* WebContents::HostWebContents() {
if (!embedder_)
return nullptr;
return embedder_->web_contents();
}
v8::Local<v8::Value> WebContents::DevToolsWebContents(v8::Isolate* isolate) {
if (devtools_web_contents_.IsEmpty())
return v8::Null(isolate);
@@ -1059,6 +1266,14 @@ v8::Local<v8::Value> WebContents::DevToolsWebContents(v8::Isolate* isolate) {
return v8::Local<v8::Value>::New(isolate, devtools_web_contents_);
}
v8::Local<v8::Value> WebContents::Debugger(v8::Isolate* isolate) {
if (debugger_.IsEmpty()) {
auto handle = atom::api::Debugger::Create(isolate, web_contents());
debugger_.Reset(isolate, handle.ToV8());
}
return v8::Local<v8::Value>::New(isolate, debugger_);
}
// static
void WebContents::BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::ObjectTemplate> prototype) {
@@ -1071,6 +1286,7 @@ void WebContents::BuildPrototype(v8::Isolate* isolate,
.SetMethod("_getURL", &WebContents::GetURL)
.SetMethod("getTitle", &WebContents::GetTitle)
.SetMethod("isLoading", &WebContents::IsLoading)
.SetMethod("isLoadingMainFrame", &WebContents::IsLoadingMainFrame)
.SetMethod("isWaitingForResponse", &WebContents::IsWaitingForResponse)
.SetMethod("_stop", &WebContents::Stop)
.SetMethod("_goBack", &WebContents::GoBack)
@@ -1114,8 +1330,8 @@ void WebContents::BuildPrototype(v8::Isolate* isolate,
&WebContents::BeginFrameSubscription)
.SetMethod("endFrameSubscription", &WebContents::EndFrameSubscription)
.SetMethod("setSize", &WebContents::SetSize)
.SetMethod("setAllowTransparency", &WebContents::SetAllowTransparency)
.SetMethod("isGuest", &WebContents::IsGuest)
.SetMethod("getType", &WebContents::GetType)
.SetMethod("getWebPreferences", &WebContents::GetWebPreferences)
.SetMethod("getOwnerBrowserWindow", &WebContents::GetOwnerBrowserWindow)
.SetMethod("hasServiceWorker", &WebContents::HasServiceWorker)
@@ -1126,8 +1342,13 @@ void WebContents::BuildPrototype(v8::Isolate* isolate,
.SetMethod("_printToPDF", &WebContents::PrintToPDF)
.SetMethod("addWorkSpace", &WebContents::AddWorkSpace)
.SetMethod("removeWorkSpace", &WebContents::RemoveWorkSpace)
.SetMethod("showDefinitionForSelection",
&WebContents::ShowDefinitionForSelection)
.SetProperty("id", &WebContents::ID)
.SetProperty("session", &WebContents::Session)
.SetProperty("devToolsWebContents", &WebContents::DevToolsWebContents);
.SetProperty("hostWebContents", &WebContents::HostWebContents)
.SetProperty("devToolsWebContents", &WebContents::DevToolsWebContents)
.SetProperty("debugger", &WebContents::Debugger);
}
AtomBrowserContext* WebContents::GetBrowserContext() const {
@@ -1156,7 +1377,8 @@ mate::Handle<WebContents> WebContents::CreateFrom(
return mate::CreateHandle(isolate, static_cast<WebContents*>(existing));
// Otherwise create a new WebContents wrapper object.
auto handle = mate::CreateHandle(isolate, new WebContents(web_contents));
auto handle = mate::CreateHandle(
isolate, new WebContents(isolate, web_contents));
g_wrap_web_contents.Run(handle.ToV8());
return handle;
}
@@ -1169,16 +1391,8 @@ mate::Handle<WebContents> WebContents::Create(
return handle;
}
void ClearWrapWebContents() {
g_wrap_web_contents.Reset();
}
void SetWrapWebContents(const WrapWebContentsCallback& callback) {
g_wrap_web_contents = callback;
// Cleanup the wrapper on exit.
atom::AtomBrowserMainParts::Get()->RegisterDestructionCallback(
base::Bind(ClearWrapWebContents));
}
} // namespace api
@@ -1194,6 +1408,10 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
mate::Dictionary dict(isolate, exports);
dict.SetMethod("create", &atom::api::WebContents::Create);
dict.SetMethod("_setWrapWebContents", &atom::api::SetWrapWebContents);
dict.SetMethod("fromId",
&mate::TrackableObject<atom::api::WebContents>::FromWeakMapID);
dict.SetMethod("getAllWebContents",
&mate::TrackableObject<atom::api::WebContents>::GetAll);
}
} // namespace

View File

@@ -14,6 +14,7 @@
#include "atom/browser/common_web_contents_delegate.h"
#include "content/public/browser/web_contents_observer.h"
#include "content/public/common/favicon_url.h"
#include "content/common/cursors/webcursor.h"
#include "native_mate/handle.h"
#include "ui/gfx/image/image.h"
@@ -42,6 +43,13 @@ class WebContents : public mate::TrackableObject<WebContents>,
public CommonWebContentsDelegate,
public content::WebContentsObserver {
public:
enum Type {
BACKGROUND_PAGE, // A DevTools extension background page.
BROWSER_WINDOW, // Used by BrowserWindow.
REMOTE, // Thin wrap around an existing WebContents.
WEB_VIEW, // Used by <webview>.
};
// For node.js callback function type: function(error, buffer)
using PrintToPDFCallback =
base::Callback<void(v8::Local<v8::Value>, v8::Local<v8::Value>)>;
@@ -54,13 +62,18 @@ class WebContents : public mate::TrackableObject<WebContents>,
static mate::Handle<WebContents> Create(
v8::Isolate* isolate, const mate::Dictionary& options);
static void BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::ObjectTemplate> prototype);
int GetID() const;
Type GetType() const;
bool Equal(const WebContents* web_contents) const;
void LoadURL(const GURL& url, const mate::Dictionary& options);
void DownloadURL(const GURL& url);
GURL GetURL() const;
base::string16 GetTitle() const;
bool IsLoading() const;
bool IsLoadingMainFrame() const;
bool IsWaitingForResponse() const;
void Stop();
void ReloadIgnoringCache();
@@ -109,15 +122,17 @@ class WebContents : public mate::TrackableObject<WebContents>,
void Unselect();
void Replace(const base::string16& word);
void ReplaceMisspelling(const base::string16& word);
uint32 FindInPage(mate::Arguments* args);
uint32_t FindInPage(mate::Arguments* args);
void StopFindInPage(content::StopFindAction action);
void ShowDefinitionForSelection();
// Focus.
void Focus();
void TabTraverse(bool reverse);
// Send messages to browser.
bool SendIPCMessage(const base::string16& channel,
bool SendIPCMessage(bool all_frames,
const base::string16& channel,
const base::ListValue& args);
// Send WebInputEvent to the page.
@@ -130,9 +145,18 @@ class WebContents : public mate::TrackableObject<WebContents>,
// Methods for creating <webview>.
void SetSize(const SetSizeParams& params);
void SetAllowTransparency(bool allow);
bool IsGuest() const;
// 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);
// Returns the web preferences of current WebContents.
v8::Local<v8::Value> GetWebPreferences(v8::Isolate* isolate);
@@ -140,33 +164,23 @@ class WebContents : public mate::TrackableObject<WebContents>,
v8::Local<v8::Value> GetOwnerBrowserWindow();
// Properties.
int32_t ID() const;
v8::Local<v8::Value> Session(v8::Isolate* isolate);
content::WebContents* HostWebContents();
v8::Local<v8::Value> DevToolsWebContents(v8::Isolate* isolate);
// mate::TrackableObject:
static void BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::ObjectTemplate> prototype);
v8::Local<v8::Value> Debugger(v8::Isolate* isolate);
protected:
explicit WebContents(content::WebContents* web_contents);
WebContents(v8::Isolate* isolate, content::WebContents* web_contents);
WebContents(v8::Isolate* isolate, const mate::Dictionary& options);
~WebContents();
// content::WebContentsDelegate:
bool AddMessageToConsole(content::WebContents* source,
int32 level,
int32_t level,
const base::string16& message,
int32 line_no,
int32_t line_no,
const base::string16& source_id) override;
bool ShouldCreateWebContents(
content::WebContents* web_contents,
int route_id,
int main_frame_route_id,
WindowContainerType window_container_type,
const std::string& frame_name,
const GURL& target_url,
const std::string& partition_id,
content::SessionStorageNamespace* session_storage_namespace) override;
content::WebContents* OpenURLFromTab(
content::WebContents* source,
const content::OpenURLParams& params) override;
@@ -177,6 +191,7 @@ class WebContents : public mate::TrackableObject<WebContents>,
const gfx::Rect& pos) override;
void CloseContents(content::WebContents* source) override;
void ActivateContents(content::WebContents* contents) override;
void UpdateTargetURL(content::WebContents* source, const GURL& url) override;
bool IsPopupOrPanel(const content::WebContents* source) const override;
void HandleKeyboardEvent(
content::WebContents* source,
@@ -194,6 +209,21 @@ class WebContents : public mate::TrackableObject<WebContents>,
const gfx::Rect& selection_rect,
int active_match_ordinal,
bool final_update) override;
bool CheckMediaAccessPermission(
content::WebContents* web_contents,
const GURL& security_origin,
content::MediaStreamType type) override;
void RequestMediaAccessPermission(
content::WebContents* web_contents,
const content::MediaStreamRequest& request,
const content::MediaResponseCallback& callback) override;
void RequestToLockMouse(
content::WebContents* web_contents,
bool user_gesture,
bool last_unlocked_by_target) override;
std::unique_ptr<content::BluetoothChooser> RunBluetoothChooser(
content::RenderFrameHost* frame,
const content::BluetoothChooser::EventHandler& handler) override;
// content::WebContentsObserver:
void BeforeUnloadFired(const base::TimeTicks& proceed_time) override;
@@ -232,28 +262,28 @@ 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() override;
void MediaPaused() override;
void MediaStartedPlaying(const MediaPlayerId& id) override;
void MediaStoppedPlaying(const MediaPlayerId& id) override;
void DidChangeThemeColor(SkColor theme_color) override;
// brightray::InspectableWebContentsDelegate:
void DevToolsReloadPage() override;
// brightray::InspectableWebContentsViewDelegate:
void DevToolsFocused() override;
void DevToolsOpened() override;
void DevToolsClosed() override;
private:
enum Type {
BROWSER_WINDOW, // Used by BrowserWindow.
WEB_VIEW, // Used by <webview>.
REMOTE, // Thin wrap around an existing WebContents.
};
AtomBrowserContext* GetBrowserContext() const;
uint32 GetNextRequestId() {
uint32_t GetNextRequestId() {
return ++request_id_;
}
// Called when we receive a CursorChange message from chromium.
void OnCursorChange(const content::WebCursor& cursor);
// Called when received a message from renderer.
void OnRendererMessage(const base::string16& channel,
const base::ListValue& args);
@@ -265,14 +295,21 @@ class WebContents : public mate::TrackableObject<WebContents>,
v8::Global<v8::Value> session_;
v8::Global<v8::Value> devtools_web_contents_;
v8::Global<v8::Value> debugger_;
scoped_ptr<WebViewGuestDelegate> guest_delegate_;
std::unique_ptr<WebViewGuestDelegate> guest_delegate_;
// The host webcontents that may contain this webcontents.
WebContents* embedder_;
// The type of current WebContents.
Type type_;
// Request id used for findInPage request.
uint32 request_id_;
uint32_t request_id_;
// Whether background throttling is disabled.
bool background_throttling_;
DISALLOW_COPY_AND_ASSIGN(WebContents);
};

View File

@@ -36,8 +36,10 @@ namespace atom {
namespace api {
WebRequest::WebRequest(AtomBrowserContext* browser_context)
WebRequest::WebRequest(v8::Isolate* isolate,
AtomBrowserContext* browser_context)
: browser_context_(browser_context) {
Init(isolate);
}
WebRequest::~WebRequest() {
@@ -81,7 +83,7 @@ void WebRequest::SetListener(Method method, Event type, mate::Arguments* args) {
mate::Handle<WebRequest> WebRequest::Create(
v8::Isolate* isolate,
AtomBrowserContext* browser_context) {
return mate::CreateHandle(isolate, new WebRequest(browser_context));
return mate::CreateHandle(isolate, new WebRequest(isolate, browser_context));
}
// static

View File

@@ -21,13 +21,12 @@ class WebRequest : public mate::TrackableObject<WebRequest> {
static mate::Handle<WebRequest> Create(v8::Isolate* isolate,
AtomBrowserContext* browser_context);
// mate::TrackableObject:
static void BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::ObjectTemplate> prototype);
protected:
explicit WebRequest(AtomBrowserContext* browser_context);
~WebRequest();
WebRequest(v8::Isolate* isolate, AtomBrowserContext* browser_context);
~WebRequest() override;
// C++ can not distinguish overloaded member function.
template<AtomNetworkDelegate::SimpleEvent type>

View File

@@ -2,9 +2,9 @@
// 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_web_contents.h"
#include "atom/browser/web_contents_preferences.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 "content/public/browser/browser_context.h"
@@ -12,40 +12,14 @@
using atom::WebContentsPreferences;
namespace mate {
template<>
struct Converter<content::WebContents*> {
static bool FromV8(v8::Isolate* isolate, v8::Local<v8::Value> val,
content::WebContents** out) {
atom::api::WebContents* contents;
if (!Converter<atom::api::WebContents*>::FromV8(isolate, val, &contents))
return false;
*out = contents->web_contents();
return true;
}
};
} // namespace mate
namespace {
atom::WebViewManager* GetWebViewManager(content::WebContents* web_contents) {
auto context = web_contents->GetBrowserContext();
if (context) {
auto manager = context->GetGuestManager();
return static_cast<atom::WebViewManager*>(manager);
} else {
return nullptr;
}
}
void AddGuest(int guest_instance_id,
int element_instance_id,
content::WebContents* embedder,
content::WebContents* guest_web_contents,
const base::DictionaryValue& options) {
auto manager = GetWebViewManager(embedder);
auto manager = atom::WebViewManager::GetWebViewManager(embedder);
if (manager)
manager->AddGuest(guest_instance_id, element_instance_id, embedder,
guest_web_contents);
@@ -54,7 +28,7 @@ void AddGuest(int guest_instance_id,
}
void RemoveGuest(content::WebContents* embedder, int guest_instance_id) {
auto manager = GetWebViewManager(embedder);
auto manager = atom::WebViewManager::GetWebViewManager(embedder);
if (manager)
manager->RemoveGuest(guest_instance_id);
}

View File

@@ -21,8 +21,11 @@
#include "native_mate/dictionary.h"
#include "ui/gfx/geometry/rect.h"
#if defined(OS_WIN)
#if defined(TOOLKIT_VIEWS)
#include "atom/browser/native_window_views.h"
#endif
#if defined(OS_WIN)
#include "atom/browser/ui/win/taskbar_host.h"
#endif
@@ -61,55 +64,9 @@ void OnCapturePageDone(
callback.Run(gfx::Image::CreateFrom1xBitmap(bitmap));
}
// Converts min-width to minWidth, returns false if no conversion is needed.
bool TranslateOldKey(const std::string& key, std::string* new_key) {
if (key.find('-') == std::string::npos)
return false;
new_key->reserve(key.size());
bool next_upper_case = false;
for (char c : key) {
if (c == '-') {
next_upper_case = true;
} else if (next_upper_case) {
new_key->push_back(base::ToUpperASCII(c));
next_upper_case = false;
} else {
new_key->push_back(c);
}
}
return true;
}
// Converts min-width to minWidth recursively in the dictionary.
void TranslateOldOptions(v8::Isolate* isolate, v8::Local<v8::Object> options) {
auto context = isolate->GetCurrentContext();
auto maybe_keys = options->GetOwnPropertyNames(context);
if (maybe_keys.IsEmpty())
return;
std::vector<std::string> keys;
if (!mate::ConvertFromV8(isolate, maybe_keys.ToLocalChecked(), &keys))
return;
mate::Dictionary dict(isolate, options);
for (const auto& key : keys) {
v8::Local<v8::Value> value;
if (!dict.Get(key, &value)) // Shouldn't happen, but guard it anyway.
continue;
// Go recursively.
v8::Local<v8::Object> sub_options;
if (mate::ConvertFromV8(isolate, value, &sub_options))
TranslateOldOptions(isolate, sub_options);
// Translate key.
std::string new_key;
if (TranslateOldKey(key, &new_key)) {
dict.Set(new_key, value);
dict.Delete(key);
}
}
}
// Converts binary data to Buffer.
v8::Local<v8::Value> ToBuffer(v8::Isolate* isolate, void* val, int size) {
auto buffer = node::Buffer::New(isolate, static_cast<char*>(val), size);
auto buffer = node::Buffer::Copy(isolate, static_cast<char*>(val), size);
if (buffer.IsEmpty())
return v8::Null(isolate);
else
@@ -120,21 +77,14 @@ v8::Local<v8::Value> ToBuffer(v8::Isolate* isolate, void* val, int size) {
Window::Window(v8::Isolate* isolate, const mate::Dictionary& options) {
// Be compatible with old style field names like min-width.
TranslateOldOptions(isolate, options.GetHandle());
// Use options.webPreferences to create WebContents.
mate::Dictionary web_preferences = mate::Dictionary::CreateEmpty(isolate);
options.Get(options::kWebPreferences, &web_preferences);
// Be compatible with old options which are now in web_preferences.
// Copy the backgroundColor to webContents.
v8::Local<v8::Value> value;
if (options.Get(options::kNodeIntegration, &value))
web_preferences.Set(options::kNodeIntegration, value);
if (options.Get(options::kPreloadScript, &value))
web_preferences.Set(options::kPreloadScript, value);
if (options.Get(options::kZoomFactor, &value))
web_preferences.Set(options::kZoomFactor, value);
if (options.Get(options::kBackgroundColor, &value))
web_preferences.Set(options::kBackgroundColor, value);
// Creates the WebContents used by BrowserWindow.
auto web_contents = WebContents::Create(isolate, web_preferences);
@@ -142,7 +92,7 @@ Window::Window(v8::Isolate* isolate, const mate::Dictionary& options) {
api_web_contents_ = web_contents.get();
// Keep a copy of the options for later use.
mate::Dictionary(isolate, web_contents->GetWrapper(isolate)).Set(
mate::Dictionary(isolate, web_contents->GetWrapper()).Set(
"browserWindowOptions", options);
// Creates BrowserWindow.
@@ -152,6 +102,13 @@ Window::Window(v8::Isolate* isolate, const mate::Dictionary& options) {
window_->InitFromOptions(options);
window_->AddObserver(this);
AttachAsUserData(window_.get());
#if defined(TOOLKIT_VIEWS)
// Sets the window icon.
mate::Handle<NativeImage> icon;
if (options.Get(options::kIcon, &icon))
SetIcon(icon);
#endif
}
Window::~Window() {
@@ -191,6 +148,18 @@ void Window::OnWindowFocus() {
Emit("focus");
}
void Window::OnWindowShow() {
Emit("show");
}
void Window::OnWindowHide() {
Emit("hide");
}
void Window::OnReadyToShow() {
Emit("ready-to-show");
}
void Window::OnWindowMaximize() {
Emit("maximize");
}
@@ -227,6 +196,18 @@ void Window::OnWindowLeaveFullScreen() {
Emit("leave-full-screen");
}
void Window::OnWindowScrollTouchBegin() {
Emit("scroll-touch-begin");
}
void Window::OnWindowScrollTouchEnd() {
Emit("scroll-touch-end");
}
void Window::OnWindowSwipe(const std::string& direction) {
Emit("swipe", direction);
}
void Window::OnWindowEnterHtmlFullScreen() {
Emit("enter-html-full-screen");
}
@@ -258,7 +239,7 @@ void Window::OnWindowMessage(UINT message, WPARAM w_param, LPARAM l_param) {
#endif
// static
mate::Wrappable* Window::New(v8::Isolate* isolate, mate::Arguments* args) {
mate::WrappableBase* Window::New(v8::Isolate* isolate, mate::Arguments* args) {
if (!Browser::Get()->is_ready()) {
isolate->ThrowException(v8::Exception::Error(mate::StringToV8(
isolate, "Cannot create BrowserWindow before app is ready")));
@@ -286,6 +267,10 @@ void Window::Focus() {
window_->Focus(true);
}
void Window::Blur() {
window_->Focus(false);
}
bool Window::IsFocused() {
return window_->IsFocused();
}
@@ -338,16 +323,20 @@ bool Window::IsFullscreen() {
return window_->IsFullscreen();
}
void Window::SetBounds(const gfx::Rect& bounds) {
window_->SetBounds(bounds);
void Window::SetBounds(const gfx::Rect& bounds, mate::Arguments* args) {
bool animate = false;
args->GetNext(&animate);
window_->SetBounds(bounds, animate);
}
gfx::Rect Window::GetBounds() {
return window_->GetBounds();
}
void Window::SetSize(int width, int height) {
window_->SetSize(gfx::Size(width, height));
void Window::SetSize(int width, int height, mate::Arguments* args) {
bool animate = false;
args->GetNext(&animate);
window_->SetSize(gfx::Size(width, height), animate);
}
std::vector<int> Window::GetSize() {
@@ -358,8 +347,10 @@ std::vector<int> Window::GetSize() {
return result;
}
void Window::SetContentSize(int width, int height) {
window_->SetContentSize(gfx::Size(width, height));
void Window::SetContentSize(int width, int height, mate::Arguments* args) {
bool animate = false;
args->GetNext(&animate);
window_->SetContentSize(gfx::Size(width, height), animate);
}
std::vector<int> Window::GetContentSize() {
@@ -394,6 +385,12 @@ std::vector<int> Window::GetMaximumSize() {
return result;
}
void Window::SetSheetOffset(double offsetY, mate::Arguments* args) {
double offsetX = 0.0;
args->GetNext(&offsetX);
window_->SetSheetOffset(offsetX, offsetY);
}
void Window::SetResizable(bool resizable) {
window_->SetResizable(resizable);
}
@@ -402,6 +399,46 @@ bool Window::IsResizable() {
return window_->IsResizable();
}
void Window::SetMovable(bool movable) {
window_->SetMovable(movable);
}
bool Window::IsMovable() {
return window_->IsMovable();
}
void Window::SetMinimizable(bool minimizable) {
window_->SetMinimizable(minimizable);
}
bool Window::IsMinimizable() {
return window_->IsMinimizable();
}
void Window::SetMaximizable(bool maximizable) {
window_->SetMaximizable(maximizable);
}
bool Window::IsMaximizable() {
return window_->IsMaximizable();
}
void Window::SetFullScreenable(bool fullscreenable) {
window_->SetFullScreenable(fullscreenable);
}
bool Window::IsFullScreenable() {
return window_->IsFullScreenable();
}
void Window::SetClosable(bool closable) {
window_->SetClosable(closable);
}
bool Window::IsClosable() {
return window_->IsClosable();
}
void Window::SetAlwaysOnTop(bool top) {
window_->SetAlwaysOnTop(top);
}
@@ -414,8 +451,10 @@ void Window::Center() {
window_->Center();
}
void Window::SetPosition(int x, int y) {
window_->SetPosition(gfx::Point(x, y));
void Window::SetPosition(int x, int y, mate::Arguments* args) {
bool animate = false;
args->GetNext(&animate);
window_->SetPosition(gfx::Point(x, y), animate);
}
std::vector<int> Window::GetPosition() {
@@ -454,6 +493,14 @@ void Window::SetBackgroundColor(const std::string& color_name) {
window_->SetBackgroundColor(color_name);
}
void Window::SetHasShadow(bool has_shadow) {
window_->SetHasShadow(has_shadow);
}
bool Window::HasShadow() {
return window_->HasShadow();
}
void Window::FocusOnWebView() {
window_->FocusOnWebView();
}
@@ -486,6 +533,10 @@ void Window::SetIgnoreMouseEvents(bool ignore) {
return window_->SetIgnoreMouseEvents(ignore);
}
void Window::SetFocusable(bool focusable) {
return window_->SetFocusable(focusable);
}
void Window::CapturePage(mate::Arguments* args) {
gfx::Rect rect;
base::Callback<void(const gfx::Image&)> callback;
@@ -580,9 +631,16 @@ void Window::UnhookAllWindowMessages() {
}
#endif
#if defined(OS_MACOSX)
void Window::ShowDefinitionForSelection() {
window_->ShowDefinitionForSelection();
#if defined(TOOLKIT_VIEWS)
void Window::SetIcon(mate::Handle<NativeImage> icon) {
#if defined(OS_WIN)
static_cast<NativeWindowViews*>(window_.get())->SetIcon(
icon->GetHICON(GetSystemMetrics(SM_CXSMICON)),
icon->GetHICON(GetSystemMetrics(SM_CXICON)));
#elif defined(USE_X11)
static_cast<NativeWindowViews*>(window_.get())->SetIcon(
icon->image().AsImageSkia());
#endif
}
#endif
@@ -624,6 +682,7 @@ void Window::BuildPrototype(v8::Isolate* isolate,
.MakeDestroyable()
.SetMethod("close", &Window::Close)
.SetMethod("focus", &Window::Focus)
.SetMethod("blur", &Window::Blur)
.SetMethod("isFocused", &Window::IsFocused)
.SetMethod("show", &Window::Show)
.SetMethod("showInactive", &Window::ShowInactive)
@@ -649,8 +708,19 @@ void Window::BuildPrototype(v8::Isolate* isolate,
.SetMethod("getMinimumSize", &Window::GetMinimumSize)
.SetMethod("setMaximumSize", &Window::SetMaximumSize)
.SetMethod("getMaximumSize", &Window::GetMaximumSize)
.SetMethod("setSheetOffset", &Window::SetSheetOffset)
.SetMethod("setResizable", &Window::SetResizable)
.SetMethod("isResizable", &Window::IsResizable)
.SetMethod("setMovable", &Window::SetMovable)
.SetMethod("isMovable", &Window::IsMovable)
.SetMethod("setMinimizable", &Window::SetMinimizable)
.SetMethod("isMinimizable", &Window::IsMinimizable)
.SetMethod("setMaximizable", &Window::SetMaximizable)
.SetMethod("isMaximizable", &Window::IsMaximizable)
.SetMethod("setFullScreenable", &Window::SetFullScreenable)
.SetMethod("isFullScreenable", &Window::IsFullScreenable)
.SetMethod("setClosable", &Window::SetClosable)
.SetMethod("isClosable", &Window::IsClosable)
.SetMethod("setAlwaysOnTop", &Window::SetAlwaysOnTop)
.SetMethod("isAlwaysOnTop", &Window::IsAlwaysOnTop)
.SetMethod("center", &Window::Center)
@@ -663,11 +733,14 @@ void Window::BuildPrototype(v8::Isolate* isolate,
.SetMethod("setKiosk", &Window::SetKiosk)
.SetMethod("isKiosk", &Window::IsKiosk)
.SetMethod("setBackgroundColor", &Window::SetBackgroundColor)
.SetMethod("setHasShadow", &Window::SetHasShadow)
.SetMethod("hasShadow", &Window::HasShadow)
.SetMethod("setRepresentedFilename", &Window::SetRepresentedFilename)
.SetMethod("getRepresentedFilename", &Window::GetRepresentedFilename)
.SetMethod("setDocumentEdited", &Window::SetDocumentEdited)
.SetMethod("isDocumentEdited", &Window::IsDocumentEdited)
.SetMethod("setIgnoreMouseEvents", &Window::SetIgnoreMouseEvents)
.SetMethod("setFocusable", &Window::SetFocusable)
.SetMethod("focusOnWebView", &Window::FocusOnWebView)
.SetMethod("blurWebView", &Window::BlurWebView)
.SetMethod("isWebViewFocused", &Window::IsWebViewFocused)
@@ -690,9 +763,8 @@ void Window::BuildPrototype(v8::Isolate* isolate,
.SetMethod("unhookWindowMessage", &Window::UnhookWindowMessage)
.SetMethod("unhookAllWindowMessages", &Window::UnhookAllWindowMessages)
#endif
#if defined(OS_MACOSX)
.SetMethod("showDefinitionForSelection",
&Window::ShowDefinitionForSelection)
#if defined(TOOLKIT_VIEWS)
.SetMethod("setIcon", &Window::SetIcon)
#endif
.SetProperty("id", &Window::ID)
.SetProperty("webContents", &Window::WebContents);
@@ -703,7 +775,7 @@ v8::Local<v8::Value> Window::From(v8::Isolate* isolate,
NativeWindow* native_window) {
auto existing = TrackableObject::FromWrappedClass(isolate, native_window);
if (existing)
return existing->GetWrapper(isolate);
return existing->GetWrapper();
else
return v8::Null(isolate);
}

View File

@@ -14,6 +14,7 @@
#include "atom/browser/api/trackable_object.h"
#include "atom/browser/native_window.h"
#include "atom/browser/native_window_observer.h"
#include "atom/common/api/atom_api_native_image.h"
#include "native_mate/handle.h"
class GURL;
@@ -38,7 +39,7 @@ class WebContents;
class Window : public mate::TrackableObject<Window>,
public NativeWindowObserver {
public:
static mate::Wrappable* New(v8::Isolate* isolate, mate::Arguments* args);
static mate::WrappableBase* New(v8::Isolate* isolate, mate::Arguments* args);
static void BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::ObjectTemplate> prototype);
@@ -51,13 +52,16 @@ class Window : public mate::TrackableObject<Window>,
protected:
Window(v8::Isolate* isolate, const mate::Dictionary& options);
virtual ~Window();
~Window() override;
// NativeWindowObserver:
void WillCloseWindow(bool* prevent_default) override;
void OnWindowClosed() override;
void OnWindowBlur() override;
void OnWindowFocus() override;
void OnWindowShow() override;
void OnWindowHide() override;
void OnReadyToShow() override;
void OnWindowMaximize() override;
void OnWindowUnmaximize() override;
void OnWindowMinimize() override;
@@ -65,6 +69,9 @@ class Window : public mate::TrackableObject<Window>,
void OnWindowResize() override;
void OnWindowMove() override;
void OnWindowMoved() override;
void OnWindowScrollTouchBegin() override;
void OnWindowScrollTouchEnd() override;
void OnWindowSwipe(const std::string& direction) override;
void OnWindowEnterFullScreen() override;
void OnWindowLeaveFullScreen() override;
void OnWindowEnterHtmlFullScreen() override;
@@ -81,6 +88,7 @@ class Window : public mate::TrackableObject<Window>,
// APIs for NativeWindow.
void Close();
void Focus();
void Blur();
bool IsFocused();
void Show();
void ShowInactive();
@@ -94,22 +102,33 @@ class Window : public mate::TrackableObject<Window>,
bool IsMinimized();
void SetFullScreen(bool fullscreen);
bool IsFullscreen();
void SetBounds(const gfx::Rect& bounds);
void SetBounds(const gfx::Rect& bounds, mate::Arguments* args);
gfx::Rect GetBounds();
void SetSize(int width, int height);
void SetSize(int width, int height, mate::Arguments* args);
std::vector<int> GetSize();
void SetContentSize(int width, int height);
void SetContentSize(int width, int height, mate::Arguments* args);
std::vector<int> GetContentSize();
void SetMinimumSize(int width, int height);
std::vector<int> GetMinimumSize();
void SetMaximumSize(int width, int height);
std::vector<int> GetMaximumSize();
void SetSheetOffset(double offsetY, mate::Arguments* args);
void SetResizable(bool resizable);
bool IsResizable();
void SetMovable(bool movable);
bool IsMovable();
void SetMinimizable(bool minimizable);
bool IsMinimizable();
void SetMaximizable(bool maximizable);
bool IsMaximizable();
void SetFullScreenable(bool fullscreenable);
bool IsFullScreenable();
void SetClosable(bool closable);
bool IsClosable();
void SetAlwaysOnTop(bool top);
bool IsAlwaysOnTop();
void Center();
void SetPosition(int x, int y);
void SetPosition(int x, int y, mate::Arguments* args);
std::vector<int> GetPosition();
void SetTitle(const std::string& title);
std::string GetTitle();
@@ -118,6 +137,8 @@ class Window : public mate::TrackableObject<Window>,
void SetKiosk(bool kiosk);
bool IsKiosk();
void SetBackgroundColor(const std::string& color_name);
void SetHasShadow(bool has_shadow);
bool HasShadow();
void FocusOnWebView();
void BlurWebView();
bool IsWebViewFocused();
@@ -126,6 +147,7 @@ class Window : public mate::TrackableObject<Window>,
void SetDocumentEdited(bool edited);
bool IsDocumentEdited();
void SetIgnoreMouseEvents(bool ignore);
void SetFocusable(bool focusable);
void CapturePage(mate::Arguments* args);
void SetProgressBar(double progress);
void SetOverlayIcon(const gfx::Image& overlay,
@@ -149,8 +171,8 @@ class Window : public mate::TrackableObject<Window>,
void UnhookAllWindowMessages();
#endif
#if defined(OS_MACOSX)
void ShowDefinitionForSelection();
#if defined(TOOLKIT_VIEWS)
void SetIcon(mate::Handle<NativeImage> icon);
#endif
void SetVisibleOnAllWorkspaces(bool visible);
@@ -169,7 +191,7 @@ class Window : public mate::TrackableObject<Window>,
api::WebContents* api_web_contents_;
scoped_ptr<NativeWindow> window_;
std::unique_ptr<NativeWindow> window_;
DISALLOW_COPY_AND_ASSIGN(Window);
};

View File

@@ -11,31 +11,15 @@
namespace mate {
namespace {
v8::Persistent<v8::ObjectTemplate> template_;
} // namespace
Event::Event()
Event::Event(v8::Isolate* isolate)
: sender_(NULL),
message_(NULL) {
Init(isolate);
}
Event::~Event() {
}
ObjectTemplateBuilder Event::GetObjectTemplateBuilder(v8::Isolate* isolate) {
if (template_.IsEmpty())
template_.Reset(isolate, ObjectTemplateBuilder(isolate)
.SetMethod("preventDefault", &Event::PreventDefault)
.SetMethod("sendReply", &Event::SendReply)
.Build());
return ObjectTemplateBuilder(
isolate, v8::Local<v8::ObjectTemplate>::New(isolate, template_));
}
void Event::SetSenderAndMessage(content::WebContents* sender,
IPC::Message* message) {
DCHECK(!sender_);
@@ -52,7 +36,7 @@ void Event::WebContentsDestroyed() {
}
void Event::PreventDefault(v8::Isolate* isolate) {
GetWrapper(isolate)->Set(StringToV8(isolate, "defaultPrevented"),
GetWrapper()->Set(StringToV8(isolate, "defaultPrevented"),
v8::True(isolate));
}
@@ -61,12 +45,23 @@ bool Event::SendReply(const base::string16& json) {
return false;
AtomViewHostMsg_Message_Sync::WriteReplyParams(message_, json);
return sender_->Send(message_);
bool success = sender_->Send(message_);
message_ = NULL;
sender_ = NULL;
return success;
}
// static
Handle<Event> Event::Create(v8::Isolate* isolate) {
return CreateHandle(isolate, new Event);
return mate::CreateHandle(isolate, new Event(isolate));
}
// static
void Event::BuildPrototype(
v8::Isolate* isolate, v8::Local<v8::ObjectTemplate> prototype) {
mate::ObjectTemplateBuilder(isolate, prototype)
.SetMethod("preventDefault", &Event::PreventDefault)
.SetMethod("sendReply", &Event::SendReply);
}
} // namespace mate

View File

@@ -15,11 +15,14 @@ class Message;
namespace mate {
class Event : public Wrappable,
class Event : public Wrappable<Event>,
public content::WebContentsObserver {
public:
static Handle<Event> Create(v8::Isolate* isolate);
static void BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::ObjectTemplate> prototype);
// Pass the sender and message to be replied.
void SetSenderAndMessage(content::WebContents* sender, IPC::Message* message);
@@ -30,11 +33,8 @@ class Event : public Wrappable,
bool SendReply(const base::string16& json);
protected:
Event();
virtual ~Event();
// Wrappable implementations:
ObjectTemplateBuilder GetObjectTemplateBuilder(v8::Isolate* isolate) override;
explicit Event(v8::Isolate* isolate);
~Event() override;
// content::WebContentsObserver implementations:
void WebContentsDestroyed() override;

View File

@@ -34,11 +34,13 @@ v8::Local<v8::Object> CreateEventObject(v8::Isolate* isolate) {
} // namespace
EventEmitter::EventEmitter() {
}
namespace internal {
v8::Local<v8::Object> EventEmitter::CreateJSEvent(
v8::Isolate* isolate, content::WebContents* sender, IPC::Message* message) {
v8::Local<v8::Object> CreateJSEvent(
v8::Isolate* isolate,
v8::Local<v8::Object> object,
content::WebContents* sender,
IPC::Message* message) {
v8::Local<v8::Object> event;
bool use_native_event = sender && message;
@@ -49,16 +51,20 @@ v8::Local<v8::Object> EventEmitter::CreateJSEvent(
} else {
event = CreateEventObject(isolate);
}
mate::Dictionary(isolate, event).Set("sender", GetWrapper(isolate));
mate::Dictionary(isolate, event).Set("sender", object);
return event;
}
v8::Local<v8::Object> EventEmitter::CreateCustomEvent(
v8::Isolate* isolate, v8::Local<v8::Object> custom_event) {
v8::Local<v8::Object> CreateCustomEvent(
v8::Isolate* isolate,
v8::Local<v8::Object> object,
v8::Local<v8::Object> custom_event) {
v8::Local<v8::Object> event = CreateEventObject(isolate);
(void)event->SetPrototype(custom_event->CreationContext(), custom_event);
mate::Dictionary(isolate, event).Set("sender", GetWrapper(isolate));
mate::Dictionary(isolate, event).Set("sender", object);
return event;
}
} // namespace internal
} // namespace mate

View File

@@ -20,17 +20,38 @@ class Message;
namespace mate {
namespace internal {
v8::Local<v8::Object> CreateJSEvent(v8::Isolate* isolate,
v8::Local<v8::Object> object,
content::WebContents* sender,
IPC::Message* message);
v8::Local<v8::Object> CreateCustomEvent(
v8::Isolate* isolate,
v8::Local<v8::Object> object,
v8::Local<v8::Object> event);
} // namespace internal
// Provide helperers to emit event in JavaScript.
class EventEmitter : public Wrappable {
template<typename T>
class EventEmitter : public Wrappable<T> {
public:
typedef std::vector<v8::Local<v8::Value>> ValueArray;
// Make the convinient methods visible:
// https://isocpp.org/wiki/faq/templates#nondependent-name-lookup-members
v8::Local<v8::Object> GetWrapper() { return Wrappable<T>::GetWrapper(); }
v8::Isolate* isolate() const { return Wrappable<T>::isolate(); }
// this.emit(name, event, args...);
template<typename... Args>
bool EmitCustomEvent(const base::StringPiece& name,
v8::Local<v8::Object> event,
const Args&... args) {
return EmitWithEvent(name, CreateCustomEvent(isolate(), event), args...);
return EmitWithEvent(
name,
internal::CreateCustomEvent(isolate(), GetWrapper(), event), args...);
}
// this.emit(name, new Event(), args...);
@@ -47,12 +68,13 @@ class EventEmitter : public Wrappable {
const Args&... args) {
v8::Locker locker(isolate());
v8::HandleScope handle_scope(isolate());
v8::Local<v8::Object> event = CreateJSEvent(isolate(), sender, message);
v8::Local<v8::Object> event = internal::CreateJSEvent(
isolate(), GetWrapper(), sender, message);
return EmitWithEvent(name, event, args...);
}
protected:
EventEmitter();
EventEmitter() {}
private:
// this.emit(name, event, args...);
@@ -62,17 +84,11 @@ class EventEmitter : public Wrappable {
const Args&... args) {
v8::Locker locker(isolate());
v8::HandleScope handle_scope(isolate());
EmitEvent(isolate(), GetWrapper(isolate()), name, event, args...);
EmitEvent(isolate(), GetWrapper(), name, event, args...);
return event->Get(
StringToV8(isolate(), "defaultPrevented"))->BooleanValue();
}
v8::Local<v8::Object> CreateJSEvent(v8::Isolate* isolate,
content::WebContents* sender,
IPC::Message* message);
v8::Local<v8::Object> CreateCustomEvent(
v8::Isolate* isolate, v8::Local<v8::Object> event);
DISALLOW_COPY_AND_ASSIGN(EventEmitter);
};

View File

@@ -4,19 +4,18 @@
#include "atom/browser/api/frame_subscriber.h"
#include "atom/common/node_includes.h"
#include "base/bind.h"
#include "media/base/video_frame.h"
#include "media/base/yuv_convert.h"
#include "atom/common/node_includes.h"
#include "content/public/browser/render_widget_host.h"
namespace atom {
namespace api {
FrameSubscriber::FrameSubscriber(v8::Isolate* isolate,
const gfx::Size& size,
content::RenderWidgetHostView* view,
const FrameCaptureCallback& callback)
: isolate_(isolate), size_(size), callback_(callback) {
: isolate_(isolate), view_(view), callback_(callback), weak_factory_(this) {
}
bool FrameSubscriber::ShouldCaptureFrame(
@@ -24,39 +23,39 @@ bool FrameSubscriber::ShouldCaptureFrame(
base::TimeTicks present_time,
scoped_refptr<media::VideoFrame>* storage,
DeliverFrameCallback* callback) {
*storage = media::VideoFrame::CreateFrame(
media::PIXEL_FORMAT_YV12,
size_, gfx::Rect(size_), size_, base::TimeDelta());
*callback = base::Bind(&FrameSubscriber::OnFrameDelivered,
base::Unretained(this), *storage);
return true;
const auto host = view_ ? view_->GetRenderWidgetHost() : nullptr;
if (!view_ || !host)
return false;
const auto size = view_->GetVisibleViewportSize();
host->CopyFromBackingStore(
gfx::Rect(size),
size,
base::Bind(&FrameSubscriber::OnFrameDelivered,
weak_factory_.GetWeakPtr(), callback_),
kBGRA_8888_SkColorType);
return false;
}
void FrameSubscriber::OnFrameDelivered(
scoped_refptr<media::VideoFrame> frame, base::TimeTicks, bool result) {
if (!result)
void FrameSubscriber::OnFrameDelivered(const FrameCaptureCallback& callback,
const SkBitmap& bitmap, content::ReadbackResponse response) {
if (bitmap.computeSize64() == 0)
return;
v8::Locker locker(isolate_);
v8::HandleScope handle_scope(isolate_);
gfx::Rect rect = frame->visible_rect();
size_t rgb_arr_size = rect.width() * rect.height() * 4;
size_t rgb_arr_size = bitmap.width() * bitmap.height() *
bitmap.bytesPerPixel();
v8::MaybeLocal<v8::Object> buffer = node::Buffer::New(isolate_, rgb_arr_size);
if (buffer.IsEmpty())
return;
// Convert a frame of YUV to 32 bit ARGB.
media::ConvertYUVToRGB32(frame->data(media::VideoFrame::kYPlane),
frame->data(media::VideoFrame::kUPlane),
frame->data(media::VideoFrame::kVPlane),
reinterpret_cast<uint8*>(
node::Buffer::Data(buffer.ToLocalChecked())),
rect.width(), rect.height(),
frame->stride(media::VideoFrame::kYPlane),
frame->stride(media::VideoFrame::kUVPlane),
rect.width() * 4,
media::YV12);
bitmap.copyPixelsTo(
reinterpret_cast<uint8_t*>(node::Buffer::Data(buffer.ToLocalChecked())),
rgb_arr_size);
callback_.Run(buffer.ToLocalChecked());
}

View File

@@ -6,7 +6,11 @@
#define ATOM_BROWSER_API_FRAME_SUBSCRIBER_H_
#include "base/callback.h"
#include "base/memory/weak_ptr.h"
#include "content/public/browser/render_widget_host_view.h"
#include "content/public/browser/render_widget_host_view_frame_subscriber.h"
#include "content/public/browser/readback_types.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/gfx/geometry/size.h"
#include "v8/include/v8.h"
@@ -19,7 +23,7 @@ class FrameSubscriber : public content::RenderWidgetHostViewFrameSubscriber {
using FrameCaptureCallback = base::Callback<void(v8::Local<v8::Value>)>;
FrameSubscriber(v8::Isolate* isolate,
const gfx::Size& size,
content::RenderWidgetHostView* view,
const FrameCaptureCallback& callback);
bool ShouldCaptureFrame(const gfx::Rect& damage_rect,
@@ -28,13 +32,15 @@ class FrameSubscriber : public content::RenderWidgetHostViewFrameSubscriber {
DeliverFrameCallback* callback) override;
private:
void OnFrameDelivered(
scoped_refptr<media::VideoFrame> frame, base::TimeTicks, bool);
void OnFrameDelivered(const FrameCaptureCallback& callback,
const SkBitmap& bitmap, content::ReadbackResponse response);
v8::Isolate* isolate_;
gfx::Size size_;
content::RenderWidgetHostView* view_;
FrameCaptureCallback callback_;
base::WeakPtrFactory<FrameSubscriber> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(FrameSubscriber);
};

View File

@@ -1,124 +0,0 @@
var EventEmitter, Menu, app, appPath, bindings, deprecate, downloadItemBindings, fn, i, len, name, ref, ref1, session, wrapDownloadItem,
slice = [].slice;
ref = require('electron'), deprecate = ref.deprecate, session = ref.session, Menu = ref.Menu;
EventEmitter = require('events').EventEmitter;
bindings = process.atomBinding('app');
downloadItemBindings = process.atomBinding('download_item');
app = bindings.app;
app.__proto__ = EventEmitter.prototype;
app.setApplicationMenu = function(menu) {
return Menu.setApplicationMenu(menu);
};
app.getApplicationMenu = function() {
return Menu.getApplicationMenu();
};
app.commandLine = {
appendSwitch: bindings.appendSwitch,
appendArgument: bindings.appendArgument
};
if (process.platform === 'darwin') {
app.dock = {
bounce: function(type) {
if (type == null) {
type = 'informational';
}
return bindings.dockBounce(type);
},
cancelBounce: bindings.dockCancelBounce,
setBadge: bindings.dockSetBadgeText,
getBadge: bindings.dockGetBadgeText,
hide: bindings.dockHide,
show: bindings.dockShow,
setMenu: bindings.dockSetMenu
};
}
appPath = null;
app.setAppPath = function(path) {
return appPath = path;
};
app.getAppPath = function() {
return appPath;
};
// Routes the events to webContents.
ref1 = ['login', 'certificate-error', 'select-client-certificate'];
fn = function(name) {
return app.on(name, function() {
var args, event, webContents;
event = arguments[0], webContents = arguments[1], args = 3 <= arguments.length ? slice.call(arguments, 2) : [];
return webContents.emit.apply(webContents, [name, event].concat(slice.call(args)));
});
};
for (i = 0, len = ref1.length; i < len; i++) {
name = ref1[i];
fn(name);
}
// Deprecated.
app.getHomeDir = deprecate('app.getHomeDir', 'app.getPath', function() {
return this.getPath('home');
});
app.getDataPath = deprecate('app.getDataPath', 'app.getPath', function() {
return this.getPath('userData');
});
app.setDataPath = deprecate('app.setDataPath', 'app.setPath', function(path) {
return this.setPath('userData', path);
});
app.resolveProxy = deprecate('app.resolveProxy', 'session.defaultSession.resolveProxy', function(url, callback) {
return session.defaultSession.resolveProxy(url, callback);
});
deprecate.rename(app, 'terminate', 'quit');
deprecate.event(app, 'finish-launching', 'ready', function() {
// give default app a chance to setup default menu.
return setImmediate((function(_this) {
return function() {
return _this.emit('finish-launching');
};
})(this));
});
deprecate.event(app, 'activate-with-no-open-windows', 'activate', function(event, hasVisibleWindows) {
if (!hasVisibleWindows) {
return this.emit('activate-with-no-open-windows', event);
}
});
deprecate.event(app, 'select-certificate', 'select-client-certificate');
// Wrappers for native classes.
wrapDownloadItem = function(downloadItem) {
// downloadItem is an EventEmitter.
downloadItem.__proto__ = EventEmitter.prototype;
// Deprecated.
deprecate.property(downloadItem, 'url', 'getURL');
deprecate.property(downloadItem, 'filename', 'getFilename');
deprecate.property(downloadItem, 'mimeType', 'getMimeType');
return deprecate.rename(downloadItem, 'getUrl', 'getURL');
};
downloadItemBindings._setWrapDownloadItem(wrapDownloadItem);
// Only one App object pemitted.
module.exports = app;

View File

@@ -1,10 +0,0 @@
var autoUpdater, deprecate;
deprecate = require('electron').deprecate;
autoUpdater = process.platform === 'win32' ? require('./auto-updater/auto-updater-win') : require('./auto-updater/auto-updater-native');
// Deprecated.
deprecate.rename(autoUpdater, 'setFeedUrl', 'setFeedURL');
module.exports = autoUpdater;

View File

@@ -1,9 +0,0 @@
var EventEmitter, autoUpdater;
EventEmitter = require('events').EventEmitter;
autoUpdater = process.atomBinding('auto_updater').autoUpdater;
autoUpdater.__proto__ = EventEmitter.prototype;
module.exports = autoUpdater;

View File

@@ -1,75 +0,0 @@
var AutoUpdater, EventEmitter, app, squirrelUpdate, url,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
app = require('electron').app;
EventEmitter = require('events').EventEmitter;
url = require('url');
squirrelUpdate = require('./squirrel-update-win');
AutoUpdater = (function(superClass) {
extend(AutoUpdater, superClass);
function AutoUpdater() {
return AutoUpdater.__super__.constructor.apply(this, arguments);
}
AutoUpdater.prototype.quitAndInstall = function() {
squirrelUpdate.processStart();
return app.quit();
};
AutoUpdater.prototype.setFeedURL = function(updateURL) {
return this.updateURL = updateURL;
};
AutoUpdater.prototype.checkForUpdates = function() {
if (!this.updateURL) {
return this.emitError('Update URL is not set');
}
if (!squirrelUpdate.supported()) {
return this.emitError('Can not find Squirrel');
}
this.emit('checking-for-update');
return squirrelUpdate.download(this.updateURL, (function(_this) {
return function(error, update) {
if (error != null) {
return _this.emitError(error);
}
if (update == null) {
return _this.emit('update-not-available');
}
_this.emit('update-available');
return squirrelUpdate.update(_this.updateURL, function(error) {
var date, releaseNotes, version;
if (error != null) {
return _this.emitError(error);
}
releaseNotes = update.releaseNotes, version = update.version;
// Following information is not available on Windows, so fake them.
date = new Date;
url = _this.updateURL;
return _this.emit('update-downloaded', {}, releaseNotes, version, date, url, function() {
return _this.quitAndInstall();
});
});
};
})(this));
};
// Private: Emit both error object and message, this is to keep compatibility
// with Old APIs.
AutoUpdater.prototype.emitError = function(message) {
return this.emit('error', new Error(message), message);
};
return AutoUpdater;
})(EventEmitter);
module.exports = new AutoUpdater;

View File

@@ -1,104 +0,0 @@
var appFolder, exeName, fs, path, spawn, spawnUpdate, updateExe;
fs = require('fs');
path = require('path');
spawn = require('child_process').spawn;
// i.e. my-app/app-0.1.13/
appFolder = path.dirname(process.execPath);
// i.e. my-app/Update.exe
updateExe = path.resolve(appFolder, '..', 'Update.exe');
exeName = path.basename(process.execPath);
// Spawn a command and invoke the callback when it completes with an error
// and the output from standard out.
spawnUpdate = function(args, detached, callback) {
var error, error1, errorEmitted, spawnedProcess, stderr, stdout;
try {
spawnedProcess = spawn(updateExe, args, {
detached: detached
});
} catch (error1) {
error = error1;
// Shouldn't happen, but still guard it.
process.nextTick(function() {
return callback(error);
});
return;
}
stdout = '';
stderr = '';
spawnedProcess.stdout.on('data', function(data) {
return stdout += data;
});
spawnedProcess.stderr.on('data', function(data) {
return stderr += data;
});
errorEmitted = false;
spawnedProcess.on('error', function(error) {
errorEmitted = true;
return callback(error);
});
return spawnedProcess.on('exit', function(code, signal) {
// We may have already emitted an error.
if (errorEmitted) {
return;
}
// Process terminated with error.
if (code !== 0) {
return callback("Command failed: " + (signal != null ? signal : code) + "\n" + stderr);
}
// Success.
return callback(null, stdout);
});
};
// Start an instance of the installed app.
exports.processStart = function(callback) {
return spawnUpdate(['--processStart', exeName], true, function() {});
};
// Download the releases specified by the URL and write new results to stdout.
exports.download = function(updateURL, callback) {
return spawnUpdate(['--download', updateURL], false, function(error, stdout) {
var error1, json, ref, ref1, update;
if (error != null) {
return callback(error);
}
try {
// Last line of output is the JSON details about the releases
json = stdout.trim().split('\n').pop();
update = (ref = JSON.parse(json)) != null ? (ref1 = ref.releasesToApply) != null ? typeof ref1.pop === "function" ? ref1.pop() : void 0 : void 0 : void 0;
} catch (error1) {
return callback("Invalid result:\n" + stdout);
}
return callback(null, update);
});
};
// Update the application to the latest remote version specified by URL.
exports.update = function(updateURL, callback) {
return spawnUpdate(['--update', updateURL], false, callback);
};
// Is the Update.exe installed with the current application?
exports.supported = function() {
var error1;
try {
fs.accessSync(updateExe, fs.R_OK);
return true;
} catch (error1) {
return false;
}
};

View File

@@ -1,244 +0,0 @@
var BrowserWindow, EventEmitter, deprecate, ipcMain, ref;
ref = require('electron'), ipcMain = ref.ipcMain, deprecate = ref.deprecate;
EventEmitter = require('events').EventEmitter;
BrowserWindow = process.atomBinding('window').BrowserWindow;
BrowserWindow.prototype.__proto__ = EventEmitter.prototype;
BrowserWindow.prototype._init = function() {
// avoid recursive require.
var app, menu;
app = require('electron').app;
// Simulate the application menu on platforms other than OS X.
if (process.platform !== 'darwin') {
menu = app.getApplicationMenu();
if (menu != null) {
this.setMenu(menu);
}
}
// Make new windows requested by links behave like "window.open"
this.webContents.on('-new-window', function(event, url, frameName) {
var options;
options = {
show: true,
width: 800,
height: 600
};
return ipcMain.emit('ATOM_SHELL_GUEST_WINDOW_MANAGER_WINDOW_OPEN', event, url, frameName, options);
});
// window.resizeTo(...)
// window.moveTo(...)
this.webContents.on('move', (function(_this) {
return function(event, size) {
return _this.setBounds(size);
};
})(this));
// Hide the auto-hide menu when webContents is focused.
this.webContents.on('activate', (function(_this) {
return function() {
if (process.platform !== 'darwin' && _this.isMenuBarAutoHide() && _this.isMenuBarVisible()) {
return _this.setMenuBarVisibility(false);
}
};
})(this));
// Forward the crashed event.
this.webContents.on('crashed', (function(_this) {
return function() {
return _this.emit('crashed');
};
})(this));
// Change window title to page title.
this.webContents.on('page-title-updated', (function(_this) {
return function(event, title, explicitSet) {
_this.emit('page-title-updated', event, title);
if (!event.defaultPrevented) {
return _this.setTitle(title);
}
};
})(this));
// Sometimes the webContents doesn't get focus when window is shown, so we have
// to force focusing on webContents in this case. The safest way is to focus it
// when we first start to load URL, if we do it earlier it won't have effect,
// if we do it later we might move focus in the page.
// Though this hack is only needed on OS X when the app is launched from
// Finder, we still do it on all platforms in case of other bugs we don't know.
this.webContents.once('load-url', function() {
return this.focus();
});
// Redirect focus/blur event to app instance too.
this.on('blur', (function(_this) {
return function(event) {
return app.emit('browser-window-blur', event, _this);
};
})(this));
this.on('focus', (function(_this) {
return function(event) {
return app.emit('browser-window-focus', event, _this);
};
})(this));
// Notify the creation of the window.
app.emit('browser-window-created', {}, this);
// Be compatible with old APIs.
this.webContents.on('devtools-focused', (function(_this) {
return function() {
return _this.emit('devtools-focused');
};
})(this));
this.webContents.on('devtools-opened', (function(_this) {
return function() {
return _this.emit('devtools-opened');
};
})(this));
this.webContents.on('devtools-closed', (function(_this) {
return function() {
return _this.emit('devtools-closed');
};
})(this));
return Object.defineProperty(this, 'devToolsWebContents', {
enumerable: true,
configurable: false,
get: function() {
return this.webContents.devToolsWebContents;
}
});
};
BrowserWindow.getFocusedWindow = function() {
var i, len, window, windows;
windows = BrowserWindow.getAllWindows();
for (i = 0, len = windows.length; i < len; i++) {
window = windows[i];
if (window.isFocused()) {
return window;
}
}
return null;
};
BrowserWindow.fromWebContents = function(webContents) {
var i, len, ref1, window, windows;
windows = BrowserWindow.getAllWindows();
for (i = 0, len = windows.length; i < len; i++) {
window = windows[i];
if ((ref1 = window.webContents) != null ? ref1.equal(webContents) : void 0) {
return window;
}
}
};
BrowserWindow.fromDevToolsWebContents = function(webContents) {
var i, len, ref1, window, windows;
windows = BrowserWindow.getAllWindows();
for (i = 0, len = windows.length; i < len; i++) {
window = windows[i];
if ((ref1 = window.devToolsWebContents) != null ? ref1.equal(webContents) : void 0) {
return window;
}
}
};
// Helpers.
BrowserWindow.prototype.loadURL = function() {
return this.webContents.loadURL.apply(this.webContents, arguments);
};
BrowserWindow.prototype.getURL = function() {
return this.webContents.getURL();
};
BrowserWindow.prototype.reload = function() {
return this.webContents.reload.apply(this.webContents, arguments);
};
BrowserWindow.prototype.send = function() {
return this.webContents.send.apply(this.webContents, arguments);
};
BrowserWindow.prototype.openDevTools = function() {
return this.webContents.openDevTools.apply(this.webContents, arguments);
};
BrowserWindow.prototype.closeDevTools = function() {
return this.webContents.closeDevTools();
};
BrowserWindow.prototype.isDevToolsOpened = function() {
return this.webContents.isDevToolsOpened();
};
BrowserWindow.prototype.isDevToolsFocused = function() {
return this.webContents.isDevToolsFocused();
};
BrowserWindow.prototype.toggleDevTools = function() {
return this.webContents.toggleDevTools();
};
BrowserWindow.prototype.inspectElement = function() {
return this.webContents.inspectElement.apply(this.webContents, arguments);
};
BrowserWindow.prototype.inspectServiceWorker = function() {
return this.webContents.inspectServiceWorker();
};
// Deprecated.
deprecate.member(BrowserWindow, 'undo', 'webContents');
deprecate.member(BrowserWindow, 'redo', 'webContents');
deprecate.member(BrowserWindow, 'cut', 'webContents');
deprecate.member(BrowserWindow, 'copy', 'webContents');
deprecate.member(BrowserWindow, 'paste', 'webContents');
deprecate.member(BrowserWindow, 'selectAll', 'webContents');
deprecate.member(BrowserWindow, 'reloadIgnoringCache', 'webContents');
deprecate.member(BrowserWindow, 'isLoading', 'webContents');
deprecate.member(BrowserWindow, 'isWaitingForResponse', 'webContents');
deprecate.member(BrowserWindow, 'stop', 'webContents');
deprecate.member(BrowserWindow, 'isCrashed', 'webContents');
deprecate.member(BrowserWindow, 'print', 'webContents');
deprecate.member(BrowserWindow, 'printToPDF', 'webContents');
deprecate.rename(BrowserWindow, 'restart', 'reload');
deprecate.rename(BrowserWindow, 'loadUrl', 'loadURL');
deprecate.rename(BrowserWindow, 'getUrl', 'getURL');
BrowserWindow.prototype.executeJavaScriptInDevTools = deprecate('executeJavaScriptInDevTools', 'devToolsWebContents.executeJavaScript', function(code) {
var ref1;
return (ref1 = this.devToolsWebContents) != null ? ref1.executeJavaScript(code) : void 0;
});
BrowserWindow.prototype.getPageTitle = deprecate('getPageTitle', 'webContents.getTitle', function() {
var ref1;
return (ref1 = this.webContents) != null ? ref1.getTitle() : void 0;
});
module.exports = BrowserWindow;

View File

@@ -1 +0,0 @@
module.exports = process.atomBinding('content_tracing');

View File

@@ -1,171 +0,0 @@
var BrowserWindow, api, app, binding, checkAppInitialized, fileDialogProperties, j, len, messageBoxOptions, messageBoxTypes, parseArgs, ref, ref1, v8Util,
slice = [].slice,
indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
ref = require('electron'), app = ref.app, BrowserWindow = ref.BrowserWindow;
binding = process.atomBinding('dialog');
v8Util = process.atomBinding('v8_util');
fileDialogProperties = {
openFile: 1 << 0,
openDirectory: 1 << 1,
multiSelections: 1 << 2,
createDirectory: 1 << 3
};
messageBoxTypes = ['none', 'info', 'warning', 'error', 'question'];
messageBoxOptions = {
noLink: 1 << 0
};
parseArgs = function(window, options, callback) {
if (!(window === null || (window != null ? window.constructor : void 0) === BrowserWindow)) {
// Shift.
callback = options;
options = window;
window = null;
}
if ((callback == null) && typeof options === 'function') {
// Shift.
callback = options;
options = null;
}
return [window, options, callback];
};
checkAppInitialized = function() {
if (!app.isReady()) {
throw new Error('dialog module can only be used after app is ready');
}
};
module.exports = {
showOpenDialog: function() {
var args, callback, options, prop, properties, ref1, value, window, wrappedCallback;
args = 1 <= arguments.length ? slice.call(arguments, 0) : [];
checkAppInitialized();
ref1 = parseArgs.apply(null, args), window = ref1[0], options = ref1[1], callback = ref1[2];
if (options == null) {
options = {
title: 'Open',
properties: ['openFile']
};
}
if (options.properties == null) {
options.properties = ['openFile'];
}
if (!Array.isArray(options.properties)) {
throw new TypeError('Properties need to be array');
}
properties = 0;
for (prop in fileDialogProperties) {
value = fileDialogProperties[prop];
if (indexOf.call(options.properties, prop) >= 0) {
properties |= value;
}
}
if (options.title == null) {
options.title = '';
}
if (options.defaultPath == null) {
options.defaultPath = '';
}
if (options.filters == null) {
options.filters = [];
}
wrappedCallback = typeof callback === 'function' ? function(success, result) {
return callback(success ? result : void 0);
} : null;
return binding.showOpenDialog(String(options.title), String(options.defaultPath), options.filters, properties, window, wrappedCallback);
},
showSaveDialog: function() {
var args, callback, options, ref1, window, wrappedCallback;
args = 1 <= arguments.length ? slice.call(arguments, 0) : [];
checkAppInitialized();
ref1 = parseArgs.apply(null, args), window = ref1[0], options = ref1[1], callback = ref1[2];
if (options == null) {
options = {
title: 'Save'
};
}
if (options.title == null) {
options.title = '';
}
if (options.defaultPath == null) {
options.defaultPath = '';
}
if (options.filters == null) {
options.filters = [];
}
wrappedCallback = typeof callback === 'function' ? function(success, result) {
return callback(success ? result : void 0);
} : null;
return binding.showSaveDialog(String(options.title), String(options.defaultPath), options.filters, window, wrappedCallback);
},
showMessageBox: function() {
var args, callback, flags, i, j, len, messageBoxType, options, ref1, ref2, ref3, text, window;
args = 1 <= arguments.length ? slice.call(arguments, 0) : [];
checkAppInitialized();
ref1 = parseArgs.apply(null, args), window = ref1[0], options = ref1[1], callback = ref1[2];
if (options == null) {
options = {
type: 'none'
};
}
if (options.type == null) {
options.type = 'none';
}
messageBoxType = messageBoxTypes.indexOf(options.type);
if (!(messageBoxType > -1)) {
throw new TypeError('Invalid message box type');
}
if (!Array.isArray(options.buttons)) {
throw new TypeError('Buttons need to be array');
}
if (options.title == null) {
options.title = '';
}
if (options.message == null) {
options.message = '';
}
if (options.detail == null) {
options.detail = '';
}
if (options.icon == null) {
options.icon = null;
}
if (options.defaultId == null) {
options.defaultId = -1;
}
// Choose a default button to get selected when dialog is cancelled.
if (options.cancelId == null) {
options.cancelId = 0;
ref2 = options.buttons;
for (i = j = 0, len = ref2.length; j < len; i = ++j) {
text = ref2[i];
if ((ref3 = text.toLowerCase()) === 'cancel' || ref3 === 'no') {
options.cancelId = i;
break;
}
}
}
flags = options.noLink ? messageBoxOptions.noLink : 0;
return binding.showMessageBox(messageBoxType, options.buttons, options.defaultId, options.cancelId, flags, options.title, options.message, options.detail, options.icon, window, callback);
},
showErrorBox: function() {
var args;
args = 1 <= arguments.length ? slice.call(arguments, 0) : [];
return binding.showErrorBox.apply(binding, args);
}
};
// Mark standard asynchronous functions.
ref1 = ['showMessageBox', 'showOpenDialog', 'showSaveDialog'];
for (j = 0, len = ref1.length; j < len; j++) {
api = ref1[j];
v8Util.setHiddenValue(module.exports[api], 'asynchronous', true);
}

View File

@@ -1,114 +0,0 @@
var common;
common = require('../../../../common/api/lib/exports/electron');
// Import common modules.
common.defineProperties(exports);
Object.defineProperties(exports, {
// Browser side modules, please sort with alphabet order.
app: {
enumerable: true,
get: function() {
return require('../app');
}
},
autoUpdater: {
enumerable: true,
get: function() {
return require('../auto-updater');
}
},
BrowserWindow: {
enumerable: true,
get: function() {
return require('../browser-window');
}
},
contentTracing: {
enumerable: true,
get: function() {
return require('../content-tracing');
}
},
dialog: {
enumerable: true,
get: function() {
return require('../dialog');
}
},
ipcMain: {
enumerable: true,
get: function() {
return require('../ipc-main');
}
},
globalShortcut: {
enumerable: true,
get: function() {
return require('../global-shortcut');
}
},
Menu: {
enumerable: true,
get: function() {
return require('../menu');
}
},
MenuItem: {
enumerable: true,
get: function() {
return require('../menu-item');
}
},
powerMonitor: {
enumerable: true,
get: function() {
return require('../power-monitor');
}
},
powerSaveBlocker: {
enumerable: true,
get: function() {
return require('../power-save-blocker');
}
},
protocol: {
enumerable: true,
get: function() {
return require('../protocol');
}
},
screen: {
enumerable: true,
get: function() {
return require('../screen');
}
},
session: {
enumerable: true,
get: function() {
return require('../session');
}
},
Tray: {
enumerable: true,
get: function() {
return require('../tray');
}
},
// The internal modules, invisible unless you know their names.
NavigationController: {
get: function() {
return require('../navigation-controller');
}
},
webContents: {
get: function() {
return require('../web-contents');
}
}
});

View File

@@ -1,5 +0,0 @@
var globalShortcut;
globalShortcut = process.atomBinding('global_shortcut').globalShortcut;
module.exports = globalShortcut;

View File

@@ -1,5 +0,0 @@
var EventEmitter;
EventEmitter = require('events').EventEmitter;
module.exports = new EventEmitter;

View File

@@ -1,8 +0,0 @@
var deprecate, ipcMain, ref;
ref = require('electron'), deprecate = ref.deprecate, ipcMain = ref.ipcMain;
// This module is deprecated, we mirror everything from ipcMain.
deprecate.warn('ipc module', 'require("electron").ipcMain');
module.exports = ipcMain;

View File

@@ -1,104 +0,0 @@
var MenuItem, methodInBrowserWindow, nextCommandId, rolesMap, v8Util;
v8Util = process.atomBinding('v8_util');
nextCommandId = 0;
// Maps role to methods of webContents
rolesMap = {
undo: 'undo',
redo: 'redo',
cut: 'cut',
copy: 'copy',
paste: 'paste',
selectall: 'selectAll',
minimize: 'minimize',
close: 'close'
};
// Maps methods that should be called directly on the BrowserWindow instance
methodInBrowserWindow = {
minimize: true,
close: true
};
MenuItem = (function() {
MenuItem.types = ['normal', 'separator', 'submenu', 'checkbox', 'radio'];
function MenuItem(options) {
var Menu, click, ref;
Menu = require('electron').Menu;
click = options.click, this.selector = options.selector, this.type = options.type, this.role = options.role, this.label = options.label, this.sublabel = options.sublabel, this.accelerator = options.accelerator, this.icon = options.icon, this.enabled = options.enabled, this.visible = options.visible, this.checked = options.checked, this.submenu = options.submenu;
if ((this.submenu != null) && this.submenu.constructor !== Menu) {
this.submenu = Menu.buildFromTemplate(this.submenu);
}
if ((this.type == null) && (this.submenu != null)) {
this.type = 'submenu';
}
if (this.type === 'submenu' && ((ref = this.submenu) != null ? ref.constructor : void 0) !== Menu) {
throw new Error('Invalid submenu');
}
this.overrideReadOnlyProperty('type', 'normal');
this.overrideReadOnlyProperty('role');
this.overrideReadOnlyProperty('accelerator');
this.overrideReadOnlyProperty('icon');
this.overrideReadOnlyProperty('submenu');
this.overrideProperty('label', '');
this.overrideProperty('sublabel', '');
this.overrideProperty('enabled', true);
this.overrideProperty('visible', true);
this.overrideProperty('checked', false);
if (MenuItem.types.indexOf(this.type) === -1) {
throw new Error("Unknown menu type " + this.type);
}
this.commandId = ++nextCommandId;
this.click = (function(_this) {
return function(focusedWindow) {
// Manually flip the checked flags when clicked.
var methodName, ref1, ref2;
if ((ref1 = _this.type) === 'checkbox' || ref1 === 'radio') {
_this.checked = !_this.checked;
}
if (_this.role && rolesMap[_this.role] && process.platform !== 'darwin' && (focusedWindow != null)) {
methodName = rolesMap[_this.role];
if (methodInBrowserWindow[methodName]) {
return focusedWindow[methodName]();
} else {
return (ref2 = focusedWindow.webContents) != null ? ref2[methodName]() : void 0;
}
} else if (typeof click === 'function') {
return click(_this, focusedWindow);
} else if (typeof _this.selector === 'string') {
return Menu.sendActionToFirstResponder(_this.selector);
}
};
})(this);
}
MenuItem.prototype.overrideProperty = function(name, defaultValue) {
if (defaultValue == null) {
defaultValue = null;
}
return this[name] != null ? this[name] : this[name] = defaultValue;
};
MenuItem.prototype.overrideReadOnlyProperty = function(name, defaultValue) {
if (defaultValue == null) {
defaultValue = null;
}
if (this[name] == null) {
this[name] = defaultValue;
}
return Object.defineProperty(this, name, {
enumerable: true,
writable: false,
value: this[name]
});
};
return MenuItem;
})();
module.exports = MenuItem;

View File

@@ -1,336 +0,0 @@
var BrowserWindow, EventEmitter, Menu, MenuItem, applicationMenu, bindings, generateGroupId, indexOfItemById, indexToInsertByPosition, nextGroupId, ref, v8Util;
ref = require('electron'), BrowserWindow = ref.BrowserWindow, MenuItem = ref.MenuItem;
EventEmitter = require('events').EventEmitter;
v8Util = process.atomBinding('v8_util');
bindings = process.atomBinding('menu');
// Automatically generated radio menu item's group id.
nextGroupId = 0;
// Search between seperators to find a radio menu item and return its group id,
// otherwise generate a group id.
generateGroupId = function(items, pos) {
var i, item, j, k, ref1, ref2, ref3;
if (pos > 0) {
for (i = j = ref1 = pos - 1; ref1 <= 0 ? j <= 0 : j >= 0; i = ref1 <= 0 ? ++j : --j) {
item = items[i];
if (item.type === 'radio') {
return item.groupId;
}
if (item.type === 'separator') {
break;
}
}
} else if (pos < items.length) {
for (i = k = ref2 = pos, ref3 = items.length - 1; ref2 <= ref3 ? k <= ref3 : k >= ref3; i = ref2 <= ref3 ? ++k : --k) {
item = items[i];
if (item.type === 'radio') {
return item.groupId;
}
if (item.type === 'separator') {
break;
}
}
}
return ++nextGroupId;
};
// Returns the index of item according to |id|.
indexOfItemById = function(items, id) {
var i, item, j, len;
for (i = j = 0, len = items.length; j < len; i = ++j) {
item = items[i];
if (item.id === id) {
return i;
}
}
return -1;
};
// Returns the index of where to insert the item according to |position|.
indexToInsertByPosition = function(items, position) {
var id, insertIndex, query, ref1;
if (!position) {
return items.length;
}
ref1 = position.split('='), query = ref1[0], id = ref1[1];
insertIndex = indexOfItemById(items, id);
if (insertIndex === -1 && query !== 'endof') {
console.warn("Item with id '" + id + "' is not found");
return items.length;
}
switch (query) {
case 'after':
insertIndex++;
break;
case 'endof':
// If the |id| doesn't exist, then create a new group with the |id|.
if (insertIndex === -1) {
items.push({
id: id,
type: 'separator'
});
insertIndex = items.length - 1;
}
// Find the end of the group.
insertIndex++;
while (insertIndex < items.length && items[insertIndex].type !== 'separator') {
insertIndex++;
}
}
return insertIndex;
};
Menu = bindings.Menu;
Menu.prototype.__proto__ = EventEmitter.prototype;
Menu.prototype._init = function() {
this.commandsMap = {};
this.groupsMap = {};
this.items = [];
return this.delegate = {
isCommandIdChecked: (function(_this) {
return function(commandId) {
var ref1;
return (ref1 = _this.commandsMap[commandId]) != null ? ref1.checked : void 0;
};
})(this),
isCommandIdEnabled: (function(_this) {
return function(commandId) {
var ref1;
return (ref1 = _this.commandsMap[commandId]) != null ? ref1.enabled : void 0;
};
})(this),
isCommandIdVisible: (function(_this) {
return function(commandId) {
var ref1;
return (ref1 = _this.commandsMap[commandId]) != null ? ref1.visible : void 0;
};
})(this),
getAcceleratorForCommandId: (function(_this) {
return function(commandId) {
var ref1;
return (ref1 = _this.commandsMap[commandId]) != null ? ref1.accelerator : void 0;
};
})(this),
getIconForCommandId: (function(_this) {
return function(commandId) {
var ref1;
return (ref1 = _this.commandsMap[commandId]) != null ? ref1.icon : void 0;
};
})(this),
executeCommand: (function(_this) {
return function(commandId) {
var ref1;
return (ref1 = _this.commandsMap[commandId]) != null ? ref1.click(BrowserWindow.getFocusedWindow()) : void 0;
};
})(this),
menuWillShow: (function(_this) {
return function() {
// Make sure radio groups have at least one menu item seleted.
var checked, group, id, j, len, radioItem, ref1, results;
ref1 = _this.groupsMap;
results = [];
for (id in ref1) {
group = ref1[id];
checked = false;
for (j = 0, len = group.length; j < len; j++) {
radioItem = group[j];
if (!radioItem.checked) {
continue;
}
checked = true;
break;
}
if (!checked) {
results.push(v8Util.setHiddenValue(group[0], 'checked', true));
} else {
results.push(void 0);
}
}
return results;
};
})(this)
};
};
Menu.prototype.popup = function(window, x, y) {
if ((window != null ? window.constructor : void 0) !== BrowserWindow) {
// Shift.
y = x;
x = window;
window = BrowserWindow.getFocusedWindow();
}
if ((x != null) && (y != null)) {
return this._popupAt(window, x, y);
} else {
return this._popup(window);
}
};
Menu.prototype.append = function(item) {
return this.insert(this.getItemCount(), item);
};
Menu.prototype.insert = function(pos, item) {
var base, name;
if ((item != null ? item.constructor : void 0) !== MenuItem) {
throw new TypeError('Invalid item');
}
switch (item.type) {
case 'normal':
this.insertItem(pos, item.commandId, item.label);
break;
case 'checkbox':
this.insertCheckItem(pos, item.commandId, item.label);
break;
case 'separator':
this.insertSeparator(pos);
break;
case 'submenu':
this.insertSubMenu(pos, item.commandId, item.label, item.submenu);
break;
case 'radio':
// Grouping radio menu items.
item.overrideReadOnlyProperty('groupId', generateGroupId(this.items, pos));
if ((base = this.groupsMap)[name = item.groupId] == null) {
base[name] = [];
}
this.groupsMap[item.groupId].push(item);
// Setting a radio menu item should flip other items in the group.
v8Util.setHiddenValue(item, 'checked', item.checked);
Object.defineProperty(item, 'checked', {
enumerable: true,
get: function() {
return v8Util.getHiddenValue(item, 'checked');
},
set: (function(_this) {
return function(val) {
var j, len, otherItem, ref1;
ref1 = _this.groupsMap[item.groupId];
for (j = 0, len = ref1.length; j < len; j++) {
otherItem = ref1[j];
if (otherItem !== item) {
v8Util.setHiddenValue(otherItem, 'checked', false);
}
}
return v8Util.setHiddenValue(item, 'checked', true);
};
})(this)
});
this.insertRadioItem(pos, item.commandId, item.label, item.groupId);
}
if (item.sublabel != null) {
this.setSublabel(pos, item.sublabel);
}
if (item.icon != null) {
this.setIcon(pos, item.icon);
}
if (item.role != null) {
this.setRole(pos, item.role);
}
// Make menu accessable to items.
item.overrideReadOnlyProperty('menu', this);
// Remember the items.
this.items.splice(pos, 0, item);
return this.commandsMap[item.commandId] = item;
};
// Force menuWillShow to be called
Menu.prototype._callMenuWillShow = function() {
var item, j, len, ref1, ref2, results;
if ((ref1 = this.delegate) != null) {
ref1.menuWillShow();
}
ref2 = this.items;
results = [];
for (j = 0, len = ref2.length; j < len; j++) {
item = ref2[j];
if (item.submenu != null) {
results.push(item.submenu._callMenuWillShow());
}
}
return results;
};
applicationMenu = null;
Menu.setApplicationMenu = function(menu) {
var j, len, results, w, windows;
if (!(menu === null || menu.constructor === Menu)) {
throw new TypeError('Invalid menu');
}
// Keep a reference.
applicationMenu = menu;
if (process.platform === 'darwin') {
if (menu === null) {
return;
}
menu._callMenuWillShow();
return bindings.setApplicationMenu(menu);
} else {
windows = BrowserWindow.getAllWindows();
results = [];
for (j = 0, len = windows.length; j < len; j++) {
w = windows[j];
results.push(w.setMenu(menu));
}
return results;
}
};
Menu.getApplicationMenu = function() {
return applicationMenu;
};
Menu.sendActionToFirstResponder = bindings.sendActionToFirstResponder;
Menu.buildFromTemplate = function(template) {
var insertIndex, item, j, k, key, len, len1, menu, menuItem, positionedTemplate, value;
if (!Array.isArray(template)) {
throw new TypeError('Invalid template for Menu');
}
positionedTemplate = [];
insertIndex = 0;
for (j = 0, len = template.length; j < len; j++) {
item = template[j];
if (item.position) {
insertIndex = indexToInsertByPosition(positionedTemplate, item.position);
} else {
// If no |position| is specified, insert after last item.
insertIndex++;
}
positionedTemplate.splice(insertIndex, 0, item);
}
menu = new Menu;
for (k = 0, len1 = positionedTemplate.length; k < len1; k++) {
item = positionedTemplate[k];
if (typeof item !== 'object') {
throw new TypeError('Invalid template for MenuItem');
}
menuItem = new MenuItem(item);
for (key in item) {
value = item[key];
if (menuItem[key] == null) {
menuItem[key] = value;
}
}
menu.append(menuItem);
}
return menu;
};
module.exports = Menu;

View File

@@ -1,189 +0,0 @@
var NavigationController, ipcMain,
slice = [].slice;
ipcMain = require('electron').ipcMain;
// The history operation in renderer is redirected to browser.
ipcMain.on('ATOM_SHELL_NAVIGATION_CONTROLLER', function() {
var args, event, method, ref;
event = arguments[0], method = arguments[1], args = 3 <= arguments.length ? slice.call(arguments, 2) : [];
return (ref = event.sender)[method].apply(ref, args);
});
ipcMain.on('ATOM_SHELL_SYNC_NAVIGATION_CONTROLLER', function() {
var args, event, method, ref;
event = arguments[0], method = arguments[1], args = 3 <= arguments.length ? slice.call(arguments, 2) : [];
return event.returnValue = (ref = event.sender)[method].apply(ref, args);
});
// JavaScript implementation of Chromium's NavigationController.
// Instead of relying on Chromium for history control, we compeletely do history
// control on user land, and only rely on WebContents.loadURL for navigation.
// This helps us avoid Chromium's various optimizations so we can ensure renderer
// process is restarted everytime.
NavigationController = (function() {
function NavigationController(webContents) {
this.webContents = webContents;
this.clearHistory();
// webContents may have already navigated to a page.
if (this.webContents._getURL()) {
this.currentIndex++;
this.history.push(this.webContents._getURL());
}
this.webContents.on('navigation-entry-commited', (function(_this) {
return function(event, url, inPage, replaceEntry) {
var currentEntry;
if (_this.inPageIndex > -1 && !inPage) {
// Navigated to a new page, clear in-page mark.
_this.inPageIndex = -1;
} else if (_this.inPageIndex === -1 && inPage) {
// Started in-page navigations.
_this.inPageIndex = _this.currentIndex;
}
if (_this.pendingIndex >= 0) {
// Go to index.
_this.currentIndex = _this.pendingIndex;
_this.pendingIndex = -1;
return _this.history[_this.currentIndex] = url;
} else if (replaceEntry) {
// Non-user initialized navigation.
return _this.history[_this.currentIndex] = url;
} else {
// Normal navigation. Clear history.
_this.history = _this.history.slice(0, _this.currentIndex + 1);
currentEntry = _this.history[_this.currentIndex];
if ((currentEntry != null ? currentEntry.url : void 0) !== url) {
_this.currentIndex++;
return _this.history.push(url);
}
}
};
})(this));
}
NavigationController.prototype.loadURL = function(url, options) {
if (options == null) {
options = {};
}
this.pendingIndex = -1;
this.webContents._loadURL(url, options);
return this.webContents.emit('load-url', url, options);
};
NavigationController.prototype.getURL = function() {
if (this.currentIndex === -1) {
return '';
} else {
return this.history[this.currentIndex];
}
};
NavigationController.prototype.stop = function() {
this.pendingIndex = -1;
return this.webContents._stop();
};
NavigationController.prototype.reload = function() {
this.pendingIndex = this.currentIndex;
return this.webContents._loadURL(this.getURL(), {});
};
NavigationController.prototype.reloadIgnoringCache = function() {
this.pendingIndex = this.currentIndex;
return this.webContents._loadURL(this.getURL(), {
extraHeaders: "pragma: no-cache\n"
});
};
NavigationController.prototype.canGoBack = function() {
return this.getActiveIndex() > 0;
};
NavigationController.prototype.canGoForward = function() {
return this.getActiveIndex() < this.history.length - 1;
};
NavigationController.prototype.canGoToIndex = function(index) {
return index >= 0 && index < this.history.length;
};
NavigationController.prototype.canGoToOffset = function(offset) {
return this.canGoToIndex(this.currentIndex + offset);
};
NavigationController.prototype.clearHistory = function() {
this.history = [];
this.currentIndex = -1;
this.pendingIndex = -1;
return this.inPageIndex = -1;
};
NavigationController.prototype.goBack = function() {
if (!this.canGoBack()) {
return;
}
this.pendingIndex = this.getActiveIndex() - 1;
if (this.inPageIndex > -1 && this.pendingIndex >= this.inPageIndex) {
return this.webContents._goBack();
} else {
return this.webContents._loadURL(this.history[this.pendingIndex], {});
}
};
NavigationController.prototype.goForward = function() {
if (!this.canGoForward()) {
return;
}
this.pendingIndex = this.getActiveIndex() + 1;
if (this.inPageIndex > -1 && this.pendingIndex >= this.inPageIndex) {
return this.webContents._goForward();
} else {
return this.webContents._loadURL(this.history[this.pendingIndex], {});
}
};
NavigationController.prototype.goToIndex = function(index) {
if (!this.canGoToIndex(index)) {
return;
}
this.pendingIndex = index;
return this.webContents._loadURL(this.history[this.pendingIndex], {});
};
NavigationController.prototype.goToOffset = function(offset) {
var pendingIndex;
if (!this.canGoToOffset(offset)) {
return;
}
pendingIndex = this.currentIndex + offset;
if (this.inPageIndex > -1 && pendingIndex >= this.inPageIndex) {
this.pendingIndex = pendingIndex;
return this.webContents._goToOffset(offset);
} else {
return this.goToIndex(pendingIndex);
}
};
NavigationController.prototype.getActiveIndex = function() {
if (this.pendingIndex === -1) {
return this.currentIndex;
} else {
return this.pendingIndex;
}
};
NavigationController.prototype.length = function() {
return this.history.length;
};
return NavigationController;
})();
module.exports = NavigationController;

View File

@@ -1,9 +0,0 @@
var EventEmitter, powerMonitor;
EventEmitter = require('events').EventEmitter;
powerMonitor = process.atomBinding('power_monitor').powerMonitor;
powerMonitor.__proto__ = EventEmitter.prototype;
module.exports = powerMonitor;

View File

@@ -1,5 +0,0 @@
var powerSaveBlocker;
powerSaveBlocker = process.atomBinding('power_save_blocker').powerSaveBlocker;
module.exports = powerSaveBlocker;

View File

@@ -1,33 +0,0 @@
var app, logAndThrow, protocol;
app = require('electron').app;
if (!app.isReady()) {
throw new Error('Can not initialize protocol module before app is ready');
}
protocol = process.atomBinding('protocol').protocol;
// Warn about removed APIs.
logAndThrow = function(callback, message) {
console.error(message);
if (callback) {
return callback(new Error(message));
} else {
throw new Error(message);
}
};
protocol.registerProtocol = function(scheme, handler, callback) {
return logAndThrow(callback, 'registerProtocol API has been replaced by the register[File/Http/Buffer/String]Protocol API family, please switch to the new APIs.');
};
protocol.isHandledProtocol = function(scheme, callback) {
return logAndThrow(callback, 'isHandledProtocol API has been replaced by isProtocolHandled.');
};
protocol.interceptProtocol = function(scheme, handler, callback) {
return logAndThrow(callback, 'interceptProtocol API has been replaced by the intercept[File/Http/Buffer/String]Protocol API family, please switch to the new APIs.');
};
module.exports = protocol;

View File

@@ -1,9 +0,0 @@
var EventEmitter, screen;
EventEmitter = require('events').EventEmitter;
screen = process.atomBinding('screen').screen;
screen.__proto__ = EventEmitter.prototype;
module.exports = screen;

View File

@@ -1,37 +0,0 @@
var EventEmitter, PERSIST_PERFIX, bindings, wrapSession;
EventEmitter = require('events').EventEmitter;
bindings = process.atomBinding('session');
PERSIST_PERFIX = 'persist:';
// Returns the Session from |partition| string.
exports.fromPartition = function(partition) {
if (partition == null) {
partition = '';
}
if (partition === '') {
return exports.defaultSession;
}
if (partition.startsWith(PERSIST_PERFIX)) {
return bindings.fromPartition(partition.substr(PERSIST_PERFIX.length), false);
} else {
return bindings.fromPartition(partition, true);
}
};
// Returns the default session.
Object.defineProperty(exports, 'defaultSession', {
enumerable: true,
get: function() {
return bindings.fromPartition('', false);
}
});
wrapSession = function(session) {
// session is an EventEmitter.
return session.__proto__ = EventEmitter.prototype;
};
bindings._setWrapSession(wrapSession);

View File

@@ -1,27 +0,0 @@
var EventEmitter, Tray, deprecate;
deprecate = require('electron').deprecate;
EventEmitter = require('events').EventEmitter;
Tray = process.atomBinding('tray').Tray;
Tray.prototype.__proto__ = EventEmitter.prototype;
Tray.prototype._init = function() {
// Deprecated.
deprecate.rename(this, 'popContextMenu', 'popUpContextMenu');
deprecate.event(this, 'clicked', 'click');
deprecate.event(this, 'double-clicked', 'double-click');
deprecate.event(this, 'right-clicked', 'right-click');
return deprecate.event(this, 'balloon-clicked', 'balloon-click');
};
Tray.prototype.setContextMenu = function(menu) {
this._setContextMenu(menu);
// Keep a strong reference of menu.
return this.menu = menu;
};
module.exports = Tray;

View File

@@ -1,221 +0,0 @@
'use strict';
var EventEmitter, Menu, NavigationController, PDFPageSize, binding, deprecate, getNextId, ipcMain, nextId, ref, session, wrapWebContents,
slice = [].slice;
EventEmitter = require('events').EventEmitter;
ref = require('electron'), deprecate = ref.deprecate, ipcMain = ref.ipcMain, session = ref.session, NavigationController = ref.NavigationController, Menu = ref.Menu;
binding = process.atomBinding('web_contents');
nextId = 0;
getNextId = function() {
return ++nextId;
};
PDFPageSize = {
A5: {
custom_display_name: "A5",
height_microns: 210000,
name: "ISO_A5",
width_microns: 148000
},
A4: {
custom_display_name: "A4",
height_microns: 297000,
name: "ISO_A4",
is_default: "true",
width_microns: 210000
},
A3: {
custom_display_name: "A3",
height_microns: 420000,
name: "ISO_A3",
width_microns: 297000
},
Legal: {
custom_display_name: "Legal",
height_microns: 355600,
name: "NA_LEGAL",
width_microns: 215900
},
Letter: {
custom_display_name: "Letter",
height_microns: 279400,
name: "NA_LETTER",
width_microns: 215900
},
Tabloid: {
height_microns: 431800,
name: "NA_LEDGER",
width_microns: 279400,
custom_display_name: "Tabloid"
}
};
// Following methods are mapped to webFrame.
const webFrameMethods = [
'executeJavaScript',
'insertText',
'setZoomFactor',
'setZoomLevel',
'setZoomLevelLimits',
];
wrapWebContents = function(webContents) {
// webContents is an EventEmitter.
var controller, method, name, ref1;
webContents.__proto__ = EventEmitter.prototype;
// WebContents::send(channel, args..)
webContents.send = function() {
var args, channel;
channel = arguments[0], args = 2 <= arguments.length ? slice.call(arguments, 1) : [];
return this._send(channel, slice.call(args));
};
// The navigation controller.
controller = new NavigationController(webContents);
ref1 = NavigationController.prototype;
for (name in ref1) {
method = ref1[name];
if (method instanceof Function) {
(function(name, method) {
return webContents[name] = function() {
return method.apply(controller, arguments);
};
})(name, method);
}
}
// Mapping webFrame methods.
for (let method of webFrameMethods) {
webContents[method] = function() {
let args = Array.prototype.slice.call(arguments);
this.send('ELECTRON_INTERNAL_RENDERER_WEB_FRAME_METHOD', method, args);
};
}
// Make sure webContents.executeJavaScript would run the code only when the
// webContents has been loaded.
const executeJavaScript = webContents.executeJavaScript;
webContents.executeJavaScript = function(code, hasUserGesture) {
if (this.getURL() && !this.isLoading())
return executeJavaScript.call(this, code, hasUserGesture);
else
return this.once('did-finish-load', executeJavaScript.bind(this, code, hasUserGesture));
};
// Dispatch IPC messages to the ipc module.
webContents.on('ipc-message', function(event, packed) {
var args, channel;
channel = packed[0], args = 2 <= packed.length ? slice.call(packed, 1) : [];
return ipcMain.emit.apply(ipcMain, [channel, event].concat(slice.call(args)));
});
webContents.on('ipc-message-sync', function(event, packed) {
var args, channel;
channel = packed[0], args = 2 <= packed.length ? slice.call(packed, 1) : [];
Object.defineProperty(event, 'returnValue', {
set: function(value) {
return event.sendReply(JSON.stringify(value));
}
});
return ipcMain.emit.apply(ipcMain, [channel, event].concat(slice.call(args)));
});
// Handle context menu action request from pepper plugin.
webContents.on('pepper-context-menu', function(event, params) {
var menu;
menu = Menu.buildFromTemplate(params.menu);
return menu.popup(params.x, params.y);
});
// This error occurs when host could not be found.
webContents.on('did-fail-provisional-load', function() {
var args;
args = 1 <= arguments.length ? slice.call(arguments, 0) : [];
// Calling loadURL during this event might cause crash, so delay the event
// until next tick.
return setImmediate((function(_this) {
return function() {
return _this.emit.apply(_this, ['did-fail-load'].concat(slice.call(args)));
};
})(this));
});
// Delays the page-title-updated event to next tick.
webContents.on('-page-title-updated', function() {
var args;
args = 1 <= arguments.length ? slice.call(arguments, 0) : [];
return setImmediate((function(_this) {
return function() {
return _this.emit.apply(_this, ['page-title-updated'].concat(slice.call(args)));
};
})(this));
});
// Deprecated.
deprecate.rename(webContents, 'loadUrl', 'loadURL');
deprecate.rename(webContents, 'getUrl', 'getURL');
deprecate.event(webContents, 'page-title-set', 'page-title-updated', function() {
var args;
args = 1 <= arguments.length ? slice.call(arguments, 0) : [];
return this.emit.apply(this, ['page-title-set'].concat(slice.call(args)));
});
return webContents.printToPDF = function(options, callback) {
var printingSetting;
printingSetting = {
pageRage: [],
mediaSize: {},
landscape: false,
color: 2,
headerFooterEnabled: false,
marginsType: 0,
isFirstRequest: false,
requestID: getNextId(),
previewModifiable: true,
printToPDF: true,
printWithCloudPrint: false,
printWithPrivet: false,
printWithExtension: false,
deviceName: "Save as PDF",
generateDraftData: true,
fitToPageEnabled: false,
duplex: 0,
copies: 1,
collate: true,
shouldPrintBackgrounds: false,
shouldPrintSelectionOnly: false
};
if (options.landscape) {
printingSetting.landscape = options.landscape;
}
if (options.marginsType) {
printingSetting.marginsType = options.marginsType;
}
if (options.printSelectionOnly) {
printingSetting.shouldPrintSelectionOnly = options.printSelectionOnly;
}
if (options.printBackground) {
printingSetting.shouldPrintBackgrounds = options.printBackground;
}
if (options.pageSize && PDFPageSize[options.pageSize]) {
printingSetting.mediaSize = PDFPageSize[options.pageSize];
} else {
printingSetting.mediaSize = PDFPageSize['A4'];
}
return this._printToPDF(printingSetting, callback);
};
};
binding._setWrapWebContents(wrapWebContents);
module.exports.create = function(options) {
if (options == null) {
options = {};
}
return binding.create(options);
};

View File

@@ -73,11 +73,6 @@ void SavePageHandler::Destroy(content::DownloadItem* item) {
delete this;
}
// static
bool SavePageHandler::IsSavePageTypes(const std::string& type) {
return type == "multipart/related" || type == "text/html";
}
} // namespace api
} // namespace atom

View File

@@ -37,8 +37,6 @@ class SavePageHandler : public content::DownloadManager::Observer,
bool Handle(const base::FilePath& full_path,
const content::SavePageType& save_type);
static bool IsSavePageTypes(const std::string& type);
private:
void Destroy(content::DownloadItem* item);

View File

@@ -37,15 +37,6 @@ TrackableObjectBase::~TrackableObjectBase() {
cleanup_.Run();
}
void TrackableObjectBase::AfterInit(v8::Isolate* isolate) {
if (wrapped_)
AttachAsUserData(wrapped_);
}
void TrackableObjectBase::MarkDestroyed() {
GetWrapper(isolate())->SetAlignedPointerInInternalField(0, nullptr);
}
base::Closure TrackableObjectBase::GetDestroyClosure() {
return base::Bind(&TrackableObjectBase::Destroy, weak_factory_.GetWeakPtr());
}

View File

@@ -8,7 +8,7 @@
#include <vector>
#include "atom/browser/api/event_emitter.h"
#include "atom/common/id_weak_map.h"
#include "atom/common/key_weak_map.h"
#include "base/bind.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
@@ -21,7 +21,7 @@ class SupportsUserData;
namespace mate {
// Users should use TrackableObject instead.
class TrackableObjectBase : public mate::EventEmitter {
class TrackableObjectBase {
public:
TrackableObjectBase();
@@ -32,13 +32,7 @@ class TrackableObjectBase : public mate::EventEmitter {
void AttachAsUserData(base::SupportsUserData* wrapped);
protected:
~TrackableObjectBase() override;
// mate::Wrappable:
void AfterInit(v8::Isolate* isolate) override;
// Mark the JS object as destroyed.
void MarkDestroyed();
virtual ~TrackableObjectBase();
// Returns a closure that can destroy the native class.
base::Closure GetDestroyClosure();
@@ -65,8 +59,14 @@ class TrackableObjectBase : public mate::EventEmitter {
// All instances of TrackableObject will be kept in a weak map and can be got
// from its ID.
template<typename T>
class TrackableObject : public TrackableObjectBase {
class TrackableObject : public TrackableObjectBase,
public mate::EventEmitter<T> {
public:
// Mark the JS object as destroyed.
void MarkDestroyed() {
Wrappable<T>::GetWrapper()->SetAlignedPointerInInternalField(0, nullptr);
}
// Finds out the TrackableObject from its ID in weak map.
static T* FromWeakMapID(v8::Isolate* isolate, int32_t id) {
if (!weak_map_)
@@ -106,50 +106,33 @@ class TrackableObject : public TrackableObjectBase {
protected:
TrackableObject() {}
~TrackableObject() override {
RemoveFromWeakMap();
}
void AfterInit(v8::Isolate* isolate) override {
if (!weak_map_) {
weak_map_.reset(new atom::IDWeakMap);
RegisterDestructionCallback(
base::Bind(&TrackableObject<T>::ReleaseAllWeakReferences));
weak_map_ = new atom::KeyWeakMap<int32_t>;
}
weak_map_id_ = weak_map_->Add(isolate, GetWrapper(isolate));
TrackableObjectBase::AfterInit(isolate);
weak_map_id_ = ++next_id_;
weak_map_->Set(isolate, weak_map_id_, Wrappable<T>::GetWrapper());
if (wrapped_)
AttachAsUserData(wrapped_);
}
private:
// mate::Wrappable:
mate::ObjectTemplateBuilder GetObjectTemplateBuilder(
v8::Isolate* isolate) override {
if (template_.IsEmpty()) {
auto templ = v8::ObjectTemplate::New(isolate);
T::BuildPrototype(isolate, templ);
template_.Reset(isolate, templ);
}
return ObjectTemplateBuilder(
isolate, v8::Local<v8::ObjectTemplate>::New(isolate, template_));
}
// Releases all weak references in weak map, called when app is terminating.
static void ReleaseAllWeakReferences() {
weak_map_.reset();
}
static v8::Persistent<v8::ObjectTemplate> template_;
static scoped_ptr<atom::IDWeakMap> weak_map_;
static int32_t next_id_;
static atom::KeyWeakMap<int32_t>* weak_map_; // leaked on purpose
DISALLOW_COPY_AND_ASSIGN(TrackableObject);
};
template<typename T>
v8::Persistent<v8::ObjectTemplate> TrackableObject<T>::template_;
int32_t TrackableObject<T>::next_id_ = 0;
template<typename T>
scoped_ptr<atom::IDWeakMap> TrackableObject<T>::weak_map_;
atom::KeyWeakMap<int32_t>* TrackableObject<T>::weak_map_ = nullptr;
} // namespace mate

View File

@@ -32,18 +32,18 @@ AtomAccessTokenStore::~AtomAccessTokenStore() {
}
void AtomAccessTokenStore::LoadAccessTokens(
const LoadAccessTokensCallbackType& callback) {
AccessTokenSet access_token_set;
const LoadAccessTokensCallback& callback) {
AccessTokenMap access_token_map;
// Equivelent to access_token_set[kGeolocationProviderURL].
// Equivelent to access_token_map[kGeolocationProviderURL].
// Somehow base::string16 is causing compilation errors when used in a pair
// of std::map on Linux, this can work around it.
std::pair<GURL, base::string16> token_pair;
token_pair.first = GURL(kGeolocationProviderURL);
access_token_set.insert(token_pair);
access_token_map.insert(token_pair);
auto browser_context = AtomBrowserMainParts::Get()->browser_context();
callback.Run(access_token_set, browser_context->url_request_context_getter());
callback.Run(access_token_map, browser_context->url_request_context_getter());
}
void AtomAccessTokenStore::SaveAccessToken(const GURL& server_url,

View File

@@ -18,7 +18,7 @@ class AtomAccessTokenStore : public content::AccessTokenStore {
// content::AccessTokenStore:
void LoadAccessTokens(
const LoadAccessTokensCallbackType& callback) override;
const LoadAccessTokensCallback& callback) override;
void SaveAccessToken(const GURL& server_url,
const base::string16& access_token) override;

View File

@@ -8,6 +8,7 @@
#include <shlobj.h>
#endif
#include "atom/browser/api/atom_api_app.h"
#include "atom/browser/atom_access_token_store.h"
#include "atom/browser/atom_browser_context.h"
#include "atom/browser/atom_browser_main_parts.h"
@@ -15,6 +16,7 @@
#include "atom/browser/atom_resource_dispatcher_host_delegate.h"
#include "atom/browser/atom_speech_recognition_manager_delegate.h"
#include "atom/browser/native_window.h"
#include "atom/browser/web_contents_permission_helper.h"
#include "atom/browser/web_contents_preferences.h"
#include "atom/browser/window_list.h"
#include "atom/common/options_switches.h"
@@ -35,7 +37,6 @@
#include "content/public/browser/site_instance.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/web_preferences.h"
#include "net/cert/x509_certificate.h"
#include "net/ssl/ssl_cert_request_info.h"
#include "ppapi/host/ppapi_host.h"
#include "ui/base/l10n/l10n_util.h"
@@ -45,37 +46,13 @@ namespace atom {
namespace {
// The default routing id of WebContents.
// In Electron each RenderProcessHost only has one WebContents, so this ID is
// same for every WebContents.
int kDefaultRoutingID = 2;
// Next navigation should not restart renderer process.
bool g_suppress_renderer_process_restart = false;
// Custom schemes to be registered to standard.
std::string g_custom_schemes = "";
// Custom schemes to be registered to handle service worker.
std::string g_custom_service_worker_schemes = "";
scoped_refptr<net::X509Certificate> ImportCertFromFile(
const base::FilePath& path) {
if (path.empty())
return nullptr;
std::string cert_data;
if (!base::ReadFileToString(path, &cert_data))
return nullptr;
net::CertificateList certs =
net::X509Certificate::CreateCertificateListFromBytes(
cert_data.data(), cert_data.size(),
net::X509Certificate::FORMAT_AUTO);
if (certs.empty())
return nullptr;
return certs[0];
void Noop(scoped_refptr<content::SiteInstance>) {
}
} // namespace
@@ -85,11 +62,6 @@ void AtomBrowserClient::SuppressRendererProcessRestartForOnce() {
g_suppress_renderer_process_restart = true;
}
void AtomBrowserClient::SetCustomSchemes(
const std::vector<std::string>& schemes) {
g_custom_schemes = base::JoinString(schemes, ",");
}
void AtomBrowserClient::SetCustomServiceWorkerSchemes(
const std::vector<std::string>& schemes) {
g_custom_service_worker_schemes = base::JoinString(schemes, ",");
@@ -101,6 +73,17 @@ AtomBrowserClient::AtomBrowserClient() : delegate_(nullptr) {
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))
process_id = pending_processes_[process_id];
// Certain render process will be created with no associated render view,
// for example: ServiceWorker.
return WebContentsPreferences::GetWebContentsFromProcessID(process_id);
}
void AtomBrowserClient::RenderProcessWillLaunch(
content::RenderProcessHost* host) {
int process_id = host->GetID();
@@ -160,7 +143,16 @@ void AtomBrowserClient::OverrideSiteInstanceForNavigation(
if (url.SchemeIs(url::kJavaScriptScheme))
return;
*new_instance = content::SiteInstance::CreateForURL(browser_context, url);
scoped_refptr<content::SiteInstance> site_instance =
content::SiteInstance::CreateForURL(browser_context, url);
*new_instance = site_instance.get();
// Make sure the |site_instance| is not freed when this function returns.
// FIXME(zcbenz): We should adjust OverrideSiteInstanceForNavigation's
// interface to solve this.
content::BrowserThread::PostTask(
content::BrowserThread::UI, FROM_HERE,
base::Bind(&Noop, base::RetainedRef(site_instance)));
// Remember the original renderer process of the pending renderer process.
auto current_process = current_instance->GetProcess();
@@ -177,10 +169,13 @@ void AtomBrowserClient::AppendExtraCommandLineSwitches(
if (process_type != "renderer")
return;
// The registered standard schemes.
if (!g_custom_schemes.empty())
command_line->AppendSwitchASCII(switches::kRegisterStandardSchemes,
g_custom_schemes);
// Copy following switches to child process.
static const char* const kCommonSwitchNames[] = {
switches::kStandardSchemes,
};
command_line->CopySwitchesFrom(
*base::CommandLine::ForCurrentProcess(),
kCommonSwitchNames, arraysize(kCommonSwitchNames));
// The registered service worker schemes.
if (!g_custom_service_worker_schemes.empty())
@@ -196,20 +191,7 @@ void AtomBrowserClient::AppendExtraCommandLineSwitches(
}
#endif
// If the process is a pending process, we should use the old one.
if (ContainsKey(pending_processes_, process_id))
process_id = pending_processes_[process_id];
// Certain render process will be created with no associated render view,
// for example: ServiceWorker.
auto rvh = content::RenderViewHost::FromID(process_id, kDefaultRoutingID);
if (!rvh)
return;
// Get the WebContents of the render process.
content::WebContents* web_contents =
content::WebContents::FromRenderViewHost(rvh);
content::WebContents* web_contents = GetWebContentsFromProcessID(process_id);
if (!web_contents)
return;
@@ -229,8 +211,7 @@ content::QuotaPermissionContext*
}
void AtomBrowserClient::AllowCertificateError(
int render_process_id,
int render_frame_id,
content::WebContents* web_contents,
int cert_error,
const net::SSLInfo& ssl_info,
const GURL& request_url,
@@ -242,7 +223,7 @@ void AtomBrowserClient::AllowCertificateError(
content::CertificateRequestResultType* request) {
if (delegate_) {
delegate_->AllowCertificateError(
render_process_id, render_frame_id, cert_error, ssl_info, request_url,
web_contents, cert_error, ssl_info, request_url,
resource_type, overridable, strict_enforcement,
expired_previous_decision, callback, request);
}
@@ -251,20 +232,10 @@ void AtomBrowserClient::AllowCertificateError(
void AtomBrowserClient::SelectClientCertificate(
content::WebContents* web_contents,
net::SSLCertRequestInfo* cert_request_info,
scoped_ptr<content::ClientCertificateDelegate> delegate) {
// --client-certificate=`path`
auto cmd = base::CommandLine::ForCurrentProcess();
if (cmd->HasSwitch(switches::kClientCertificate)) {
auto cert_path = cmd->GetSwitchValuePath(switches::kClientCertificate);
auto certificate = ImportCertFromFile(cert_path);
if (certificate.get())
delegate->ContinueWithCertificate(certificate.get());
return;
}
std::unique_ptr<content::ClientCertificateDelegate> delegate) {
if (!cert_request_info->client_certs.empty() && delegate_) {
delegate_->SelectClientCertificate(
web_contents, cert_request_info, delegate.Pass());
web_contents, cert_request_info, std::move(delegate));
}
}
@@ -275,12 +246,63 @@ void AtomBrowserClient::ResourceDispatcherHostCreated() {
resource_dispatcher_host_delegate_.get());
}
bool AtomBrowserClient::CanCreateWindow(
const GURL& opener_url,
const GURL& opener_top_level_frame_url,
const GURL& source_origin,
WindowContainerType container_type,
const std::string& frame_name,
const GURL& target_url,
const content::Referrer& referrer,
WindowOpenDisposition disposition,
const blink::WebWindowFeatures& features,
bool user_gesture,
bool opener_suppressed,
content::ResourceContext* context,
int render_process_id,
int opener_render_view_id,
int opener_render_frame_id,
bool* no_javascript_access) {
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
if (delegate_) {
content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE,
base::Bind(&api::App::OnCreateWindow,
base::Unretained(static_cast<api::App*>(delegate_)),
target_url,
frame_name,
disposition,
render_process_id,
opener_render_frame_id));
}
return false;
}
brightray::BrowserMainParts* AtomBrowserClient::OverrideCreateBrowserMainParts(
const content::MainFunctionParams&) {
v8::V8::Initialize(); // Init V8 before creating main parts.
return new AtomBrowserMainParts;
}
void AtomBrowserClient::WebNotificationAllowed(
int render_process_id,
const base::Callback<void(bool)>& callback) {
content::WebContents* web_contents =
WebContentsPreferences::GetWebContentsFromProcessID(render_process_id);
if (!web_contents) {
callback.Run(false);
return;
}
auto permission_helper =
WebContentsPermissionHelper::FromWebContents(web_contents);
if (!permission_helper) {
callback.Run(false);
return;
}
permission_helper->RequestWebNotificationPermission(callback);
}
void AtomBrowserClient::RenderProcessHostDestroyed(
content::RenderProcessHost* host) {
int process_id = host->GetID();

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