Compare commits

...

2816 Commits

Author SHA1 Message Date
Cheng Zhao
5bd3cfc4f6 Update brightray 2015-03-23 08:30:01 +00:00
Cheng Zhao
2e172a1053 Bump v0.22.2 2015-03-23 16:31:23 +08:00
Cheng Zhao
2f5345e10d Merge pull request #1284 from atom/subpixel-font
Bring back the "subpixel-font-scaling" option
2015-03-23 16:30:58 +08:00
Cheng Zhao
2a4b04bac6 Update libchromiumcontent 2015-03-23 16:29:32 +08:00
Cheng Zhao
30e931f10b Revert "The "subpixel-font-scaling" option is removed"
This reverts commit 98fbe5127b.
2015-03-23 16:29:32 +08:00
Cheng Zhao
266fadcb96 Update native_mate for #1112 2015-03-23 16:24:38 +08:00
Cheng Zhao
475f624113 docs: The right way of "set", according to #1126 2015-03-23 10:35:35 +08:00
Cheng Zhao
de76ab97fb docs: Fix setting GYP_DEFINES on Windows, closes #1126 2015-03-23 10:19:49 +08:00
Cheng Zhao
414c91a637 Cleanup #1275 2015-03-23 09:51:50 +08:00
Cheng Zhao
adce07785a Merge pull request #1275 from lygstate/master
Add runas as devDependencies, or the python script will install it again...
2015-03-23 09:49:10 +08:00
Cheng Zhao
1479f73612 Simplify #1261 2015-03-21 19:20:52 +08:00
Cheng Zhao
5e8c478b2c Merge pull request #1261 from deepak1556/asar_lib_patch
fs.read empty files from asar archive
2015-03-21 19:17:49 +08:00
Cheng Zhao
db056f8730 Merge pull request #1267 from atom/asar-unpacked
Add support for asar archives with unpacked files
2015-03-21 19:11:54 +08:00
Cheng Zhao
f5dc8fc80d docs: How to use asar archive with unpacked files 2015-03-21 19:11:15 +08:00
Yonggang Luo
fa011c3d97 Add runas as devDependencies, or the python script will install it again and again.
The options of register_msdia80_dll.js should be admin.
Fix the problem of runas not works cause it will escape command parameters by default.
2015-03-21 17:28:07 +08:00
deepak1556
fdc10e4e5f Allow reading empty file from asar archive 2015-03-21 14:56:03 +05:30
Cheng Zhao
73ce16fc52 Remove unneeded log 2015-03-20 21:32:10 +08:00
Cheng Zhao
b5a8cfb704 Recognize asar archive with unpacked files 2015-03-20 20:34:58 +08:00
Cheng Zhao
dc82553fc3 spec: Test asar archive with unpacked files 2015-03-20 20:34:31 +08:00
Cheng Zhao
1df033dce8 No need to override child_process.fork
We already support asar in Node mode.
2015-03-20 19:04:11 +08:00
Cheng Zhao
2c0b50a7e9 Merge pull request #1208 from deepak1556/protocol
adding protocol.RequestBufferJob api
2015-03-20 10:34:31 +08:00
Cheng Zhao
9bae54f917 Avoid extra copy of data in capturePage 2015-03-20 10:26:42 +08:00
deepak1556
9eac8ef266 add protocol.RequestBuffer api 2015-03-19 09:36:57 +05:30
Cheng Zhao
24d615d428 docs: Add a "s" 2015-03-19 11:25:53 +08:00
Cheng Zhao
99410217b9 Bump v0.22.1 2015-03-18 22:36:44 +08:00
Cheng Zhao
46cb6e68f6 Ship snapshot file, fixes #1260 2015-03-18 22:36:27 +08:00
Cheng Zhao
8b88dc6a94 libudev.so is now dynamically loaded from Chrome 41 2015-03-18 13:07:03 +00:00
Cheng Zhao
d6b36bb487 Bump v0.22.0 2015-03-18 20:57:21 +08:00
Cheng Zhao
b8d918d24f Merge pull request #1254 from austinmoore-/master
Add check for root in script/bootstrap.py
2015-03-18 20:36:29 +08:00
Cheng Zhao
b19cfba98e Merge pull request #1240 from suyash/rename-node-webkit-to-nwjs
rename node-webkit to NW.js in development docs
2015-03-18 18:01:37 +08:00
Cheng Zhao
c497eef3b3 Merge pull request #1243 from atom/chrome41
Upgrade to Chrome 41
2015-03-18 18:01:14 +08:00
Cheng Zhao
57812616b9 win: Fix tests and compilation errors 2015-03-18 13:58:33 +08:00
Cheng Zhao
b43386b273 Upgrade libchromiumcontent 2015-03-18 09:57:49 +08:00
Cheng Zhao
f8f7ca1d57 linux: Upgrade libchromiumcontent to fix linking 2015-03-18 09:57:48 +08:00
Cheng Zhao
105ad369ab linux: Fix compilation error 2015-03-18 09:57:48 +08:00
Cheng Zhao
ff724634f2 js_stream is a new module of io.js 2015-03-18 09:57:47 +08:00
Cheng Zhao
0b8eb6ad90 ⬆️ apm@0.144.0 2015-03-18 09:57:47 +08:00
Cheng Zhao
66292a2787 Upgrade brightray to fix invalid commit to libchromiumcontent 2015-03-18 09:57:46 +08:00
Cheng Zhao
12d5474077 Fix webview for the new API 2015-03-18 09:57:46 +08:00
Cheng Zhao
8328bce3f6 Initialize AtExitManager before calling MainApplicationBundlePath
Some singleton calsses require the existence of AtExitManager.
2015-03-18 09:57:45 +08:00
Cheng Zhao
c62c943bdb Define our own Node entry
Chromium's V8 is using external startup snapshot file while Node does
not, so we have to use Chromium's gin for V8 initialization.
2015-03-18 09:57:45 +08:00
Cheng Zhao
ceccf1b48a Fix devtools override for its new architecture 2015-03-18 09:57:44 +08:00
Cheng Zhao
6af7388ac0 Use DevToolsAPI instead of InspectorFrontendAPI 2015-03-18 09:57:43 +08:00
Cheng Zhao
d16d5b290a Remove the "X-Frame-Options" from response headers for devtools 2015-03-18 09:57:43 +08:00
Cheng Zhao
fbd9501c61 Upgrade to io.js v1.5.2 2015-03-18 09:57:42 +08:00
Cheng Zhao
578b24ae8a Ship with snapshot files 2015-03-18 09:57:42 +08:00
Cheng Zhao
5b2c0110dc Fix other compilation errors 2015-03-18 09:57:41 +08:00
Cheng Zhao
98fbe5127b The "subpixel-font-scaling" option is removed 2015-03-18 09:57:41 +08:00
Cheng Zhao
8e2fdc178b Fix API changes of CopyFromBackingStore 2015-03-18 09:57:40 +08:00
Cheng Zhao
757df39941 Upgrade native_mate for unsigned long conversion 2015-03-18 09:57:40 +08:00
Cheng Zhao
dfad907530 Fix API changes of tracing API 2015-03-18 09:57:39 +08:00
Cheng Zhao
04d1075db5 Fix API changes of ContentBrowserClient 2015-03-18 09:57:39 +08:00
Cheng Zhao
8a138fafd4 Fix API changes of WebContentsDelegate 2015-03-18 09:57:38 +08:00
Cheng Zhao
819ab5cd0c Fix ui/gfx/geometry headers 2015-03-18 09:57:38 +08:00
Cheng Zhao
dead7caab2 CommandLine moved to base::CommandLine 2015-03-18 09:57:37 +08:00
Cheng Zhao
14542f4fc8 Upgrade to Chrome 41 2015-03-18 09:57:37 +08:00
Kevin Sawicki
8a52374951 Update brightray repo url to be under atom org 2015-03-17 11:22:39 -07:00
Cheng Zhao
cfc615a6c1 Fix accidental update of submodules, closes #1255 2015-03-17 21:26:10 +08:00
Cheng Zhao
af0690fb88 docs: "Quick start" should also be a "tutorial"
Guides should include information that not available in the API
references, and tutorials should be step-by-step walkthrough or
introductory text on certain APIs.
2015-03-17 18:41:54 +08:00
Cheng Zhao
c80aaa2980 docs: Separate guides and tutorials 2015-03-17 18:37:32 +08:00
Austin Moore
521f61d7db Add argument that allows for non-interactive use
The newly added 'check_root()' method introduced an interactive prompt
that would ask the user if they wanted to continue. The new argument '-y'
will now skip the prompt, so that if a user needs to run this script
un-interactively, they can do so easily.
2015-03-17 01:42:23 -06:00
Austin Moore
2d1f70c1cf Add check for root in script/bootstrap.py 2015-03-17 01:01:33 -06:00
Suyash
327c7bc3cc 📝 avoid breaking everyone's stuff 2015-03-16 16:50:23 +05:30
Cheng Zhao
9e2842c9ca Merge pull request #1235 from suyash/update-linux-development-docs
add troubleshooting instructions for libudev.so.0 failure
2015-03-16 16:55:48 +08:00
Cheng Zhao
7457eccdee Merge pull request #1238 from deepak1556/browser_window_lib_patch
define devToolsWebContents for use from remote module
2015-03-16 16:43:46 +08:00
Cheng Zhao
2942eae9f2 Merge pull request #1242 from deepak1556/web_contents_patch
add DidFailProvisionalLoad method
2015-03-16 16:27:32 +08:00
Robo
87cb2ece80 add DidFailProvisionalLoad method 2015-03-14 08:58:30 +05:30
Kevin Sawicki
042074cab1 Merge pull request #1241 from ylaassel/patch-1
Fix a typo
2015-03-12 08:09:58 -07:00
Yassine Laassel
bd81b24b99 Fix a typo 2015-03-11 17:38:31 -07:00
Cheng Zhao
bb2f3a82d9 Merge pull request #1224 from deepak1556/chromium_flag_patch
test for ignoreCertificateError
2015-03-11 13:40:06 -07:00
Suyash
cda129b073 📝 rename node-webkit to NW.js in development docs
Replaces all occurences of node-webkit with NW.js in the development
docs.
2015-03-12 01:58:58 +05:30
deepak1556
adb130cefa define devToolsWebContents for use from remote module 2015-03-11 19:58:12 +05:30
Suyash
860b15ef8a 📝 add troubleshooting instructions for libudev.so.0 failure
Adding the easiest solution for solving the missing libudev.so.0 error
on ubuntu 13.04+.

I had to do this on my own machine running ubuntu 14.04.2 to build atom.

The solution is also referenced in
https://github.com/nwjs/nw.js/wiki/The-solution-of-lacking-libudev.so.0
2015-03-11 12:17:22 +05:30
Cheng Zhao
1679115302 Merge pull request #1225 from deepak1556/remote_lib_patch
using Object.defineProperty instead of __defineMethods__
2015-03-10 16:03:22 -07:00
deepak1556
8395745cc1 using Object.defineProperty instead of __defineMethods__ 2015-03-11 04:18:11 +05:30
deepak1556
dd706ea6e2 test for ignoreCertificateError 2015-03-10 12:39:23 +05:30
Cheng Zhao
6856d203c5 Merge pull request #1215 from deepak1556/dialog_patch
avoid overriding type value of showMessageBox
2015-03-09 13:50:18 -07:00
Cheng Zhao
29471ff8b5 Fix styling of #1209 2015-03-09 13:46:46 -07:00
Cheng Zhao
2495583b5e Merge pull request #1209 from deepak1556/webcontents_patch
using WebContentsObserver::NavigationEntryCommitted to set virtualurl
2015-03-09 13:41:27 -07:00
deepak1556
0b780def24 avoid overriding type value of showMessageBox 2015-03-06 17:56:26 +05:30
Cheng Zhao
5a50ce4157 Merge pull request #1210 from paulyoung/update-readme
Update README to replace node.js with io.js
2015-03-05 13:42:40 -08:00
Paul Young
4b9f78e375 Update README to replace node.js with io.js 2015-03-05 13:33:02 -08:00
Cheng Zhao
c9b549ae69 Fix styling of #1199 2015-03-05 12:31:45 -08:00
Cheng Zhao
bb0e68e563 Merge pull request #1199 from deepak1556/protocol_asar_patch
read files from asar archives in custom protocol
2015-03-05 12:26:42 -08:00
Robo
0663b9dae2 using WebContentsObserver::NavigationEntryCommitted to set virtualurl 2015-03-05 20:09:27 +05:30
Robo
2ce42af6e4 read files from asar archives in custom protocol 2015-03-05 09:26:34 +05:30
Kevin Sawicki
47463ae5cb 📝 Tweak Windows installer sentence 2015-03-04 14:36:56 -08:00
Kevin Sawicki
d813537e38 Merge pull request #1206 from joaomoreno/patch-1
Refer grunt-atom-shell-installer to Windows users
2015-03-04 14:35:26 -08:00
João Moreno
7148f6d144 Refer grunt-atom-shell-installer to Windows users 2015-03-04 22:38:25 +01:00
Cheng Zhao
52d596e576 Merge pull request #1202 from xfq/patch-2
Update application-packaging.md
2015-03-04 09:36:51 -08:00
Cheng Zhao
1f849ec7b0 Merge pull request #1203 from xfq/patch-3
Update online-offline-events.md
2015-03-04 09:27:54 -08:00
Cheng Zhao
610ab0c0a5 Merge pull request #1204 from xfq/patch-4
Update using-selenium-and-webdriver.md
2015-03-04 09:27:34 -08:00
Cheng Zhao
4e93b567e2 Merge pull request #1200 from xfq/patch-1
Update quick-start.md
2015-03-04 09:26:02 -08:00
Cheng Zhao
2d6dd9f4d2 docs: Put window.open docs in its own chapter, regards #1137 2015-03-04 08:47:04 -08:00
Cheng Zhao
eb31df2940 Rename FakeWindow to BrowserWindowProxy 2015-03-04 08:46:45 -08:00
Cheng Zhao
99f6bf045f Improve #1137 2015-03-04 07:58:06 -08:00
Cheng Zhao
fac9ea3356 Merge pull request #1137 from bundyo/implement-some-popup-methods
Implement FakeWindow.postMessage, window.opener.postMessage and window.closed flag for popup windows
2015-03-04 07:28:33 -08:00
Xue Fuqiao
246d6cbcf7 Update using-selenium-and-webdriver.md
Update the URI  of ChromeDriver.
2015-03-04 21:59:27 +08:00
Xue Fuqiao
29c6d1e46f Update online-offline-events.md
Add HTML5 doctype.
2015-03-04 21:29:02 +08:00
Xue Fuqiao
92c76bac2b Update application-packaging.md
`BrowserWindow` should be used in browser scripts instead of client scripts. Move it to the "Node API" section.
2015-03-04 20:16:22 +08:00
Bundyo
dbbc35bd13 Fixes after code review. 2015-03-04 11:29:52 +02:00
Xue Fuqiao
dab9dad9db Update quick-start.md
node-webkit has been renamed to nw.js.
2015-03-04 16:18:51 +08:00
Cheng Zhao
4176d542a5 Bump v0.21.3 2015-03-03 13:42:29 -08:00
Kevin Sawicki
e19c50223b Merge pull request #1192 from senorflor/fix-error-text
Fix tense of error message
2015-03-02 12:19:14 -08:00
Patrick Flor
5bdc200376 Fix tense of error message
Thanks for putting this project together; really enjoying hacking with
it so far!
2015-03-02 12:08:12 -08:00
Cheng Zhao
f2c8ea085b Merge pull request #1177 from maxogden/patch-1
add npm installation instructions to README
2015-03-02 09:10:04 -08:00
Max Ogden
d8d0f15ca8 fix readme style 2015-03-01 11:58:33 -08:00
Cheng Zhao
38a871aa4b Merge pull request #1176 from CharlieHess/before-quit-event
App Before-Quit Event
2015-03-01 02:20:03 -08:00
bundyo
e8d648bcba Change the link to use dashes. 2015-02-28 10:34:26 +02:00
bundyo
c7562dbfd0 Add FakeWindow documentation. 2015-02-28 10:31:07 +02:00
Cheng Zhao
54c948409e Merge pull request #1167 from mal/patch-1
Prevent overflow on webview with height: 100%
2015-02-27 15:30:17 -08:00
Cheng Zhao
70a83ad069 Merge pull request #1148 from bundyo/fix-window-open-options
Fix window.open options parsing
2015-02-27 12:24:13 -08:00
Cheng Zhao
e98953a5a5 win: Fix calling FILE_PATH_LITERAL for variable, fixes #1143 2015-02-27 12:21:19 -08:00
Charlie Hess
78b856268e Fix cpplint errors. 2015-02-25 21:57:25 -08:00
Max Ogden
1d1db66abd add npm installation instructions to README 2015-02-25 21:56:47 -08:00
Charlie Hess
b6787a9b34 Emit a new before-quit event at the start of Browser::Quit, which gives us a chance to cancel before any windows are closed. 2015-02-25 19:33:42 -08:00
Mal Graty
7eecb84898 Prevent overflow on webview with height: 100%
Without this, the object element gets displayed `inline` which in chromium means that it slightly exceeds it's bounds. Unfortunately there's no nice way to mitigate this issue as I can't find a way to get extra css into this intermediate page. However, forcing a block display solves the issue.
2015-02-21 22:34:57 +00:00
Kevin Sawicki
0c99f3baa6 Merge pull request #1158 from beardicus/patch-1
Broken link in docs, api/synopsis
2015-02-20 15:39:05 -08:00
Brian Boucheron
72d6a13e9e Broken link in docs, api/synopsis
Link to using-native-node-modules.md instead of use-native-node-modules. Filename changed with 268508764f
2015-02-19 12:03:05 -05:00
Bundyo
43e44f8c35 Fix window.open options parsing:
remove excessive whitespace (gets inserted in property names),
avoid creating dummy properties if not needed,
turn 1/0 to true/false, convert integer strings to strings (fixes width/height).
2015-02-18 14:36:05 +02:00
Bundyo
4e82f4c672 Remove two semicolons. 2015-02-13 18:54:18 +02:00
Bundyo
7fa1296a17 Implement FakeWindow.postMessage, window.opener.postMessage and window.closed flag for popup windows. 2015-02-13 18:45:12 +02:00
Cheng Zhao
f1ad8836d1 Merge pull request #1136 from atom/no-js
Bundle all the .js files in asar archive
2015-02-13 14:10:09 +08:00
Cheng Zhao
4834eed520 Set process.resourcesPath in C++ 2015-02-13 13:32:58 +08:00
Cheng Zhao
0f15dd04af Put compiled coffee sources into asar archive 2015-02-13 13:05:51 +08:00
Cheng Zhao
0b8efc434d Use __dirname when setting globalPaths 2015-02-13 12:55:06 +08:00
Cheng Zhao
3f3e66916a asar@0.2.2 2015-02-13 12:40:25 +08:00
Cheng Zhao
fd9a8f4b91 Merge pull request #1134 from atom/menu-icon
Enable setting icon for MenuItem
2015-02-13 12:32:41 +08:00
Cheng Zhao
ac6c2ce69a docs: "icon" attribute 2015-02-13 12:12:40 +08:00
Cheng Zhao
e81baf759a Enable setting icon of menu item 2015-02-13 12:11:50 +08:00
Cheng Zhao
b28a241dbf Simplify the code to call delegate method 2015-02-13 11:47:22 +08:00
Cheng Zhao
afd4052bde Merge pull request #1129 from atom/asar-image
Recognize asar archive in NativeImage
2015-02-12 21:04:34 +08:00
Cheng Zhao
a8c227d5f5 Fix cpplint warnings 2015-02-12 19:50:28 +08:00
Cheng Zhao
9646c28a41 spec: native-image should read asar archive 2015-02-12 19:34:39 +08:00
Cheng Zhao
3678f13dfb Make NativeImage work with asar archive 2015-02-12 19:34:21 +08:00
Cheng Zhao
98a7f08be2 Move GetAsarArchivePath to asar_util.h 2015-02-12 17:31:14 +08:00
Cheng Zhao
3b3a025ed4 Move GetsOrCreateAsarArchive to asar_util.h 2015-02-12 17:23:49 +08:00
Cheng Zhao
64622ceae3 Merge pull request #1128 from atom/native-image
Introduce NativeImage
2015-02-12 16:48:42 +08:00
Cheng Zhao
06d681c66a docs: Update NativeImage 2015-02-12 15:38:16 +08:00
Cheng Zhao
c8738a88a4 Add nativeImage.createFromBuffer() 2015-02-12 15:19:05 +08:00
Cheng Zhao
faf40457c5 spec: Fix BrowserWindow.capturePage 2015-02-12 14:37:32 +08:00
Cheng Zhao
353b485202 Add NativeImage.toDataUrl() 2015-02-12 14:32:51 +08:00
Cheng Zhao
8e94856cc8 Add nativeImage.createFromDataUrl() 2015-02-12 14:27:53 +08:00
Cheng Zhao
b9f6d6dffc Add nativeImage.createEmpty() 2015-02-12 13:55:45 +08:00
Cheng Zhao
8093300a43 docs: Use NativeImage to replace Image 2015-02-12 13:52:28 +08:00
Cheng Zhao
da407200d2 Return NativeImage in BrowserWindow.capturePage 2015-02-12 13:45:50 +08:00
Cheng Zhao
443a4b8f2f mac: Use AsNSImage instead of ToNSImage
It can get rid of the empty check.
2015-02-12 12:29:49 +08:00
Cheng Zhao
509ce0d5cb mac: Don't rely on NSImage to read file
It doesn't work with asar.
2015-02-12 12:24:18 +08:00
Cheng Zhao
903ff0b61a Upgrade native_mate for security check 2015-02-12 10:45:04 +08:00
Cheng Zhao
2ca6be69e2 Fix cpplint warnings 2015-02-12 10:45:04 +08:00
Cheng Zhao
054b6a9817 Use NativeImage when converting images from V8 2015-02-12 10:45:04 +08:00
Cheng Zhao
6556602bdc Enable creating NativeImage from file path 2015-02-12 10:45:04 +08:00
Cheng Zhao
2876f15063 Enable creating NativeImage with native-image module 2015-02-12 10:45:04 +08:00
Cheng Zhao
85f5ef2ab1 Enable creating NativeImage from PNG and JPEG 2015-02-12 10:45:04 +08:00
Cheng Zhao
53fca43d89 Add NativeImage.ToJPEG 2015-02-12 10:45:03 +08:00
Cheng Zhao
549df36f00 Add a few more methods for NativeImage 2015-02-12 10:45:03 +08:00
Cheng Zhao
aae576b484 Convert gfx::Image to NativeImage instance 2015-02-12 10:45:03 +08:00
Cheng Zhao
b76615f3e7 Add clipboard.readImage method 2015-02-12 10:45:03 +08:00
Cheng Zhao
878d25e91e Enable converting gfx::Image to Buffer 2015-02-12 10:45:03 +08:00
Cheng Zhao
ab315e502f Upgrade brightray for gyp 2015-02-12 10:43:53 +08:00
Cheng Zhao
564c0b41df Merge pull request #1122 from atom/window-type
Add "type" option to change window type of BrowserWindow
2015-02-11 12:31:44 +08:00
Cheng Zhao
382a00493b docs: "type" option of BrowserWindow 2015-02-11 12:19:39 +08:00
Cheng Zhao
f0924df68a Add "type" option to change window type 2015-02-11 12:19:39 +08:00
Cheng Zhao
6b37f30bd6 Merge pull request #1106 from paulcbetts/set-overlay-icon
Set window overlay icon
2015-02-11 11:51:01 +08:00
Paul Betts
86de75deef Style fixups 2015-02-10 17:14:26 -08:00
Cheng Zhao
bedd0a11ba Suppress SSL verification, fixes #1115 2015-02-10 17:52:33 +08:00
Cheng Zhao
778078973b Merge pull request #1107 from yoshuawuyts/patch-1
docs: update wording in `application-packaging`
2015-02-10 12:12:34 +08:00
Yoshua Wuyts
a26976a161 docs: update wording in application-packagaging
Minor tweak, should make the sentence a bit more fluent. Thanks!
2015-02-08 12:04:02 +01:00
Paul Betts
8a7acfc6c0 icon_util is Windows-only 2015-02-07 11:57:00 -08:00
Paul Betts
03a88883b6 Fix build on OS X 2015-02-07 11:56:03 -08:00
Paul Betts
59a8be53c2 Documentation 2015-02-06 17:11:54 -08:00
Paul Betts
f55379ed5b Add missing trampoline method 2015-02-06 17:07:29 -08:00
Paul Betts
ef869fb2ff We need a UTF-16 string here 2015-02-06 17:00:38 -08:00
Paul Betts
1b9649b481 Switch to gfx::Image 2015-02-06 17:00:26 -08:00
Paul Betts
fa6d499a4e Come correct with line length and constness 2015-02-06 16:32:27 -08:00
Paul Betts
0afac1e05a Plumb code all the way up 2015-02-06 16:12:32 -08:00
Paul Betts
66f2d18d8b First hack at setting the window icon overlay 2015-02-06 15:58:49 -08:00
Cheng Zhao
b75bfe0e92 Bump v0.21.2 2015-02-05 13:46:09 -08:00
Cheng Zhao
1cae81c0d6 Merge pull request #1100 from christoth/master
Remove MFC lib dependency
2015-02-05 12:01:25 -08:00
christoth
92ab227397 Update atom.rc 2015-02-05 14:55:32 -05:00
christoth
076535bc06 Remove MFC lib dependency
Replace afxres.h with windows.h to remove dependency on MFC for compilation on Windows
2015-02-05 13:09:19 -05:00
Cheng Zhao
071a55974a A little clean up 2015-02-05 00:19:30 -08:00
Kevin Sawicki
c21c89c0ce Merge pull request #1098 from dpatou/patch-1
Event name typo
2015-02-04 16:27:01 -08:00
Damien Patou
8e6e1610a4 Event name typo 2015-02-05 01:23:16 +01:00
Cheng Zhao
0b694dffd8 Merge pull request #1097 from atom/fix-webview-race-condition
Fix the race condition when updating webview info
2015-02-04 16:13:18 -08:00
Cheng Zhao
7c8bed7bfc Get the WebViewManager from embedder WebContents
This make our lives easier when we have multiple BrowserContext support.
2015-02-04 15:52:59 -08:00
Cheng Zhao
209840871c Seperate the API implementation of WebViewManager 2015-02-04 15:39:41 -08:00
Cheng Zhao
ea99037f3b Clean up WebViewManager 2015-02-04 15:28:26 -08:00
Cheng Zhao
331d0481bb Move web_view_manager to atom/browser 2015-02-04 15:17:28 -08:00
Cheng Zhao
2c61070b36 Avoid using global BrowserContext 2015-02-04 15:08:29 -08:00
Cheng Zhao
502c0f0df7 Remove the WebViewRendererState class 2015-02-04 14:58:03 -08:00
Cheng Zhao
aa49e4790f Update WebViewRendererState immediately 2015-02-04 12:59:46 -08:00
Cheng Zhao
3490ce507a Remove WebViewRendererState::IsGuest 2015-02-04 12:51:15 -08:00
Cheng Zhao
c1f3d22910 Add lock for WebViewRendererState 2015-02-04 12:50:24 -08:00
Cheng Zhao
f1bca5dd0f Merge pull request #1096 from atom/generic-asar-support
Support asar archives in scripts forked with child_process.fork
2015-02-04 12:18:13 -08:00
Cheng Zhao
7861eec426 linux: Fix building 2015-02-04 11:18:25 -08:00
Cheng Zhao
a02707f998 Fix cpplint warnings 2015-02-04 11:01:01 -08:00
Cheng Zhao
f214e88784 spec: Script forked with child_process supports asar archives 2015-02-04 10:52:09 -08:00
Cheng Zhao
45e2dd2ab5 Init asar support without external .js files 2015-02-04 10:45:17 -08:00
Cheng Zhao
f905bb64f6 Compile asar.coffee to .c 2015-02-03 16:46:52 -08:00
Cheng Zhao
8612ad0459 generate_sources => compile_coffee 2015-02-03 16:07:29 -08:00
Cheng Zhao
3bbcc1efd8 compile-coffee.py should be put under tools/ 2015-02-03 15:56:58 -08:00
Cheng Zhao
6dac8da91f Merge pull request #1092 from paulcbetts/patch-2
Use 'atomScreen' for the variable name
2015-02-03 12:12:59 -08:00
Cheng Zhao
137f3b8439 docs: forBrowser is now required for webdriver 2015-02-03 11:38:22 -08:00
Paul Betts
b77ed51594 Use 'atomScreen' for the variable name
Even though it's not screen's fault, it's super easy in the DevTools to write `screen = require('screen')`, then wonder why it doesn't work (because `window.screen` is reserved by the DOM). This makes people who just type in the example more likely to get it right.
2015-02-03 11:32:33 -08:00
Cheng Zhao
d17e6a3857 Upgrade brightray 2015-02-03 10:59:19 -08:00
Cheng Zhao
a2c38ed48c Upgrade brightray 2015-02-03 10:43:24 -08:00
Cheng Zhao
93a24ec672 Bump v0.21.1 2015-02-02 17:06:11 -08:00
Cheng Zhao
11cb777e35 win: Delete temp file on reboot, fix #1084 2015-02-02 17:03:52 -08:00
Cheng Zhao
27011ad0c8 win: Fix program not quitting, close #1084 2015-02-02 16:10:48 -08:00
Cheng Zhao
c6fabf8613 Merge pull request #1082 from atom/graceful-asar
Make asar support work with graceful-fs
2015-02-02 15:01:20 -08:00
Cheng Zhao
6e469df90e Fix string escaping 2015-02-02 13:35:32 -08:00
Cheng Zhao
0c0a6bd939 Don't touch global fs object in graceful-fs 2015-02-02 13:35:32 -08:00
Cheng Zhao
3f8ad3bf75 spec: graceful-fs should not touch global fs object 2015-02-02 13:35:32 -08:00
Cheng Zhao
afd6f41e08 Redirect process.binding('natives').fs to global fs object 2015-02-02 13:35:32 -08:00
Cheng Zhao
0a393eaa1c Enable wrap arbitrary fs object 2015-02-02 13:35:32 -08:00
Cheng Zhao
b1bb7bd8f3 spec: Test graceful-fs 2015-02-02 13:35:32 -08:00
Daniel Hengeveld
45bfbb7cf6 Merge pull request #1081 from xfq/osx
Change Mac OS X to OS X.
2015-02-02 11:11:07 -08:00
Xue Fuqiao
5083a7505d Change Mac OS X to OS X.
Apple has renamed Mac OS X to OS X.
2015-02-02 16:21:23 +08:00
Cheng Zhao
fd2b2003b4 Merge pull request #1077 from atom/asar-standard
Remove asar: protocol, use file: protocol instead
2015-01-31 22:30:29 -08:00
Cheng Zhao
23b5c1f782 Cleanup usaages of asar: protocol 2015-01-31 18:50:26 -08:00
Cheng Zhao
37d278de34 docs: Use file: instead of asar: 2015-01-31 18:48:11 -08:00
Cheng Zhao
24b5faf8df spec: Test loading script tag in html 2015-01-30 17:59:00 -08:00
Cheng Zhao
8b712bac8d Remove the asar: protocol 2015-01-30 17:59:00 -08:00
Cheng Zhao
a1f26c4c93 Make file: protocol compatible with asar: protocol 2015-01-30 17:58:59 -08:00
Cheng Zhao
13c887d4c9 No more need of pathwatcher spec
It was used for testing modules not working while compiling, since the
module version increases for ABI breakage, it is not useful anymore.
2015-01-30 16:50:42 -08:00
Cheng Zhao
2ed7d58ac4 Fix loading node integration when page in webview navigates, close #1068 2015-01-29 16:49:34 -08:00
Cheng Zhao
b51e2f6453 spec: Fix flags in fs.open 2015-01-28 21:25:48 -08:00
Cheng Zhao
17c191201c Upgrade node modules in spec 2015-01-28 21:22:56 -08:00
Cheng Zhao
4217b70331 Return null in window.open if failed to open new window, fixes #1067 2015-01-28 21:07:57 -08:00
Cheng Zhao
8947d54cc9 Bump v0.21.0 2015-01-27 17:33:13 -08:00
Cheng Zhao
f829f2eb0c Merge pull request #1002 from atom/chrome40
Upgrade to Chrome 40
2015-01-27 17:32:07 -08:00
Cheng Zhao
0087f8da27 linux: Fix building for Chrome 40 2015-01-27 17:20:50 -08:00
Cheng Zhao
dd606684c7 Upgrade node to fix module initialization 2015-01-27 15:29:39 -08:00
Cheng Zhao
12998399f8 Do not warn about deprecated APIs
Some APIs deprecated by iojs is still in use.
2015-01-27 14:49:14 -08:00
Cheng Zhao
c09ba6efdb Use upload-node-headers.py in upload.py 2015-01-27 13:19:18 -08:00
Cheng Zhao
7df1957ac7 Fix executing upload-node-headers.py in cygwin 2015-01-27 13:19:18 -08:00
Cheng Zhao
241e410a07 Move the code of uploading node headers to the new script 2015-01-27 13:19:18 -08:00
Cheng Zhao
68cfe80369 Move the code of creating tarball to a new script 2015-01-27 13:19:18 -08:00
Cheng Zhao
88d7ad95f6 ⬆️ apm@0.126.0 2015-01-27 13:19:18 -08:00
Cheng Zhao
02c04cbf68 win: gfx::EnableHighDPISupport is dropped 2015-01-27 13:19:18 -08:00
Cheng Zhao
5523938a47 kDisableDirectWrite has been moved to ui/gfx 2015-01-27 13:19:18 -08:00
Cheng Zhao
fbe1abddf4 Upgrade libchromiumcontent to ship crypto headers 2015-01-27 13:19:18 -08:00
Cheng Zhao
9a14d2bd0e Upgrade to Chrome 40.0.2214.91 2015-01-27 13:19:18 -08:00
Cheng Zhao
86644543ed Fix cpplint warning 2015-01-27 13:18:31 -08:00
Cheng Zhao
a9c720969f Upgrade to latest io.js 2015-01-27 13:18:31 -08:00
Cheng Zhao
3dd9e4cdf8 uv_run_mode can not be used as bitmask
See http://git.io/9ou_MQ for more on this.
2015-01-27 13:18:31 -08:00
Cheng Zhao
9a5698807f Update to latest URLRequestJobFactory API 2015-01-27 13:18:31 -08:00
Cheng Zhao
92142ee372 Fix the API to set opaque background 2015-01-27 13:18:31 -08:00
Cheng Zhao
715ac35672 Update to new FilesSelectedInChooser API 2015-01-27 13:18:30 -08:00
Cheng Zhao
750db6aed8 base/file_util.h has been moved to base/files/file_util.h 2015-01-27 13:18:30 -08:00
Cheng Zhao
5c78ecfe40 scoped_ptr.PassAs is removed 2015-01-27 13:18:30 -08:00
Cheng Zhao
43421aedcf OVERRIDE macro is now removed 2015-01-27 13:18:30 -08:00
Cheng Zhao
13ed038082 Upgrade to Chrome 40.0.2214.72 2015-01-27 13:17:48 -08:00
Cheng Zhao
de151cef8e Bump v0.20.8 2015-01-27 11:38:30 -08:00
Cheng Zhao
5bfe644c3e Merge pull request #1059 from atom/ipc-preload
Don't rely on global "process" object for message dispatching
2015-01-27 10:58:20 -08:00
Cheng Zhao
20431f4f2f No need to route via ATOM_INTERNAL_MESSAGE 2015-01-27 10:47:11 -08:00
Cheng Zhao
ad16e9ea49 Check for the existence of "ipc" object 2015-01-26 18:47:23 -08:00
Cheng Zhao
a10782cdea Don't rely on the global process object for message dispatching 2015-01-26 18:42:43 -08:00
Cheng Zhao
c14c6a3521 spec: The preload script should be able to receive ipc messages 2015-01-26 18:06:27 -08:00
Cheng Zhao
6c62895898 Merge pull request #1044 from atom/load-environment-later
Fix race condition when initializing node integration
2015-01-25 13:04:33 -08:00
Cheng Zhao
134aa32612 Merge pull request #1052 from gappsby/patch-1
Correct spelling mistake.
2015-01-25 13:04:22 -08:00
Florian Hämmerle
0a59384003 Correct spelling mistake. 2015-01-24 13:39:36 +01:00
Cheng Zhao
c2b109f7fc Fix process.crash() 2015-01-23 21:55:42 -08:00
Cheng Zhao
a755edebfa Simplify atom_bindings 2015-01-23 21:33:40 -08:00
Cheng Zhao
76fc62808c Use FILE_PATH_LITERAL instead of AppendASCII 2015-01-23 21:12:45 -08:00
Cheng Zhao
54ab6744f1 Remove some unused virtual functions 2015-01-23 21:05:32 -08:00
Cheng Zhao
2d262d2dbd Use node::CreateEnvironment to create environment 2015-01-23 21:02:31 -08:00
Cheng Zhao
de99c38fb6 Get rid of AtomRenderFrameObserver 2015-01-23 20:51:19 -08:00
Cheng Zhao
91320a9e55 Remove AtomRendererBindings
After the simplification of code this class is no longer needed.
2015-01-23 20:43:38 -08:00
Cheng Zhao
0bcc9b7713 Don't handle browser messages before document object is created
When we recevied messages from browser, we will try to transfer the
message to web page, and when we do that blink will create an empty
document when there is no document object yet, which will make our init
script run when window.location is still about:blank.
2015-01-23 18:33:01 -08:00
Cheng Zhao
33b6876cc1 Add support for Plus as accelerator key, fixes #1050 2015-01-23 15:26:54 -08:00
Cheng Zhao
81b370ee9f Implement CheckMediaAccessPermission, fixes #1017 2015-01-23 15:13:49 -08:00
Cheng Zhao
fe81e5b32d Use https://atom.io/download/atom-shell as headers download URL 2015-01-23 12:16:49 -08:00
Cheng Zhao
4ba3e101f6 Clean the init.coffee 2015-01-21 17:38:26 -08:00
Cheng Zhao
7210f6e64d spec: No node integration in iframe 2015-01-21 17:05:19 -08:00
Cheng Zhao
ef15b670a9 Initialize node integration after window object is cleared 2015-01-21 16:40:19 -08:00
Cheng Zhao
706f547287 Don't insert node symbols in frames
This greatly simplified our code, and it is not useful to enable node
integrations in frames.
2015-01-21 15:42:57 -08:00
Cheng Zhao
f142f572c3 Add DidClearWindowObject for renderer client 2015-01-21 15:35:43 -08:00
Cheng Zhao
7e33e26465 Add atom-shell bindings before loading environment 2015-01-21 15:02:09 -08:00
Cheng Zhao
5e58915bdd Separate LoadEnvironment from CreateEnvironment 2015-01-21 14:00:19 -08:00
Cheng Zhao
854c59df5c docs: Make getCurrentWindow more clear, fixes #1035 2015-01-21 13:47:28 -08:00
Cheng Zhao
f6db9bc84c Merge pull request #1034 from atom/index-js
Update index.json when publishing
2015-01-21 13:38:56 -08:00
Cheng Zhao
b8d0c5b3fe Include node's version 2015-01-21 13:37:52 -08:00
Cheng Zhao
23760058e9 Fix target url 2015-01-20 22:16:27 -08:00
Cheng Zhao
7b621262ea Upload the index.json to S3 2015-01-20 22:09:30 -08:00
Cheng Zhao
62756a79df Include apm version in index.json 2015-01-20 22:01:51 -08:00
Cheng Zhao
87cd762eb3 ⬆️ apm@0.122.0 2015-01-20 21:58:46 -08:00
Cheng Zhao
74566375b5 Download the index.json from server 2015-01-20 21:53:53 -08:00
Cheng Zhao
5d9b538513 Add script to dump information for atom-shell 2015-01-20 14:39:14 -08:00
Cheng Zhao
7c0f414881 Bump v0.20.7 2015-01-20 11:30:41 -08:00
Cheng Zhao
62d2b90e18 Merge pull request #1027 from fengmk2/mirror
Add China download mirrors
2015-01-19 19:44:19 -08:00
Cheng Zhao
69092eee15 No need to preheat original-fs module 2015-01-19 15:47:21 -08:00
Cheng Zhao
96f24b88ea Update asar specs 2015-01-19 15:36:56 -08:00
Cheng Zhao
3d858bee95 Guard against bad events in screen module
It can happen that the DisplayObserver methods are called without a
valid Display object passed.
2015-01-19 14:46:29 -08:00
Cheng Zhao
0933a7d1b2 Evaluate the "fs.js" in original-fs
Some high-level APIs in fs are using low-level APIs via "fs.xxx", which
will be overriden by our asar wrappers, so just shadow-copy those
methods is not enough.

By evaluating the whole "fs.js" we can make sure original-fs is not
polluted by the asar wrappers.

Fixes #782.
2015-01-19 14:22:32 -08:00
Cheng Zhao
fe78c17ea6 Don't popup error if the user has a custom uncaught exception handler
Fix #1012.
2015-01-19 12:50:44 -08:00
Cheng Zhao
79a233436b Merge pull request #1029 from atom/editing-commands
Add editing commands for <webview> and WebContents
2015-01-19 12:40:30 -08:00
Cheng Zhao
3da347a783 docs: The editing commands 2015-01-19 12:30:28 -08:00
Cheng Zhao
ff856e679d Make editing commands available in <webview> 2015-01-19 12:15:07 -08:00
Cheng Zhao
7fbf4246ac Add editing commands for WebContents 2015-01-19 12:09:47 -08:00
fengmk2
42077999e9 Add China download mirrors 2015-01-19 22:30:33 +08:00
Cheng Zhao
e75950cb89 Merge pull request #1026 from atom/set-data-path
Add API to set/get path to special directory or file
2015-01-18 21:53:29 -08:00
Cheng Zhao
4604c9bb0e Add a few more paths for app.getPath 2015-01-18 21:43:23 -08:00
Cheng Zhao
8aa5b97c61 docs: Say more about Linux's behavior 2015-01-18 21:43:22 -08:00
Cheng Zhao
ce52a87477 Add "cache" and "userCache" directories 2015-01-18 21:43:22 -08:00
Cheng Zhao
9a04f67c0a docs: Mention when to override userData path 2015-01-18 21:43:21 -08:00
Cheng Zhao
3d398458a8 Throw error when PathService call failed 2015-01-18 21:43:21 -08:00
Cheng Zhao
dec3e37683 docs: Document app.getPath/app.setPath 2015-01-18 21:43:20 -08:00
Cheng Zhao
a988b48016 Implement app.getHomeDir with app.getPath 2015-01-18 21:43:20 -08:00
Cheng Zhao
d31df439c3 Override default userData according to app's name 2015-01-18 21:43:19 -08:00
Cheng Zhao
06da5f254a Add app.setPath and app.getPath APIs
They can be used to set/get any path defined in PathService
2015-01-18 21:43:19 -08:00
Cheng Zhao
2d1afbf51b Call app.getDataPath after app is ready
It is possible for users to override the data path.
2015-01-18 21:43:18 -08:00
Cheng Zhao
45c26e0e5a Add app.setDataPath API 2015-01-18 21:43:18 -08:00
Cheng Zhao
c6fb645f6b Warning of app not ready in screen module 2015-01-18 21:42:46 -08:00
Cheng Zhao
e8f1f6819c Merge pull request #1016 from atom/screen-improve
Add API to enumerate external displays in screen module
2015-01-18 10:23:18 -08:00
Cheng Zhao
c59bd82f6f Merge pull request #1019 from atom/locale-in-node
Initialize ICU in Node mode
2015-01-16 17:08:30 -08:00
Cheng Zhao
b2be9373b0 linux,win: Initalize ICU for node mode 2015-01-16 16:12:12 -08:00
Cheng Zhao
f81df9a5d3 spec: Test localeCompare in child process 2015-01-16 16:11:02 -08:00
Cheng Zhao
51c03c3a71 mac: Initialize ICU in Node mode 2015-01-16 15:55:50 -08:00
Cheng Zhao
4f6ee31a28 docs: Fix typo 2015-01-16 14:01:52 -08:00
Cheng Zhao
1746518cdf docs: Update docs and examples for screen module 2015-01-16 13:57:16 -08:00
Cheng Zhao
b3c3556286 Update the displays when there is metrics change 2015-01-16 12:04:35 -08:00
Cheng Zhao
50b96ca7ef Pass the display in screen events 2015-01-16 12:02:32 -08:00
Cheng Zhao
7749484628 Make getAllDisplays return current displays. 2015-01-16 11:39:25 -08:00
Cheng Zhao
b5898d3355 Add events on display add/remove. 2015-01-16 11:01:38 -08:00
Cheng Zhao
809c995c0b Make "screen" module a browser module 2015-01-16 11:01:38 -08:00
Cheng Zhao
551c39e241 Add some more attributes for Display 2015-01-16 11:01:38 -08:00
Cheng Zhao
97070246b7 Don't put gfx_converter's implementaion in header file 2015-01-16 11:01:38 -08:00
Cheng Zhao
029ee9aa1e Add a few more API bindings 2015-01-16 11:01:38 -08:00
Cheng Zhao
509294b228 Don't hard-code API names 2015-01-16 11:01:38 -08:00
Cheng Zhao
ab9e1dd650 Upgrade brightray for #863 2015-01-15 17:52:14 -08:00
Cheng Zhao
0ac2443eb0 Merge pull request #1009 from atom/better-emit
Convert arguments to V8 directly in EventEmitter::Emit
2015-01-15 17:40:20 -08:00
Cheng Zhao
136b3da458 Add -stdlib=libc++ for linking 2015-01-15 17:17:43 -08:00
Cheng Zhao
9f5ed14f24 mac: Upgrade libchromiumcontent to fix linking error 2015-01-14 20:15:39 -08:00
Cheng Zhao
482c740e61 Also unpack arguments in ipc-message-host message 2015-01-14 19:43:01 -08:00
Cheng Zhao
1a1cf57097 Unpack the arguments in ipc message 2015-01-14 19:33:24 -08:00
Cheng Zhao
f6f5ff4330 Fix converting ListValue to V8 2015-01-14 19:09:25 -08:00
Cheng Zhao
6a11eccc3e Update native_mate to fix linking error 2015-01-14 18:55:54 -08:00
Cheng Zhao
2d6dc9c527 Convert arguments to V8 directly in EventEmitter::Emmit
This gets rid of the extra conversion between ListValue.
2015-01-14 17:51:54 -08:00
Cheng Zhao
65d2540807 Use C++11 stdlib 2015-01-14 17:40:24 -08:00
Cheng Zhao
834d28f528 win: Fix building 2015-01-14 14:05:22 -08:00
Cheng Zhao
b4ba4a908e Bump v0.20.6 2015-01-13 11:47:10 -08:00
Cheng Zhao
bda3711815 docs: Transparent window 2015-01-12 15:27:33 -08:00
Cheng Zhao
b4cdb546fe Don't set contentWindow property for <webview>
This property is only available in Chrome and we don't need it in
atom-shell, so remove it to avoid confusions.

Fixes #997.
2015-01-12 14:17:49 -08:00
Cheng Zhao
7ab5db1adb Use http in framework download url, fixes #998 2015-01-12 14:10:22 -08:00
Cheng Zhao
1926c2cd01 Merge pull request #949 from atom/window-transparency
Add support for window transparency
2015-01-12 14:05:20 -08:00
Cheng Zhao
21ba5b867d Merge branch 'master' into window-transparency
Conflicts:
	script/lib/config.py
2015-01-12 13:39:32 -08:00
Kevin Sawicki
1a80bc786d Merge pull request #1000 from yibuyisheng/master
remove `will`
2015-01-12 09:10:22 -08:00
yibuyisheng
6a532292c4 remove 2015-01-12 23:23:10 +08:00
Cheng Zhao
c8ed581e5c Merge pull request #990 from deepak1556/chrome_extension_patch
ensuring single instance for loading and unloading extension
2015-01-09 15:11:21 -08:00
deepak1556
c0f0f4cdc6 ensuring single instance for loading and unloading extension 2015-01-10 04:12:13 +05:30
Cheng Zhao
b83f042363 Merge pull request #985 from atom/set-safe-schema
Add webFrame.registerUrlSchemeAsSecure API
2015-01-08 13:12:14 -08:00
Cheng Zhao
bce8a3f835 Fix cpplint warning 2015-01-08 12:51:15 -08:00
Cheng Zhao
2d5b17552a Add webFrame.registerUrlSchemeAsSecure API 2015-01-08 12:39:58 -08:00
Cheng Zhao
19d6d171b1 Don't show insecure content by default
This follows the behavior of Chrome.
2015-01-08 11:50:55 -08:00
Cheng Zhao
09acb9032a Allow using blink's private headers 2015-01-08 11:50:55 -08:00
Cheng Zhao
3dfc496243 Add support for --ignore-certificate-errors
This makes it possible to test HTTPS related APIs.
2015-01-08 11:50:55 -08:00
Cheng Zhao
506237f5d6 Bump v0.20.5 2015-01-07 23:27:58 -08:00
Cheng Zhao
609e3ec3ff Don't allow duplicate object in a parsed array
This feature was introduced to fix #874 but caused the converter to go
through a deep nested object sometimes, which made program crash on
Windows. So we have to revert the fix even though it makes a regression.

Fixes atom/atom#4904.
2015-01-07 23:20:03 -08:00
Cheng Zhao
640c8f88ff Bump v0.20.4 2015-01-05 15:51:29 -08:00
Cheng Zhao
d0ed681643 Merge pull request #977 from atom/dialog-icon
Add "icon" option for dialog.showMessageBox
2015-01-05 15:50:33 -08:00
Cheng Zhao
5656714b27 docs: "icon" option of dialog.showMessageBox 2015-01-05 15:30:54 -08:00
Cheng Zhao
ecb9e93394 File dialogs don't need icon 2015-01-05 15:29:26 -08:00
Cheng Zhao
708e738521 views: Fix showing icon in message dialog 2015-01-05 15:26:35 -08:00
Cheng Zhao
8457090b18 Add "icon" option for message box 2015-01-05 15:08:42 -08:00
Cheng Zhao
513052de87 Enable initializing an empty image 2015-01-05 14:55:06 -08:00
Cheng Zhao
d65919d896 Add --disable-http-cache switch, fixes #891 2015-01-05 13:40:38 -08:00
Cheng Zhao
895ccf69a7 Avoid using app API in renderer process for #907 2015-01-04 22:51:00 -08:00
Cheng Zhao
3063b5189a Upgrade brightray for #941 2015-01-04 22:33:02 -08:00
Cheng Zhao
335cd79b37 Don't call Screen functions until app is ready
Fixes #907.
2015-01-04 22:27:02 -08:00
Cheng Zhao
e3bad233e9 Upgrade native_mate to fix throwing exception from constructor 2015-01-04 22:13:46 -08:00
Cheng Zhao
7abb08cc25 docs: Document dialog.showErrorBox, fixes #909 2015-01-04 21:56:45 -08:00
Cheng Zhao
31bdfc2281 Merge pull request #972 from atom/template-image
Add support for template image
2015-01-02 19:43:17 -08:00
Cheng Zhao
bf14f67cb8 win: Fix building 2015-01-02 19:31:19 -08:00
Cheng Zhao
ef7a60807b linux: Fix building 2015-01-02 19:26:17 -08:00
Cheng Zhao
f17673be9c docs: Template image 2015-01-02 19:15:09 -08:00
Cheng Zhao
079f81b304 mac: Add support for template image 2015-01-02 19:01:38 -08:00
Cheng Zhao
ab83b21fa6 Use gfx::Image instead of gfx::ImageSkia in API
The gfx::Image can use NSImage directly as underlying format, so we
don't have to decode images ourselves on Mac, and we will also be able
to make use of template images.
2015-01-02 18:43:56 -08:00
Cheng Zhao
3d7da455bc mac: Check for invalid image 2015-01-02 18:35:33 -08:00
Cheng Zhao
ac8a9afada mac: Initialize gfx::ImageSkia from gfx::Image 2015-01-02 18:34:13 -08:00
Cheng Zhao
8faab22f5e mac: Initialize gfx::Image from NSImage 2015-01-02 18:24:23 -08:00
Cheng Zhao
40679ae82c Simplify the image_converter.cc 2015-01-02 18:10:29 -08:00
Cheng Zhao
f972c38bc8 Add converters for gfx::Image 2015-01-02 17:13:26 -08:00
Cheng Zhao
e1f0f02da9 Upgrade brightray for #969 2015-01-02 15:18:55 -08:00
Cheng Zhao
b4d9c92705 Merge pull request #966 from ttilley/master
fix typo in atom.gyp
2015-01-02 12:10:32 -08:00
Travis Tilley
44b932f90b fix typo in atom.gyp
use product_name instead of project_name when creating framework symlinks; fixes build on MacOS
2015-01-01 10:51:59 -05:00
Cheng Zhao
c5411c3291 docs: Add troubleshooting for runnin on Git Bash, closed #711 2014-12-29 19:09:36 -08:00
Cheng Zhao
7dc8ede90f Bump v0.20.3 2014-12-29 12:21:35 -08:00
Cheng Zhao
b94375c794 Merge pull request #962 from atom/fix-rename-bundle
Fix renaming application bundle on Mac
2014-12-29 12:20:38 -08:00
Cheng Zhao
45c2cda6bb docs: Mention the GYP_DEFINES way of rebranding 2014-12-29 12:12:04 -08:00
Cheng Zhao
5c65f037b0 docs: Update Application Distribution 2014-12-29 10:46:15 -08:00
Cheng Zhao
de55d8c292 Make product_name and project_name configurable
Now users can make use of GYP_DEFINES to custom application name:

export GYP_DEFINES="product_name=MyApp project_name=myapp"
./script/update.py
./script/build.py -C Release -t myapp
2014-12-29 09:51:47 -08:00
Cheng Zhao
a9d67e9715 Discard "framework_name"
We are using "'product_name' Framework" directly in C++, so we should
keep the name consistent in C++ and gyp
2014-12-29 09:49:10 -08:00
Cheng Zhao
9bd517e623 Use PRODUCT_NAME as application name 2014-12-29 09:46:27 -08:00
Cheng Zhao
22d5d40a66 Define PRODUCT_NAME 2014-12-29 09:42:54 -08:00
Cheng Zhao
3f307ea8a6 Revert #898 2014-12-29 09:35:08 -08:00
Cheng Zhao
ded58b8e65 mac: BrowserWindow.show() should also focus on window 2014-12-27 17:41:13 -08:00
Cheng Zhao
6939567cb4 win: Make transparent window resizable 2014-12-23 17:24:04 -08:00
Cheng Zhao
1a34e09a45 views: Make transparent window work 2014-12-23 16:55:57 -08:00
Cheng Zhao
85685feff4 mac: Simplify frameless window dragging code 2014-12-23 15:55:56 -08:00
Cheng Zhao
4ca0458b37 OVERRIDE => override in native_window_mac.h 2014-12-23 15:31:39 -08:00
Cheng Zhao
effcf18d56 Upgrade libchromiumcontent to make transparent window work on Mac 2014-12-23 13:32:18 -08:00
Cheng Zhao
5b312e8f64 mac: Fix a crash when closing window 2014-12-23 12:31:27 -08:00
Cheng Zhao
8506725b54 mac: Don't show title text in transparent window 2014-12-23 11:48:20 -08:00
Cheng Zhao
45c41fe880 mac: Use transparent window 2014-12-23 11:17:56 -08:00
Cheng Zhao
4fc73117c4 Tell the render widget to use transparent background. 2014-12-23 11:17:32 -08:00
Cheng Zhao
9593c71f52 Add "transparent" option 2014-12-22 17:48:54 -08:00
Cheng Zhao
a23218c51d Bump v0.20.2 2014-12-22 13:11:28 -08:00
Cheng Zhao
70225009af Fix bootstrap.py on posix platform 2014-12-21 17:39:59 -08:00
Cheng Zhao
80bea0766e win: Update version file with unix line ending 2014-12-21 16:30:48 -08:00
Cheng Zhao
54933f992a Upgrade libchromiumcontent to fix icu symbols 2014-12-21 16:27:56 -08:00
Cheng Zhao
c0bf2facca Merge pull request #942 from atom/spell-check-client
Add support for spell checking
2014-12-20 14:25:32 -08:00
Cheng Zhao
d642fe6075 docs: webFrame.setSpellCheckProvider 2014-12-19 22:34:34 -08:00
Cheng Zhao
e7dfd48b1c Spell check pasted text 2014-12-19 22:13:07 -08:00
Cheng Zhao
90b2d12371 Add option to turn on/off auto correct word 2014-12-19 21:01:47 -08:00
Cheng Zhao
f6c66e7ece Use Chrome's policy for auto correct word 2014-12-19 20:56:16 -08:00
Cheng Zhao
c6a18b1b59 Split the words before sending it to spellCheck 2014-12-19 20:42:19 -08:00
Cheng Zhao
6cdc8e4b96 Small style fixes 2014-12-19 12:48:53 -08:00
Cheng Zhao
598060dfd8 Merge pull request #938 from omo/show-definition-for-selection
Add BrowserWindow.showDefinitionForSelection()
2014-12-19 12:43:48 -08:00
Cheng Zhao
b801a93dc5 Also expose requestCheckingOfText 2014-12-18 17:41:42 -08:00
Hajime Morrita
dc9329ff43 Add BrowserWindow.showDefinitionForSelection()
This API shows the system-provided pop-up dictionary.
Some Mac apps including Chrome have "Look Up in in Dictionary" context
menu item. This API can be used to implement it.
2014-12-18 16:45:45 -08:00
Cheng Zhao
a61331a083 Call JavaScript to get spell check results 2014-12-18 16:44:38 -08:00
Cheng Zhao
f1fbc5c701 Add webFrame.setSpellCheckClient API 2014-12-18 13:54:01 -08:00
Cheng Zhao
896077222d Add an empty SpellCheckClient 2014-12-18 13:43:51 -08:00
Cheng Zhao
47d7a355f2 Make file dialogs work in <webview>, fixes #930 2014-12-18 12:58:17 -08:00
Cheng Zhao
a1ae399d10 Make getUserMedia work in <webview>, fixes #845 2014-12-18 12:02:53 -08:00
Cheng Zhao
48b0d85f54 Merge pull request #934 from atom/webview-websecurity
Add "disablewebsecurity" attribute for <webview>
2014-12-18 11:21:04 -08:00
Cheng Zhao
423d269187 docs: "disablewebsecurity" attribute 2014-12-17 21:34:02 -08:00
Cheng Zhao
da54ac5f55 Don't leak listeners in embedder when guest is destroyed 2014-12-17 20:44:15 -08:00
Cheng Zhao
a26091e485 Suppress EventEmitter warnings 2014-12-17 20:33:47 -08:00
Cheng Zhao
40ab21d9df spec: "disablewebsecurity" attribute 2014-12-17 18:14:10 -08:00
Cheng Zhao
947e6aca9b Set web preferences for guest page 2014-12-17 18:13:39 -08:00
Cheng Zhao
c92d2531b5 Add "disablewebsecurity" attribute for <webview> 2014-12-17 18:13:20 -08:00
Cheng Zhao
6d168b89ef Use "http" for download url, fixes #929 2014-12-17 16:25:25 -08:00
Cheng Zhao
55c8206bda Bump v0.20.1 2014-12-17 15:27:42 -08:00
Cheng Zhao
c01e3cf9aa Merge pull request #931 from atom/will-navigate
Add "will-navigate" event
2014-12-17 15:27:15 -08:00
Cheng Zhao
040049f9e7 docs: "will-navigate" event 2014-12-17 15:15:37 -08:00
Cheng Zhao
2fc1e2a4e6 Merge pull request #924 from atom/webview-ipc-message
Add ipc-message event for <webview>
2014-12-17 15:06:25 -08:00
Cheng Zhao
eaacf0a6ef spec: "will-navigate" event 2014-12-17 15:03:34 -08:00
Cheng Zhao
c2975d2bcc Redirect BrowserWindow's "will-navigate" event to WebContents 2014-12-17 14:56:51 -08:00
Cheng Zhao
60df32aab5 Add "will-navigate" event for WebContents 2014-12-17 14:55:22 -08:00
Cheng Zhao
fd596d4a65 Add "will-navigate" event for BrowserWindow 2014-12-17 14:40:19 -08:00
Cheng Zhao
5142b7858b Upgrade brightray to fix crash in #393 2014-12-17 13:16:06 -08:00
Cheng Zhao
a8f5a4e2d4 Add sendToHost method 2014-12-17 11:09:11 -08:00
Cheng Zhao
d46300587a Remove uses of deprecated APIs in remote module 2014-12-17 11:00:41 -08:00
Cheng Zhao
64a41b65bb Merge pull request #923 from ffdd/patch-1
Add that Menu.setApplication only works after 'ready' event.
2014-12-17 10:29:46 -08:00
Cheng Zhao
275ac2c4b6 doc: ipc-message event 2014-12-16 21:19:04 -08:00
Cheng Zhao
c0285747a2 spec: ipc-message event 2014-12-16 21:11:30 -08:00
Cheng Zhao
95793e410d Redirect guest page's ipc message to embedder 2014-12-16 21:10:53 -08:00
ffdd
31d606220e Add that Menu.setApplication only works after 'ready' event.
I got caught on this while trying to add a menu in my application in OSX.
2014-12-16 21:50:40 -05:00
Cheng Zhao
4fc14959a8 Allow same object to appear in one list when parsing V8 array
Fixes #874.
2014-12-16 16:57:42 -08:00
Cheng Zhao
95dd73bd1d Add maximum depth when converting V8 object to base::Value 2014-12-16 16:46:23 -08:00
Cheng Zhao
5bed184014 Merge pull request #922 from atom/dialog-thread
Run asynchronous file dialog in new thread on Windows
2014-12-16 14:01:05 -08:00
Cheng Zhao
4fa7e8e914 Merge pull request #919 from paulcbetts/nullref-in-webview-manager
Fix nullref crash in WebViewManager::RemoveGuest
2014-12-16 13:40:11 -08:00
Cheng Zhao
63e83a7ef8 win: Don't hang when failed to create thread 2014-12-16 12:33:17 -08:00
Cheng Zhao
c20e1e9d82 win: Run async save dialog in new thread 2014-12-16 12:27:26 -08:00
Cheng Zhao
253bacdf1d win: Run async open dialog in new thread 2014-12-16 11:27:38 -08:00
Cheng Zhao
98127ba13c linux: Fix building 2014-12-15 17:28:51 -08:00
Cheng Zhao
cb911b19dd win: Fixes stopping FlashFrame, closes #906 2014-12-15 17:27:58 -08:00
Cheng Zhao
d50eeb04d5 Upgrade cpplint 2014-12-15 17:15:56 -08:00
Cheng Zhao
1641caf353 Fix cpplint warnings 2014-12-15 16:57:04 -08:00
Cheng Zhao
23951e6ef3 views: Implement CanMinimize, fixes #918 2014-12-15 16:46:37 -08:00
Cheng Zhao
c9a5c6515c views: Make it possible to show a window in maximized state
Fixes #834.
2014-12-15 16:38:20 -08:00
Cheng Zhao
0ab32bfe17 win: Reserve border space for maximized frameless window
Fixes #732.
2014-12-15 16:01:11 -08:00
Cheng Zhao
3d30e6ddc4 win: Don't allow maximzing a unresiazble frameless window
Fixes #857.
2014-12-15 12:55:16 -08:00
Paul Betts
ffdf2f7fcf Check key via ContainsKey instead of null check 2014-12-15 11:22:14 -08:00
Paul Betts
974415f8a1 You're not my real Dad, cpplint 2014-12-15 06:23:00 -08:00
Paul Betts
3105092130 Fix nullref crash in RemoveGuest 2014-12-15 06:10:39 -08:00
Cheng Zhao
85b0885af7 Bump v0.20.0 2014-12-12 18:21:14 -08:00
Cheng Zhao
11cd301127 Only listen to its own events in <webview>, fixes #885 2014-12-12 17:16:12 -08:00
Cheng Zhao
654d21100f Upgrade libchromiumcontent to remove dom storage quota
Closes #897.
2014-12-12 16:42:07 -08:00
Cheng Zhao
5bd924a52d mac: Use com.github.atom-shell as default CFBundleIdentifier 2014-12-12 15:37:13 -08:00
Cheng Zhao
186d34c33a Merge pull request #904 from atom/chrome39
Upgrade to Chrome 39
2014-12-12 15:23:55 -08:00
Cheng Zhao
b0a414ea83 Upgrade brightray 2014-12-12 14:50:39 -08:00
Cheng Zhao
099eb53d3c Upgrade libchromiumcontent to fix generating node.lib 2014-12-12 10:40:42 -08:00
Cheng Zhao
e3ccb18696 win: Fix calculating window bounds on high DPI display 2014-12-12 09:04:43 -08:00
Cheng Zhao
e38614ce31 win: No longer support building with VS Express
The Community edition can provide everything we need for Professional
edition.
2014-12-11 19:47:15 -08:00
Cheng Zhao
290dd4ccd8 win: Use d3dcompiler_46.dll 2014-12-11 19:46:42 -08:00
Cheng Zhao
1bebf1cc2c win: Fix generating location.pak. 2014-12-11 19:29:36 -08:00
Cheng Zhao
d8d9dea792 Upgrade node to fix failed call to LoadLibrary 2014-12-11 18:33:39 -08:00
Cheng Zhao
7457f81283 mac: Fix installing view on frameless window
Closes #601.
2014-12-11 14:25:51 -08:00
Cheng Zhao
158d8efb8e Merge pull request #910 from sonnyp/patch-1
Update tray.md
2014-12-11 13:08:23 -08:00
Cheng Zhao
0b668b8e17 Minor fixes on <webview> 2014-12-11 09:30:55 -08:00
Sonny Piers
5437470b4e Update tray.md
checked seems to be the correct property
2014-12-11 12:28:01 +01:00
Cheng Zhao
409f2b4d0f win: Fix compilation errors 2014-12-10 14:17:07 -08:00
Cheng Zhao
64edede20d Move handling of "preload" to web-view-attributes 2014-12-10 11:05:51 -08:00
Cheng Zhao
6624fd9a1b Fix relative links in "src" of <webview> 2014-12-10 10:51:34 -08:00
Cheng Zhao
1cdbb6f186 Upgrade brightray to fix running on Mac 2014-12-09 22:40:26 -08:00
Cheng Zhao
f57533fa0e Add os_bsd variable for breakpad 2014-12-09 17:25:45 -08:00
Cheng Zhao
2db7c84cbc spec: Remove "restore" event test
It is too slow and unstable.
2014-12-09 17:16:21 -08:00
Cheng Zhao
cefc846e9e linux: Upgrade breakpad to fix building 2014-12-09 17:05:18 -08:00
Cheng Zhao
1853bef39a views: SizeConstraintsChanged has become required 2014-12-09 16:55:01 -08:00
Cheng Zhao
22c4911b58 linux: GTK+ status icon has come back 2014-12-09 16:55:01 -08:00
Cheng Zhao
e58b3ddc86 Bump Chrome version 2014-12-09 16:37:40 -08:00
Cheng Zhao
e3ba17f2d3 linux: Disable warnings for g_settings_list_schemas 2014-12-09 16:37:05 -08:00
Cheng Zhao
7d1830d014 Upgrade node to bump node module version 2014-12-09 15:49:17 -08:00
Cheng Zhao
da3a988c8c Merge branch 'master' into chrome39
Conflicts:
	vendor/brightray
2014-12-09 15:49:06 -08:00
Cheng Zhao
9d23cce2b6 Move "nodeintegration" and "plugins" to web-view-attributes 2014-12-09 14:51:35 -08:00
Cheng Zhao
68381e1b76 Use element instant id for GetGuestByInstanceID 2014-12-09 14:38:43 -08:00
Cheng Zhao
3493d2c701 Merge pull request #901 from IgorKlopov/patch-1
Full verbosity, helps troubleshooting
2014-12-08 21:45:55 -08:00
Cheng Zhao
9e1d3f9e27 Merge pull request #902 from IgorKlopov/patch-2
Why not verbose?
2014-12-08 21:44:00 -08:00
Cheng Zhao
7fdd94520e Merge pull request #898 from paulcbetts/dont-hardcode-atom-helper
Dont hardcode paths to Atom [Helper / Framework]
2014-12-08 21:39:14 -08:00
Cheng Zhao
9fcb6b2cd1 Moved parseSrcAttribute() into the SrcAttribute object as parse()
Imported from:
3bc15760f9%5E%21/
2014-12-08 21:35:10 -08:00
Cheng Zhao
cbafac774e Various webview cleanup
Imported from:
848f1ed048%5E%21/
2014-12-08 21:15:18 -08:00
Cheng Zhao
7f5fb4e6f9 Renamed "WebView" -> "WebViewImpl" in web_view.js and other files that import it
Imported from:
a615ea0839%5E%21/
2014-12-08 21:10:59 -08:00
Cheng Zhao
ac51207860 Optimized the handling of webview attribute mutation
Imported from:
86dff6fc51%5E%21/
2014-12-08 21:06:23 -08:00
Paul Betts
aa3be09ab0 Bump submodule to merged version 2014-12-08 20:26:09 -08:00
Cheng Zhao
4348143fd9 Simplify web-view.coffee
Imported from:
3ef1fc1b72%5E%21/
2014-12-08 17:15:50 -08:00
Cheng Zhao
b6b8b936f2 Automated the definitions of webview attributes as properties on the webview node
Imported from:
aef58f49f6%5E%21/
2014-12-08 17:05:57 -08:00
Cheng Zhao
2c27b953b5 Got rid of the internal copies of webview attributes
Imported from:
abb035a09b%5E%21/
2014-12-08 16:56:14 -08:00
Cheng Zhao
d7eae69587 Webview attributes overhaul
Imported from:
884a5b43cb
2014-12-08 16:14:12 -08:00
Cheng Zhao
e0f1433c12 Moved constants out of web-view.coffee and into a new file
Imported from:
ccbfe27c8d
2014-12-08 13:37:18 -08:00
IgorKlopov
27710cd4f7 bootstrap.py -v in mac 2014-12-08 20:07:29 +03:00
IgorKlopov
4d5bbbc2d7 bootstrap.py -v 2014-12-08 20:07:00 +03:00
IgorKlopov
da900b3094 bootstrap.py also imports it 2014-12-08 20:03:48 +03:00
IgorKlopov
0f29d9f30f verbose_mode from config.py
Also, no return value supposed for execute_stdout
2014-12-08 20:02:08 +03:00
IgorKlopov
b88824a70c verbose_mode getter/setter 2014-12-08 20:00:35 +03:00
Cheng Zhao
882a08f61a Fix browser plugin API changes 2014-12-08 09:00:00 -08:00
Cheng Zhao
a9072049ea Move webview code to atom/renderer/lib/web-view 2014-12-08 06:08:21 -08:00
Paul Betts
e87876671f Add some documentation about renaming Atom Shell 2014-12-07 21:38:29 -08:00
Paul Betts
d0f6c89e77 Bump brightray to pick up brightray/brightray#85 2014-12-07 21:26:19 -08:00
Paul Betts
8eab230fe1 Delete OverrideChildProcessPath and OverrideFrameworkBundlePath altogether 2014-12-07 21:06:47 -08:00
IgorKlopov
7ff95ec255 Travis CI says: execute unused
Removed `execute` import
2014-12-08 03:04:41 +03:00
IgorKlopov
20afd51a9d Travis CI says long line detected
Foldede the line
2014-12-08 02:58:04 +03:00
IgorKlopov
19bba5c18c One more verbose_mode
`bootstrap.py` new variable `verbose_mode` to run `npm install` with --verbose option
2014-12-08 02:52:13 +03:00
IgorKlopov
bf4c219766 Make use of execute_stdout
execute_stdout makes stdout real-time
2014-12-08 02:47:05 +03:00
IgorKlopov
a5e1d8c97f introduce execute_stdout
`execute_stdout` does not return the output of the process. Instead it outputs directly to current stdout (in real-time - to see what is `npm` doing now)
2014-12-08 02:42:55 +03:00
Cheng Zhao
7bc364a374 Upgrade node for new V8 API 2014-12-07 13:09:50 -08:00
Cheng Zhao
5dd73e74cb Disable crash reporter spec on Yosemite 2014-12-07 08:57:55 -08:00
Cheng Zhao
ba347f6460 mac: Fix crash reporting on Yosemite 2014-12-07 08:56:59 -08:00
Cheng Zhao
85cf8f9174 apm@0.112.0 2014-12-07 08:13:42 -08:00
IgorKlopov
2153e018a3 Bootstrap indeed 2014-12-07 18:47:23 +03:00
IgorKlopov
3f4fec0864 Why not verbose?
The silence are scary
2014-12-07 18:46:12 +03:00
Cheng Zhao
10823eeeaa Fix compilation errors caused by Chrome 39 2014-12-07 07:43:26 -08:00
Cheng Zhao
25ea169c72 Upgrade libchromiumcontent to 39.0.2171.65 2014-12-07 07:43:07 -08:00
IgorKlopov
743e8331b5 Helps troubleshooting 2014-12-07 18:42:59 +03:00
Cheng Zhao
d309fd5a27 Update printing code 2014-12-07 06:55:40 -08:00
Paul Betts
091357ad8e Find the MainMenu nib correctly 2014-12-05 23:19:19 -08:00
Paul Betts
3d4491a468 Determine the Helper name from the App name 2014-12-05 23:19:19 -08:00
Cheng Zhao
6d32db32ef Upgrade node, fixes #843 2014-12-04 12:17:36 -08:00
Cheng Zhao
357f5f9781 Upgrade brightray 2014-12-04 11:45:02 -08:00
Cheng Zhao
a0f5544a07 Fix compilation warning on Yosemite 2014-12-03 15:21:50 -08:00
Cheng Zhao
6c9dbe190d Bump v0.19.5 2014-11-28 20:01:42 +08:00
Cheng Zhao
29b8cd8df7 Merge pull request #872 from atom/tray-balloon
Add Tray.displayBalloon API on Windows
2014-11-28 20:01:08 +08:00
Cheng Zhao
f78f94d4f1 Fix building on Mac 2014-11-28 19:50:10 +08:00
Cheng Zhao
ef8b20af65 docs: "balloon-show" and "balloon-closed" events 2014-11-28 19:47:21 +08:00
Cheng Zhao
9f99209733 win: Add "balloon-show" and "balloon-closed" events 2014-11-28 19:42:57 +08:00
Cheng Zhao
ee3fa67c48 docs: Tray balloon 2014-11-28 19:23:13 +08:00
Cheng Zhao
a3327ac53e win: Remove XP code in Tray 2014-11-28 18:59:51 +08:00
Cheng Zhao
210c97f957 win: Add "balloon-clicked" event for Tray 2014-11-28 18:50:31 +08:00
Cheng Zhao
8097cb2b9e Add Tray.displayBallon API 2014-11-28 18:39:30 +08:00
Cheng Zhao
2650e34867 win: Add NotifyIcon::DisplayBalloon 2014-11-28 18:30:43 +08:00
Cheng Zhao
9f0b5a14a4 Remove tray_icon_win.h 2014-11-28 18:21:31 +08:00
Cheng Zhao
a8b4e5faec OVERRIDE => override in notify_icon.h 2014-11-28 18:20:38 +08:00
Cheng Zhao
f6c66a7374 Add Tray.destroy() API, fixes #871 2014-11-28 18:06:51 +08:00
Cheng Zhao
86cf5e0028 OVERRIDE => override in atom_api_tray.h 2014-11-28 17:54:38 +08:00
Cheng Zhao
89de5b6e9a win: Remove NotifyIconHostStateChanger
We don't need the ability it provided, and it is causing crashes on some
machines.

Fixes #850.
2014-11-28 17:47:47 +08:00
Cheng Zhao
ff26c3c16f Some coding style fixes 2014-11-28 15:59:03 +08:00
Cheng Zhao
8a736abac7 Merge pull request #870 from joaomoreno/popup
Allow positioning the context menu
2014-11-28 12:42:49 +08:00
Cheng Zhao
0397b282c0 Merge pull request #867 from IgorKlopov/patch-2
`subprocess.Popen` fails when Python is in "App Paths"
2014-11-28 11:47:57 +08:00
Cheng Zhao
d50a2b810d Merge pull request #866 from bwin/fix-typo
fix typo in variable name
2014-11-28 11:36:02 +08:00
Cheng Zhao
c5de8ea7bf Merge pull request #864 from IgorKlopov/patch-1
Lookup node in PATHs
2014-11-28 11:34:02 +08:00
Joao Moreno
c06e844ef4 fix build 2014-11-26 15:28:03 +01:00
Joao Moreno
c6a16161d9 Update documentation for Menu.popup() 2014-11-26 15:15:55 +01:00
Joao Moreno
46e6b5ec3e Allow positioning the context menu 2014-11-26 13:54:05 +01:00
IgorKlopov
0fd1f61a24 Paul suggests paths to be reversed 2014-11-26 01:43:30 +03:00
IgorKlopov
d8de9754d6 subprocess.Popen fails when Python is in "App Paths"
Win32. Python is not added to PATHs by default. Instead it is added to `App Paths` registry key ( http://msdn.microsoft.com/en-us/library/windows/desktop/ee872121(v=vs.85).aspx ). In both cases Python binary is found when i enter `python` command. But `subprocess.Popen` seems to fail when BOTH (1) runs a string `python tools/atom_source_root.py` AND (2) python is not in PATHs, only in App Paths. I suggest using list in <!( and hope this does not break linux/macos builds.
2014-11-25 14:16:17 -08:00
IgorKlopov
b00bbdeb81 Preserve that empty line 2014-11-25 13:54:02 -08:00
IgorKlopov
0ab4475f24 Compose full list in one place 2014-11-25 13:53:08 -08:00
IgorKlopov
5137e16485 WINDOWS_NODE_PATHs are to stay
WINDOWS_NODE_PATHs are checked first, and then os.environ['PATH']
2014-11-25 13:46:09 -08:00
Benjamin Winkler
bf85e61dc2 fix typo in variable name
This is just for the looks. No errors where throws, because the variable
name was misspelled in all occurences.
2014-11-25 20:57:55 +01:00
IgorKlopov
91a3e12ab0 Paul says lookup PATH
Works both with trailing slash `c:\nodejs\` and without it `c:\nodejs`
2014-11-25 11:41:11 -08:00
IgorKlopov
6aa6bdebe6 Travis says line too long
80 chars limit hit
2014-11-25 10:58:13 -08:00
IgorKlopov
1af0e0a762 Verbose required paths
I installed to `c:\nodejs` to avoid spaces in path (old habits die hard). So i had an obstacle you see.
2014-11-25 10:27:31 -08:00
Cheng Zhao
03f19bea6b Upgrade brightray for #849 2014-11-25 21:24:40 +08:00
Cheng Zhao
85a3e06718 Merge pull request #860 from rprichard/master
Move Linux pkg-config dependencies from atom-shell to brightray.
2014-11-25 21:23:49 +08:00
Cheng Zhao
8278d8b51a Merge pull request #862 from atom/window-state-events
Add window states events for BrowserWindow
2014-11-25 15:41:10 +08:00
Cheng Zhao
c19abed4fa spec: Don't test window state events in CI on Linux 2014-11-25 15:17:48 +08:00
Cheng Zhao
cef5f06ceb spec: Make timeout longer for window state tests 2014-11-25 15:06:57 +08:00
Cheng Zhao
a666014990 spec: Window state events 2014-11-25 14:52:49 +08:00
Cheng Zhao
5a8678b191 docs: Window state events 2014-11-25 14:43:11 +08:00
Cheng Zhao
271eb63083 SetFullscreen => SetFullScreen 2014-11-25 14:34:14 +08:00
Cheng Zhao
28ca883805 win: Implement window state events 2014-11-25 14:28:34 +08:00
Cheng Zhao
3c7e5e47b8 mac: Implement window state events 2014-11-25 13:16:51 +08:00
Cheng Zhao
588cc3c7ab Make WindowStateWatcher X11 only
On Windows we need to take another way of detecting window state events.
2014-11-25 13:05:04 +08:00
Cheng Zhao
b77e6c369a x11: Implement window state events 2014-11-25 12:43:25 +08:00
Cheng Zhao
06cc27c6b3 views: Add WindowStateWatcher 2014-11-25 11:46:30 +08:00
Ryan Prichard
73ee24bd98 Move Linux pkg-config dependencies from atom-shell to brightray. 2014-11-24 03:27:24 -08:00
Cheng Zhao
84fcfd1fac Merge pull request #858 from atom/wm-class
Use app's name for WM_CLASS
2014-11-24 16:12:07 +08:00
Cheng Zhao
cd5007cfa1 linux: Set WM_CLASS for devtools window 2014-11-24 16:04:41 +08:00
Cheng Zhao
172c55d194 linux: Use app's name for WM_CLASS 2014-11-24 15:51:26 +08:00
Cheng Zhao
60bd20872c linux: Set WM_WINDOW_ROLE correctly
WM_WINDOW_ROLE is used to specify the "role" of the window, and all
browser windows in atom-shell should have the same role.
2014-11-24 15:23:02 +08:00
Cheng Zhao
b2aaffa921 Upgrade node, fixes #843 2014-11-24 14:46:36 +08:00
Cheng Zhao
438d7ada49 Merge pull request #855 from paulcbetts/fix-webview-typo
Fix typo in method
2014-11-24 14:05:03 +08:00
Cheng Zhao
a9b1b567fb Fix capturePage API, closes #847 2014-11-24 13:44:45 +08:00
Paul Betts
2f530f7049 Downcast variable to appease clang 2014-11-23 13:52:59 -08:00
Paul Betts
dfcad75a27 Fix typo in method 2014-11-22 21:26:09 -08:00
Cheng Zhao
a0034521da Bump v0.19.4 2014-11-21 16:51:11 +08:00
Cheng Zhao
e4d9dbcfa2 Do not use no_overwrite mode.
Sometimes it would prevent uploading even when the file doesn't exist in
S3.
2014-11-21 16:41:16 +08:00
Cheng Zhao
ac914e1f19 OVERRODE => override in atom_main_delegate.h 2014-11-21 16:40:47 +08:00
Cheng Zhao
bed09839d5 Remove debugging print, closes #841 2014-11-21 16:39:16 +08:00
Cheng Zhao
8951572366 win: Fix crash when calling app.setName 2014-11-21 16:38:54 +08:00
Cheng Zhao
8a73d91ea1 Bump v0.19.3 2014-11-20 11:09:05 +08:00
Cheng Zhao
879de42372 Merge pull request #831 from atom/taskbar-extension
Add API for Windows jump list and Mac application dock menu
2014-11-18 11:39:30 +08:00
Cheng Zhao
32b8366d30 docs: Represented file of window 2014-11-18 11:27:08 +08:00
Cheng Zhao
95662d4233 docs: Progress bar in taskbar 2014-11-18 10:54:08 +08:00
Cheng Zhao
2f36216cb0 docs: Some tunes on desktop-environment-integration.md 2014-11-18 10:16:52 +08:00
Cheng Zhao
2513358eb5 docs: Add notes on Unity launcher 2014-11-17 22:00:56 +08:00
Cheng Zhao
21fa395b61 docs: Add "Desktop environment integration" 2014-11-17 21:40:07 +08:00
Cheng Zhao
afde383e28 docs: app.setUserTasks 2014-11-17 19:50:34 +08:00
Cheng Zhao
ee9964c141 AddUserTasks => setUserTasks 2014-11-17 19:32:11 +08:00
Cheng Zhao
bf66aeb8ee docs: Recent documents API 2014-11-17 19:02:37 +08:00
Cheng Zhao
f706bb45cb docs: app.dock.setMenu 2014-11-17 18:48:02 +08:00
Cheng Zhao
0b1b0940d2 Enable setting icon for addUserTasks 2014-11-17 17:35:51 +08:00
Cheng Zhao
0db2769781 Only "title" and "program" are required for AddUserTasks 2014-11-17 17:26:44 +08:00
Cheng Zhao
47c18fef7f win: Add app.addUserTasks API 2014-11-17 17:19:41 +08:00
Cheng Zhao
48412769df win: Add app.clearRecentDocuments API 2014-11-17 16:13:47 +08:00
Cheng Zhao
528f7bd45f win: Set app user model ID
This ID is used by Windows to identify your application.
2014-11-17 15:55:49 +08:00
Cheng Zhao
78322b5231 win: Implement Browser::AddRecentDocument 2014-11-17 15:53:18 +08:00
Cheng Zhao
c23ba7b504 mac: Add app.addRecentDocument API 2014-11-17 13:05:06 +08:00
Cheng Zhao
6aa69a06c8 mac: Release application delegate on exit 2014-11-17 09:52:24 +08:00
Cheng Zhao
0e94977d42 Add app.dock.setMenu API 2014-11-16 23:04:31 +08:00
Cheng Zhao
ba4f502b1e OVERRIDE => override in atom_api_app.h 2014-11-16 22:45:29 +08:00
Cheng Zhao
651dabf47e Fix displaying context menu for devtools 2014-11-16 22:34:29 +08:00
Cheng Zhao
af72842728 cocoa: Enable creating empty menu 2014-11-16 21:06:16 +08:00
Cheng Zhao
49ac363eef cocoa: Enable modifying initialized menu 2014-11-16 20:24:29 +08:00
Cheng Zhao
66bbf00b7a OVERRIDE => override in browser.h 2014-11-16 19:47:04 +08:00
Cheng Zhao
0398316192 views: Fix "visible" not working in menu bar, closes #825 2014-11-16 16:01:33 +08:00
Cheng Zhao
b428b2eb99 OVERRIDE => override in atom/browser/ui/views 2014-11-16 15:54:40 +08:00
Cheng Zhao
ab6cb042f6 OVERRIDE => override in atom_api_menu.h 2014-11-16 10:45:53 +08:00
Cheng Zhao
9c8b3e3c2e No . in commit message 2014-11-15 20:37:52 +08:00
Cheng Zhao
b27abd2011 Bump v0.19.2. 2014-11-15 15:18:01 +08:00
Cheng Zhao
bf1a4e12f1 Merge pull request #830 from paulcbetts/windows-build-instructions
Windows build instructions
2014-11-15 15:15:59 +08:00
Cheng Zhao
20acead8be apm@0.111.0 2014-11-15 11:25:50 +08:00
Paul Betts
d07482c5f6 Add a paragraph about modern.ie 2014-11-14 19:21:12 -08:00
Paul Betts
26ac34d0e0 Come Correct with 80-char wrapping 2014-11-14 19:21:04 -08:00
Cheng Zhao
b7816d85a1 Upgrade to Chrome 38.0.2125.122 2014-11-15 11:20:47 +08:00
Paul Betts
c99b20206c Misc copy fixups 2014-11-14 19:15:11 -08:00
Paul Betts
d97155d7b0 Point people towards VS2013 Community Edition 2014-11-14 19:14:27 -08:00
Paul Betts
10af87008d Remove Cygwin suggestion 2014-11-14 19:14:10 -08:00
Paul Betts
ed633b3250 Powershell'ify everything 2014-11-14 19:13:40 -08:00
Cheng Zhao
e0fddcb7ce Merge pull request #826 from statico/patch-1
Update Windows build instructions
2014-11-15 10:52:12 +08:00
Cheng Zhao
aa55e397d4 linux: Install libgconf2-dev in CI 2014-11-15 10:37:27 +08:00
Cheng Zhao
7943f7f7eb linux: Link necessary libraries
This fixes linking problem on some systems, see #500.
2014-11-15 10:16:48 +08:00
Cheng Zhao
869e086a41 Revert "Upgrade node for #811"
This reverts commit a96618e5cd.
2014-11-14 20:50:19 +08:00
Cheng Zhao
a96618e5cd Upgrade node for #811 2014-11-14 17:17:42 +08:00
Cheng Zhao
02b2459db6 Add <webview>.getId, fixes #818 2014-11-14 16:34:14 +08:00
Ian Langworth ☠
bef6909218 Update Windows build instructions
I encountered a few problems when trying to build atom-shell under Windows.
2014-11-13 19:11:56 -08:00
Cheng Zhao
1ade8dcee7 Merge pull request #823 from frankhale/win-file-dialog-default-path
win: Fix default path for native dialogs
2014-11-14 09:55:20 +08:00
Frank Hale
e1e1c173fe win: Fix default path for native dialogs 2014-11-13 14:33:25 -05:00
Cheng Zhao
5ee805e451 Merge pull request #817 from atom/menubar-dynamic-api
Add APIs to show/hide menu bar dynamically
2014-11-12 21:02:13 +08:00
Cheng Zhao
f2b91d5e1d docs: Menu bar APIs 2014-11-12 20:49:38 +08:00
Cheng Zhao
1cd3918494 views: Implement menubar APIs 2014-11-12 20:32:14 +08:00
Cheng Zhao
cb8f975528 Add JS menubar APIs 2014-11-12 20:31:55 +08:00
Cheng Zhao
42afc071eb OVERRIDE => override in native_window_views.h 2014-11-12 20:08:51 +08:00
Cheng Zhao
79d4724a15 Add a bunch of menu bar related APIs 2014-11-12 17:36:20 +08:00
Cheng Zhao
e699cac92c Merge pull request #816 from atom/browser-window-preload
Add "preload" option for BrowserWindow
2014-11-12 16:03:08 +08:00
Cheng Zhao
a3d2a490da docs: "preload" option of BrowserWindow 2014-11-12 15:51:48 +08:00
Cheng Zhao
58795eaa7e spec: "preload" option of BrowserWindow 2014-11-12 15:38:50 +08:00
Cheng Zhao
9f29f66768 Add "preload" option for BrowserWindow 2014-11-12 15:04:03 +08:00
Cheng Zhao
14d01544d4 Tidy code in CreateNonClientFrameView 2014-11-12 14:33:30 +08:00
Cheng Zhao
cf7cf098d8 Merge pull request #815 from frankhale/force-native-window
Force native window
2014-11-12 14:24:13 +08:00
Frank Hale
e9636bb87b Fix CPP formatting 2014-11-12 01:11:25 -05:00
Cheng Zhao
c82f5c8da8 Merge pull request #814 from atom/original-fs
Add original-fs module
2014-11-12 14:08:03 +08:00
Frank Hale
246a145930 Fix merge conflict with native_window_views.cc 2014-11-12 01:04:51 -05:00
Frank Hale
c9371bceec Force native window
- Force native frame and suppress the Chromium default blue frame. This
resolves issues with Windows systems that are running in VM's and cannot
enable Aero Glass. Atom-Shell was adding the default Chromium blue frame
even when frame was set to false in the BrowserWindow options.
2014-11-12 00:45:21 -05:00
Cheng Zhao
bd1f0e78a8 docs: original-fs module 2014-11-12 11:58:03 +08:00
Cheng Zhao
90c24de0f0 spec: original-fs module 2014-11-12 11:31:31 +08:00
Cheng Zhao
5cb97545fd Add original-fs module 2014-11-12 11:09:59 +08:00
Cheng Zhao
db8361a0a9 spec: "httpreferrer" attribute of <webview> 2014-11-12 10:39:28 +08:00
Cheng Zhao
57bfc63d23 docs: "httpreferrer" attribute of <webview> 2014-11-12 10:34:54 +08:00
Cheng Zhao
fbd74c0e2d Various fixes of #801 2014-11-12 10:28:50 +08:00
Cheng Zhao
993c52dcd5 Merge pull request #801 from frankhale/http-referrer
Add http referrer to LoadUrl and Webview
2014-11-12 10:10:24 +08:00
Cheng Zhao
f5a8ec0cd3 Merge pull request #800 from frankhale/windows-min-max-animation
Fix Windows min/max animation on frameless windows
2014-11-12 09:59:53 +08:00
Frank Hale
747698fe9b Fix code style formatting
- Fix code style formatting to be <= 80 lines
- Add default parameter for urlOptions to loadUrl, reload and
reloadIgnoringCache functions to be compatible with old API.
2014-11-11 13:33:15 -05:00
Frank Hale
e0dae4054a Fix code style to be <= 80 lines 2014-11-11 13:09:54 -05:00
Frank Hale
070d26e68e Merge branch 'master' into windows-min-max-animation 2014-11-11 13:08:27 -05:00
Frank Hale
e6830e9ac8 Merge branch 'master' into http-referrer 2014-11-11 11:47:35 -05:00
Cheng Zhao
aba3b721c5 Merge pull request #810 from atom/report-back-crash-id
WIP: Add API to get last crash report ID
2014-11-11 20:23:53 +08:00
Cheng Zhao
62fd76f7e4 docs: crashRepoter.getLastCrashReport 2014-11-11 20:20:36 +08:00
Cheng Zhao
66e96f69fc Add crashRepoter.getLastCrashReport API 2014-11-11 17:30:01 +08:00
Cheng Zhao
9a825c5cbd win: Writes uploads.log 2014-11-11 16:38:16 +08:00
Cheng Zhao
02bcdc1c19 linux: Put "uploads.log" under "/tmp/ProductName Crashes/" 2014-11-11 13:30:06 +08:00
Cheng Zhao
f13d8407ee linux: Put crash dumps under "/tmp/ProductName Crashes/" 2014-11-11 13:03:47 +08:00
Cheng Zhao
739c432c98 linux: Writes crash report upload log 2014-11-11 12:24:33 +08:00
Cheng Zhao
94084639f2 Merge pull request #806 from atom/symbols-server
Upload PDB to S3 when publishing and add docs on setting up symbol server
2014-11-11 09:28:39 +08:00
Cheng Zhao
e6f748d77f Merge pull request #807 from paulcbetts/patch-1
Ports are limited to 64k
2014-11-11 09:17:36 +08:00
Paul Betts
212cd67f08 Ports are limited to 64k 2014-11-10 11:53:12 -08:00
Cheng Zhao
90480fff4e Fix pylint warnings 2014-11-10 23:33:56 +08:00
Cheng Zhao
4a1b6d76b2 docs: Update symbol server address 2014-11-10 23:24:13 +08:00
Cheng Zhao
6d663d1d01 Use lowercase for symbol paths 2014-11-10 23:07:57 +08:00
Cheng Zhao
e5e94ed437 Add execution bit 2014-11-10 23:02:54 +08:00
Cheng Zhao
621867e518 docs: Setting up symbol server in debugger 2014-11-10 16:09:13 +08:00
Cheng Zhao
716037544a views: Fix showing menu bar when pressing Alt for a long time 2014-11-07 21:59:26 -05:00
Cheng Zhao
b92d5071fa views: Make auto-hide-menu-bar work when NumLock is on, fixes #796 2014-11-07 21:59:26 -05:00
Frank Hale
ef255db069 Making Http Referrer addition better!
- Code cleanup
2014-11-07 21:54:36 -05:00
Frank Hale
24f8c51959 Make sure frame is frameless 2014-11-07 13:34:52 -05:00
Frank Hale
4b20ac3dc6 Fix Windows min/max animation on frameless windows
- Frameless windows disappeared or appears when minimized and maximized
on Windows. This commit fixes that.
2014-11-07 13:13:12 -05:00
Cheng Zhao
34521e5880 Upload PDBs to Windows symbol server when publishing 2014-11-07 22:52:00 +08:00
Cheng Zhao
45fb3ec41d Don't overwrite files on S3 2014-11-07 21:45:40 +08:00
Cheng Zhao
caa0634df8 Upload symbols to S3 2014-11-07 20:51:25 +08:00
Cheng Zhao
15a05b3639 Add script to call symstore 2014-11-07 20:23:13 +08:00
Cheng Zhao
edcae49e52 views: Fix showing menu bar when pressing Alt for a long time 2014-11-07 15:20:16 +08:00
Cheng Zhao
81283db2da views: Make auto-hide-menu-bar work when NumLock is on, fixes #796 2014-11-07 15:05:55 +08:00
Frank Hale
f56d1ea7b4 Add support for setting http referrer
- Add url option to specify the http referrer
- Add httpReferrer attribute to webview

NOTE: This is still not complete. Some love has to be done to
guest-view-manager.coffee and very likely the function calls called
createGuest and to the code that uses them.
2014-11-06 14:29:41 -05:00
Cheng Zhao
fea5559fbc Upgrade node, fixes #634 2014-11-06 21:27:16 +08:00
Cheng Zhao
b360122b35 Add spec for #634 2014-11-06 21:26:54 +08:00
Cheng Zhao
185d3a7c02 Upgrade brightray for #646 2014-11-06 19:09:10 +08:00
Cheng Zhao
f90fb8cc72 Print error when "preload" script is not found 2014-11-06 16:12:40 +08:00
Cheng Zhao
111dcbac25 Merge pull request #794 from atom/webivew-preload
Add "preload" attribute for <webview>
2014-11-06 16:04:36 +08:00
Cheng Zhao
e28bdcdd46 docs: "preload" attribute of <webview> 2014-11-06 15:51:33 +08:00
Cheng Zhao
395b0c4224 spec: "preload" attribute of <webview> 2014-11-06 15:23:42 +08:00
Cheng Zhao
217b1afe87 Load the "preload" script in <webview> 2014-11-06 15:13:37 +08:00
Cheng Zhao
8d8bfcd120 Pass "preload" attribute to GuestViewManager 2014-11-06 14:35:32 +08:00
Cheng Zhao
2637cafda5 Merge pull request #791 from brentertz/online-offline-events-tutorial
Online/offline event detection tutorial
2014-11-06 14:02:42 +08:00
Cheng Zhao
c764b7b023 docs: Mention the side effect of "fullscreen" option, fixes #792 2014-11-06 10:16:28 +08:00
Brent Ertz
522ae765ea Updates per PR feedback
* Use backticks instead of quotes around code object
* Remove path.join usage
* Dasherize event names
2014-11-05 11:21:18 -07:00
Brent Ertz
9cf3811a56 Add tutorial on online/offline event detection 2014-11-05 07:49:50 -07:00
Cheng Zhao
6d2cc8aedf Merge pull request #790 from atom/error-box
Fix crash when showing error dialog before GUI environment is initialized
2014-11-05 20:25:04 +08:00
Cheng Zhao
058046304d Forbid using dialog module before app is ready 2014-11-05 19:50:24 +08:00
Cheng Zhao
7ff0e0214e linux: Use GTK+ for error reporting when GUI is ready 2014-11-05 19:27:43 +08:00
Cheng Zhao
2be5393768 Don't print error to console in default_app 2014-11-05 19:08:09 +08:00
Cheng Zhao
b54caccb22 linux: Print error to console when GUI is not ready 2014-11-05 19:08:00 +08:00
Cheng Zhao
c499dfbb22 mac: Implement dialog.showErrorBox 2014-11-05 17:27:04 +08:00
Cheng Zhao
f6ba308ff8 Use dialog.showErrorBox for showing errors 2014-11-05 16:05:29 +08:00
Cheng Zhao
10e195a444 win: Implement dialog.showErrorBox 2014-11-05 16:05:11 +08:00
Cheng Zhao
490a12d38a Add dialog.showErrorBox API 2014-11-05 16:04:39 +08:00
Cheng Zhao
e004d53d2a Merge pull request #787 from atom/webview-plugins
Add "plugins" attribute for <webview>
2014-11-05 15:18:19 +08:00
Cheng Zhao
4788323582 docs: "plugins" attribute of <webview> 2014-11-05 15:02:37 +08:00
Cheng Zhao
80d574482e Add "plugins" attribute for <webview> 2014-11-05 14:59:28 +08:00
Cheng Zhao
d1724ad733 Bump v0.19.1. 2014-11-04 19:19:31 +08:00
Cheng Zhao
1fbe05b2d5 Merge pull request #779 from atom/new-window-disposition
Emit "new-window" event for dispositions other than current tab
2014-11-04 18:59:58 +08:00
Cheng Zhao
c5212b36f7 External links should have "foreground-tab" disposition 2014-11-04 18:49:57 +08:00
Cheng Zhao
033212841d docs: Document the disposition parameter 2014-11-04 18:37:06 +08:00
Cheng Zhao
22c5720aa2 Window opened by window.open should have "default" disposition 2014-11-04 18:31:47 +08:00
Cheng Zhao
f29c7164f3 Translate |disposition| to string 2014-11-04 18:12:57 +08:00
Cheng Zhao
013593ccf8 Emit "new-window" event for dispositions other than CURRENT_TAB 2014-11-04 17:59:15 +08:00
Cheng Zhao
77724345c4 Upgrade brightray, fixes #769 2014-11-04 10:01:17 +08:00
Cheng Zhao
4c12a4369d Fixes Event.prevenDefault() not working, closes #771 2014-11-03 23:24:20 +08:00
Cheng Zhao
a3a21b5b88 Merge pull request #778 from atom/project-infinium-webview-devtools
devtools for webview tags (continue work of #774)
2014-11-03 23:10:09 +08:00
Cheng Zhao
48d54e8d3a Fix JavaScript errors in webview 2014-11-03 22:18:03 +08:00
Cheng Zhao
4ebe58df57 Also add closeDevTools and isDevToolsOpened for webview 2014-11-03 22:12:56 +08:00
Cheng Zhao
accd08a2bf Show devtools for guest page in undocked mode 2014-11-03 21:48:25 +08:00
Cheng Zhao
1731d609b7 Fix double freeing WebContents 2014-11-03 19:45:09 +08:00
Cheng Zhao
cf9f249f07 Merge branch 'webview-devtools' of https://github.com/project-infinium/atom-shell into project-infinium-webview-devtools 2014-11-03 18:42:18 +08:00
Cheng Zhao
92cfd96933 Merge pull request #777 from atom/web-dialog
Implement file dialog and color chooser for <input> tag
2014-11-03 17:47:08 +08:00
gray
6c3f065147 force devtools to show as undocked. 2014-11-02 11:32:06 -08:00
gray
45f4a25ac9 fix for cpplint 2014-11-02 07:32:33 -08:00
gray
f43c227806 update and document openDevTools on web view. 2014-11-02 07:20:10 -08:00
Kevin Sawicki
490efe69f4 📝 a -> an 2014-11-02 07:20:00 -08:00
gray
368d23ef5b add open devtools api to webview tag 2014-11-02 06:34:22 -08:00
Cheng Zhao
5e99c8f280 Merge pull request #763 from paulcbetts/dont-hardcode-atom-lib
Don't hard-code the atom.lib file
2014-11-01 18:55:49 +08:00
Cheng Zhao
914dce6cc2 win: Add color chooser dialog 2014-11-01 13:44:28 +08:00
Paul Betts
c6697f5f07 Use project_name for the lib file 2014-10-31 11:33:29 -07:00
Kevin Sawicki
b6b6fc3bfd Remove All Rights Reserved after GitHub copyright
Closes #762
2014-10-31 11:17:05 -07:00
Cheng Zhao
de49498102 aura: Add color chooser dialog 2014-10-31 23:06:50 +08:00
Cheng Zhao
14c9a2a087 mac: Add color chooser dialog 2014-10-31 22:53:15 +08:00
Cheng Zhao
a4a390b2cc Upgrade brightray to handle localized string 2014-10-31 19:42:36 +08:00
Cheng Zhao
0f5a058bdd Implement RunFileChooser 2014-10-31 19:27:01 +08:00
Cheng Zhao
7d15aa2321 OVERRIDE => override in atom_browser_client.h 2014-10-31 18:26:01 +08:00
Cheng Zhao
9b1bcf51c6 Implement EnumerateDirectory 2014-10-31 17:37:32 +08:00
Cheng Zhao
b710cc3063 Add WebDialogHelper 2014-10-31 00:37:14 +08:00
Kevin Sawicki
1c91b4888a Merge pull request #754 from Subash/master
Update web-view-tag.md
2014-10-30 09:18:40 -07:00
Subash Pathak
996e2bdc69 Update web-view-tag.md 2014-10-30 20:52:00 +05:45
Cheng Zhao
9ed6ad8165 Forbid using protocol module before app is ready, fixes #661 2014-10-30 22:27:29 +08:00
Cheng Zhao
c0cd8fca80 Upgrade native_mate, fixes #660 2014-10-30 21:55:03 +08:00
Cheng Zhao
25f69df341 Throw error when BrowserWindow is created before app is ready 2014-10-30 21:32:35 +08:00
Cheng Zhao
35e5c2172f Bump v0.19.0. 2014-10-30 12:02:42 +08:00
Cheng Zhao
41b6f682d8 Merge pull request #750 from atom/fix-leaking-webcontents
Handle window.open and <a target="..."> correctly
2014-10-28 19:23:59 +08:00
Cheng Zhao
0c21c863d7 Simplify the GuestWindowManager
Instead of recording guest explicitly in a map, we just make use of
closure for bookkeeping.
2014-10-28 18:51:28 +08:00
Cheng Zhao
c71aa0995a Reuse the window of same frame name 2014-10-28 13:23:25 +08:00
Cheng Zhao
8359c8e194 spec: Only test net.connect on Mac
The Linux travis ci machine is quite unstable on this test.
2014-10-28 10:09:47 +08:00
Kevin Sawicki
209dcd1aca Merge pull request #747 from stefanbuck/patch-1
fix broken links
2014-10-27 14:45:21 -07:00
Stefan Buck
eaa5e136b6 fix broken links 2014-10-27 22:43:29 +01:00
Cheng Zhao
89990ec037 Don't throw exception on closed guest window 2014-10-27 23:59:11 +08:00
Cheng Zhao
cc9ff77dd2 Make <a target="_blank"> open window by default 2014-10-27 23:46:47 +08:00
Cheng Zhao
f44be28309 doc: "new-window" event of WebContents 2014-10-27 23:27:33 +08:00
Cheng Zhao
7f4d00fac0 Add eval() for FakeWindow 2014-10-27 23:07:41 +08:00
Cheng Zhao
bdad1d1753 Add focus() and blur() for FakeWindow 2014-10-27 23:03:05 +08:00
Cheng Zhao
64ce44d341 spec: "new-window" event of BrowserWindow 2014-10-27 22:08:24 +08:00
Cheng Zhao
6f41598962 Use GuestWindowManager to mange windows created by window.open 2014-10-27 21:56:04 +08:00
Cheng Zhao
9c92f2e692 spec: "new-window" event of <webview> 2014-10-27 19:26:45 +08:00
Cheng Zhao
fefeb39757 Add "frameName" as paramter for "new-window" event 2014-10-27 19:14:57 +08:00
Cheng Zhao
389e56ce36 Route window.open to "new-window" event 2014-10-27 18:52:55 +08:00
Cheng Zhao
94818aef26 Set "defaultPrevented" when "preventDefault()" is called 2014-10-27 17:55:28 +08:00
Cheng Zhao
e9b344b200 OVERRIDE => override in atom_api_window.h 2014-10-27 16:58:35 +08:00
Cheng Zhao
fb864a8f23 Prevent creating popup window from inside WebContents 2014-10-27 16:56:28 +08:00
Cheng Zhao
cf4c2d02f3 OVERRIDE => override in native_window.h 2014-10-27 16:47:50 +08:00
Cheng Zhao
b3dc0bc57e Upgrade brightray 2014-10-27 16:47:38 +08:00
Cheng Zhao
0839915538 Merge pull request #740 from atom/webview
Implement <webview> tag
2014-10-26 19:43:52 +08:00
Cheng Zhao
9e32570dfa Merge pull request #742 from patr0nus/yosemite-fix
Yosemite build fix
2014-10-26 19:36:08 +08:00
Cheng Zhao
404e08c0e7 Make remote.getCurrentWindow() work in <webview> 2014-10-26 19:30:53 +08:00
Cheng Zhao
10a8f3c884 Make <webview> work with plugins turned off 2014-10-26 14:05:54 +08:00
Kevin Sawicki
9f8ad36f30 📝 Minor grammar tweaks 2014-10-25 16:03:27 -07:00
Kevin Sawicki
8a4e0a64cf 📝 codes -> code 2014-10-25 16:00:23 -07:00
Cheng Zhao
db071f8d8e Add specs for <webview> 2014-10-25 23:23:49 +08:00
Cheng Zhao
24b4fcea15 Add BIND_DONE event for process object 2014-10-25 23:21:17 +08:00
Cheng Zhao
e110f5c37c Remove unneeded cleanup code 2014-10-25 23:09:45 +08:00
Cheng Zhao
1a93babdbc Fix double freeing guest 2014-10-25 22:01:24 +08:00
Cheng Zhao
22e3b9df44 Add attribute to turn on node integration in <webview> 2014-10-25 20:52:42 +08:00
Cheng Zhao
d596a7427e Node integration option is now only true/false 2014-10-25 19:20:04 +08:00
Cheng Zhao
81170d81b3 Remove iframe related security code 2014-10-25 19:08:21 +08:00
Cheng Zhao
e7825da0f8 Upgrade libchromiumcontent to discard iframe security settings 2014-10-25 18:53:24 +08:00
Cheng Zhao
f629fa7b27 Detect node integration in JavaScript 2014-10-25 18:51:26 +08:00
Cheng Zhao
04f1860bf5 Make autoresize follow Chrome's behavior 2014-10-25 16:04:16 +08:00
Cheng Zhao
69bcc8e831 Add docs on our custom web elements 2014-10-25 14:58:32 +08:00
Cheng Zhao
194ed3884c Add 'new-window' event for <webview> 2014-10-25 13:21:09 +08:00
Cheng Zhao
d8447524cb Allow passing V8 objects in EventEmitter 2014-10-25 11:30:35 +08:00
patr0nus
915a6196cc Remove the deprecated convertScreenToBase and convertBaseToScreen. 2014-10-25 11:06:39 +08:00
patr0nus
623e3ebc03 Fix type convertion errors. 2014-10-25 11:06:10 +08:00
Cheng Zhao
485bd7bbd3 Add 'close' and 'console-message' for <webview> 2014-10-25 10:01:19 +08:00
Cheng Zhao
218d69d288 Dispatch WebContents events to <webview> 2014-10-25 09:05:50 +08:00
Cheng Zhao
d63f44cd07 Add more events for WebContents 2014-10-24 23:05:25 +08:00
Cheng Zhao
2d56067819 Fix creating window in <webview> 2014-10-24 22:14:12 +08:00
Cheng Zhao
a96cde254b Send unhandled key event to embedder 2014-10-24 21:46:47 +08:00
Cheng Zhao
e214ce6bc4 Add WebContents.insertCSS 2014-10-24 21:04:50 +08:00
Cheng Zhao
1f08d50e98 Add WebContents.setUserAgent 2014-10-24 20:57:44 +08:00
Cheng Zhao
07a8a50861 Bind WebContents APIs to <webview> 2014-10-24 20:49:51 +08:00
Cheng Zhao
46ed83a057 Assign a new SiteInstance for guest 2014-10-24 20:20:56 +08:00
Cheng Zhao
e95c1256a0 Add remote.getGuestWebContents 2014-10-24 19:57:29 +08:00
Cheng Zhao
c0955eaa90 Don't expose <webview> in guest 2014-10-24 19:18:58 +08:00
Cheng Zhao
58a38d90b8 Don't fork renderer process for guest 2014-10-24 19:08:26 +08:00
Cheng Zhao
4ccb0cccf3 Rename web-view module to web-frame 2014-10-24 18:45:03 +08:00
Cheng Zhao
4f43c41577 Enable navigation from webview 2014-10-24 18:44:32 +08:00
Cheng Zhao
6336edbe92 Implement allowtransparency attribute 2014-10-24 16:48:21 +08:00
Cheng Zhao
ce793ec86d Destroy guest when the embedder is gone 2014-10-24 16:19:00 +08:00
Cheng Zhao
993f66bd02 Fix initializing webview 2014-10-24 16:09:18 +08:00
Cheng Zhao
39e75574f4 Attach <webview> with guest WebContents 2014-10-24 14:37:14 +08:00
Cheng Zhao
2d8fe489a7 Add converters between gfx:: and v8 2014-10-24 12:48:52 +08:00
Cheng Zhao
5b167e3684 Mention clang 3.4 is required, refs #735 2014-10-24 09:55:31 +08:00
Cheng Zhao
dacbf7a042 Register guest web view 2014-10-23 23:08:48 +08:00
Cheng Zhao
81599f1535 Use old PLUGIN_METHOD_ATTACH for webview 2014-10-23 20:28:31 +08:00
Cheng Zhao
a22a5c67bd Implement GuestViewInternal.createGuest and destroyGuest 2014-10-23 17:54:52 +08:00
Cheng Zhao
d34cff2eef api: Add webContent.create() to create detached WebContents 2014-10-23 14:04:13 +08:00
Cheng Zhao
c72d769ff0 Make WebContents cache object template 2014-10-23 13:31:10 +08:00
Cheng Zhao
97139b7487 Fix js errors in webview 2014-10-22 23:37:27 +08:00
Cheng Zhao
d26dcd5501 Schemas should be registered early 2014-10-22 23:36:31 +08:00
Cheng Zhao
380de24f2e Add code to register <webview> tag 2014-10-22 22:55:13 +08:00
Cheng Zhao
e7c7e086b1 Add API to register custom element 2014-10-22 21:01:12 +08:00
Cheng Zhao
645f81effd Bump v0.18.2. 2014-10-21 21:27:43 +08:00
Cheng Zhao
f39224a56b Merge pull request #727 from atom/high-dpi
Set DPI settings from gsettings on Linux
2014-10-21 21:23:28 +08:00
Cheng Zhao
0d19e772e6 linux: Don't append --force-device-scale-factor to process.argv 2014-10-21 20:55:37 +08:00
Cheng Zhao
2844d3b358 Make code cleaner 2014-10-21 20:45:50 +08:00
Cheng Zhao
fe3489b383 linux: Also check for schema before init 2014-10-21 20:06:54 +08:00
Cheng Zhao
f6ff97cbeb linux: Make scale factor default to 1 2014-10-21 19:48:08 +08:00
Cheng Zhao
779e5c2ea5 linux: Set scale factor to the value in gsettings 2014-10-21 19:32:40 +08:00
Cheng Zhao
0d957cc68e Update libgio_loader for some APIs 2014-10-21 19:31:44 +08:00
Cheng Zhao
4b75b10542 Add libgio loader 2014-10-21 18:50:50 +08:00
Cheng Zhao
b09252f13e Merge pull request #726 from atom/dbus-checking-menu
Fix detecting global menu bar on Ubuntu
2014-10-21 16:35:11 +08:00
Cheng Zhao
b06d59fcb2 linux: Add libdbus-1-dev as requirement 2014-10-21 15:01:24 +08:00
Cheng Zhao
5162275b9b Upgrade libchromiumcontent for dbus headers 2014-10-21 14:38:35 +08:00
Cheng Zhao
f82de6528b linux: Fix detect global menu bar
It seems that detecting the bus name "com.canonical.AppMenu.Registrar"
is the most reliable way to detect whether the appmenu is available, see
http://git.io/JmP7Yg for the discussion.
2014-10-21 12:10:31 +08:00
Cheng Zhao
593dce23a5 Link with dbus 2014-10-21 12:07:10 +08:00
Cheng Zhao
ef417cb8c2 linux: Fix compilation warning from dbus 2014-10-21 11:47:52 +08:00
Cheng Zhao
ab652b738c mac: Should restart renderer when reloading
Fixes #692.
2014-10-19 16:27:50 +08:00
Cheng Zhao
53b83eba8c Merge pull request #717 from atom/show-inactive
Add BrowserWindow.showInactive()
2014-10-18 11:13:55 +08:00
Cheng Zhao
cbe52c58ac spec: Don't test BrowserWindow.show() in CI
Some environments can not handle focusing very well.
2014-10-17 23:38:14 +08:00
Cheng Zhao
19c8864c32 spec: BrowserWindow.showInactive() 2014-10-17 22:55:09 +08:00
Cheng Zhao
141894aacd Implement BrowserWindow::ShowInactive 2014-10-17 22:51:20 +08:00
Cheng Zhao
cb9bdbf247 docs: Add BrowserWindow.showInactive() 2014-10-17 22:49:21 +08:00
Cheng Zhao
4b5dd2ed4b Bump v0.18.1. 2014-10-17 17:00:26 +08:00
Cheng Zhao
85afa851dd win: Fix toggling the menubar, closes #681 2014-10-17 16:43:57 +08:00
Cheng Zhao
57acdc1bf6 Use menu bar features in default_app 2014-10-17 16:43:37 +08:00
Cheng Zhao
ae76657e17 Still requires unity for global app menubar
Fixes #709 and atom/atom#3854.
2014-10-17 16:06:45 +08:00
Cheng Zhao
4ca6ac34ac Do not create native Event object when not needed 2014-10-17 14:36:43 +08:00
Cheng Zhao
e4a71b86df Caching object templates for Event, fixes #705 2014-10-17 13:53:18 +08:00
Cheng Zhao
4dd7848084 Run idle GC in browser every 1m 2014-10-17 12:41:40 +08:00
Cheng Zhao
a95679c212 Enable mnemonics in menu, fixes atom/atom#3844 2014-10-16 21:22:22 +08:00
Cheng Zhao
b41d356143 --harmony_collections is not needed anymore 2014-10-16 20:59:01 +08:00
Cheng Zhao
feb6a93881 Merge pull request #708 from matttbe/globalmenu
linux: GlobalMenu: UBUNTU_MENUPROXY with >1 char
2014-10-16 18:53:24 +08:00
Matthieu Baerts
940b40439f linux: GlobalMenu: UBUNTU_MENUPROXY with >1 char
When testing if $UBUNTU_MENUPROXY is set, we should also check if it
contains more than one character. Avoid cases when $UBUNTU_MENUPROXY is
set to 0 or 1.
2014-10-15 14:17:18 +02:00
Cheng Zhao
ed07bd202f Bump v0.18.0. 2014-10-14 20:24:56 +08:00
Cheng Zhao
8c29ffd084 Make __filename normalized
This can make sure __filename and __dirname on Windows use "\" as path
delimeter.
2014-10-14 19:45:57 +08:00
Cheng Zhao
dba2fa31b6 Fix __dirname for page in asar package
Fixes #694.
2014-10-14 19:27:47 +08:00
Cheng Zhao
2de80571d8 Add spec for #694 2014-10-14 19:27:38 +08:00
Cheng Zhao
51acba594b Merge pull request #698 from matttbe/master
linux: Rename window's class to Atom
2014-10-14 18:58:37 +08:00
Cheng Zhao
a194d45dfa Merge pull request #700 from atom/chrome38
Upgrade to Chrome 38
2014-10-14 18:42:21 +08:00
Cheng Zhao
9356296a84 Merge pull request #703 from waywardmonkeys/cleanup-asar-docs
[docs] Clean up some grammar around ASAR.
2014-10-14 18:40:47 +08:00
Bruce Mitchener
2fa0b1117c [docs] Clean up some grammar around ASAR. 2014-10-14 08:16:22 +07:00
Cheng Zhao
49814e1919 Just pass spec when mkdir failed 2014-10-13 23:48:56 +08:00
Cheng Zhao
74da83a0bb Upgrade libchromiumcontent to fix node.lib 2014-10-13 23:26:13 +08:00
Cheng Zhao
643d1dcdd1 win: Fix building 2014-10-13 22:47:13 +08:00
Cheng Zhao
b717add81b Print error when mkdir failed 2014-10-13 19:08:23 +08:00
Cheng Zhao
c36c4e36c5 Upgrade libchromiumcontent to fix linking error 2014-10-13 18:11:19 +08:00
Cheng Zhao
0b48c3ea90 Merge pull request #699 from matttbe/globalmenu
linux: GlobalMenu: only if UBUNTU_MENUPROXY is set
2014-10-13 16:31:04 +08:00
Cheng Zhao
68e28159bb Upgrade to apm@0.102.0 2014-10-13 15:00:05 +08:00
Cheng Zhao
69a89303d0 Fix building on Linux 2014-10-13 11:03:56 +08:00
Cheng Zhao
9e87037d34 Upgrade to libchromiumcontent 44c71d8 2014-10-13 10:09:58 +08:00
Matthieu Baerts
7cd4d35778 linux: GlobalMenu: only if UBUNTU_MENUPROXY is set
When checking if we should react differently when GlobalMenu bar is
used, we should check if UBUNTU_MENUPROXY env var is (correctly) set
instead of checking if we're using Unity on a Unity session.

It's better to do that because we can use Compiz on a Unity session
without Unity. Or we can also use Unity in a different session.
2014-10-12 21:16:32 +02:00
Matthieu Baerts
8296178e33 linux: Rename window's class to Atom
The window's class should be Atom instead of Atom Shell because the
launcher and the binary to launch Atom are called 'atom' and not 'atom
shell'. This is why currently all Atom's windows will not be linked to
their launcher in a dock (e.g. with Cairo-Dock).

Note that it's not advised to add white-spaces in a window's class
('Atom Shell').
2014-10-12 18:47:49 +02:00
Cheng Zhao
32dff999a5 Fix API changes of Chrome 38 2014-10-11 19:11:34 +08:00
Cheng Zhao
13e5cf32d5 Upgrade brightray for Chrome 38 2014-10-11 19:11:07 +08:00
Cheng Zhao
11d9e522d5 Update node for V8 changes 2014-10-11 19:10:57 +08:00
Cheng Zhao
4aac0d6d1c Upgrade to Chrome 38.0.2125.102 2014-10-11 19:10:32 +08:00
Cheng Zhao
ddf4f14dba Merge pull request #685 from atom/speech
Add support for speech synthesizer and recognizer
2014-10-08 19:05:00 +08:00
Cheng Zhao
b560176aeb Set google API key 2014-10-08 18:27:39 +08:00
Cheng Zhao
802f964cd3 Enable AVFoundation 2014-10-08 18:17:27 +08:00
Cheng Zhao
0c349c047d Fix cpplint warning 2014-10-08 17:47:47 +08:00
Cheng Zhao
d4e3c39fa5 Add AtomSpeechRecognitionManagerDelegate 2014-10-08 11:55:14 +08:00
Cheng Zhao
3a177d55f8 Add linux tts implementation from Chrome 2014-10-08 02:14:12 +00:00
Cheng Zhao
b2741a8316 Upgrade libchromiuncontent to 3245ef8 2014-10-08 02:05:19 +00:00
Cheng Zhao
909f1bcf3c Upgrade brightray 2014-10-08 01:34:24 +00:00
Cheng Zhao
009412d738 Upgrade libchromiumcontent to f0c3a45 2014-10-08 01:27:07 +00:00
Cheng Zhao
33c622ec86 Install tts dispatcher 2014-10-07 21:27:15 +08:00
Cheng Zhao
05b602d0ce Import Chrome's tts code 2014-10-07 21:18:44 +08:00
Cheng Zhao
8519ea3299 Bump v0.17.2. 2014-10-06 19:13:26 +08:00
Cheng Zhao
aad46b0894 Upgrade to Chrome af66653 2014-10-06 19:02:54 +08:00
Cheng Zhao
5dfbaebd4c Upgrade brightray 2014-10-06 11:23:53 +08:00
Cheng Zhao
b2b70bb37c Upgrade libchromiumcontent to 440833b, fixes #462 2014-10-06 10:54:14 +08:00
Cheng Zhao
35d37c3463 Merge pull request #680 from Subash/patch-1
Optimize fs.stat
2014-10-03 18:09:57 +08:00
Kevin Sawicki
eea82efbf8 Merge pull request #682 from joshmarinacci/patch-1
speling error.
2014-10-02 14:51:41 -07:00
Josh Marinacci
7659edd139 speling error. 2014-10-02 14:51:05 -07:00
Subash Pathak
9f8a5a7af3 Optimize fs.stat 2014-10-02 23:35:37 +05:45
Cheng Zhao
cc4897f8c1 Add process.versions['chrome'], fixes #675 2014-10-02 23:48:17 +08:00
Cheng Zhao
ee5335ca6e Merge pull request #674 from Subash/fs-stat
Fs stat fixes #672
2014-10-02 11:46:06 +08:00
Subash Pathak
dde8e47add Time Shim 2014-10-01 22:24:51 +05:45
Subash Pathak
0040f07097 Added Stat Time 2014-10-01 22:01:57 +05:45
Cheng Zhao
64b2c9b36c Bump v0.17.1. 2014-10-01 20:41:35 +08:00
Cheng Zhao
d754b2bda7 Break on first found app 2014-10-01 20:40:52 +08:00
Cheng Zhao
9dd68c7add Bump v0.17.0. 2014-10-01 18:12:03 +08:00
Cheng Zhao
1499d44584 gtk: Fix focusing on file dialog
Fixes atom/atom#3626.
2014-10-01 17:02:00 +08:00
Cheng Zhao
039903c6b2 mac: Don't create button without title, fixes #631 2014-10-01 15:51:32 +08:00
Cheng Zhao
5df1716144 Upgrade brightray 2014-10-01 15:26:16 +08:00
Cheng Zhao
f6d6a12c1a win: uv_poll_get_timeout is removed 2014-09-30 23:27:36 +08:00
Cheng Zhao
e316e4a267 Upgrade node to v0.11.4, fixes #669 2014-09-30 23:14:25 +08:00
Cheng Zhao
9d84f139eb Merge pull request #665 from atom/asar
Support loading apps in asar format
2014-09-30 20:53:38 +08:00
Cheng Zhao
ad70cb27bd linux: Fix compilation warning 2014-09-30 20:52:57 +08:00
Cheng Zhao
98fec2f317 Still use 14 for node_module_version
We haven't broken abi yet, still use 14 to be compatible with previous
versions.
2014-09-30 20:49:34 +08:00
Cheng Zhao
72fc1e8dc6 Increase node_module_version, fixes #533 2014-09-30 20:32:14 +08:00
Cheng Zhao
301014e4a6 win: asar: Support "\" as path separator 2014-09-30 20:12:48 +08:00
Cheng Zhao
927ec6ab7a spec: asar: fs.realpath 2014-09-30 15:37:46 +08:00
Cheng Zhao
37d45e2881 spec: asar: fs.realpathSync 2014-09-30 15:17:48 +08:00
Cheng Zhao
915c1b19d3 asar: Fix fs.realpath on package's root 2014-09-30 15:09:50 +08:00
Cheng Zhao
b87dfb964c asar: Add support in fs.realpath 2014-09-30 14:57:49 +08:00
Cheng Zhao
885ac53a48 asar: Add support in fs.realpathSync 2014-09-30 14:53:58 +08:00
Cheng Zhao
d77bf0440c docs: Add usage on app packaging 2014-09-29 23:05:02 +08:00
Cheng Zhao
5a0be6672d docs: Add reference on app packaging 2014-09-29 21:34:54 +08:00
Cheng Zhao
724cae7de1 Merge pull request #670 from alexanderneu/master
win: Fix total value in SetProgressBar API.
2014-09-29 20:59:24 +08:00
Alexander Neu
6c9769999b win: Fix total value in SetProgressBar API. 2014-09-29 12:50:51 +02:00
Cheng Zhao
2bf2ad094c spec: asar: Testing getting file in web page 2014-09-29 16:58:54 +08:00
Cheng Zhao
3eaf0fe82b spec: asar: child_process.fork 2014-09-29 16:41:49 +08:00
Cheng Zhao
013e7fb611 spec: asar: fs.open 2014-09-29 16:29:10 +08:00
Cheng Zhao
e24976c59f Fix overriding async node API 2014-09-29 16:28:51 +08:00
Cheng Zhao
e3ae062c5c spec: asar: fs.open 2014-09-29 16:05:19 +08:00
Cheng Zhao
5e6e173d59 spec: asar: fs.readdir 2014-09-29 15:30:56 +08:00
Cheng Zhao
3fcd571db0 spec: asar: Test getting stats of root in fs.lstat 2014-09-29 15:25:28 +08:00
Cheng Zhao
988fa73696 spec: asar: fs.readdirSync 2014-09-29 15:24:01 +08:00
Cheng Zhao
3c412e1cb8 Fix readdir on a linked directory 2014-09-29 15:23:28 +08:00
Cheng Zhao
a579f58454 spec: asar: fs.lstat 2014-09-29 15:00:13 +08:00
Cheng Zhao
35e867820e Make sure fs.stat and fs.lstat are async 2014-09-29 14:59:44 +08:00
Cheng Zhao
a757c62da5 Use "null" instead of "undefined" as no error 2014-09-29 14:57:10 +08:00
Cheng Zhao
370dd26745 spec: asar: fs.lstatSync 2014-09-29 14:45:19 +08:00
Cheng Zhao
e20697b870 spec: asar: fs.readFile 2014-09-28 23:36:45 +08:00
Cheng Zhao
4d01aa2772 Fix shifting args in fs.readFile 2014-09-28 23:36:12 +08:00
Cheng Zhao
4a485f9819 spec: asar: fs.readFileSync 2014-09-28 23:02:14 +08:00
Cheng Zhao
cebafeae40 Fix getting file from symbol linked directory. 2014-09-28 22:46:29 +08:00
Cheng Zhao
150739e19e Fix calling fs.open in fs.readFile wrapper 2014-09-28 22:45:29 +08:00
Cheng Zhao
38f83cacf9 Make some APIs work with archive.copyFileOut API. 2014-09-25 23:25:17 +08:00
Cheng Zhao
fc8ff314e2 Make docs follow 80 columns rule. 2014-09-25 23:22:29 +08:00
Cheng Zhao
8acf96d268 Make spliting paths faster. 2014-09-25 22:18:40 +08:00
Cheng Zhao
c49a44f944 Remove unneeded ArchiveFactory. 2014-09-25 21:54:59 +08:00
Cheng Zhao
390b804ca0 Make process.dlopen work for asar packages. 2014-09-25 21:49:28 +08:00
Cheng Zhao
05317ad81e Clean cached asar archives when quitting. 2014-09-25 21:49:01 +08:00
Cheng Zhao
d559275711 Emit "exit" event for "process" when quitting. 2014-09-25 21:48:30 +08:00
Cheng Zhao
909ff085ac Add "quit" event for app. 2014-09-25 21:48:15 +08:00
Cheng Zhao
dbbfef38b1 Cache asar archives on JavaScript side. 2014-09-25 20:48:32 +08:00
Cheng Zhao
4006b6407c Just use plain pointer for weak reference. 2014-09-25 20:38:12 +08:00
Cheng Zhao
c95a93ef1c Add a way to copy a file in archive into filesystem. 2014-09-25 16:56:50 +08:00
Cheng Zhao
e5e1e207b6 Also search for app.asar when starting app. 2014-09-24 20:09:41 +08:00
Cheng Zhao
e0c469183d Make sure fs.readdir calls its callback asynchronously. 2014-09-24 19:10:37 +08:00
Cheng Zhao
4d2e4ed573 Fill the stats object as much as we can. 2014-09-24 19:10:13 +08:00
Cheng Zhao
0cab034dab Make fs.readdir support asar package. 2014-09-24 18:44:00 +08:00
Cheng Zhao
9f9d209e3d Make options of fs.readFile work. 2014-09-24 16:24:22 +08:00
Cheng Zhao
8740147aa2 Make fs.readFile support asar package 2014-09-24 15:38:07 +08:00
Cheng Zhao
9b755620d3 Make fs.stat support asar package 2014-09-24 15:38:02 +08:00
Cheng Zhao
fa287c2422 Fix getting information for root. 2014-09-24 13:42:04 +08:00
Cheng Zhao
b6cded379e Fix __dirname and __filename in asar: protocol. 2014-09-24 13:23:37 +08:00
Cheng Zhao
8199ad2ae6 Add asar.stat method. 2014-09-24 12:02:33 +08:00
Cheng Zhao
0d09143a77 Add JavaScript bindings of asar::Archive. 2014-09-24 11:10:07 +08:00
Cheng Zhao
7081f7799b Separate the archive cache out to ArchiveFactory. 2014-09-23 22:31:45 +08:00
Cheng Zhao
b6583635d4 Caching the Archive object. 2014-09-23 21:48:40 +08:00
Cheng Zhao
b01db4aa09 Send file content in asar:// 2014-09-23 20:30:07 +08:00
Cheng Zhao
6d712da7e3 Read the archive's header when there is a url request 2014-09-23 19:14:30 +08:00
Cheng Zhao
9b71117171 Add asar:// protocol handler. 2014-09-23 12:13:46 +08:00
Cheng Zhao
50ea0f0b45 Merge pull request #659 from hokein/master
mac: Fix dock progress bar doesn't show after hiding, fixes #658.
2014-09-22 20:52:32 +08:00
Haojian Wu
fa8e158587 mac: Fix dock progress bar doesn't show after hiding, fixes #658. 2014-09-21 18:56:03 +08:00
Cheng Zhao
2768b1ff64 Fix creating empty chromedriver archive. 2014-09-20 15:29:46 +00:00
Cheng Zhao
b3770bc407 Bump v0.16.3. 2014-09-20 23:12:05 +08:00
Cheng Zhao
8f44046f9a Fix chromedriver's version in archive. 2014-09-20 23:09:49 +08:00
Cheng Zhao
a717235212 Only include chromedriver in vX.X.0 releases. 2014-09-20 22:39:52 +08:00
Cheng Zhao
805215be78 Merge pull request #655 from hokein/master
SetProgressBar API Implementation, fixes #635
2014-09-20 11:19:34 +08:00
Haojian Wu
e7fbe84644 Use app name as desktop name by default. 2014-09-18 22:58:17 +08:00
Cheng Zhao
9653f20995 win: Add "direct-write" option for BrowserWindow.
For atom/atom#3540.
2014-09-18 21:49:04 +08:00
Haojian Wu
e959a40b49 docs: setProgressBar API. 2014-09-18 19:32:58 +08:00
Haojian Wu
d9ce3f0ca3 linux: Implement SetProgressBar API. 2014-09-18 19:26:52 +08:00
Haojian Wu
d8f57a0ecc Correct code style. 2014-09-18 16:48:00 +08:00
Haojian Wu
c5e0b65cc7 mac: Implement SetProgressBar API. 2014-09-18 10:20:55 +08:00
Haojian Wu
b5e82dac6f win: Implement SetProgressBar API. 2014-09-17 09:42:47 +08:00
Cheng Zhao
1381d16f9c Merge pull request #652 from atom/chromedriver
Ship chromedriver and add docs on how to use it
2014-09-16 17:45:39 +08:00
Cheng Zhao
268508764f docs: use => using 2014-09-13 00:16:32 +08:00
Cheng Zhao
34109fa741 docs: Document how to use chromedriver. 2014-09-13 00:07:21 +08:00
Cheng Zhao
925ff2da5b Pretend to be Chrome by default.
This is used to cheat client web drivers.
2014-09-12 23:28:14 +08:00
Cheng Zhao
b8a6658ba9 Make our user agent string follow standard. 2014-09-12 23:08:13 +08:00
Cheng Zhao
4a4814b41c default_app: Don't quit when started as web driver. 2014-09-12 22:54:00 +08:00
Cheng Zhao
f952dae0d0 Create dist for chromedriver and upload it. 2014-09-12 22:10:06 +08:00
Cheng Zhao
cba155bcfb Add action to copy chromedriver. 2014-09-12 21:48:45 +08:00
Cheng Zhao
0f714c81cd Merge pull request #644 from lusbuab/patch-1
Correct parameter type of setHightlightMode()
2014-09-10 10:30:42 +09:00
Cheng Zhao
92b5dab3f9 Merge pull request #642 from hokein/master
Add Volume keys support in global-shortcut API, fix #630.
2014-09-10 10:30:26 +09:00
Florian
6ca238852a Correct parameter type of setHightlightMode() 2014-09-09 15:04:00 +02:00
Haojian Wu
d2368d2d3b Add Volume keys support in global-shortcut API, fix #630. 2014-09-09 20:56:47 +08:00
Cheng Zhao
88269a613a Bump v0.16.2. 2014-09-09 20:07:08 +08:00
Cheng Zhao
5696fe8ec8 No need to set "--harmony" in renderer process.
After Chrome 37 renderer process can work correctly without it.
2014-09-09 20:05:43 +08:00
Cheng Zhao
ba439b6824 Merge pull request #643 from atom/mac-tray
Add some OS X only Tray APIs
2014-09-09 21:00:27 +09:00
Cheng Zhao
c8a8576970 docs: Document the new Tray APIs. 2014-09-09 19:50:50 +08:00
Cheng Zhao
67cbecaba0 mac: Add "double-clicked" event for Tray. 2014-09-09 19:45:21 +08:00
Cheng Zhao
ec1db0c7bb mac: Add Tray.setHighlightMode API, fixes #425. 2014-09-09 19:39:39 +08:00
Cheng Zhao
4330d67e0d mac: Add Tray.setTitle API, fixes #560. 2014-09-09 19:36:15 +08:00
Cheng Zhao
db8de9e60d Make default_app focus the main window on startup. 2014-09-09 18:33:36 +08:00
Cheng Zhao
9c9a306095 Upgrade brightray. 2014-09-09 18:33:22 +08:00
Cheng Zhao
bda317b000 views: Set devtools window's icon, fixes #429. 2014-09-09 15:30:33 +08:00
Cheng Zhao
700510d63a mac: Don't activate window when showing. 2014-09-09 14:47:04 +08:00
Cheng Zhao
ab2714fda9 Merge pull request #641 from atom/web-runtime-flags
Add options for web runtime features
2014-09-09 14:43:08 +08:00
Cheng Zhao
33b94edcf0 Use PersistentDictionary to store web perferences. 2014-09-09 14:13:21 +08:00
Cheng Zhao
44d3e58ddb Make code more tidy. 2014-09-09 13:21:15 +08:00
Cheng Zhao
f08c3f9134 docs: Add options for web runtime features. 2014-09-09 11:14:44 +08:00
Cheng Zhao
8de90db429 Pass web runtime features by command line. 2014-09-09 11:08:30 +08:00
Cheng Zhao
81241b38eb Add switches of web runtime flags. 2014-09-09 10:33:31 +08:00
Cheng Zhao
1c07b9c85b Bump v0.16.1. 2014-09-08 16:00:32 +08:00
Cheng Zhao
1199224086 BrowserWindow.show() should not focus window, fixes #609. 2014-09-08 15:28:34 +08:00
Cheng Zhao
add4e3c6f5 docs: Now atom-shell's version should be used when building modules. 2014-09-08 15:07:33 +08:00
Cheng Zhao
eb55f1cf47 Merge pull request #636 from kitematic/master
Fixing dialog api parameter parsing
2014-09-08 11:26:03 +08:00
Jeffrey Morgan
8367071dc6 Fixing dialog api parameter parsing 2014-09-07 15:14:43 -07:00
Cheng Zhao
68ac6b0cbb Bump v0.16.0. 2014-09-06 20:58:34 +08:00
Cheng Zhao
7fb1cb5b3d Merge pull request #612 from nuivall/master
win: Don't overwrite Chrome high DPI setting.
2014-09-06 20:55:58 +08:00
Cheng Zhao
19b25c0d83 Make dialog API's parameters more flexible. 2014-09-06 18:56:28 +08:00
Cheng Zhao
fd806f81ce linux: Don't set PR_SET_NO_NEW_PRIVS when creating process, fixes #623. 2014-09-05 21:04:27 +08:00
Cheng Zhao
d515404abd Merge pull request #626 from atom/v8-debugger
Implement V8 debugger agent
2014-09-05 13:40:37 +08:00
Cheng Zhao
4509056d5e docs: Add notes on OS X application menu. 2014-09-05 13:39:29 +08:00
Cheng Zhao
f604525b98 mac: Enable setting "Services" menu.
Regarding https://github.com/atom/atom/issues/3204.
2014-09-05 13:07:05 +08:00
Cheng Zhao
3afbb66b92 Send message to client in debugger thread. 2014-09-05 11:51:45 +08:00
Cheng Zhao
fadfd74923 win: Fix compilation error. 2014-09-05 11:44:30 +08:00
Cheng Zhao
222f8e1028 Make --debug-brk work. 2014-09-05 10:59:29 +08:00
Cheng Zhao
e3b6ea62d6 Send connect message if client is connected. 2014-09-05 10:52:47 +08:00
Cheng Zhao
3795cc58b0 Pass debugger messages between V8 debugger. 2014-09-05 10:44:07 +08:00
Cheng Zhao
ed7d430f2b Pass header sent from client. 2014-09-05 09:39:28 +08:00
Cheng Zhao
20f21b707b Start a TCP server in the debugger thread. 2014-09-04 23:02:18 +08:00
Cheng Zhao
a584ca3678 Start a new debugger thread to listen for commands. 2014-09-04 21:06:31 +08:00
Cheng Zhao
ca881c5aaf win: Fix compilation with Chrome 37. 2014-09-03 23:17:00 +08:00
Cheng Zhao
2832708618 Merge pull request #622 from atom/chrome37
Upgrade to Chrome37
2014-09-02 17:03:07 +08:00
Cheng Zhao
b00e56f587 Upgrade to apm@0.93.0 2014-09-02 10:58:42 +08:00
Cheng Zhao
d64f43da65 Merge pull request #624 from Rahazan/patch-1
Small typo fix in fatal JS error message
2014-09-02 09:55:07 +08:00
Guido Zuidhof
3e6d8ddbbd Small typo fix in fatal JS error message
An javascript error -> A javascript error
2014-09-01 21:02:03 +02:00
Cheng Zhao
533548fdc7 Use atom-shell's version for creating node headers tarball. 2014-09-01 22:54:20 +08:00
Cheng Zhao
3b95f49a14 Upgrade node to fix child_process.fork. 2014-09-01 22:32:58 +08:00
Cheng Zhao
d9d1d03d4d linux: Dont' use native style border. 2014-09-01 20:22:38 +08:00
Cheng Zhao
9546120ce4 linux: Fix API changes of Chrome 37. 2014-09-01 20:10:14 +08:00
Cheng Zhao
48a5591508 Upgrade brightray. 2014-09-01 19:18:45 +08:00
Cheng Zhao
a413935e91 Initialize node after WebKit is initialized. 2014-09-01 18:43:43 +08:00
Cheng Zhao
241b07f763 Initailize V8 with gin. 2014-09-01 16:41:26 +08:00
Cheng Zhao
d874ba80db Upgrade libchromiumcontent for gin headers. 2014-09-01 16:08:08 +08:00
Cheng Zhao
3e46363ae1 Fix API changes of Chrome 37. 2014-09-01 15:36:37 +08:00
Cheng Zhao
d4a46fa35f Comment out debugger agent.
V8 has discarded support for debugger agent, we should reimplement it in
atom-shell.
2014-09-01 15:35:56 +08:00
Cheng Zhao
134f8236cc Update printing code to Chrome 37. 2014-09-01 15:35:39 +08:00
Cheng Zhao
55003716aa Upgrade node for Chrome 37. 2014-09-01 15:08:19 +08:00
Cheng Zhao
fe88330e87 Upgrade brightray to Chrome 37. 2014-09-01 13:59:01 +08:00
Cheng Zhao
ed68bd18b8 Upgrade libchromiumcontent to Chrome 37. 2014-09-01 13:33:03 +08:00
Cheng Zhao
45228493eb Merge pull request #610 from atom/devtools-extension
Add support for chrome devtools extension
2014-08-28 23:12:21 +08:00
Cheng Zhao
80fb44b926 docs: Add docs on how to use chrome devtools extension. 2014-08-28 16:33:27 +08:00
Cheng Zhao
aa8f5e54df dev-tools => devtools. 2014-08-28 16:00:29 +08:00
Cheng Zhao
8134585578 Remember loaded extensions. 2014-08-28 15:58:36 +08:00
Cheng Zhao
a59388ecdd Add "dev-tools-opened" and "dev-tools-closed" events. 2014-08-28 14:25:00 +08:00
Cheng Zhao
8051ad8b2a Add support for chrome.extension API in devtools extension. 2014-08-28 12:54:19 +08:00
Cheng Zhao
0a937cd2be Merge pull request #614 from atom/atom-shell-squirrel
Atom.exe should receive Squirrel events
2014-08-28 10:06:24 +08:00
Paul Betts
db11c631f6 Atom.exe should receive Squirrel events
This sets up Atom to be packaged into a Squirrel installer. See
https://github.com/Squirrel/Squirrel.Windows.Next/pull/17 for the details
2014-08-27 17:06:26 -07:00
Marcin Maliszkiewicz
90bfd4bf0f win: Don't overwrite Chrome hight DPI setting.
Also disable high DPI mode by default, Chrome enables it since
https://codereview.chromium.org/294293002
2014-08-27 20:14:41 +02:00
Cheng Zhao
39b98b0e4d Fix cpplint warnings. 2014-08-27 21:16:45 +08:00
Cheng Zhao
b6c2e7ef76 Ignore requests to other hosts. 2014-08-27 21:05:54 +08:00
Cheng Zhao
fe96a9de33 Don't use pure number as host name.
Numbers would be treated as IP addresses.
2014-08-27 20:49:57 +08:00
Cheng Zhao
b80f109524 Make "chrome-extension" a standard scheme.
If we do not do so, urls like "chrome-extension://extension-1" will
never get a hostname.
2014-08-27 20:48:49 +08:00
Cheng Zhao
cd40bdbec8 Add chrome-extension protocol for loading devtools extensions. 2014-08-27 16:01:15 +08:00
Cheng Zhao
1533600720 Upgrade libchromiumcontent to loose iframe sandbox. 2014-08-26 22:27:50 +08:00
Cheng Zhao
263c4b9ab4 Turn off web security for devtools. 2014-08-26 16:05:10 +08:00
Cheng Zhao
f1e72914f5 Update brightray for devtools zooming. 2014-08-26 15:11:26 +08:00
Cheng Zhao
400d5cef3f linux: Fix BrowserWindow.setResizable. 2014-08-26 13:37:37 +08:00
Cheng Zhao
af531d685e linux: Make BrowserWindow.setSkipTaskbar work dynamically. 2014-08-26 12:15:22 +08:00
Cheng Zhao
eb5f1f78bf linux: Set WM_CLASS and WM_WINDOW_ROLE for window, fixes #605. 2014-08-26 10:34:48 +08:00
Cheng Zhao
c81a4bcafc Don't use third party dependency in default_app. 2014-08-26 09:50:45 +08:00
Cheng Zhao
1beeda170c Merge pull request #606 from hokein/master
docs: Correct debugging chapter.
2014-08-25 18:55:09 +08:00
Haojian Wu
9ad81c054d docs: Correct debugging chapter. 2014-08-25 13:08:11 +08:00
Cheng Zhao
5604e75886 Merge pull request #603 from soh1988/patch-corrections
Correction to the API Documentation of the Browser FlashFrame
2014-08-23 19:18:38 +08:00
Cheng Zhao
2e7ef7ea44 Merge pull request #602 from soh1988/patch-minSize
Changing the Logical Or to Bitwise Or to change from Either to Either Or...
2014-08-23 19:17:54 +08:00
Chris Soh
a0867fa7c5 Changing the Logical Or to Bitwise Or to change from Either to Either Or Both values 2014-08-23 13:30:43 +08:00
Chris Soh
31f5855001 Adding the compulsory flag in the API documentation of BrowserWindow.flashFrame 2014-08-23 13:20:47 +08:00
Cheng Zhao
0b24883649 Merge pull request #599 from atom/printing
Add support for printing
2014-08-22 17:48:36 +08:00
Cheng Zhao
4fda81a0b4 Document the BrowserWindow.print(). 2014-08-22 15:14:49 +08:00
Cheng Zhao
17c0888932 Make print settings optional. 2014-08-22 15:05:30 +08:00
Cheng Zhao
d20ec6952a Revert "Move the code of getting printing settings to another class."
This reverts commit 57d06c5241.

Conflicts:
	atom/browser/printing/printing_config_service.cc
2014-08-22 15:03:39 +08:00
Cheng Zhao
e43b3309af Add "silent" and "print_background" option for printing. 2014-08-22 15:01:07 +08:00
Cheng Zhao
d0c1b63064 linux: Fix linking error. 2014-08-22 13:03:27 +08:00
Cheng Zhao
a98e26a307 Fix handling failed print. 2014-08-22 13:01:49 +08:00
Cheng Zhao
57d06c5241 Move the code of getting printing settings to another class. 2014-08-22 12:46:26 +08:00
Cheng Zhao
f28e4574b0 Simplify global-shortcut's code. 2014-08-22 10:53:37 +08:00
Cheng Zhao
c9b284d7f7 Remove more unused printing code. 2014-08-22 10:27:08 +08:00
Cheng Zhao
99a510701d Strip out print preview. 2014-08-21 22:14:27 +08:00
Cheng Zhao
eb3ecab6a8 Setup PrintingMessageFilter for printing. 2014-08-21 21:19:43 +08:00
Cheng Zhao
11b9a06639 Add BrowserWindow.print() method. 2014-08-21 21:00:49 +08:00
Cheng Zhao
87d5b72b76 Initailize PrintViewManagerBasic for browser window. 2014-08-21 20:49:18 +08:00
Cheng Zhao
c95869e515 Fix cpplint warnings. 2014-08-21 20:25:12 +08:00
Cheng Zhao
c2f7920068 Upgrade libchromiumcontent to contain printing headers. 2014-08-21 16:38:25 +08:00
Cheng Zhao
cb7196a9c1 Allow script initialized window.print(). 2014-08-21 16:32:41 +08:00
Cheng Zhao
7de0f71a75 Fix compiling with print messages. 2014-08-21 16:14:22 +08:00
Cheng Zhao
8dcb3726f9 Initialize the fake BrowserProcess object. 2014-08-21 15:45:34 +08:00
Cheng Zhao
d934526bb3 Add printing related source codes from chrome. 2014-08-21 15:43:11 +08:00
Cheng Zhao
cab546cbb7 No more need to flip rect for capturePage, fixes #589. 2014-08-21 12:40:31 +08:00
Cheng Zhao
058d0bbe19 linux: Add "dark-theme" option for BrowserWindow, fixes #352. 2014-08-21 12:25:43 +08:00
Cheng Zhao
a32669ac0d Merge pull request #594 from PeterDaveHello/patch-1
make CI build faster
2014-08-21 10:37:48 +08:00
Peter Dave Hello
cc4b3e9e6f make CI build faster 2014-08-20 22:49:37 +08:00
Cheng Zhao
fdcad1066e docs: Fix typos. 2014-08-20 10:57:39 +08:00
Cheng Zhao
41d43920f9 Merge pull request #590 from atom/browser-v8-debugger
Implement the "--debug" switch
2014-08-20 10:47:29 +08:00
Cheng Zhao
fecc90e67c docs: Add chapter on debugging with node-inspector. 2014-08-20 10:43:41 +08:00
Cheng Zhao
6e3b3fa5a2 Add "Debugging browser process" chapter. 2014-08-20 10:01:43 +08:00
Cheng Zhao
c12c0363a0 No need to enter isolate. 2014-08-20 08:15:50 +08:00
Cheng Zhao
1207dfde4c Add support for --debug switch. 2014-08-19 23:36:26 +08:00
Cheng Zhao
0f617c3d3c Remove the unused process.getCurrentStackTrace(). 2014-08-19 22:35:22 +08:00
Cheng Zhao
7b71ae6824 Enable setting only one side of minimum size, fixes #461. 2014-08-19 21:43:18 +08:00
Cheng Zhao
cfae3cd3af Add app.resolveProxy API, fixes #545. 2014-08-19 21:26:45 +08:00
Cheng Zhao
f470d21a55 Bump v0.15.9. 2014-08-18 19:05:56 +08:00
Cheng Zhao
af0a5744f2 Upgrade brightray for new URLRequestContextGetter interface. 2014-08-20 15:30:43 +08:00
Cheng Zhao
2bcb7393c4 Avoid calling GetRequestContext() in UI thread, fixes #591.
Since we can access job factory without touching the request context,
there is no need to make sure GetRequestContext() is called before using
the protocol module.
2014-08-20 13:48:38 +08:00
Cheng Zhao
60dcb0e67f Make process.activateUvLoop friendly to multi-context, fixes #587. 2014-08-20 13:01:23 +08:00
Cheng Zhao
c88b691db7 linux: Suppress test for "enable-larger-than-screen".
It is failing on some DEs.
2014-08-20 12:23:20 +08:00
Cheng Zhao
27f07974e0 Add --proxy-server and --no-proxy-server switches. 2014-08-20 11:57:15 +08:00
Cheng Zhao
a840799b46 Bump v0.15.8. 2014-08-18 09:49:08 +00:00
Cheng Zhao
c8ef79817a Merge pull request #585 from atom/menubar_underline
Support specifying accelerator for menu bar items by adding "&" in label
2014-08-18 16:31:22 +08:00
Cheng Zhao
29abba824d A little cleanup. 2014-08-18 16:19:23 +08:00
Cheng Zhao
6ccec45c61 views: Fix activating lower case accelerators. 2014-08-18 16:05:41 +08:00
Cheng Zhao
1dabd20d99 win: Underline's color tends to be a little lighter. 2014-08-18 15:41:57 +08:00
Cheng Zhao
fedb08899c views: Fix calculating underline's position. 2014-08-18 15:36:29 +08:00
Cheng Zhao
b8bfe8a9ad views: Always hide accelerator when submenu is activated. 2014-08-18 14:58:52 +08:00
Cheng Zhao
a230daa998 views: Pressing "Alt+Key" should bring up the menu bar. 2014-08-18 14:52:44 +08:00
Cheng Zhao
ba41634ad6 views: Show menubar's submenu when "Alt+Key" is pressed. 2014-08-18 14:42:21 +08:00
Cheng Zhao
e9536508a5 views: Show menubar's accelerator when "Alt" is pressed. 2014-08-18 14:12:12 +08:00
Cheng Zhao
965f2b1b6b views: Draw underline in menu bar for accelerators. 2014-08-18 13:36:00 +08:00
Cheng Zhao
e25417ab31 linux: Use "fg" of GtkStyle as text color, fixes #555. 2014-08-18 10:29:21 +08:00
Cheng Zhao
48c227c263 Upgrade libchromium for the accelerator fix. 2014-08-17 21:21:28 +08:00
Cheng Zhao
cbd6541e9a views: Fix compilation error. 2014-08-17 12:57:22 +08:00
Cheng Zhao
2a9f5a5fb8 Add "enable-larger-than-screen" option for BrowserWindow.
From now on BrowserWindow can only be resized larger than screen or
moved out of screen when this option is set to "true".

Fixes #582.
2014-08-17 12:23:00 +08:00
Cheng Zhao
78afa29ade Little formating on app.getDataPath. 2014-08-17 11:33:55 +08:00
Cheng Zhao
73bb05e530 mac: Make "Text to Speech" work, fixes atom/atom#3288. 2014-08-17 11:30:26 +08:00
Cheng Zhao
8cc23aca8d Upgrade to Chrome 36.0.1985.143. 2014-08-17 11:30:26 +08:00
Cheng Zhao
f96c6e4bd7 Merge pull request #578 from cornedor/appdata
Fixed  #442 added app.getDataPath()
2014-08-16 20:34:01 +08:00
Corné Dorrestijn
3afb4e017c Added the getDataPath function to the app api docs 2014-08-15 17:29:36 +02:00
Corne Dorrestijn
54ee12308d reused converted and fixed indentation 2014-08-15 16:52:16 +02:00
Cheng Zhao
fd09f13c9b Bump v0.15.7. 2014-08-15 15:07:11 +08:00
Cheng Zhao
86dd8e2dfa docs: Document the chrome command switches we support. 2014-08-15 13:06:52 +08:00
Cheng Zhao
1b70ca2098 Initialize job factory as early as possible.
Fixes atom/atom#3255.
2014-08-15 11:35:13 +08:00
Cheng Zhao
e8d1c69ea8 Enable the spec of testing crash of protocol module. 2014-08-15 11:08:06 +08:00
Cheng Zhao
1883da463f Merge pull request #577 from cornedor/verbose
Added verbose mode to the bootstrap script. Closes #574
2014-08-15 10:40:30 +08:00
Corne Dorrestijn
e9879a3e4b Removed whitespace and added vector import 2014-08-13 14:24:35 +02:00
Corne Dorrestijn
dec05988f4 Fixes for windows 2014-08-13 14:16:55 +02:00
Cheng Zhao
4087062798 Remove old symbols when generating symbols. 2014-08-13 20:08:07 +08:00
Cheng Zhao
31135321c0 Bump v0.15.6. 2014-08-13 18:19:38 +08:00
Cheng Zhao
226cbda7a6 Avoid creating our own URLRequestContextGetter. 2014-08-13 17:40:31 +08:00
Cheng Zhao
66ef1a067d Merge pull request #576 from atom/geolocation
Implement geolocation API
2014-08-13 14:53:07 +08:00
Cheng Zhao
8a7efcdcd2 Fix compilation error on Linux. 2014-08-13 14:43:21 +08:00
Cheng Zhao
adb8fb59bd Add network provider for google geolocation api. 2014-08-13 13:28:05 +08:00
Cheng Zhao
0ca9e8ee82 Add access token store. 2014-08-13 12:12:43 +08:00
Cheng Zhao
e7647ba183 mac: Fix crash when checking for update, fixes #575. 2014-08-13 11:28:19 +08:00
Corne Dorrestijn
be6599807d Added getAppData function to the app api 2014-08-12 17:01:56 +02:00
Cheng Zhao
a8ca0329b4 win: Show minimize button for unresizable window, fixes #411. 2014-08-12 22:58:19 +08:00
Corne Dorrestijn
6d9a88f415 Fixed inconsistent newlines 2014-08-12 14:28:18 +02:00
Corne Dorrestijn
0018d4b705 Added a verbose mode to the bootstrap script 2014-08-12 14:23:59 +02:00
Cheng Zhao
72e8b2882f Upgrade libchromiumcontent.
* Fix unresponsive event when in beforeunload handler.
* Compile with clang 3.4 under Linux.
2014-08-12 20:17:30 +08:00
Cheng Zhao
89539ca15e Update brightray. 2014-08-11 23:23:27 +08:00
Cheng Zhao
175d052a28 linux: Enable tests on window size.
After upgraded to Chrome36, those tests have become stable.
2014-08-11 21:00:04 +08:00
Cheng Zhao
d1a93a5135 views: Set a default maximum window size.
It is required to make the window able to be resized larger than the
screen.
2014-08-11 20:36:53 +08:00
Cheng Zhao
f96485f950 linux: Fix error when generating symbols.
Somehow strip would return 1 when a directory is passed, so we have to
wrap it in a script to avoid the error.
2014-08-11 11:08:29 +00:00
Cheng Zhao
79dfb2d2f3 Bump v0.15.5. 2014-08-11 17:44:16 +08:00
Cheng Zhao
de7ff0f944 Merge pull request #573 from atom/resource-dispatcher-delegate
Enable removing the X-Frame-Options header for frames
2014-08-11 16:31:35 +08:00
Cheng Zhao
80c77ef3a8 Fix cpplint warning. 2014-08-11 15:56:23 +08:00
Cheng Zhao
cad9580796 docs: Move security info from browser-window to web-security. 2014-08-11 15:37:44 +08:00
Cheng Zhao
253789353f docs: Add document on overriding X-Frame-Options. 2014-08-11 15:25:26 +08:00
Cheng Zhao
73262be2c2 Filter out x-frame-options header on user's request. 2014-08-11 15:03:57 +08:00
Cheng Zhao
0ad4c3ca93 Add custom ResourceDispatcherHostDelegate. 2014-08-11 14:08:23 +08:00
Cheng Zhao
b26e3a9629 Merge pull request #572 from atom/window-larger-than-screen
Enable window to be resized larger than screen
2014-08-11 12:17:48 +08:00
Cheng Zhao
c55f6d82d8 Update brightray for devtools experiments. 2014-08-11 10:52:54 +08:00
Cheng Zhao
4b90c02420 mac: Override system's default on resizing window no larger than screen. 2014-08-11 10:24:36 +08:00
Cheng Zhao
d4fb1c1f8c Add spec for resizing window larger than screen. 2014-08-11 10:22:56 +08:00
Cheng Zhao
445fe158cc Store window icon as ImageSkia. 2014-08-11 10:06:46 +08:00
Cheng Zhao
a696f06a23 Restructure headers of native_window. 2014-08-11 10:01:05 +08:00
Cheng Zhao
c019f13e8c docs: Update prerequisities in Windows build instructions. 2014-08-11 09:39:03 +08:00
Cheng Zhao
b4f00f3b40 Update with new ScopedPersistent interface. 2014-08-10 21:19:07 +08:00
Cheng Zhao
f60d8066f8 Use the function converter from native_mate. 2014-08-10 19:14:20 +08:00
Cheng Zhao
b8d5aa586e Merge pull request #567 from atom/linux-ci
Add Linux CI
2014-08-09 10:24:18 +08:00
Cheng Zhao
eeff20f1bc linux: Start xvfb in CI. 2014-08-09 09:59:06 +08:00
Cheng Zhao
9035ffff55 linux: Don't set CXX to clang when building node modules. 2014-08-09 09:24:17 +08:00
Cheng Zhao
ca522f06d3 linux: Do "apt-get update" in CI. 2014-08-08 23:53:58 +08:00
Cheng Zhao
7f534652a6 linux: Install all necessary deps on CI. 2014-08-08 23:41:11 +08:00
Cheng Zhao
b93564894c Make script quit when error happens in child processes. 2014-08-08 23:23:56 +08:00
Cheng Zhao
54b8a62920 linux: Install libgnome-keyring-dev on travis CI. 2014-08-08 23:10:20 +08:00
Cheng Zhao
bcfba96d29 Set compiler to gcc. 2014-08-08 22:38:35 +08:00
Cheng Zhao
8e21530550 Use travis-ci's multi-os feature. 2014-08-08 22:12:24 +08:00
Cheng Zhao
a4f59bc04e Merge pull request #565 from atom/deepak1556-appveyor_setup
Appveyor setup
2014-08-08 22:06:55 +08:00
Cheng Zhao
a378a719e9 Don't run tests. 2014-08-08 21:31:51 +08:00
Cheng Zhao
441ee0d978 Update brightray. 2014-08-08 20:41:24 +08:00
Cheng Zhao
8d7a59161a win: Don't call pylint in CI. 2014-08-08 17:38:22 +08:00
Cheng Zhao
d175a99811 Fix pylint warning. 2014-08-08 17:32:00 +08:00
Cheng Zhao
724b29d6d4 win: Fix calling lint scripts with win32 python. 2014-08-08 16:41:10 +08:00
Cheng Zhao
336908eba0 win: Use absolute path for ATL. 2014-08-08 15:45:24 +08:00
Cheng Zhao
0f5d929c09 win: Build with downloaded ATL instead of the ATL shipped by WDK. 2014-08-08 14:56:48 +08:00
Cheng Zhao
c4b0170a0a views: Only toggle menu bar when auto-hide-menu-bar is turned on. 2014-08-08 14:30:43 +08:00
Cheng Zhao
936860edd5 Merge pull request #564 from sryze/patch-1
Open output file in binary mode in download()
2014-08-08 14:27:26 +08:00
Cheng Zhao
1cadc9221a win: Download ATL binaries. 2014-08-08 14:18:09 +08:00
Sergey Zolotarev
4890eebd3a Open output file in binary mode in download()
This fixes #553.
2014-08-08 13:08:01 +07:00
Cheng Zhao
3a65942b97 Make node version switching faster. 2014-08-08 11:35:08 +08:00
Cheng Zhao
e06c558a86 Add lint scripts. 2014-08-08 10:58:26 +08:00
Cheng Zhao
0a0a408bf8 Upgrade to apm@0.89.0 2014-08-08 09:52:57 +08:00
Cheng Zhao
c9702b56e2 Build only Debug version. 2014-08-08 08:39:37 +08:00
Cheng Zhao
279eb23b38 No need of project_id in appveyor.yml. 2014-08-07 23:52:08 +08:00
Cheng Zhao
8eb650ce03 Merge branch 'appveyor_setup' of https://github.com/deepak1556/atom-shell into deepak1556-appveyor_setup
Conflicts:
	script/lib/util.py
2014-08-07 22:31:48 +08:00
Cheng Zhao
7f9ac88c31 Bump v0.15.4. 2014-08-07 19:42:08 +08:00
Cheng Zhao
424a00cf29 Don't set interval too short.
Otherwise it could be possible that the callback executes for multiple
times before it is cleared.
2014-08-07 19:40:41 +08:00
Cheng Zhao
3c078b4dab Merge pull request #558 from atom/menubar-autohide
Allow window menu bar to be hidden
2014-08-07 19:31:58 +08:00
Cheng Zhao
8cc49ffa80 menu_bar_show_ => menu_bar_visible_ 2014-08-07 16:48:30 +08:00
Cheng Zhao
58a09f6495 linux: Fix detecting Alt modifier. 2014-08-07 16:46:50 +08:00
Cheng Zhao
c2885f77c9 views: Focus on web view when window is focused. 2014-08-07 16:46:48 +08:00
Cheng Zhao
5d5a3138bc views: Toggle the menu bar only when a single Alt is released. 2014-08-07 15:54:05 +08:00
Cheng Zhao
09f9d0729c views: Show menu when "Alt" is up. 2014-08-07 15:07:34 +08:00
Cheng Zhao
3d989b6736 win: Fix the key code of Alt. 2014-08-07 15:02:27 +08:00
Cheng Zhao
daa00e6539 views: Add some asserts and comments. 2014-08-07 14:48:02 +08:00
Cheng Zhao
382dbb500c Also fix setInterval for #481. 2014-08-07 14:23:28 +08:00
Cheng Zhao
92d6fd641f views: Hide menu bar when web view is clicked. 2014-08-07 14:14:43 +08:00
Cheng Zhao
f219e7f0dd views: Switching to other window should hide the menubar. 2014-08-07 14:02:03 +08:00
Cheng Zhao
8a9e1824c3 views: Add support for auto-hide menubar. 2014-08-07 13:47:58 +08:00
Cheng Zhao
b139d97f3d Update brightray for devtools focus fix. 2014-08-07 10:52:17 +08:00
Cheng Zhao
d29efb7f81 Force updating timeout when setTimeout is called, fixes #481. 2014-08-07 10:37:38 +08:00
Cheng Zhao
53cedc6e5d Add spec for #481. 2014-08-07 10:37:38 +08:00
Cheng Zhao
4f4aabef7a Bump v0.15.3. 2014-08-06 23:37:51 +08:00
Cheng Zhao
a888e4b960 linux: Only use global menu bar under Unity.
Fixes atom/atom#3182.
2014-08-06 23:34:16 +08:00
Cheng Zhao
15c31ad1ba Create .version after all files have been downloaded. 2014-08-06 23:16:42 +08:00
Cheng Zhao
196be5291d Merge pull request #552 from atom/dialog-filters
Add support for extension filters for file dialogs
2014-08-06 22:02:22 +08:00
Cheng Zhao
fe9f94555b win: Implement the filters option. 2014-08-06 21:51:36 +08:00
Cheng Zhao
47e0a61dd8 docs: Document the filters option. 2014-08-06 15:00:31 +08:00
Cheng Zhao
5ba324ca9a gtk: Implement the filters option. 2014-08-06 14:49:02 +08:00
Cheng Zhao
0721b34847 mac: Implement the filters option. 2014-08-06 13:58:42 +08:00
Cheng Zhao
dc257f1f86 Add "filters" parameter for file dialogs. 2014-08-06 13:58:42 +08:00
Cheng Zhao
dfe111b95a Add support for multiple DPI images, fixes #541. 2014-08-06 13:56:49 +08:00
Cheng Zhao
a76ae8cd35 docs: Remove the outdated 32bit note in linux build instructions. 2014-08-05 22:44:21 +08:00
Cheng Zhao
866e20b4be Merge pull request #549 from cornedor/master
Add troubleshooting information for #500
2014-08-05 22:40:00 +08:00
Cheng Zhao
d25645ba67 win: Make BrowserWindow.setResizable change window frame dynamically. 2014-08-05 20:41:26 +08:00
Corné Dorrestijn
ad1efa67bc Add troubleshooting information for #500 2014-08-05 13:33:38 +02:00
Cheng Zhao
cbb14f5ca2 win: Disable the LegacyRenderWidgetHostHWND, fixes #506. 2014-08-05 18:49:55 +08:00
Cheng Zhao
a8cd101ff5 win: Fix window frame when DWM is disabled, closes #519. 2014-08-05 18:17:14 +08:00
Cheng Zhao
009e0790fe linux: Draw menubar text and background with native theme, fixes #540. 2014-08-05 18:05:34 +08:00
Cheng Zhao
d31ebb71db Fix cpplint warnings. 2014-08-05 08:46:06 +08:00
Cheng Zhao
2125a0be82 docs: Sort modules in alphabet sequence. 2014-08-05 00:05:26 +08:00
Cheng Zhao
6dc01945af Make Accelerator a standalone JS type.
This makes menu and global-shortcut share the same code on accelerator.
2014-08-05 00:03:58 +08:00
Cheng Zhao
28b9df24a6 Don't create junk file when posting crash report.
Fixes atom/atom#3166.
2014-08-04 22:58:34 +08:00
Cheng Zhao
94b4ceb8ce Bump v0.15.2. 2014-08-04 21:14:07 +08:00
Cheng Zhao
e3eaf909a5 Use the global_shortcut_listener_x11 from chrome36.
This fixes compilation error on Linux.
2014-08-04 12:52:42 +00:00
Cheng Zhao
33580f66df Run user's main script before everything is initialized, fixes #543. 2014-08-04 20:51:08 +08:00
Cheng Zhao
139316b975 Upgrade brightray, fix #498.
Previous 476f545 was using the wrong commit of brightray which didn't
actually contain the fix.
2014-08-04 20:51:07 +08:00
Cheng Zhao
8fe8cd46b9 Merge pull request #544 from hokein/master
📝 Update global-shortcut API document.
2014-08-04 20:12:26 +08:00
Cheng Zhao
e3118359ad Destroy web contents when window is closed.
Previously this was reverted because of Chromium's spammy error
loggings, but it also causes the renderer process not to exit when the
page has been closed. After fixing the spammy error logging, we can now
bring this back.

Fixes atom/atom#3141.
2014-08-04 14:55:08 +08:00
Haojian Wu
681de1b048 📝 Update global-shortcut API document. 2014-08-04 10:11:00 +08:00
Cheng Zhao
4880096f3d Restructure the update.py. 2014-08-03 23:13:04 +08:00
Cheng Zhao
9c038a2402 Merge pull request #534 from hokein/hotkey
Implement global shortcut API, fixes #439
2014-08-03 22:34:59 +08:00
Cheng Zhao
c4d9dc91a6 Merge pull request #537 from springmeyer/patch-1
fix node to build with target_arch=x64 on linux
2014-08-03 21:55:39 +08:00
Dane Springmeyer
16428baea2 make pylint happy 2014-07-31 11:58:45 -07:00
Dane Springmeyer
4cd3119125 fix indent 2014-07-31 11:22:22 -07:00
Dane Springmeyer
191b1aa719 only default to 64 bit build on darwin and 64bit linux
- maintains default to 32 bit on windows
2014-07-31 10:20:33 -07:00
Haojian Wu
035679057e Update GlobalShortcut API design.
* Rename Shortcut API to GlobalShortcut for better suite.
* Implement the new design interfaces.
* Put the chromium related source code to the same directory as in chrome.
2014-07-31 20:58:43 +08:00
Cheng Zhao
fb4ec66b37 Bump v0.15.1. 2014-07-31 11:48:09 +00:00
Cheng Zhao
89f565906b mac: No need to set wantsLayer, it is already done in brightray. 2014-07-31 18:02:12 +08:00
Cheng Zhao
6a5f732bba mac: Emit focus/blur events after page has actually focus/blur-ed.
Otherwise the page would receive the blur event when it has not blured
yet.

Fixes atom/atom#3124.
2014-07-31 17:35:08 +08:00
Cheng Zhao
fba1772000 Don't mess up with browser process's execArgv, fixes #492. 2014-07-31 16:58:59 +08:00
Cheng Zhao
e62986b97d Add spec for #492. 2014-07-31 16:47:11 +08:00
Cheng Zhao
2e38bafdb1 Merge pull request #538 from atom/tracing-module
Add content-tracing module
2014-07-31 16:25:27 +08:00
Cheng Zhao
f3e49b0696 Fix typo. 2014-07-31 15:49:14 +08:00
Cheng Zhao
70aad83b07 Add docs on content-tracing module. 2014-07-31 15:40:40 +08:00
Cheng Zhao
10c862f0bb Add options defines. 2014-07-31 15:12:02 +08:00
Cheng Zhao
d993c92cea Add content-tracing module. 2014-07-31 15:11:34 +08:00
Cheng Zhao
546e4e431d Ship VS2012 redist DLLs.
Atom Shell has been built with VS2013 so we should not ship VS2010's DLLs.
2014-07-31 14:12:17 +08:00
Cheng Zhao
4a7e98e398 linux: Only use global application menubar on unity.
Fixes atom/atom#3114.
2014-07-31 13:11:03 +08:00
Cheng Zhao
ab4558ae32 Merge pull request #530 from atom/ks-vendor-dlls
Vendor Microsoft C/C++ dlls
2014-07-31 13:10:48 +08:00
Dane Springmeyer
978f73756b fix node to build with target_arch=x64 on linux
atom-shell on linux is incorrectly reporting `ia32` for `process.arch`.

This is happening because `-Dtarget_arch=ia32` is passed to ninja on linux inside `script/update.py` which leads to '-DARCH="ia32"' being set in the compile flags. I see that the current intention is to target 64 bit builds on linux (37275c64cd) and the binaries are in fact compiled as 64 bit despite this bug.  I guess ninja is somehow smartly ignoring the incorrect setting of the `-m32` flags at 6d772c3cda/common.gypi (L175-L178).

Until this is fixed it breaks usage of any node-pre-gyp packaged node addons because node-pre-gyp depends on process.arch being correct in order to require the right binary arch.
2014-07-30 20:51:23 -07:00
Cheng Zhao
5086873f78 mac: Guard against closed window, fixes #536. 2014-07-31 10:33:45 +08:00
Haojian Wu
b2217474c1 Nits: Fix code style. 2014-07-31 09:12:44 +08:00
Haojian Wu
9342d59a7c 📝 Shortcut API document. 2014-07-31 09:12:43 +08:00
Haojian Wu
ad827eee90 Emit failed message when fail to register shortcut. 2014-07-31 09:12:43 +08:00
Haojian Wu
a8034364ff linux: Implement global keyboard shortcut API. 2014-07-31 09:12:42 +08:00
Yeechan Lu
c2c5111d75 win: Implement global keyboard shortcut API. 2014-07-31 09:12:42 +08:00
Haojian Wu
4b3bd9c3cc mac: Implement global keyboard shortcut API. 2014-07-31 09:12:41 +08:00
Cheng Zhao
476f545a67 Update brightray, fixes #498. 2014-07-30 22:45:23 +08:00
Kevin Sawicki
16a1edb422 Vendor Microsoft C/C++ dlls 2014-07-29 09:45:35 -07:00
Cheng Zhao
474445fb7d Upgrade apm to 0.84. 2014-07-29 23:00:20 +08:00
Cheng Zhao
5db31517cb mac: Fix app.dock.show/hide, close #520. 2014-07-29 22:31:51 +08:00
Cheng Zhao
740e7fbf1a Bump v0.15.0. 2014-07-29 11:15:05 +08:00
Cheng Zhao
be5789b483 Merge pull request #524 from atom/chrome36
Upgrade to Chrome36
2014-07-29 11:13:50 +08:00
Cheng Zhao
1c415b0666 win: No more need to convert to DIP point for context menu. 2014-07-28 20:44:11 +08:00
Cheng Zhao
8dd7f81175 Fix building on Windows. 2014-07-28 20:32:10 +08:00
Cheng Zhao
87019a1a70 views: No need to destroy Widget, CloseNow already closed native window. 2014-07-28 20:28:54 +08:00
Cheng Zhao
10c52bd6a6 Fix building on Linux. 2014-07-28 20:28:53 +08:00
Cheng Zhao
c23c667c2d Update brightray to fix webrtc warning. 2014-07-28 20:28:52 +08:00
Cheng Zhao
ec4275ca13 Make sure window is closed before WebContents is destroyed.
Otherwise we would get "RawChannel fatal error".
2014-07-28 20:28:51 +08:00
Cheng Zhao
143bde007a Always enable harmony when node binding is on.
If we dont' do this we would have lots of "Extension or internal
compilation error." error, seems to be V8's bug.
2014-07-28 20:28:50 +08:00
Cheng Zhao
a6ede12cd7 Make sure javascript environment is initialized after ProxyResolverV8. 2014-07-28 20:28:50 +08:00
Cheng Zhao
7a89a08534 Update to new Chromium APIs. 2014-07-28 20:28:49 +08:00
Cheng Zhao
5ad203ad99 Upgrade to Chrome 36. 2014-07-28 20:28:48 +08:00
Cheng Zhao
82dcdc6314 Merge pull request #518 from HackPlan/menudpi
win: Fix tray context menu in high DPI mode
2014-07-28 18:53:16 +08:00
Cheng Zhao
371e38198f Merge pull request #516 from alexwhitman/patch-1
Fix isMinimized API documentation
2014-07-28 18:39:02 +08:00
Yeechan Lu
472a95e433 win: Fix tray context menu in high DPI mode 2014-07-27 15:50:04 +08:00
Cheng Zhao
b84226244d Bump v0.14.3. 2014-07-27 09:28:56 +08:00
Alex Whitman
e4290393af Fix isMinimized API documentation 2014-07-26 09:53:02 +01:00
Cheng Zhao
cab00a1450 views: Return restored bounds when window is minimized, fixes #473.
On Window the minimized window would have a fake bounds that is out of
the screen, which is not consistent to other platforms' behavior.
2014-07-26 14:20:50 +08:00
Cheng Zhao
ce50b38a75 Add BrowserWindow.isMaximized API. 2014-07-26 13:58:26 +08:00
Cheng Zhao
e8d59c4326 views: Fix showing window icon, closes #514. 2014-07-26 12:06:38 +08:00
Cheng Zhao
b9d64784bb win: Don't crash on invalid parameter error.
libuv relies on suppressing the invalid parameter error in
uv__get_osfhandle, and it could hanppen frequently.

Fixes #513.
2014-07-26 11:14:28 +08:00
Kevin Sawicki
ad3eac2e38 📝 Mention code signing is required for updates
Refs #512
2014-07-25 09:14:49 -07:00
Cheng Zhao
e11c8a07ea Bump v0.14.2. 2014-07-25 22:33:28 +08:00
Cheng Zhao
a04cb08715 win: Fix generating symbols. 2014-07-25 18:00:05 +08:00
Cheng Zhao
b9fc5474c5 win: Use system's menu bar color. 2014-07-25 15:20:25 +08:00
Cheng Zhao
709670be8e win: Make menu bar height 20.
On Windows applications used to have lower menu bars.
2014-07-25 15:05:18 +08:00
Cheng Zhao
2afd3a85a9 Skip the net.connect test on Windows. 2014-07-25 15:02:17 +08:00
Cheng Zhao
92a0a4cf6c views: Filter out the "&" in window menu. 2014-07-25 14:53:19 +08:00
Cheng Zhao
32c6f4cfe8 Update node, fixes #511.
This is fixed by notifying the event loop to do next tick when the
uv__io_feed is called, see http://git.io/evYEpA.
2014-07-25 13:08:07 +08:00
Cheng Zhao
dbf19a5734 Add spec for #511. 2014-07-25 13:04:30 +08:00
Cheng Zhao
f7a9b56e93 mac: Make cmd+~ work for devtools window, fixes #508. 2014-07-25 11:03:25 +08:00
Cheng Zhao
53c73c0631 mac: Fix crash when closing window, closes #504. 2014-07-25 10:38:19 +08:00
Cheng Zhao
6c866ea909 Pass node version when calling upload-checksums. 2014-07-24 23:34:50 +08:00
Cheng Zhao
8fcd39f621 Bump v0.14.1. 2014-07-24 22:35:39 +08:00
Cheng Zhao
ef352a69b4 Merge pull request #503 from atom/linux-native-frame
Use native window frame on Linux
2014-07-24 21:28:53 +08:00
Cheng Zhao
99ef165884 Merge pull request #493 from hokein/issue460
mac: Add BrowserWindow.getRepresentedFilename API, fixes #460.
2014-07-24 21:10:43 +08:00
Cheng Zhao
77627c0d2d linux: Use native frame for message box. 2014-07-24 21:06:33 +08:00
Cheng Zhao
c91f0c575c linux: Remove custom frame code. 2014-07-24 21:03:17 +08:00
Cheng Zhao
1a5c0ab1ae linux: Implement min/max size of window. 2014-07-24 21:02:13 +08:00
Cheng Zhao
11634740d3 linux: Use native window frame. 2014-07-24 18:06:27 +08:00
Cheng Zhao
640ac43059 mac: Fix the focus event of web contents. 2014-07-24 16:42:38 +08:00
Haojian Wu
6f231d5860 mac: Add BrowserWindow.isDoucumentEdited API, fixes #459. 2014-07-24 16:01:04 +08:00
Haojian Wu
acb8b7771e mac: Add BrowserWindow.getRepresentedFilename API, fixes #460. 2014-07-24 15:59:35 +08:00
Daniel Hengeveld
301706b7d6 Merge pull request #495 from batjko/patch-1
Ironed out some spelling and grammar issues.
2014-07-21 16:01:40 -07:00
Cheng Zhao
17cf6ffbd4 Bump v0.14.0. 2014-07-21 22:23:35 +08:00
Cheng Zhao
e803d3cc7a Merge pull request #440 from atom/chrome35
Upgrade to Chrome35
2014-07-21 22:23:04 +08:00
Cheng Zhao
e4484f0c3e win: Fix parent window of dialogs. 2014-07-21 22:13:46 +08:00
Cheng Zhao
dd404fb785 win: Remove dead browser window code. 2014-07-21 22:13:46 +08:00
Cheng Zhao
a15ee1871a win: Implement SetSkipTaskbar. 2014-07-21 22:13:45 +08:00
batjko
9b8ee42f79 💄 2014-07-21 15:05:11 +01:00
batjko
939ead3aee add missing comma 2014-07-21 15:03:25 +01:00
batjko
026c85508a Ironed out some spelling and grammar issues. 2014-07-21 15:02:35 +01:00
Cheng Zhao
e6998dfd4b linux: Fix compilation error caused by X header. 2014-07-21 13:48:23 +00:00
Cheng Zhao
21949e2f0c views: Don't retain MenuRunner on heap.
Sometimes the MenuHost would crash when the window is closed, the author
didn't recommend using MenuRunner on stack, but since we always run the
menu synchronously, this is no problem.
2014-07-21 21:42:01 +08:00
Cheng Zhao
1a79093378 views: Add menu should not change window size. 2014-07-21 20:58:15 +08:00
Cheng Zhao
ffad6fe884 win: Fix compilation error. 2014-07-21 20:45:31 +08:00
Cheng Zhao
0ca33dc6b8 Add script to upload checksums of node headers, fixes #457. 2014-07-21 16:43:49 +08:00
Cheng Zhao
a0bf74b9df Merge pull request #484 from yaotti/show-stack-traces-for-boot-failure
Print stack traces when starting app failed in addition to a dialog
2014-07-21 13:30:59 +08:00
Cheng Zhao
b29ab48032 Merge pull request #480 from lusbuab/patch-1
Note for OS X, regarding sheets.
2014-07-21 13:30:43 +08:00
Cheng Zhao
42afc5603d Merge pull request #445 from island205/update-quick-start
Add notice for ##Run your app
2014-07-21 13:29:49 +08:00
Cheng Zhao
fab11950ee Fix crashing when setting web-preferences, closes #443. 2014-07-21 13:08:52 +08:00
Cheng Zhao
365638f1d5 win: Remove dead menu code. 2014-07-21 11:23:01 +08:00
Cheng Zhao
73df08ebbf Update native_mate. 2014-07-18 09:37:54 +08:00
Cheng Zhao
9c9e0d92f4 Fix cpplint warnings. 2014-07-18 09:17:17 +08:00
Cheng Zhao
66aea0c3e8 Fix releasing script contexts. 2014-07-18 09:12:22 +08:00
Cheng Zhao
a1c2adda3d Fix shipping icudtl.dat in dist. 2014-07-18 08:42:39 +08:00
Cheng Zhao
0f18d63f7f views: Implement the window menu bar. 2014-07-17 14:23:28 +08:00
Cheng Zhao
2ee7caccfe views: Add an empty menu bar. 2014-07-16 22:12:57 +08:00
Cheng Zhao
2a2fc4903d linux: Share code on frameless window with Windows. 2014-07-16 16:00:08 +08:00
Cheng Zhao
9afc2daf75 Only ship high DPI paks on Window. 2014-07-16 15:49:40 +08:00
Cheng Zhao
8f94d5886d win: Min/max size uses scaled DPI size. 2014-07-16 15:40:22 +08:00
Cheng Zhao
6de595f036 win: Implement frameless window. 2014-07-16 15:33:40 +08:00
Cheng Zhao
db6c37bfbc Include high DPI resource paks. 2014-07-16 15:05:02 +08:00
Hiroshige Umino
6bfa69ceda Print stack traces when starting app failed in addition to a dialog 2014-07-15 19:42:01 +09:00
Cheng Zhao
00467b53c7 linux: Fix modal message box. 2014-07-14 16:34:22 +08:00
Cheng Zhao
adec718503 win: Fix showing menu on High DPI display. 2014-07-13 22:22:56 +08:00
Cheng Zhao
7c8a0ae2a3 win: Fix black ground when closing message box. 2014-07-13 09:50:16 +08:00
Cheng Zhao
add45b564e win: Improve window frames. 2014-07-12 21:03:34 +08:00
Cheng Zhao
643a47cf7d win: Use native frame for browser windows. 2014-07-12 11:36:08 +08:00
Florian
2f967149fc Note for OS X, regarding sheets.
Added a note for OS X users, to tell how to present dialogs as sheets.
2014-07-12 00:35:41 +02:00
Cheng Zhao
5c99dff36d linux: Remove dead code on accessing window tree host. 2014-07-11 23:27:45 +08:00
Cheng Zhao
b2839b08cd win: Enable high dpi support. 2014-07-11 20:58:39 +08:00
Cheng Zhao
cc29f43a35 win: Update libchromiumcontent to fix shared workers. 2014-07-11 20:18:06 +08:00
Cheng Zhao
b2afe7b3bf win: Fix notify icon and context menu. 2014-07-11 19:42:53 +08:00
Cheng Zhao
b4ba149662 Fix a crash when creating window. 2014-07-11 19:39:35 +08:00
Cheng Zhao
43e8ecb118 win: screen module is now browser only. 2014-07-11 19:06:46 +08:00
Cheng Zhao
ea60a04280 Upgrade libchromiumcontent to fix chromiumviews. 2014-07-11 19:05:51 +08:00
Cheng Zhao
3c11bc5f98 Upgrade apm to v0.76.x. 2014-07-11 14:04:50 +08:00
Cheng Zhao
8d4211bd3a win: Fix compilation errors for chrome35. 2014-07-11 12:19:01 +08:00
Cheng Zhao
497174bbe4 linux: Avoid using unsigned long directly. 2014-07-11 09:18:06 +08:00
Cheng Zhao
1c62211d99 linux: No need to remember root item in menubar. 2014-07-11 09:09:23 +08:00
Cheng Zhao
7e86e53593 linux: Add support for unity global menubar. 2014-07-11 08:57:19 +08:00
Cheng Zhao
3349b8e6c7 linux: Remove all the X and GTK+ related implementations.
Now we only uses GTK+ for app indicator and status icon, also notice the
in Chrome35 the Gtk2StatusIcon class doesn't exist yet so we shipp
related files under chromium_src, remember to delete them after upgraded
to Chrome36.
2014-07-10 13:06:41 +08:00
Cheng Zhao
49160819d2 linux: Implement context menu with views. 2014-07-10 12:07:01 +08:00
Cheng Zhao
83ff00dc29 linux: screen module can not be used in renderer. 2014-07-10 10:26:17 +08:00
Cheng Zhao
e150a3e3b2 Enable accelerated composition in frameless window. 2014-07-09 19:05:24 +08:00
Cheng Zhao
dd6f8669a1 Update libchromiumcontent to fix web workers. 2014-07-09 18:52:11 +08:00
Cheng Zhao
fcf55df874 Avoid duplicate code in main delegate. 2014-07-09 17:15:28 +08:00
Cheng Zhao
d81a34d3dd Add specs for web workers. 2014-07-09 15:55:01 +08:00
Cheng Zhao
7b93a19e9b Fix context menu in devtools. 2014-07-09 15:41:16 +08:00
Cheng Zhao
2312f84ec9 Upgrade libchromiumcontent to 2f1b641fca996546b9797c359ec05ac8aeade1ba. 2014-07-09 10:48:58 +08:00
Cheng Zhao
4e4227aef8 views: Implement focus and blur event. 2014-07-08 12:55:33 +08:00
Cheng Zhao
ee5312fff9 Merge branch 'master' into chrome35
Conflicts:
	atom/browser/native_window_gtk.h
2014-07-07 23:49:28 +08:00
Cheng Zhao
b99262af32 views: Use UnhandledKeyboardEventHandler to handle accelerators. 2014-07-07 23:02:46 +08:00
Cheng Zhao
3d36a6a793 views: Make resizable frameless window work. 2014-07-07 22:40:26 +08:00
Cheng Zhao
db98a3842f views: Implment skip-taskbar option. 2014-07-07 22:40:25 +08:00
Cheng Zhao
a5e2ea2899 views: Make frameless window work. 2014-07-07 22:40:23 +08:00
Cheng Zhao
e7feafb2cc views: Use our own CustomFrameView implementation. 2014-07-07 15:35:16 +08:00
Cheng Zhao
4609a8d2be linux: Fix setting parent window for file dialogs. 2014-07-05 00:00:54 +08:00
Cheng Zhao
66ab127389 Merge pull request #437 from avdg/maximize
Add BrowserWindow::isMaximized.
2014-07-04 23:17:33 +08:00
Cheng Zhao
cb08f35c7f Merge pull request #452 from marksamman/master
Move item to trash without confirming on Windows
2014-07-04 23:13:44 +08:00
Cheng Zhao
c511933cfc Merge pull request #448 from as3boyan/patch-2
Patch 2
2014-07-04 23:06:59 +08:00
Cheng Zhao
b3bccd2e1e views: Be correct on widget's life time. 2014-07-04 17:24:49 +08:00
Cheng Zhao
3c892b8591 views: Make acceleratros work. 2014-07-04 16:54:10 +08:00
Cheng Zhao
0a38f3321e views: Currently set window's frames. 2014-07-04 12:32:03 +08:00
Cheng Zhao
61db17412c Use views to implement NativeWindow and MessageBox on Linux. 2014-07-04 01:30:36 +08:00
Cheng Zhao
1965a5ee50 Upgrade libchromiumcontent to 93f4be4bc30f98a445e4db2a2759057f0f01de01. 2014-07-03 20:26:05 +08:00
Cheng Zhao
970b82c314 Add rules for _views and _aura file names. 2014-07-03 08:41:01 +00:00
Cheng Zhao
84878c4c77 Initial work for Aura on Linux. 2014-07-02 22:49:45 +08:00
Cheng Zhao
949821f255 Use new devtools structure in brightray.
Fixes #210.
Fixes #275.
2014-07-02 16:38:11 +08:00
Cheng Zhao
2cc2fd03fa Upgrade runas and pathwatcher in specs. 2014-07-02 16:37:59 +08:00
Mark Samman
2ed46e6f7f Move item to trash without confirming on Windows
This will skip the "Are you sure you want to move this file to the Recycle Bin?" dialog on Windows.
2014-07-02 03:55:29 +02:00
Robo
58c56ce7ae specify mode for windows 2014-07-02 02:02:23 +05:30
Robo
66983c7f67 inital config setup for x86 2014-07-02 00:09:54 +05:30
as3boyan
116e4c877e Update browser-window.md 2014-07-01 18:32:44 +03:00
as3boyan
ffb0c22a80 Update screen.md 2014-07-01 18:30:26 +03:00
Zhi Cun
721a40ba82 Add notice for ##Run your app 2014-07-01 17:51:42 +08:00
Cheng Zhao
9031dcbb2f Fix specs. 2014-06-30 18:32:23 +08:00
Cheng Zhao
d0abc38afe Update node version to 0.13.0. 2014-06-30 17:16:33 +08:00
Cheng Zhao
6a891be0e4 Make the node environment constrained in browser_main_parts. 2014-06-30 14:16:16 +08:00
Cheng Zhao
1d359cb8aa icudlt.dat should be in framework's resources after previous fix. 2014-06-30 12:23:11 +08:00
Cheng Zhao
2736b5dab3 Fix assertion caused by base::mac::AssignOverridePath. 2014-06-30 12:15:59 +08:00
Cheng Zhao
d5b2a5af26 Fix invoking ContentMain. 2014-06-30 11:44:05 +08:00
Cheng Zhao
e0f263950e The icudtl.dat is also needed by helper app. 2014-06-30 11:26:00 +08:00
Cheng Zhao
750148f7b4 Fix using common modules. 2014-06-30 10:06:10 +08:00
Cheng Zhao
6ddb8c00dc Upgrade libchromiumcontent to e6aebd2156034b12e869d8905b22c088b2dc42ea. 2014-06-30 09:01:11 +08:00
Cheng Zhao
ba46f2c820 Use new context aware module API in builtin modules. 2014-06-29 20:48:44 +08:00
Cheng Zhao
c3301a197e Fix including gtk rules in other OSs. 2014-06-29 19:13:49 +08:00
Cheng Zhao
69adff19fe Force all builtin modules to be referenced. 2014-06-29 18:15:39 +08:00
Cheng Zhao
64bf1bcb9f Move all chromium's code under chromium_src. 2014-06-29 06:06:35 +00:00
Cheng Zhao
1f99a97544 gtk: Fix lack of x11_util implementations. 2014-06-29 05:31:11 +00:00
Cheng Zhao
f4b6ca70a9 gtk: Import chromium's ActiveWindowWatcherX. 2014-06-29 04:05:29 +00:00
Cheng Zhao
e5c10f29de gtk: Use libgtk2ui from chrome. 2014-06-29 03:41:22 +00:00
Cheng Zhao
436deddf68 Fix compilation errors on Linux. 2014-06-29 01:51:02 +00:00
Cheng Zhao
ad19381217 Fix ICU inilialization bug. 2014-06-28 23:58:53 +08:00
Cheng Zhao
cd4c5d976b Adapt to API changes of Chromium and node. 2014-06-28 22:33:00 +08:00
Cheng Zhao
58ccb27792 There is no more node_isolate. 2014-06-28 19:49:55 +08:00
Cheng Zhao
e0e1d45859 Rename string16 to base::string16. 2014-06-28 19:49:22 +08:00
Cheng Zhao
c713deb1e8 Upgrade to new V8 APIs. 2014-06-28 19:31:23 +08:00
Cheng Zhao
91c7458ab8 Fix changes of node's build environment. 2014-06-28 19:31:04 +08:00
Cheng Zhao
5f3fa341b2 Update node to 0.11.13. 2014-06-28 18:44:10 +08:00
Cheng Zhao
066d129536 Upgrade brightray to chrome35 branch. 2014-06-28 18:19:13 +08:00
Anthony Van de Gejuchte
348dc8365b Fix return types 2014-06-28 10:17:37 +09:00
Anthony Van de Gejuchte
dad7aa6a20 Add BrowserWindow::isMaximized. 2014-06-28 09:56:39 +09:00
Cheng Zhao
5d4f1e3c00 Update build instructions for VS2013. 2014-06-27 11:08:00 +08:00
Cheng Zhao
2d073e78ef Suppress new compiler warnings for VS2013. 2014-06-27 11:04:58 +08:00
Cheng Zhao
72d6778894 gtk: Make AppIndicator.SetContextMenu async, fixes #430. 2014-06-26 12:09:07 +08:00
Cheng Zhao
0440c59d18 Remove native_window's dead code. 2014-06-25 13:21:04 +08:00
Cheng Zhao
8ecc4061a8 mac: Add app.dock.hide()/show() APIs, closes #422. 2014-06-25 11:55:33 +08:00
Cheng Zhao
3eecd664b4 Bump v0.13.3. 2014-06-25 09:17:06 +08:00
Cheng Zhao
4c5a306733 📝 Mention a new Windows build error. 2014-06-25 09:11:06 +08:00
Cheng Zhao
79c3377cd7 Show chromium's version in user agent, fixes #428. 2014-06-25 09:05:10 +08:00
Cheng Zhao
32c881bde9 gtk: Make BrowserWindow::HasModalDialog work.
Fixes atom/atom#2658.
2014-06-24 21:52:06 +08:00
Cheng Zhao
27d73b362a Markdown in website is rendered differently 2014-06-24 11:24:40 +08:00
Cheng Zhao
ab1670ff03 💄 Fix the links 2014-06-24 11:22:09 +08:00
Cheng Zhao
d3c76d6998 📝 Add the presentation link given on HuJS. 2014-06-24 11:18:45 +08:00
Cheng Zhao
a2c897aa9f Merge pull request #423 from atom/hidpi-icon
Add support for high resolution icon
2014-06-23 23:36:13 +08:00
Cheng Zhao
a8de615034 Wait for crash reporter spec longer. 2014-06-23 23:01:50 +08:00
Cheng Zhao
1a0d8a4aa9 📝 Add docs on image support in atom-shell. 2014-06-23 22:58:42 +08:00
Cheng Zhao
2ff4d56d6d Fix compilation error. 2014-06-23 22:31:02 +08:00
Cheng Zhao
ca1d2a32b0 Support high dpi icon as window icon. 2014-06-23 22:26:01 +08:00
Cheng Zhao
b92e6e97ea Dicard uses of base::Value in native_window. 2014-06-23 22:08:40 +08:00
Cheng Zhao
84e2c35611 Use mate::Dictionary instead of base::DictionaryValue for options.
mate::Dictionary can represent arbitray type, which matches our use.
2014-06-23 21:56:22 +08:00
Cheng Zhao
0349fdfd67 Fix converting empty V8 dictionary. 2014-06-23 21:50:28 +08:00
Cheng Zhao
11e4111f25 Recognize the "@2x" suffix of icon's filename. 2014-06-23 13:09:06 +08:00
Cheng Zhao
6cac69238c mac: Convert from ImageSkia to NSImage to reserve DPI info. 2014-06-23 12:59:10 +08:00
Cheng Zhao
17842e06aa Merge pull request #420 from atom/process-main-module
remote.require should search module from user's app
2014-06-22 15:07:23 +08:00
Cheng Zhao
fe6eac6c7d Fix refreshing the spec window. 2014-06-22 14:59:14 +08:00
Cheng Zhao
ae3958c997 The default_app should also set process.mainModule. 2014-06-22 14:57:11 +08:00
Cheng Zhao
9c84f92f3e remote.require should use process.mainModule.require. 2014-06-22 14:56:30 +08:00
Cheng Zhao
48224a6455 Set process.mainModule to user's app. 2014-06-22 14:56:00 +08:00
Cheng Zhao
41b9add5d6 Add spec for checking process.mainModule. 2014-06-22 14:55:41 +08:00
Kevin Sawicki
716c7ee6f4 Merge pull request #418 from sprintr/master
Removed a typo
2014-06-21 12:05:29 -07:00
Amin Ullah Khan
3d89181e96 Removed a typo
Fix for #416
2014-06-21 20:34:31 +05:00
Cheng Zhao
32323a0006 Bump v0.13.2. 2014-06-18 01:09:04 +00:00
Cheng Zhao
6493bc4c8c Merge pull request #408 from FWeinb/patch-1
Update `tray` example to wait for app.on('ready')
2014-06-18 09:07:27 +08:00
Cheng Zhao
6d404d1cc4 Merge pull request #409 from atom/ks-escape-accelerator
Escape accelerator
2014-06-18 08:59:42 +08:00
Kevin Sawicki
edc043c924 Make escape to ui::VKEY_ESCAPE 2014-06-17 14:47:35 -07:00
FWeinb
dca50fcec3 Update example to wait for app.on('ready')
Related to Issue #383
2014-06-17 18:06:15 +02:00
Cheng Zhao
f0e297ba77 Merge pull request #407 from atom/detached-devtools
Enable detached devtools
2014-06-17 18:40:57 +08:00
Cheng Zhao
8a8ffbebf9 Update brightray to fix detached devtools. 2014-06-17 18:32:21 +08:00
Cheng Zhao
f4aadcbbfc Do not disable detached devtools. 2014-06-17 16:35:23 +08:00
Cheng Zhao
81eedd4faf mac: Fix handling event from other windows. 2014-06-17 16:35:19 +08:00
Cheng Zhao
74fe964f75 Merge pull request #406 from atom/webview
Provide ways to set page's zoom level
2014-06-17 16:14:22 +08:00
Cheng Zhao
a138b5ec8b 📝 Document the 'zoom-factor' option. 2014-06-17 15:59:46 +08:00
Cheng Zhao
054daadc33 💄 Fix cpplint warnings. 2014-06-16 21:29:18 +08:00
Cheng Zhao
05f079fa5b Allow setting default zoom factor. 2014-06-16 18:52:04 +08:00
Cheng Zhao
0bc8251e1b 📝 Document the web-view module. 2014-06-16 14:56:24 +08:00
Cheng Zhao
8c264b9a07 Add zoom factor APIs alternative to zoom level. 2014-06-16 14:40:02 +08:00
Cheng Zhao
accfabf569 Add web-view module. 2014-06-16 14:27:57 +08:00
Cheng Zhao
4a7a417423 Merge pull request #404 from atom/skip-taskbar
Add BrowserWindow.setSkipTaskbar API
2014-06-16 11:00:43 +08:00
Cheng Zhao
386ef9197c 📝 Document the setSkipTaskbar API. 2014-06-16 10:51:45 +08:00
Cheng Zhao
d4e9518ec6 win: Implement setSkipTaskbar. 2014-06-16 10:49:55 +08:00
Cheng Zhao
70d3365414 gtk: Add BrowserWindow.setSkipTaskbar API. 2014-06-16 10:29:51 +08:00
Cheng Zhao
a8cb839734 webContents.executeJavaScript should run code after page is loaded.
Fixes atom/atom#1805.
2014-06-16 09:10:41 +08:00
Cheng Zhao
5270eab512 Do not assume trailing callback in dialog API, fixes #395. 2014-06-15 12:43:28 +08:00
Cheng Zhao
bf5fc2db9b Merge pull request #397 from RobberPhex/master
Add document for browser-window's icon
2014-06-14 22:42:53 +08:00
Cheng Zhao
c97e849610 Bump v0.13.1. 2014-06-14 22:27:06 +08:00
Cheng Zhao
2cdcb45d16 Support INSERT in accelerator, fixes #398. 2014-06-14 22:25:21 +08:00
RobberPhex
df8b9f69b1 Add document for browser-window's icon 2014-06-14 00:11:49 +08:00
Cheng Zhao
b431566421 mac: Make sure web view is the first responder of window, fixes #382. 2014-06-11 15:57:40 +08:00
Cheng Zhao
4aa217970e win: Implement attached devtools, fixes #373. 2014-06-11 11:03:10 +08:00
Cheng Zhao
444fe8bf1f 📝 Fix the outdated menu example, closed #389. 2014-06-10 13:29:09 +08:00
Cheng Zhao
f063a63b69 📝 Remove the dead link, fixes #390. 2014-06-10 13:17:41 +08:00
Cheng Zhao
1d6b02f304 mac: Restore presentation options when leaving kiosk mode, fixes #272. 2014-06-09 13:04:59 +08:00
Cheng Zhao
7d38fe61d2 "did-finish-load" should only emit for main frame, fixes #385. 2014-06-09 12:03:19 +08:00
Cheng Zhao
2b0ec2bcc6 Bump v0.13.0. 2014-06-05 07:14:32 +00:00
Cheng Zhao
c575d40d63 💄 Fix clipboard on Linux. 2014-06-05 15:22:36 +08:00
Cheng Zhao
950704c7e8 Provide API to access selection clipboard, fixes #377. 2014-06-05 14:48:12 +08:00
Cheng Zhao
7c14c2758b Return unicode string in clipboard.readText(), fixes atom/atom#2145. 2014-06-05 11:43:45 +08:00
Cheng Zhao
ac1a03bf9c Merge pull request #379 from atom/32bit-linux
Support 32bit build on Linux
2014-06-05 10:51:49 +08:00
Cheng Zhao
232b8721fe Contain arch in distribution name. 2014-06-04 15:24:38 +00:00
Cheng Zhao
d82ceda770 Upgrade libchromiumcontent to 765ec5dcf192845fed4aec0b117f1e53050911d6. 2014-06-04 22:16:29 +08:00
Cheng Zhao
5fe84a997f Upgrade to latest brightray. 2014-06-04 22:05:12 +08:00
Cheng Zhao
15127f7b4b Upgrade libchromiumcontent to 64b6768f1d24318bd35b538658dacd429c544377. 2014-06-03 15:43:00 +08:00
Cheng Zhao
04cbb76776 win: Remove focus listener after window is closed, fixes #364. 2014-06-03 14:39:47 +08:00
Cheng Zhao
98aba2aa12 Merge pull request #375 from atom/status-icon
Tray module
2014-06-03 14:27:21 +08:00
Cheng Zhao
53092cfb7c win: Fix context menu clicking in notify icon. 2014-06-03 14:11:12 +08:00
Cheng Zhao
9ef7ecbdaf Win: Implement context menu for tray icon. 2014-06-03 11:52:57 +08:00
Cheng Zhao
1cb135f7f2 win: Implement tray icon API. 2014-06-03 11:25:09 +08:00
Cheng Zhao
08e7c07c57 Add StatusTrayStateChangerWindow from chrome. 2014-06-03 11:24:40 +08:00
Cheng Zhao
01e93c108c 📝 Mention platform limitations on Linux. 2014-06-02 23:18:14 +08:00
Cheng Zhao
540e6ff01b gtk: Implement click event for status icon. 2014-06-02 23:10:36 +08:00
Cheng Zhao
4647efd22f 💄 Fix cpplint warning. 2014-06-02 11:47:37 +08:00
Cheng Zhao
884f30010c 📝 Document the tray module. 2014-06-02 11:47:22 +08:00
Cheng Zhao
da31588e0d mac: Implement the "click" event of TrayIcon. 2014-06-02 11:28:23 +08:00
Cheng Zhao
cbd9366898 Add "click" event for TrayIcon. 2014-06-02 11:08:29 +08:00
Cheng Zhao
9699dbb71f gtk: Add app indicator support as tray icon. 2014-06-01 10:20:06 +08:00
Cheng Zhao
065185baea gtk: Add TrayIcon implementation for GtkStatusIcon. 2014-05-31 10:27:07 +08:00
Cheng Zhao
6c7fe80ec5 Bind TrayIcon to JS. 2014-05-30 23:57:54 +08:00
Cheng Zhao
52d8d6fdb3 Add native_mate converters for ImageSkia. 2014-05-30 23:05:24 +08:00
Cheng Zhao
6f5184f001 mac: Simple implementation of tray icon. 2014-05-30 14:37:53 +08:00
Cheng Zhao
80fb79daac Add dummy implementations for TrayIcon. 2014-05-30 10:31:27 +08:00
Cheng Zhao
dd804b090a 📝 Menu.setApplicationMenu is not OS X only. 2014-05-30 09:03:29 +08:00
Cheng Zhao
c7d0da2cfd Merge pull request #363 from atom/application-locale
Implement navigator.language
2014-05-29 21:54:04 +08:00
Cheng Zhao
2da5bcb0b8 Fix cpplint warning. 2014-05-29 21:24:22 +08:00
Cheng Zhao
b073d35918 Add spec for application locale. 2014-05-29 20:23:28 +08:00
Cheng Zhao
16bc7f10c1 Generate .pak for each locale. 2014-05-29 19:08:59 +08:00
Cheng Zhao
f57bcfc429 mac: Fix en-US locale. 2014-05-29 17:13:24 +08:00
Cheng Zhao
7bd0c8aa06 mac: Create .lproj files for each locale. 2014-05-29 15:54:45 +08:00
Cheng Zhao
162e47ca15 Initialize locale on mac. 2014-05-29 15:54:25 +08:00
Cheng Zhao
649730244b Override application locale with system default locale. 2014-05-29 15:21:15 +08:00
Cheng Zhao
2efd91c150 Bump v0.12.7. 2014-05-27 06:16:37 +00:00
Cheng Zhao
7297faf09a 📝 Fix some old docs. 2014-05-27 14:20:22 +08:00
Cheng Zhao
a7b730654c mac: Add APIs on setting icon in titlebar. 2014-05-27 14:15:34 +08:00
Cheng Zhao
2f5dfb1dc7 Do not init Menu lazily, otherwise empty menus would be invalid. 2014-05-27 09:10:54 +08:00
Cheng Zhao
541b855512 Move the ability of calling _init to native_mate. 2014-05-27 08:47:53 +08:00
Cheng Zhao
8b42990bb3 Bump v0.12.6. 2014-05-26 13:34:57 +00:00
Cheng Zhao
5b216ee0e6 Merge pull request #354 from atom/automatic-group-id
Improve radio and checkbox menu items support
2014-05-26 21:40:56 +08:00
Cheng Zhao
9b8edeb609 Fix specs. 2014-05-26 13:01:26 +08:00
Cheng Zhao
15d9b320db 💄 Organize Menu and MenuItem's code. 2014-05-26 12:40:21 +08:00
Cheng Zhao
d38ffea4a3 win: Setting enabled/visiable should also update menu. 2014-05-26 12:00:20 +08:00
Cheng Zhao
dfa1ae1c20 win: Update states when setting checked property. 2014-05-26 11:34:36 +08:00
Cheng Zhao
6ee437e9bf win: Force menuWillShow to be called when setting window menu. 2014-05-26 09:38:04 +08:00
Cheng Zhao
0e5f697b48 win: Update menu states when setting menu bar. 2014-05-26 09:18:19 +08:00
Cheng Zhao
22927c9478 Fix error when showing empty menu. 2014-05-25 16:37:45 +08:00
Cheng Zhao
f07d8c5677 Quit when get uncaughtException in specs. 2014-05-25 16:16:29 +08:00
Cheng Zhao
cd35430d0e mac: Make sure menuWillShow is called when setting application menu. 2014-05-25 15:42:23 +08:00
Cheng Zhao
6a48568911 Radio menu items should have at least one item checked.
This is to force all platforms to match the same behavior in GTK+.
2014-05-25 15:25:36 +08:00
Cheng Zhao
3921895dd5 Add specs for radio menu items. 2014-05-25 13:01:53 +08:00
Cheng Zhao
aa17b3adc2 Setting a radio menu item should flip other items in the group. 2014-05-25 12:47:38 +08:00
Cheng Zhao
04fbec5120 Generate menu group id automatically.
In GTK+ radio menu items are managed automatically, so group id won't
have any effect there, in the meanwhile we need to maintain the same
behavior on all platforms, so we have to generate group id instead of
letting users specifying it.
2014-05-25 12:37:00 +08:00
Cheng Zhao
76d0d3ec19 gtk: Fix setting unresizable window. 2014-05-25 11:44:25 +08:00
Cheng Zhao
fd99d21c8f Make menu's checked property flipped automatically, fixes #349. 2014-05-25 11:32:29 +08:00
Cheng Zhao
6a071e1b4d win: Implement focus and blur event. 2014-05-24 13:04:04 +08:00
Cheng Zhao
393d61b362 Override app version and name when loading apps from default_app.
Fixes #346.
2014-05-24 11:18:06 +08:00
Cheng Zhao
3d2464c30e 📝 Fix typos regarding to #349. 2014-05-24 10:41:54 +08:00
Cheng Zhao
890448d5fa Merge pull request #351 from atom/custom-web-preferences
Enable custom web preferences
2014-05-23 23:18:06 +08:00
Cheng Zhao
2984c0d521 📝 Add details on plugins support. 2014-05-23 23:07:38 +08:00
Cheng Zhao
fc9fd46308 gtk: Fix the focus event. 2014-05-23 23:00:04 +08:00
Cheng Zhao
542e795fe0 📝 Mention atom-shell's changes to the process object. 2014-05-23 22:56:56 +08:00
Cheng Zhao
fc1bc78fb9 Merge pull request #343 from gmr/master
Add a `focus` event to BrowserWindow
2014-05-23 22:49:59 +08:00
Cheng Zhao
2565a4e71b Merge pull request #347 from SeriousM/patch-2
Add information about the crash-reporter payload
2014-05-23 22:48:31 +08:00
Cheng Zhao
23d2dc5007 📝 Document the 'web-preferences' option. 2014-05-22 23:58:02 +08:00
Cheng Zhao
1fbebb0da7 Add 'extra-plugin-dirs' option. 2014-05-22 23:48:00 +08:00
Cheng Zhao
2204e9bb15 Add 'web-preferences' options in BrowserWindow. 2014-05-22 22:54:09 +08:00
Bernhard Millauer
8fd31106ca Add information about the crash-reporter payload 2014-05-22 14:20:17 +02:00
Cheng Zhao
34fa0f1ff8 📝 Add docs on BrowserWindow.id. 2014-05-22 09:56:04 +08:00
Cheng Zhao
d49060d659 Add "id" property for BrowserWindow, fixes #218. 2014-05-22 09:51:58 +08:00
Cheng Zhao
764deab5c1 Make the default_app unresizable. 2014-05-22 09:09:32 +08:00
Cheng Zhao
28e266ac11 mac: Include more information in Info.plist, fixes #340. 2014-05-22 09:03:02 +08:00
Gavin M. Roy
b08ec402d2 Add a focus event to BrowserWindow
- Tested in OSX
- Untested in GTK, but I expect it should work
- Did not see any similar constructs for notifications in Windows
2014-05-21 13:46:13 -04:00
Cheng Zhao
9721c4e761 Rename process.__atom_type to process.type. 2014-05-21 22:44:43 +08:00
Cheng Zhao
70c96eeac6 📝 frameworks => external_binaries. 2014-05-21 22:41:46 +08:00
Cheng Zhao
c2efc4aeb3 📝 Remove unneeded install dependency on Ubuntu. 2014-05-21 22:38:17 +08:00
Cheng Zhao
55640a3ff7 win: Make sure shell.showItemInFolder in called on browser side.
Fixes #341.
2014-05-21 22:31:44 +08:00
Cheng Zhao
dc907f501c win: Fix the resizable flag, closed #316. 2014-05-20 23:37:14 +08:00
Cheng Zhao
972bb2e9fb Make sure webContents is created when opening devtools.
Fixes atom/atom#2270.
2014-05-20 20:58:11 +08:00
Cheng Zhao
754abbd39c Bump v0.12.5. 2014-05-19 02:02:33 +00:00
Cheng Zhao
b89ef80481 Skip the webgl spec on Linux.
WebGL just usually don't work on Linux in virtual machines.
2014-05-19 02:00:59 +00:00
Cheng Zhao
b2abeb9beb Merge pull request #330 from atom/windows-webgl
Fix WebGL support on Windows
2014-05-19 00:02:34 +08:00
Cheng Zhao
59293bc938 Only build Debug target in cibuild. 2014-05-18 23:52:14 +08:00
Cheng Zhao
c1e2348695 Check for version when downloading external binaries. 2014-05-18 23:42:47 +08:00
Cheng Zhao
9754050598 Rename "frameworks" to "external_binaries". 2014-05-18 23:35:07 +08:00
Cheng Zhao
6358fd1a4b Ship WebGL necessary files in distribution. 2014-05-18 23:15:53 +08:00
Cheng Zhao
a83787ea42 Update libchromiumcontent for libEGL.dll. 2014-05-18 23:11:32 +08:00
Cheng Zhao
8f9e0d8d59 Download dirextx sdk dlls. 2014-05-18 23:03:46 +08:00
Cheng Zhao
d5171ab941 Add spec for checking webgl support. 2014-05-18 22:37:59 +08:00
Cheng Zhao
a0e1174304 Merge pull request #326 from jcanaway/patch-1
Updated example of implementing a protocol.
2014-05-18 22:22:43 +08:00
Cheng Zhao
6799fe5393 Merge pull request #327 from atom/content-size
Provide ways to control window content's size
2014-05-18 21:46:37 +08:00
Cheng Zhao
6b51dad973 📝 Document content size related APIs. 2014-05-18 21:33:31 +08:00
Cheng Zhao
8ae66cab9d win: Implement setContentSize API. 2014-05-18 21:27:23 +08:00
Cheng Zhao
0b202a2df1 win: Setting menu shouldn't change client area size. 2014-05-18 21:19:38 +08:00
Cheng Zhao
ee336b4218 win: Convert content size to window size. 2014-05-18 21:16:33 +08:00
Cheng Zhao
1b3fc53a95 Merge pull request #322 from pullreq/patch-1
10.8+, preexisting node required.
2014-05-18 20:17:19 +08:00
Cheng Zhao
4d9f19f660 Update to latest brightray. 2014-05-18 20:00:43 +08:00
Cheng Zhao
c407588821 📝 Add usage of VS console in troubleshooting, regarding #306. 2014-05-18 19:59:43 +08:00
Josh Canaway
037ca07847 Updated example of implementing a protocol.
These changes demonstrates a more usable protocol implementation.
2014-05-18 06:33:10 -04:00
Geoff Nixon
75ce386065 10.8+, preexisting node required.
I'm presently giving 10.7 support the old college try (building against the 10.7 SDK with Xcode 5.1, not necessarily supporting the Xcode 4.6 toolchain), but I thought this should be updated in the meantime. It also seems possible to me that the pre-installed node requirement is somewhat accidental. Since we have the source checked out already, it should be rather trivial to build an intermediate "bootstrap" node if there isn't one found in the path. Do it?
2014-05-15 18:07:08 -07:00
Kevin Sawicki
a5e49c0c6f Merge pull request #311 from SeriousM/patch-1
Documentation: Add more BrowserWindow methods
2014-05-15 13:35:07 -07:00
Kevin Sawicki
30f6ddf113 Merge pull request #320 from avdg/pathwatcher
Upgrade to pathwatcher@1.3.1
2014-05-15 13:34:06 -07:00
Anthony Van de Gejuchte
bbeb3beecd Upgrade to pathwatcher@1.3.1 2014-05-15 19:31:19 +02:00
Bernhard Millauer
cb324181ad Replaced restart with reload
because restart is deprecated
2014-05-15 14:21:37 +02:00
Cheng Zhao
0dc3e6ac7c 💄 Fix cpplint warning. 2014-05-15 16:44:56 +08:00
Cheng Zhao
bef22e80c8 Add spec on content size. 2014-05-15 16:41:13 +08:00
Cheng Zhao
64da04777e gtk: Fix setting content size. 2014-05-15 16:27:18 +08:00
Cheng Zhao
5150fd6946 Add BrowserWindow::setContentSize. 2014-05-15 16:06:12 +08:00
Cheng Zhao
511a49f6fb gtk: Respect use-content-size when creating window. 2014-05-15 15:38:22 +08:00
Cheng Zhao
76cc3eeb6d Get BrowserWindow::getContentSize API. 2014-05-15 15:30:04 +08:00
Cheng Zhao
8d5fbe525d Use content size in default_app. 2014-05-15 15:29:53 +08:00
Cheng Zhao
074ac051d2 mac: Respect use-content-size when creating window. 2014-05-15 15:19:02 +08:00
Cheng Zhao
e22a8d0a49 Add use-content-size switch. 2014-05-15 15:18:46 +08:00
Cheng Zhao
f2281957ce 📝 VS2010 SP1 is required, fixes #306. 2014-05-15 14:32:34 +08:00
Cheng Zhao
d38bc95f04 📝 More instructions on installing under Ubuntu, closes #315. 2014-05-15 14:13:41 +08:00
Cheng Zhao
b243aea5c8 Merge pull request #314 from atom/add-community-info-to-readme
add community docs
2014-05-15 10:18:43 +08:00
Daniel Hengeveld
1f0116af13 add community docs 2014-05-14 11:32:24 -07:00
Bernhard Millauer
2dfbe0b5d3 Add BrowserWindow.setMenu(menu) 2014-05-14 18:19:30 +02:00
Bernhard Millauer
08115d57fd Add BrowserWindow.restart() 2014-05-14 18:06:56 +02:00
Cheng Zhao
afd927f749 Use system's setting for font renderering, fixes #301. 2014-05-14 16:54:07 +08:00
Cheng Zhao
cfeb00e629 Only report "app invalid" error when app could not be loaded, fixes #294. 2014-05-14 16:27:40 +08:00
Cheng Zhao
e415c66f68 Upgrade node: Enable ArrayBufferAllocator, fix #308. 2014-05-14 16:16:35 +08:00
Cheng Zhao
0798896936 Add spec for #308. 2014-05-14 16:16:35 +08:00
Cheng Zhao
b2c25a3efd Merge pull request #304 from kramerc/graphics-switching
Fix Atom Shell from always using the discrete GPU
2014-05-14 10:32:33 +08:00
Cheng Zhao
e1fbe7d886 Merge pull request #307 from SeriousM/patch-1
The source_root was wrong computed
2014-05-14 10:29:16 +08:00
Bernhard Millauer
75fcafa013 The source_root was wrong computed
Using 'SOURCE_ROOT = os.path.dirname(os.path.dirname(__file__))' leads to an empty string if the path is relative.
2014-05-14 01:07:26 +02:00
Kramer Campbell
59ecf7bb50 Add missing graphics switching attribute.
Atom Shell was causing the GPU to be switched to the discrete card as
this attribute was missing from Info.plist files in common/ and
renderer/
2014-05-13 09:33:54 -07:00
Cheng Zhao
0521663076 Ship with libnotify.so. 2014-05-13 21:03:55 +08:00
Cheng Zhao
d42dc9baba Do not copy system libraries with permission bits. 2014-05-13 21:03:32 +08:00
Cheng Zhao
64bc157d1a Only open url in browser for GET request, fixes #299. 2014-05-13 14:49:48 +08:00
Cheng Zhao
cf887379e1 Bump v0.12.4. 2014-05-12 21:44:33 +08:00
Cheng Zhao
90477321fe gtk: Show the menu after it has been added to window, fixes #292. 2014-05-12 21:33:08 +08:00
Cheng Zhao
47cbcd5278 Merge pull request #288 from jhiggins-thrillist/patch-1
Fixed typo in BrowserWindow API Documentation
2014-05-12 12:27:39 +08:00
Joseph Higgins
7c77ab060a Fixed typo in BrowserWindow API Documentation 2014-05-10 14:18:40 -04:00
Cheng Zhao
ff9450305e Merge pull request #285 from GregMefford/patch-3
Doc: grammar/content fixes in the remote module
2014-05-10 21:19:29 +08:00
Cheng Zhao
e72e21f481 Merge pull request #284 from GregMefford/patch-2
Doc: grammatical fixes in Windows build docs
2014-05-10 21:17:49 +08:00
Cheng Zhao
2416056444 Merge pull request #283 from GregMefford/patch-1
Doc: Grammatical fixes to synopsys.md
2014-05-10 21:17:28 +08:00
Cheng Zhao
d98ba5f2b3 Merge pull request #286 from yaotti/patch-1
Fix a typo
2014-05-10 21:17:07 +08:00
Hiroshige Umino yaotti
ecbb46344c Fix a typo 2014-05-10 18:47:54 +09:00
Greg Mefford
74c517d186 Doc: grammar/content fixes in the remote module
Mostly minor grammatical issues, but also some content that seems to be incorrect based on the surrounding descriptions and example code.
2014-05-09 23:51:25 -04:00
Greg Mefford
257964d13e Doc: grammatical fixes in Windows build docs
Minor documentation changes to fix typos and clarify some phrasing
2014-05-09 22:11:17 -04:00
Greg Mefford
9e0b1b864b Doc: Grammatical fixes to synopsys.md 2014-05-09 21:17:10 -04:00
Cheng Zhao
d9e1861aff linux: Ship system dynamic libraries, closes #278. 2014-05-09 19:29:18 +08:00
Cheng Zhao
42c2f87217 Merge pull request #276 from atom/quitting-unresponsive
Fix emitting unresponsive event when closing window
2014-05-09 13:33:39 +08:00
Cheng Zhao
77d6bb2c3f Bring the close timeout back to 5s. 2014-05-09 12:10:37 +08:00
Cheng Zhao
3e6df19eff Do not send "unresponsive" when window is closed. 2014-05-09 12:08:15 +08:00
Cheng Zhao
a070f0fdb6 Only cancel unresponsive event when window close is cancelled. 2014-05-09 11:40:48 +08:00
Cheng Zhao
146ce284de Do not override pending unresponsive counter. 2014-05-09 11:38:57 +08:00
Cheng Zhao
6c76d9751f Print the script running in cibuild. 2014-05-09 10:17:02 +08:00
Cheng Zhao
1321fb8151 Assume users are using Xcode 5.1. 2014-05-09 10:04:49 +08:00
Cheng Zhao
d10292d95c Do not receive notifications after window is closed, fixes #265. 2014-05-09 09:47:11 +08:00
Cheng Zhao
676b1e0bc7 Fix closing a crashed window, closes #269. 2014-05-09 09:26:46 +08:00
Cheng Zhao
6483cd0b43 Merge pull request #273 from weakish/patch-1
doc atom-shell-vs-node-webkit: typo
2014-05-08 18:01:51 +08:00
Jakukyo Friel
123e20c688 doc atom-shell-vs-node-webkit: typo 2014-05-08 15:38:28 +08:00
Cheng Zhao
7c9c3170f5 Merge pull request #266 from dougnukem/patch-2
Update "app" to "your-app" to avoid module collision with require('app')
2014-05-08 12:22:00 +08:00
Cheng Zhao
90a472cd1d Merge pull request #267 from kramerc/patch-1
Correct WebContents send example.
2014-05-08 09:40:39 +08:00
Cheng Zhao
ed744bf1d2 Do not rely on external server in spec. 2014-05-08 09:20:01 +08:00
Kramer Campbell
72f6575fc4 Correct WebContents send example. 2014-05-07 16:32:02 -07:00
Doug Daniels
90538d0e16 Update "app" to "your-app" to avoid module collision with require('app')
If you name your app's folder `app/` and if you run the atom-shell from the directory above that, it will result in an error, which I believe is caused by resolving `require('app')` to your `app/` folder.

So just to avoid confusion where someone might create an app with that folder and run the atom-shell from that directory.


I wrote up some details getting atom-shell working using the grunt plugin.

- https://github.com/atom/atom-shell/issues/256#issuecomment-42464026
2014-05-07 14:21:13 -05:00
Cheng Zhao
2b5a0e28e3 Make timeout longer for some could-be-slow specs. 2014-05-07 23:12:24 +08:00
Cheng Zhao
d940330a7c Merge pull request #263 from Navgeet/bump
bump apm to 0.50.x
2014-05-07 22:51:17 +08:00
Cheng Zhao
d26b226bd2 Merge pull request #264 from NKMR6194/master
Fixed typos
2014-05-07 22:50:42 +08:00
Navgeet Agrawal
b4890512a9 bump apm to 0.50.x 2014-05-07 16:41:50 +05:30
SAKATA Sinji
1bce2ec0e9 Fixed typos 2014-05-07 20:04:14 +09:00
Cheng Zhao
1b3658171f Bump v0.12.3. 2014-05-07 15:33:32 +08:00
Cheng Zhao
53faf2bde4 Merge pull request #261 from pborreli/typos
Fixed typos
2014-05-07 14:49:40 +08:00
Pascal Borreli
831c7f5924 Fixed typos 2014-05-07 07:34:53 +01:00
Cheng Zhao
c12ba5d221 Merge pull request #258 from commadelimited/doc-fixes
Capitilization, grammar, and punctuation changes
2014-05-07 14:04:06 +08:00
andy matthews
f263a8e9d5 Capitilization, grammar, and punctuation changes 2014-05-07 00:06:35 -05:00
Cheng Zhao
a69c312389 Fixes auto updater regression, closes atom/atom#1949. 2014-05-07 11:32:06 +08:00
Cheng Zhao
f280590adf Merge pull request #255 from dougnukem/patch-1
minor spelling fix and grammar
2014-05-07 10:00:11 +08:00
Cheng Zhao
779e7765ae 💄 Fix format. 2014-05-07 09:47:58 +08:00
Cheng Zhao
f25480dec5 📝 Say more on sending messages from browser to web page. 2014-05-07 09:45:39 +08:00
Doug Daniels
70194d2632 minor spelling fix and grammar 2014-05-06 20:30:58 -05:00
Cheng Zhao
a67c54869f Make sure the job factory is created when initializing protocol module.
Fixes atom/atom#1963, the regression came when moving to use native-mate
to reimplment the APIs.
2014-05-07 09:17:46 +08:00
Cheng Zhao
c841d90529 linux: Be quiet when uploading crash report. 2014-05-07 09:05:00 +08:00
Cheng Zhao
d0b8b478fc Merge pull request #246 from Dorian/patch-1
Update quick-start.md: Minor wording changes
2014-05-07 08:38:04 +08:00
Kevin Sawicki
f25caabe9a Merge pull request #252 from CoolOppo/patch-1
Update README.md
2014-05-06 11:35:52 -07:00
CoolOppo
abe4b73d43 Update README.md
Fixed a small typo
2014-05-06 14:34:02 -04:00
Kevin Sawicki
d0e255816d Merge pull request #247 from quicksnap/patch-1
missing adjective =)
2014-05-06 09:53:57 -07:00
Dan Schuman
0c9794eefa Update atom-shell-vs-node-webkit.md 2014-05-06 09:52:24 -07:00
Dan Schuman
2a22a47322 missing adjective =) 2014-05-06 09:46:29 -07:00
Dorian Marié
38178fb3c8 Quick-start.md: Emphasis on important concepts of atom-shell 2014-05-06 13:04:13 -03:00
Dorian Marié
ca845aa35e Update quick-start.md: Minor wording changes 2014-05-06 12:55:34 -03:00
Cheng Zhao
de5939456f Merge pull request #243 from hughsk/enable-webgl
Enable WebGL
2014-05-06 20:23:45 +08:00
Hugh Kennedy
da0eee6298 Enable WebGL
Enabling the `experimental_webgl_enabled` preference allows you
to create a WebGL context from within atom-shell.

While not necessarily important for the Atom editor, for others
to use atom-shell in substitution for node-webkit this is a
potentially useful feature, e.g. for packaged HTML5 games.
2014-05-06 10:43:58 +02:00
Cheng Zhao
444a094eda Fix subtitle 2014-05-06 15:22:29 +08:00
Cheng Zhao
d2f3d83678 💄 Remove redundant empty line. 2014-05-06 15:20:47 +08:00
Cheng Zhao
5eb2b33018 📝 Add technical differences to node-webkit, fixes #242. 2014-05-06 15:16:54 +08:00
Cheng Zhao
5b5651882e Squirrel.Mac is open sourced. 2014-05-06 11:22:03 +08:00
Kevin Sawicki
856bb9060c 📝 Add missing space 2014-05-05 20:13:19 -07:00
Kevin Sawicki
71d82f7ff8 Add Travis badge 2014-05-05 14:19:16 -07:00
Kevin Sawicki
2e5de25383 Listen on 0 to get random port 2014-05-05 14:06:47 -07:00
Kevin Sawicki
bed0408ed0 Add initial Travis config 2014-05-05 13:37:28 -07:00
probablycorey
da30e3348e Update readme 2014-05-05 11:56:53 -07:00
Kevin Sawicki
3a78b5fa13 Use tabs instead of spaces 2014-05-05 11:52:41 -07:00
Corey Johnson
1515ff1a08 Merge pull request #235 from atom/open-source
Open source atom-shell
2014-05-05 11:19:49 -07:00
Cheng Zhao
9e80010e1a Bump v0.12.2. 2014-05-05 17:13:13 +08:00
Cheng Zhao
e5e3a6837a Better window height for default_app. 2014-05-05 17:12:39 +08:00
Cheng Zhao
0d39249025 Merge pull request #240 from atom/friendly-default-app
Provide a friendly interface for opening an app
2014-05-05 17:04:14 +08:00
Cheng Zhao
0e7c7ca34b Also report when user provided strange files. 2014-05-05 16:50:11 +08:00
Cheng Zhao
f0e5cae9bb Disable elastic scrolling. 2014-05-05 16:48:58 +08:00
Cheng Zhao
f943f54ad5 Linkify the docs in default_app. 2014-05-05 16:46:25 +08:00
Cheng Zhao
c6448d0607 Use dialog to report invalid app. 2014-05-05 16:35:06 +08:00
Cheng Zhao
84bf956725 Enable dragging to open an app. 2014-05-05 16:30:37 +08:00
Cheng Zhao
854295c0a6 Add some styles. 2014-05-05 16:02:52 +08:00
Cheng Zhao
a132d2e5a0 Show a friendly guide when atom-shell is opened without app. 2014-05-05 15:45:50 +08:00
Cheng Zhao
5c55b9412f 📝 Add Synopsis chapter. 2014-05-05 14:49:05 +08:00
Cheng Zhao
5933947000 📝 Simpilify the structure of API references. 2014-05-05 14:24:57 +08:00
Cheng Zhao
3c0ec73d75 win: Fix dumping symbols. 2014-05-05 12:24:30 +08:00
Cheng Zhao
fae3cf9a55 📝 Add Squirrel's server settings in auto-updater doc. 2014-05-05 10:07:15 +08:00
Cheng Zhao
37275c64cd 📝 Mention 64/32 bit support on each platform. 2014-05-05 09:48:44 +08:00
Cheng Zhao
de0be312be Bump v0.12.1. 2014-05-05 01:47:46 +00:00
Cheng Zhao
4da509f928 📝 A simpler README. 2014-05-04 20:58:59 +08:00
Cheng Zhao
f176b2c58f Switch to use MIT license. 2014-05-04 20:29:08 +08:00
Cheng Zhao
9b9cfcfeaa 📝 Update source code structure. 2014-05-04 20:15:20 +08:00
Cheng Zhao
8a8048a629 Merge pull request #239 from atom/tutorials
Improve the tutorials
2014-05-04 18:32:56 +08:00
Cheng Zhao
69821cdb96 📝 Separate the application distribution chapter out. 2014-05-04 18:32:12 +08:00
Cheng Zhao
98a49fa155 📝 Update the quick start on writing the app. 2014-04-30 17:28:36 +08:00
Cheng Zhao
aa54df7e44 📝 Simpler introduction in quick start. 2014-04-30 16:39:49 +08:00
Cheng Zhao
a9748f6cc6 📝 Say some more about native node modules. 2014-04-30 15:03:14 +08:00
Cheng Zhao
f7cf3ad867 Restructure the docs to put more tutorials. 2014-04-30 14:52:58 +08:00
Cheng Zhao
a85db2d780 Deprecate the BrowserWindow.restart.
Now BrowserWindow.reload would just do the same thing.
2014-04-29 15:44:41 +08:00
Cheng Zhao
19698fc739 Move "restart()" API to webContents. 2014-04-29 15:22:06 +08:00
Cheng Zhao
8342c7cfe1 Bump v0.12.0. 2014-04-29 12:02:53 +08:00
Cheng Zhao
6df86afef8 Discard usage of deprecated APIs. 2014-04-29 11:54:12 +08:00
Cheng Zhao
ac31dc9672 Do not put modules used by specs on the root.
Modules in root is now installed by npm, and the native modules are now
not usable by atom-shell.
2014-04-29 11:51:49 +08:00
Cheng Zhao
dc9778f0f2 Fix compilation error on Windows. 2014-04-29 11:39:31 +08:00
Cheng Zhao
4addd8d227 win: Fix executing apm. 2014-04-29 11:12:41 +08:00
Cheng Zhao
b6fa1141fe 📝 Add troubleshooting in windows build instructions. 2014-04-29 11:07:17 +08:00
Cheng Zhao
ec63cc09db Fix executing npm under cygwin. 2014-04-29 11:07:02 +08:00
Cheng Zhao
d15bb62f72 Merge pull request #238 from atom/cj-move-frameworks
Move framework downloads to GitHub release
2014-04-29 10:19:56 +08:00
Cheng Zhao
042d90c047 Use 0.0.2 release. 2014-04-29 02:03:03 +00:00
Cheng Zhao
739484f1d1 💄 Fix pylint warning. 2014-04-29 02:00:57 +00:00
Cheng Zhao
dc35586be1 Merge pull request #237 from atom/apm-from-npm
Install apm from npm
2014-04-29 09:59:29 +08:00
Cheng Zhao
9afcf80d02 Upgrade to apm@0.44.x 2014-04-29 09:53:35 +08:00
probablycorey
a60fa6989a Use atom/atom-shell-frameworks until atom/atom-shell is public 2014-04-28 11:09:03 -07:00
probablycorey
b69db7ff67 Move framework downloads to github release 2014-04-28 10:49:49 -07:00
Cheng Zhao
f762ce5d06 💄 Fix pylint warning. 2014-04-28 11:57:05 +08:00
Cheng Zhao
97f0314589 Fix printing in specs. 2014-04-28 03:55:56 +00:00
Cheng Zhao
6337888a34 No need to install npm any more, the one in CI is new enough. 2014-04-28 11:42:14 +08:00
Cheng Zhao
3ccd90a690 Install apm from npm, fixes #236. 2014-04-28 11:37:46 +08:00
Cheng Zhao
97006bcbc3 Bump the close timeout to 10s.
Fixes atom/atom#1838.
2014-04-26 13:15:41 +08:00
Cheng Zhao
3584d48dbe Merge pull request #234 from atom/api-web-contents
Separate out WebContents API to a new class
2014-04-25 09:41:58 +00:00
Cheng Zhao
85f6edb815 📝 Update docs of ipc module. 2014-04-25 17:35:36 +08:00
Cheng Zhao
1fd8deaca7 📝 Add docs on WebContents. 2014-04-25 17:15:26 +08:00
Cheng Zhao
1bba15cb7f Avoid using processId and routingId directly. 2014-04-25 16:45:14 +08:00
Cheng Zhao
23ccad4915 Separate the webContents code in a new file. 2014-04-25 16:23:40 +08:00
Cheng Zhao
c0875864dc Handle IPC messages in webContents instead of BrowserWindow. 2014-04-25 16:13:16 +08:00
Cheng Zhao
1815f8b40d Make send and loadUrl also supported methods of BrowserWindow. 2014-04-25 13:14:11 +08:00
Cheng Zhao
272effd470 Add send for webContents. 2014-04-25 13:10:16 +08:00
Cheng Zhao
c8a82e6e50 Move navigator related APIs to webContents. 2014-04-25 12:52:30 +08:00
Cheng Zhao
e70d195cde Fix releasing the wrong renderer view. 2014-04-25 12:40:04 +08:00
Cheng Zhao
4135040449 Move loading events to webContents. 2014-04-25 12:22:16 +08:00
Cheng Zhao
744895f9d8 Add destroyed event for webContents. 2014-04-25 11:59:33 +08:00
Cheng Zhao
859606e88c Move webContents events away from window. 2014-04-25 11:51:05 +08:00
Cheng Zhao
9eeec9aa0b Be safe on lifetime of webContents. 2014-04-25 11:22:51 +08:00
Cheng Zhao
b02bcc0016 Get webContents on request. 2014-04-25 10:57:45 +08:00
Cheng Zhao
c5f8fbf471 Add getter for devToolsWebContents. 2014-04-25 10:48:11 +08:00
Cheng Zhao
00ed814962 Add executeJavaScript method for webContents. 2014-04-25 10:34:40 +08:00
Cheng Zhao
79babe858d Move some APIs from Window to WebContents. 2014-04-24 17:00:41 +08:00
Cheng Zhao
26e93e8798 Initial empty api_web_contents. 2014-04-24 16:45:25 +08:00
Cheng Zhao
486dd9edfa mac: Avoid sending "blur" event when closing window. 2014-04-24 16:17:35 +08:00
Cheng Zhao
11e02d6bbc spec: Should destroy window even when spec failed. 2014-04-24 16:08:59 +08:00
Cheng Zhao
0b3b621f81 spec: Use random port when creating http server. 2014-04-24 15:42:37 +08:00
Cheng Zhao
d3cda97d50 Enable passing null to dialog API. 2014-04-24 13:10:04 +08:00
Cheng Zhao
83debe2e43 Avoid passing closures to browser when showing dialog.
It's resource-costy.
2014-04-24 12:26:28 +08:00
Cheng Zhao
9091a34675 Merge pull request #232 from atom/fix-devtools-menu
Fix crash when showing menu for devtools when there are multiple windows
2014-04-24 04:24:39 +00:00
Cheng Zhao
822bc2fd52 Only call getDevTools for windows that have devtools. 2014-04-24 12:04:23 +08:00
Cheng Zhao
e8bf798b52 Fix using an null dictionary. 2014-04-24 11:25:06 +08:00
Cheng Zhao
a365e0b032 Merge pull request #231 from atom/native-mate
Reimplement JS API with native-mate
2014-04-23 07:32:36 +00:00
Cheng Zhao
d67295888d 💄 Fix cpplint warning. 2014-04-23 14:17:13 +08:00
Cheng Zhao
3d267fc743 gtk: Free resources when closing window. 2014-04-23 12:59:03 +08:00
Cheng Zhao
0c9aea3308 Fix compilation under Linux. 2014-04-23 12:45:48 +08:00
Cheng Zhao
297ccbbe58 Update native_mate for fixing crash in GC. 2014-04-23 12:30:45 +08:00
Cheng Zhao
babfbe40d2 Fix the capturePage method. 2014-04-23 11:39:40 +08:00
Cheng Zhao
f6cca0df48 Remove redundant call to NotifyWindowClosed. 2014-04-23 11:21:17 +08:00
Cheng Zhao
f3961a8007 Update brightray to fix crash from BRYInspectableWebContentsView. 2014-04-23 11:20:49 +08:00
Cheng Zhao
0eb982a972 Make sure window object is destryed. 2014-04-23 10:53:07 +08:00
Cheng Zhao
1cb23a958c Should send "closed" event when native window is closed. 2014-04-23 10:24:46 +08:00
Cheng Zhao
8417f158b4 Do not free memory used by native window immediately.
Otherwise we would have two ways to destroy a window, making code much
more complicated.
2014-04-23 09:53:38 +08:00
Cheng Zhao
db39910455 Remove window from observers when it's closed instead of deleted. 2014-04-23 09:25:04 +08:00
Cheng Zhao
bccbc5e821 Fix parameter detection in capturePage. 2014-04-23 09:09:28 +08:00
Cheng Zhao
5037daadfb Use closed event instead of destroyed event.
We now do not delete window manually so the destroyed would be delayed
until the object is GCed.
2014-04-23 08:50:33 +08:00
Cheng Zhao
5a316c0c41 Free memory when native window is closed. 2014-04-23 08:50:26 +08:00
Cheng Zhao
a040a96652 Discard all our custom V8 helpers, use native-mate instead. 2014-04-22 23:07:21 +08:00
Cheng Zhao
ef5342b86e Simplify atom_browser_bindings. 2014-04-22 11:06:13 +08:00
Cheng Zhao
3b8f959ddf Simplify atom_bindings. 2014-04-22 11:01:37 +08:00
Cheng Zhao
7e1c86a105 Remove use of native_type_conversions.h when possible. 2014-04-21 23:49:53 +08:00
Cheng Zhao
2efed6f910 Simplify menu api. 2014-04-21 23:40:10 +08:00
Cheng Zhao
a13c29f0e6 Simplify protocol api. 2014-04-21 16:33:32 +08:00
Cheng Zhao
dd6caba082 Fix cpplint warning. 2014-04-18 17:28:05 +08:00
Cheng Zhao
e5176d6a0a Use BrowserV8Locker when possible. 2014-04-18 17:25:22 +08:00
Cheng Zhao
1dd57bd3a4 Use the new function converter in dialog api. 2014-04-18 17:19:15 +08:00
Cheng Zhao
499c9bc3b9 Enable converting v8::Function to base::Callback. 2014-04-18 17:18:50 +08:00
Cheng Zhao
8f2b998718 Simpilfy auto_updater api. 2014-04-17 17:26:21 +08:00
Cheng Zhao
f36569c3b9 Use native_mate based Event in browser_ipc. 2014-04-17 17:14:05 +08:00
Cheng Zhao
da483ba7f3 Simplify app api. 2014-04-17 17:13:46 +08:00
Cheng Zhao
7c50393c72 Simplify power_monitor api. 2014-04-17 17:13:17 +08:00
Cheng Zhao
7106a36ccb Add native_mate implemented Event and EventEmitter. 2014-04-17 17:12:27 +08:00
Cheng Zhao
77cccc2db6 Simplify browser_ipc api. 2014-04-17 13:51:59 +08:00
Cheng Zhao
5dae7b8658 Put converters under atom/common/native_mate_converters. 2014-04-17 13:45:14 +08:00
Cheng Zhao
84397052fd Use base::File::StringType. 2014-04-16 15:45:28 +08:00
Cheng Zhao
a2407c6b02 Use Dictionary to set module.exports. 2014-04-16 15:43:06 +08:00
Cheng Zhao
aa1efe70e2 Use native_mate to simplify dialog api. 2014-04-16 15:14:44 +08:00
Cheng Zhao
6e2bf824f0 Use native_mate to simplify renderer_ipc api. 2014-04-16 12:29:16 +08:00
Cheng Zhao
1ae30328d6 Use the new Constructor API. 2014-04-16 11:58:48 +08:00
Cheng Zhao
8162689014 Use native_mate to simplify id_weak_map api. 2014-04-16 09:54:01 +08:00
Cheng Zhao
338d11ef01 Remove unneeded include. 2014-04-15 16:29:38 +08:00
Cheng Zhao
16e3397c32 Use native_mate to simplify screen api. 2014-04-15 16:25:39 +08:00
Cheng Zhao
c25911db0d Use native_mate to simplify crash_reporter api. 2014-04-15 16:02:19 +08:00
Cheng Zhao
d9cd50c219 Use native_mate to simplify clipboard api. 2014-04-15 15:50:00 +08:00
Cheng Zhao
4a7e392301 Fix cpplint warning. 2014-04-15 15:42:46 +08:00
Cheng Zhao
e42433cf9a Use native_mate to simplify shell API. 2014-04-15 15:41:26 +08:00
Cheng Zhao
16af53237c Add native_mate as dependency. 2014-04-15 11:15:46 +08:00
Cheng Zhao
4fa9970eff mac: Move OS X only files to atom/browser/mac. 2014-04-15 09:35:26 +08:00
Cheng Zhao
96b23830cd Bump v0.11.10. 2014-04-11 21:02:22 +08:00
Cheng Zhao
b0b5d1b1b0 Do not use new clang flags. 2014-04-15 00:18:42 +08:00
Cheng Zhao
b994ae8174 mac: Always cancel application termination.
OS X's application termination doesn't work very well with C++ message
loops. Especially when we return NSTerminateLater for shouldTerminate,
it would be impossible for the C++ message loop to quit, because unless
we explictly let NSApp terminate the application, the message loop would
think the application is not terminated and will run forever.

The fix is to simply ignore the Cocoa's application termination request
and let the C++ message loop deal with it compeletey. But we had the
side effect that atom-shell would always cancel OS X's shutdown request,
this is also the approach chosen by Chromium.

Fixes #229.
Fixes atom/atom#1864.
2014-04-15 00:13:00 +08:00
Cheng Zhao
6f4aed83f0 Fix compiler warning in breakpad when using latest clang. 2014-04-14 23:54:36 +08:00
Cheng Zhao
d654afde5f Bump v0.11.9. 2014-04-11 10:44:41 +00:00
Cheng Zhao
5c5cf3c66e Fix a crash when destroying window. 2014-04-11 18:43:01 +08:00
Cheng Zhao
84d458687a mac: Avoid managing NSWindow by hand. 2014-04-11 12:47:22 +08:00
Cheng Zhao
2ab5d6e35a Remove unneeded accessor. 2014-04-11 12:45:48 +08:00
Cheng Zhao
d6079782d1 mac: InspectableWebContents should be destroyed before release NSWindow.
Fixes atom/atom#1841.
2014-04-11 12:32:42 +08:00
Cheng Zhao
e576d4c014 Fix app.exit compatibility. 2014-04-10 17:08:22 +08:00
Cheng Zhao
a16ea1fbf2 Bump v0.11.8. 2014-04-10 07:30:29 +00:00
Cheng Zhao
f0d9ee4ca9 Shutdown gracefully, fixes #227. 2014-04-10 15:22:17 +08:00
Cheng Zhao
538bd1116d Deprecate app.terminate API.
Users should use app.quit which can shutdown the application gracefuly.
2014-04-10 15:08:14 +08:00
Cheng Zhao
5ead4f655a Bump v0.11.7. 2014-04-08 06:50:40 +00:00
Cheng Zhao
b975d4c41f Detect unresponsive window when quitting.
Preivously this is disabled because quitting multiple windows could
bring up the unresponsive dialog, but since we now have increased the
unresponsive time limitto 5s, this is not needed anymore and could cause
confusions.

Fixes #17.
2014-04-08 14:24:44 +08:00
Cheng Zhao
cca0d8d583 📝 Add docs for executeJavaScriptInDevTools. 2014-04-08 12:52:42 +08:00
Cheng Zhao
d7a54cf3a6 Add API to execute javascript in devtools. 2014-04-08 12:50:12 +08:00
Cheng Zhao
a50d3bde5c gtk: Connect to window-state-event, fixes #226. 2014-04-08 09:32:44 +08:00
Cheng Zhao
7f496f1994 Bump v0.11.6. 2014-04-07 09:21:02 +00:00
Cheng Zhao
395eb067d1 mac: Do not destroy window immediately.
Fixes atom/atom#1841.
2014-04-07 17:20:08 +08:00
Cheng Zhao
98fcc93862 💄 Remove unsed constant. 2014-04-07 17:12:24 +08:00
Cheng Zhao
b21e5a6300 Fix capturePage under accelerated mode, fixes #223. 2014-04-07 15:43:15 +08:00
Cheng Zhao
ac11c95da6 Increase the closing time limit to 5s.
Fixes https://github.com/atom/atom/issues/1838.
2014-04-06 13:16:14 +08:00
Cheng Zhao
5bbf749693 gtk: Handle accelerators after renderer handled them.
The key-press signal captured the key events before renderer handles,
which violated the behavior on OS X and Windows.

Fixes #221.
2014-04-05 19:21:18 +08:00
Cheng Zhao
3d518c2105 gtk: Do not access clipboard in renderer process. 2014-04-05 14:49:59 +08:00
Cheng Zhao
839f875045 Merge pull request #225 from atom/devtools-menu
Enable context menu in devtools
2014-04-05 03:30:47 +00:00
Cheng Zhao
2369f6cc41 Don't build symbols in CI. 2014-04-05 11:05:51 +08:00
Cheng Zhao
ff88535cd5 💄 Fix cpplint warning build/include_what_you_use. 2014-04-05 11:00:35 +08:00
Cheng Zhao
7a38307d1f Use dialog API to override file chooser dialog in web inspector. 2014-04-05 10:24:46 +08:00
Cheng Zhao
877277d837 Enable writing files in devtools. 2014-04-05 09:22:25 +08:00
Cheng Zhao
d4e7fe3eb8 Correctly translate WebInspector menu to native menu. 2014-04-04 22:37:34 +08:00
Cheng Zhao
03e6d564d7 Make remote.getCurrentWindow work for devtools. 2014-04-04 22:28:47 +08:00
Cheng Zhao
f5fc26d8fc Enable getting a window according to its attached devtools. 2014-04-04 22:28:18 +08:00
Cheng Zhao
86ebd6e8e3 Allow sending ipc messages to devtools. 2014-04-04 22:05:43 +08:00
Cheng Zhao
a80fe40f56 Synchronous event should be bound to WebContents.
This allows us to reply to synchronous message for arbitrary
WebContents.
2014-04-04 22:04:42 +08:00
Cheng Zhao
b1f0c2d174 Override web inspector's context menu. 2014-04-03 20:54:42 +08:00
Cheng Zhao
ac794c8085 Enable intercepting devtools window. 2014-04-03 20:20:42 +08:00
Cheng Zhao
663ab8e0bf 💄 Fix cpplint warning. 2014-04-02 14:23:38 +08:00
Cheng Zhao
d2162bf9f4 Bump v0.11.5. 2014-04-02 09:59:21 +08:00
Cheng Zhao
b7a71b885e Make sure tags are pushed. 2014-04-02 09:58:56 +08:00
Cheng Zhao
9aefb9c2d3 Add /vendor/npm to gitignore. 2014-04-02 09:58:38 +08:00
Cheng Zhao
a3e1fa3350 gtk: Consider window frame in SetSize. 2014-03-29 16:07:44 +08:00
Cheng Zhao
bf6fb3872e gtk: Do some guess of window border size according to window manager. 2014-03-29 14:18:47 +08:00
Cheng Zhao
84307dd329 gtk: Fix crash when calling GetSize() for hidden window. 2014-03-29 14:08:25 +08:00
Cheng Zhao
c814803c94 💄 2014-03-28 09:42:37 +00:00
Cheng Zhao
61d54f0558 Make bootstrap script silent. 2014-03-28 09:36:35 +00:00
Cheng Zhao
9d0a11580f Fix calling apm for apm 0.37.0. 2014-03-28 09:30:15 +00:00
Cheng Zhao
7a6db019e8 Use lastes npm in CI. 2014-03-28 09:25:53 +00:00
Cheng Zhao
fdecf09d99 Upgrade to apm@0.37.0 2014-03-28 16:19:19 +08:00
Cheng Zhao
7e7f0888e5 gtk: Force size allocation in window, fixes #219. 2014-03-28 16:01:38 +08:00
Cheng Zhao
5a837f5850 gtk: Detect rare conditions when resizing. 2014-03-27 21:03:27 +08:00
Cheng Zhao
d3e6166de6 gtk: Should remove self from watcher list in destructor. 2014-03-27 18:05:28 +08:00
Cheng Zhao
c6f0968d17 gtk: Do not count menubar in work area size on Unity. 2014-03-27 17:55:28 +08:00
Cheng Zhao
abea550a4d Bump v0.11.4. 2014-03-26 02:16:32 +00:00
Cheng Zhao
d7261073e7 Free window object immediately in destory().
This put everything back to the original design, since now it's not
possible to destory a window while a context menu is showing.
2014-03-26 09:58:40 +08:00
Cheng Zhao
01a9ac21a5 Increase unresponsive time to 2s when closing.
Fixes https://github.com/atom/atom/issues/1793.
2014-03-26 09:40:53 +08:00
Cheng Zhao
8b41e78245 Fix a possible crash when destroying window.
It could happend that the JS BrowserWindow object being double deleted
when calling the destroy() method.
2014-03-26 09:14:05 +08:00
Cheng Zhao
9ab3b5293c Bump v0.11.3. 2014-03-25 10:18:53 +00:00
Cheng Zhao
7a83b16cc4 Delay the unresponsive event shortly.
It could happen that a window became responsive immediately after the
unresponsive message is sent, like after showing a context menu
synchronously.
2014-03-25 18:10:51 +08:00
Cheng Zhao
679959eeb5 BrowserWindow.destroy() should not delete window immediately.
It could cause crash when context menu is showing.
2014-03-25 17:00:03 +08:00
Cheng Zhao
e96a3abdf9 mac: Do not allow nested task when showing menu.
Fixes #163.
2014-03-25 16:56:02 +08:00
Cheng Zhao
788ed588c9 Bump v0.11.2. 2014-03-21 07:04:55 +00:00
Cheng Zhao
35229255bb gtk: Ask whether window is active from WM.
It could happpen that the WM thinks a window is active but it's actually not,
like when showing a context menu. In most cases we should follow what WM
says to keep consistent bevaviour on all platforms.
2014-03-20 17:47:38 +08:00
Cheng Zhao
f4b648385c Close devtools completely instead of hiding it.
Fixes https://github.com/atom/atom/issues/1764.
2014-03-20 09:32:00 +08:00
Cheng Zhao
eb1675a90f Update node: Build .dSYM for node modules, fixes #207. 2014-03-20 09:02:36 +08:00
Cheng Zhao
f7854e0b4c Bump v0.11.1. 2014-03-15 09:33:15 -07:00
Cheng Zhao
630e1b54e8 gtk: Fix BrowserWindow::HasModalDialog. 2014-03-18 14:52:45 +08:00
Cheng Zhao
1740355855 linux: Include content_shell.pak in distribution. 2014-03-18 14:10:35 +08:00
Cheng Zhao
239f061ffd Bump v0.11.0. 2014-03-16 19:06:46 +08:00
Cheng Zhao
5402b1b432 Should set low version field to 0 in bump-version. 2014-03-16 19:06:36 +08:00
Cheng Zhao
83ff6b607f Fix bump-version script. 2014-03-16 15:49:12 +08:00
Cheng Zhao
caa553c563 Merge pull request #216 from atom/atom-chrome-src
Put atom-shell's source code under atom/
2014-03-16 07:37:14 +00:00
Cheng Zhao
e3434b5cde Fix the location default_app is copied to. 2014-03-16 15:19:09 +08:00
Cheng Zhao
5dd5f18edf Fix process.resourcesPath. 2014-03-16 13:24:25 +08:00
Cheng Zhao
6285e26972 Fix coffeelint. 2014-03-16 09:43:19 +08:00
Cheng Zhao
b6ac06c022 Order header files. 2014-03-16 09:37:04 +08:00
Cheng Zhao
375228f266 💄 Update bootstrap script. 2014-03-16 09:27:15 +08:00
Cheng Zhao
eaab9b295b 📝 Update docs for new source code structure. 2014-03-16 09:17:45 +08:00
Cheng Zhao
b1f4a47b5b Add LICENSE in chrome/. 2014-03-16 09:15:41 +08:00
Cheng Zhao
2d808d30a2 Bring back build/include_order cpplint. 2014-03-16 09:13:06 +08:00
Cheng Zhao
bbef33a33a Bring back build/header_guard cpplint. 2014-03-16 08:58:59 +08:00
Cheng Zhao
68cb6ee861 Move atom/browser/ui/gtk to chrome/. 2014-03-16 08:39:43 +08:00
Cheng Zhao
516d46444d Move all sources under atom/. 2014-03-16 08:30:26 +08:00
Cheng Zhao
26ddbbb0ee Remove unneeded include dir. 2014-03-15 22:57:35 +08:00
Cheng Zhao
467b9122e9 Merge pull request #215 from atom/first-mouse-event
Add 'accept-first-mouse' to BrowserWindow's creation option
2014-03-15 14:37:22 +00:00
Cheng Zhao
cdf6f3ade9 📝 Add 'accept-first-mouse' to docs. 2014-03-15 19:31:29 +08:00
Cheng Zhao
b1bb4d911f Add 'accept-first-mouse' in window's option. 2014-03-15 19:28:23 +08:00
Cheng Zhao
834d02d65b Upgrade libchromiumcontent: Add support for acceptsFirstMouse. 2014-03-15 19:10:24 +08:00
Cheng Zhao
47b1a90dd7 Remove hack for using foundation_util.h. 2014-03-15 18:18:19 +08:00
Cheng Zhao
66fe74de29 Merge pull request #214 from atom/linux-menu
Implement menu API on Linux
2014-03-15 09:43:59 +00:00
Cheng Zhao
60b686ff51 gtk: Fix crash when using frameless window. 2014-03-15 17:07:44 +08:00
Cheng Zhao
ef4fb8bfe0 💄 Fix cpplint warning. 2014-03-15 16:41:31 +08:00
Cheng Zhao
e3a3c342de Separate common accelerator utils out. 2014-03-15 16:36:29 +08:00
Cheng Zhao
5e2c975758 gtk: Make menubar accelerator work. 2014-03-15 16:16:12 +08:00
Cheng Zhao
c88673d6ba Fix the menu of default_app. 2014-03-14 21:45:53 +08:00
Cheng Zhao
23ebfa2955 gtk: Enabling setting menubar for window. 2014-03-14 21:44:09 +08:00
Cheng Zhao
4e4e0f5d4d gtk: Enable creating menu bar. 2014-03-14 21:13:28 +08:00
Cheng Zhao
6939e325df gtk: Implement popup menu. 2014-03-14 20:59:11 +08:00
Cheng Zhao
a941c20af4 gtk: Add menu_gtk from Chromium. 2014-03-14 20:42:39 +08:00
Cheng Zhao
cde4017c7b gtk: Add event_utils from Chromium. 2014-03-14 20:23:17 +08:00
Cheng Zhao
af301e682e Merge pull request #213 from atom/linux-open-dialog
Implement file dialog API on Linux
2014-03-13 08:34:19 +00:00
Cheng Zhao
09ebabfc45 📝 Revise the build instructions on Linux. 2014-03-13 14:20:48 +08:00
Cheng Zhao
6248aeb1ea 📝 Revise the dialog API docs. 2014-03-13 14:09:30 +08:00
Cheng Zhao
6fe9d0fdc5 gtk: Implement synchronous open dialog. 2014-03-13 14:01:34 +08:00
Cheng Zhao
b3f9a36a77 gtk: Add file open dialog. 2014-03-13 13:58:53 +08:00
Cheng Zhao
4c63307ae7 gtk: Enable create folder in dialog. 2014-03-13 13:27:01 +08:00
Cheng Zhao
637a99ea66 gtk: Filename returned by GTK+ should be freed. 2014-03-13 13:22:49 +08:00
Cheng Zhao
434065bcdf gtk: Confirm file overwrite. 2014-03-13 13:20:43 +08:00
Cheng Zhao
52958d5d3f gtk: Implement synchronous save dialog. 2014-03-13 13:17:03 +08:00
Cheng Zhao
516551623a gtk: Set default path. 2014-03-13 13:10:13 +08:00
Cheng Zhao
be28ffa028 gtk: File dialog should be modal window. 2014-03-13 13:03:38 +08:00
Cheng Zhao
c2cff39bc5 gtk: Initial implementation of save dialog. 2014-03-13 12:58:27 +08:00
Cheng Zhao
1ebbf32f29 Merge pull request #211 from atom/linux-message-box
Implement message box API on Linux
2014-03-12 13:37:20 +00:00
Cheng Zhao
7c3ac01fd3 💄 Fix pylint warning. 2014-03-12 21:25:13 +08:00
Cheng Zhao
676a48ae28 gtk: Make synchronous message box work. 2014-03-12 21:17:13 +08:00
Cheng Zhao
5f215cfa6b gtk: Be aware of "Cancel" button in message box. 2014-03-12 21:10:00 +08:00
Cheng Zhao
4d175b8f81 gtk: Make the message box asynchronous. 2014-03-12 21:01:04 +08:00
Cheng Zhao
df692f164c gtk: Left align message box text. 2014-03-12 20:39:04 +08:00
Cheng Zhao
e30fef09c8 gtk: Add gtk_util from Chromium. 2014-03-12 20:38:52 +08:00
Cheng Zhao
6b9148127e gtk: Initial implementation of message box. 2014-03-12 20:17:22 +08:00
Cheng Zhao
63ed4acd49 Bump v0.10.7. 2014-03-11 09:54:05 +00:00
Cheng Zhao
99ee21d657 linux: Generate symbols from the symbol file. 2014-03-11 09:04:41 +00:00
Cheng Zhao
449748b044 Remove vendor/apm/node_modules in cibuild. 2014-03-11 00:01:06 +08:00
Cheng Zhao
1019952989 Merge pull request #208 from atom/default-sandboxed-iframe
Make iframe sandboxed by default
2014-03-10 15:47:39 +00:00
Cheng Zhao
1c057c8ea1 Update libchromiumcontent for iframe sandbox. 2014-03-10 22:47:21 +08:00
Cheng Zhao
89507a2524 💄 Remove console output. 2014-03-10 22:46:15 +08:00
Cheng Zhao
31b08a3ec6 Update specs with new sandbox setting. 2014-03-10 22:42:03 +08:00
Cheng Zhao
b96aee50e1 📝 Mention that iframe is sandboxed by default. 2014-03-10 22:33:34 +08:00
Cheng Zhao
337e9f9553 Fixes crash caused by NativeWindow::IsWebViewFocused.
The RenderViewHostView could be NULL when the renderer process has
crashed.

Fixes #206.
2014-03-10 09:24:51 +08:00
Cheng Zhao
3260b42b18 Bump v0.10.6. 2014-03-05 04:43:45 -08:00
Cheng Zhao
f9c5d0796c Merge pull request #202 from atom/fix-acclerated-composition
Enable accelerated composition in normal window
2014-03-06 04:25:43 +00:00
Cheng Zhao
2f113286aa Disable acclerated composition in frameless window. 2014-03-06 11:07:04 +08:00
Cheng Zhao
686493e8ec Append command line for renderer in NativeWindow. 2014-03-06 10:40:10 +08:00
Cheng Zhao
1b3e6bdb92 Bring back accelerated composition. 2014-03-06 10:30:42 +08:00
Cheng Zhao
0fe65a688e Temporary fix for flashing devtools. 2014-03-06 10:30:22 +08:00
Cheng Zhao
377666503c Bump v0.10.5. 2014-03-01 14:05:02 -08:00
Cheng Zhao
0411c2d2b6 Do not rely on thread to implement modal dialog.
Fixes #199.
2014-03-05 20:02:15 +08:00
Cheng Zhao
839a751de5 Add 'activate-with-no-open-windows' event for app.
Fixes #194.
2014-03-05 18:09:44 +08:00
Cheng Zhao
a74d3d210d Merge pull request #196 from atom/iframe-security
Fix iframe security
2014-03-04 14:12:26 +00:00
Cheng Zhao
df86c9dac1 Add spec for sanbox attribute of iframe. 2014-03-04 22:04:41 +08:00
Cheng Zhao
e3d67a304f 📝 Notice on sandbox attribute. 2014-03-04 21:44:15 +08:00
Cheng Zhao
77253abbd7 📝 Mention the change of default security of node integration. 2014-03-04 21:25:43 +08:00
Cheng Zhao
013a7717b4 Enable web security. 2014-03-04 21:23:18 +08:00
Cheng Zhao
aae4abfa86 Use except-iframe security by default. 2014-03-04 20:12:43 +08:00
Cheng Zhao
abc6e1e289 Merge pull request #195 from atom/undocked-devtools
Disable the detachment of devtools
2014-03-04 12:08:26 +00:00
Cheng Zhao
dc154f3907 Disable the detachment of devtools. 2014-03-04 19:59:25 +08:00
Cheng Zhao
9f86fa1893 Correctly free devtools window. 2014-03-04 19:02:48 +08:00
Cheng Zhao
01b42c9e59 Make devtools API aware of devtools window. 2014-03-04 18:45:36 +08:00
Cheng Zhao
6bd0b82b2e Store the devtools window in weak pointer. 2014-03-04 18:42:37 +08:00
Cheng Zhao
391468ece0 Make DevToolsDelegate respond to messages. 2014-03-04 17:50:57 +08:00
Cheng Zhao
5e05a3045c Use InspectableWebContentsDelegate. 2014-03-04 17:08:30 +08:00
Cheng Zhao
c2996d4fd1 Take control if devtools is undocked. 2014-03-04 15:46:12 +08:00
Cheng Zhao
d37bf06b5a Make the DebugDevTools API more generic. 2014-03-04 14:35:35 +08:00
Cheng Zhao
1c07235121 Disable the undocked devtools. 2014-03-04 14:25:15 +08:00
Cheng Zhao
59a2430f1d Merge pull request #191 from atom/win-ci
Try fix Windows CI
2014-03-03 12:47:03 +00:00
Cheng Zhao
87221f8f55 💄 Fix pylint warning. 2014-03-03 20:03:37 +08:00
Cheng Zhao
e3215a1f21 Update to latest apm. 2014-03-03 19:57:08 +08:00
Cheng Zhao
2522bc2298 Fix calling node in coffeelint. 2014-03-03 19:50:32 +08:00
Cheng Zhao
f3103e9b00 Merge pull request #189 from atom/linux-symbols
Dump breakpad symbols on Linux
2014-03-03 11:45:45 +00:00
Cheng Zhao
e897377879 win: Disable pylint in cibuildbuild. 2014-03-03 11:31:45 +00:00
Cheng Zhao
6833865ff3 Update libchromiumcontent: Contain linux symbols. 2014-03-03 11:12:22 +00:00
Cheng Zhao
88dde07bf1 Make sure we dump symbols before stripping binary. 2014-03-03 14:17:48 +08:00
Cheng Zhao
51f0090555 Make sure symbol is dumped from unstripped binary. 2014-03-03 14:14:02 +08:00
Cheng Zhao
b8e75df8f0 linux: Add strip binary action. 2014-03-03 12:55:04 +08:00
Cheng Zhao
de21a164ea Build with -g on Linux. 2014-03-03 12:35:52 +08:00
Cheng Zhao
95e1ea6599 Move the generate_breakpad_symbols to tools/posix. 2014-03-03 10:15:19 +08:00
Cheng Zhao
2d2fbaaa4a linux: Dump symbols in create-dist.py. 2014-03-03 09:44:16 +08:00
Cheng Zhao
7cfff62037 Bump v0.10.4. 2014-03-01 06:54:22 -08:00
Cheng Zhao
d61daf6f05 Update node: Fix crash from UVException. 2014-03-02 10:38:56 +08:00
Cheng Zhao
eca911a1b1 Update libchromiumcontent: Suppress CFAllocator warning. 2014-03-01 23:00:47 +08:00
Cheng Zhao
0a5a020466 Merge pull request #188 from atom/old-fasioned-dialog
Implement alert() and confirm() with dialog API
2014-03-01 13:32:02 +00:00
Cheng Zhao
79802c2919 Explicitly disable prompt(). 2014-03-01 20:05:52 +08:00
Cheng Zhao
3f1d540077 Implement the confirm(). 2014-03-01 20:03:49 +08:00
Cheng Zhao
ff9027fa95 Use the dialog API to implement alert(). 2014-03-01 20:01:04 +08:00
Cheng Zhao
753a1e7aff Separate overrides from init script. 2014-03-01 20:00:39 +08:00
Cheng Zhao
4c8e483bc1 Make the default alert() do nothing. 2014-03-01 19:53:50 +08:00
Cheng Zhao
8404389a31 Rename no-publish-release to publish-release. 2014-03-01 09:36:48 +08:00
Cheng Zhao
f8d6fab52b Do not publish release by default. 2014-02-28 20:45:45 +08:00
Cheng Zhao
199e975a11 Remove unused -s option of bootstrap. 2014-02-28 20:44:57 +08:00
Cheng Zhao
32f83d8e4e Bump v0.10.3. 2014-02-27 00:32:05 -08:00
Cheng Zhao
6ae3402aec Update node: Fix wrong uv error code. 2014-02-28 00:34:47 +08:00
Cheng Zhao
21ccf80ba5 Bump v0.10.2. 2014-02-24 14:25:29 -08:00
Cheng Zhao
706c56bb30 Update node: Fix crash from node::uv::ErrName. 2014-02-27 14:12:10 +08:00
Cheng Zhao
c98e16b18f Do not dectect unresponsive eagerly when quitting.
Fixes https://github.com/atom/atom/issues/1589.
2014-02-27 12:47:00 +08:00
Cheng Zhao
b386ec40be Fix crash caused by Protocol::RegisterProtocol.
From crash report this exists on OS X too, previously the fix is only
available on Linux. However we should remove all calls of protocol
things in UI thread in future.
2014-02-27 10:44:45 +08:00
Cheng Zhao
14cec9e20e Merge pull request #180 from atom/linux-breakpad
Make crash reporter work on Linux
2014-02-26 14:16:52 +00:00
Cheng Zhao
120094a81e Only print when got error for some commands. 2014-02-26 22:08:01 +08:00
Cheng Zhao
637b50044d Do not use "/" explicitly in cpplint. 2014-02-26 21:51:37 +08:00
Cheng Zhao
acef33aa2c 💄 Fix cpplint warnings. 2014-02-26 21:47:52 +08:00
Cheng Zhao
6134b9ed38 linux: Remove global variables in crash reporter. 2014-02-26 21:33:14 +08:00
Cheng Zhao
ce6f9f20bf linux: No need of |ptype| parameter. 2014-02-26 20:59:27 +08:00
Cheng Zhao
b1f9c4dfc5 Only start crash service on Windows. 2014-02-26 20:58:17 +08:00
Cheng Zhao
7660816468 linux: Set upload parameters of crash reporter. 2014-02-26 20:54:56 +08:00
Cheng Zhao
1a43ec3557 💄 Remove dead code. 2014-02-26 20:41:59 +08:00
Cheng Zhao
4a3341e31e linux: Implement crash reporter. 2014-02-26 20:39:20 +08:00
Cheng Zhao
2f088c5caa linux: Suppress compiler warnings of breakpad. 2014-02-26 15:43:22 +08:00
Cheng Zhao
38810c5518 linux: Add the missing lss dependency.
Chromium ships with it in its code base, but since libchromiumcontent
doesn't contain it in the distribution, we need to include it herer to
make breakpad_client compile.

Note that we put the header under `vendor/third_party/lss` instead of
checking out the repository under `vendor`, because we don't want to
patch breakpad.
2014-02-26 15:38:28 +08:00
Cheng Zhao
876bfc69ac linux: Link with breakpad_client. 2014-02-26 15:20:57 +08:00
Cheng Zhao
2ce1d3a784 Fix building on cygwin. 2014-02-25 19:06:15 +08:00
Cheng Zhao
a81ef7847d Bump v0.10.1. 2014-02-25 19:02:12 +08:00
Cheng Zhao
2117d06274 Disable in process stack dumping on Windows.
It would force the process to run in console.
2014-02-25 18:47:11 +08:00
Cheng Zhao
a5ec8a9110 Do not define _DEBUG.
The vc++ compiler would define some internal contants if we define
_DEBUG, since we are linking to the release build of chromiumcontent,
this would result in linking errors.
2014-02-25 18:24:07 +08:00
Cheng Zhao
30b3657c0e Update libchromiumcontent to 1df8e7cdac8aa74c91c19ae0691ce512d560ab3e. 2014-02-25 08:53:17 +08:00
Cheng Zhao
06a4f83bb7 linux: Fix upload script. 2014-02-24 05:41:16 +00:00
Cheng Zhao
7a8e43c65e linux: Fix create-dist. 2014-02-24 13:44:23 +08:00
Cheng Zhao
90cc1a7062 Bump v0.10.0. 2014-02-24 05:30:52 +00:00
Cheng Zhao
7d93b4a48f Fix polluting devtools in some cases. 2014-02-24 13:14:01 +08:00
Cheng Zhao
a2ecb554cc Merge pull request #178 from atom/debug-devtools
Add BrowserWindow.debugDevTools() API
2014-02-24 13:07:32 +08:00
Cheng Zhao
f65f95e95c The DevTools window should manage lifetime itself. 2014-02-24 12:17:10 +08:00
Cheng Zhao
eaedac2536 Add the debugDevTools JS API. 2014-02-24 12:08:33 +08:00
Cheng Zhao
8b9d35d84e Separate devtools code out. 2014-02-24 11:53:13 +08:00
Cheng Zhao
99c0de6a1a Disable stack dumping on MAC.
It would prevent the system crash reporter.
2014-02-24 11:48:11 +08:00
Cheng Zhao
f2bef6c26d Setup devtools frontend. 2014-02-24 11:28:21 +08:00
Cheng Zhao
1f57994e2a Setup devtools client for the correct contents. 2014-02-24 10:09:32 +08:00
Cheng Zhao
618040efc1 Add DebugDevTools API. 2014-02-24 09:52:20 +08:00
Cheng Zhao
ed34aa6fb3 Disable node integration in devtools. 2014-02-21 22:42:33 +08:00
Cheng Zhao
57639133a9 Merge pull request #149 from atom/linux
Add support for Linux
2014-02-21 17:33:29 +08:00
Cheng Zhao
1b7c308475 linux: Make native modules work. 2014-02-21 17:22:05 +08:00
Cheng Zhao
2b2a55d870 Update apm: fix node arch on Linux. 2014-02-21 16:23:04 +08:00
Cheng Zhao
c26a9b23a7 gtk: Should init gdk when using screen module. 2014-02-21 15:50:35 +08:00
Cheng Zhao
6c36f7e5c9 gtk: Window.focus should not change visibility. 2014-02-21 15:34:38 +08:00
Cheng Zhao
eb9673a152 linux: Implement libuv message loop polling. 2014-02-21 13:21:02 +08:00
Cheng Zhao
fbe963c7f3 💄 Fix cpplint warnings. 2014-02-21 12:57:45 +08:00
Cheng Zhao
18f8af7822 Only append arguments for browser process. 2014-02-21 01:04:27 +08:00
Cheng Zhao
3576c6d2ff Fix race condition when initializing request context getter.
Note that we are calling GetURLRequestContext() in the UI thread when
using the protocol module, this should in fact not be allowed, but for
now we just use the workaround of making sure the request context getter
has been initialized before we use the protocol module.
2014-02-21 00:56:18 +08:00
Cheng Zhao
b4ee01d43d linux: Fix one compiler warning. 2014-02-20 18:58:56 +08:00
Cheng Zhao
679aa43113 📝 List libraries required for Linux. 2014-02-20 18:56:59 +08:00
Cheng Zhao
2b82eafff4 📝 Update docs on using native modules. 2014-02-20 18:51:57 +08:00
Cheng Zhao
94b3de557e 📝 Add docs on building for Linux. 2014-02-20 18:39:24 +08:00
Cheng Zhao
c56480fd89 Update libchromiumcontent to use the thin version. 2014-02-20 18:20:29 +08:00
Cheng Zhao
e9879b150e Update runas to 0.5.* 2014-02-20 16:43:26 +08:00
Cheng Zhao
ea8d349b1b 💄 Fix cpplinting. 2014-02-19 21:25:18 +08:00
Cheng Zhao
87b78a89fb Menu::attachToWindow is available on Linux. 2014-02-19 13:10:09 +00:00
Cheng Zhao
27cd6688c1 BrowserWindow::setMenu is available on Linux. 2014-02-19 13:06:45 +00:00
Cheng Zhao
c340cac02c Build with symbols on debug build. 2014-02-19 11:39:51 +00:00
Cheng Zhao
0a9c371ca2 linux: Fix crash when using protocol module early. 2014-02-19 11:39:01 +00:00
Cheng Zhao
4a000a35c4 Enable convient stack printing. 2014-02-19 19:07:52 +08:00
Cheng Zhao
d89fb15daf Merge branch 'master' into linux 2014-02-19 11:04:15 +00:00
Cheng Zhao
d698ecf017 linux: Make test.py work. 2014-02-14 15:17:24 +00:00
Cheng Zhao
2b7b4a16f5 linux: Make binary search for libraries under current directory. 2014-02-14 15:11:57 +00:00
Cheng Zhao
526aaecc52 linux: Add dummy implementation of node bindings. 2014-02-14 14:39:57 +00:00
Cheng Zhao
e3d5b62000 gtk: Add dummy implementation of dialog. 2014-02-14 14:07:23 +00:00
Cheng Zhao
6bd56f2a52 gtk: Add utils imported from chrome. 2014-02-14 13:59:41 +00:00
Cheng Zhao
426e7645bc gtk: Add dummy implementation of Menu. 2014-02-14 13:41:20 +00:00
Cheng Zhao
521fb7d54c linux: Fix compilation error. 2014-02-14 13:34:59 +00:00
Cheng Zhao
4051d2ebdb Merge branch 'master' into linux
Conflicts:
	atom.gyp
	vendor/apm
	vendor/brightray
2014-02-14 13:17:00 +00:00
Cheng Zhao
b4fa3cd925 Bump v0.9.3. 2014-02-12 22:14:13 -08:00
Cheng Zhao
984d60f935 Override default window.close, fixes #70. 2014-02-17 18:19:55 +08:00
Cheng Zhao
65f258160e Merge pull request #176 from atom/unload-on-upgrade
Close all windows before installing update
2014-02-17 18:14:14 +08:00
Cheng Zhao
a76183c188 Do not print download progress in CI. 2014-02-17 17:50:25 +08:00
Cheng Zhao
fde4c544b8 💄 2014-02-17 17:50:16 +08:00
Cheng Zhao
274c9d04b1 Enable the quitAndInstall to be cancelled by beforeunload handler. 2014-02-17 16:25:00 +08:00
Cheng Zhao
07fc2b41af Fix using BrowserWindow as parameter for ipc.sendChannel. 2014-02-17 15:24:42 +08:00
Cheng Zhao
a9efe77ceb Fix quitAndInstall when there is no window. 2014-02-17 15:06:25 +08:00
Cheng Zhao
b932461b45 Fix crash when calling quitAndUpdate without any update. 2014-02-17 14:56:23 +08:00
Cheng Zhao
6b3ff63358 Close all windows before installing update. 2014-02-17 14:51:22 +08:00
Cheng Zhao
dd4e36a42e Bump v0.9.2. 2014-02-12 20:52:46 +08:00
Cheng Zhao
93687efee9 win: Use util.format to format arguments in console.log. 2014-02-12 20:32:30 +08:00
Cheng Zhao
9ba7db8815 win: Fix detecting attached modal dialog. 2014-02-10 20:07:38 +08:00
Cheng Zhao
f4a2c12d75 Use keydown event for accelerator.
This follows the behaivor on OS X, fixed #174.
2014-02-06 19:43:30 +08:00
Cheng Zhao
74a83e3d7c The translate-crash-log-addresses script is abandonded. 2014-02-06 18:35:54 +08:00
Cheng Zhao
283aa79c17 Fix assertions when building against Debug libchromiumcontent.
Imported from https://github.com/brightray/brightray/pull/50.
2014-02-05 11:18:32 +08:00
Cheng Zhao
dc69c7b694 Merge pull request #173 from atom/cj-fix-release-name
Parse the 4th argument into a date.
2014-02-03 16:58:53 -08:00
probablycorey
a78807b309 Bump v0.9.1. 2014-02-03 12:41:53 -08:00
probablycorey
e7248b486f Parse the 4th argument into a date. 2014-02-03 12:39:54 -08:00
Cheng Zhao
c2afa3521e Fix building on Windows. 2014-02-03 09:21:45 +08:00
Cheng Zhao
6ae38d86df Bump v0.9.0. 2014-01-30 13:32:16 -08:00
Cheng Zhao
9f0d9e0fad Merge pull request #162 from atom/cj-replace-sparkle-with-squirrel
Replace sparkle with squirrel
2014-02-02 04:56:13 -08:00
Cheng Zhao
45b626e0cc 📝 Add docs on new auto updater API. 2014-02-02 20:55:35 +08:00
Cheng Zhao
c13724b342 Fix ci. 2014-02-02 19:58:25 +08:00
probablycorey
5da1e9ed10 Handle all download events from AutoUpdater::CheckForUpdates 2014-02-01 15:55:57 -08:00
probablycorey
a8913f5ea0 Remove version string from feed url 2014-01-31 16:14:16 -08:00
probablycorey
a59756485e Handle all download events in completed block.
'update-downloaded' and 'update-not-available' events are now called
in the completed block.
2014-01-31 16:13:01 -08:00
probablycorey
6949af5427 Emit 'update-available' and 'checking-for-update' events. 2014-01-31 16:11:11 -08:00
probablycorey
da602a7c01 Include the version with the update request 2014-01-31 16:02:38 -08:00
Cheng Zhao
50eb5454d4 Still subscribe to "updates" for update notifications.
It seems that we should subscribeError to checkForUpdatesCommand to
catch all errors, and the "updates" would only work when there is no
error happened.
2014-01-31 21:47:59 +08:00
Cheng Zhao
8ee1e1d208 Subscribe to checkForUpdatesCommand's return value. 2014-01-31 21:31:42 +08:00
Cheng Zhao
73ec7783af No need to add "static" for functions in anonymouse namespace. 2014-01-31 21:10:51 +08:00
Cheng Zhao
a8f172752a 💄 Fix cpplint warning. 2014-01-31 20:28:33 +08:00
Cheng Zhao
b7e120b68c Merge branch 'master' into cj-replace-sparkle-with-squirrel 2014-01-31 19:36:26 +08:00
Cheng Zhao
a85075103f Move resources file under resources/ 2014-01-31 19:34:31 +08:00
Cheng Zhao
fe30880ec0 Add Info.plist for Atom Framework, fixes #171. 2014-01-31 17:40:47 +08:00
Cheng Zhao
c81128b675 Merge pull request #172 from atom/secure-iframe
Add "node-integration" option to BrowserWindow
2014-01-31 00:52:32 -08:00
Cheng Zhao
2634328720 Fix how we filter out atom-shell switches in process.argv. 2014-01-31 16:40:20 +08:00
Cheng Zhao
0df59e2714 💄 Fix cppling warning. 2014-01-31 15:53:01 +08:00
Cheng Zhao
18fdbb6432 Add docs on the node-integration setting. 2014-01-31 15:22:32 +08:00
Cheng Zhao
bd51a4c8cf Fix crash when opening multiple pages at the same time. 2014-01-31 15:09:13 +08:00
Cheng Zhao
6478244fbf Put common constants into one file. 2014-01-31 12:18:30 +08:00
Cheng Zhao
e0f660301c Specify the commit of libchromiumcontent to download. 2014-01-31 12:09:43 +08:00
Cheng Zhao
192014cc3f Do not use plain string iterals. 2014-01-31 10:41:20 +08:00
Cheng Zhao
61b69a4e8a Fix loss of --node-integration token after refresh. 2014-01-31 10:30:16 +08:00
Cheng Zhao
ec00da416f Rename iframe-security to node-integration. 2014-01-30 23:20:12 +08:00
Cheng Zhao
d4929de33c Add iframe-security support. 2014-01-30 22:47:21 +08:00
Cheng Zhao
a0b15661ed Append --iframe-security to renderer process. 2014-01-30 21:57:01 +08:00
Cheng Zhao
9a58706e1f Don't pollute process.argv of browser process. 2014-01-30 21:20:02 +08:00
Cheng Zhao
ce586e0835 Don't append duplicate arguments to renderer process. 2014-01-30 21:06:56 +08:00
probablycorey
795c31918a Merge remote-tracking branch 'origin/master' into cj-replace-sparkle-with-squirrel 2014-01-29 14:55:20 -08:00
Cheng Zhao
2592487c3f Sort devDependencies. 2014-01-28 09:36:32 +08:00
Cheng Zhao
f05daa8bdc Make bump-version accept major/minor/patch/build. 2014-01-27 18:37:39 +08:00
Cheng Zhao
75ec34884d Bump v0.8.7. 2014-01-23 05:02:28 -08:00
Cheng Zhao
96cb4fd6d7 Merge pull request #166 from atom/cz-v8-locker
Wrap callbacks with v8 locker in browser process
2014-01-27 00:15:22 -08:00
Cheng Zhao
d63de1ae15 Wrap callbacks with v8::Locker.
In browser process, because of the use of v8::Locker in ProxyResolverV8,
creating HandleScope requires entering locker first, so in browser
process we should just use v8::Locker whenever we need to use V8 in a
callback called from non-V8 places (like dialog's callback, work pushed
to MessageLoop).

But also notice that the renderer process doesn't use v8::Locker, so we
have to be careful not to use it, otherwise blink would crash when
creating HandleScope.
2014-01-27 15:14:11 +08:00
Cheng Zhao
5250871e69 Remove unneeded HandleScopes.
It's not necessary to create HandleScope in v8 native binding functions,
because it's guarrenteed that the there is a upper HandleScope when the
native function is called. So unless we are urgent to free the handles,
not using HandleScope in native binding functions is a cleaner and safer
choice.
2014-01-27 15:01:06 +08:00
Cheng Zhao
426bc97194 Use node_isolate instead of Isolate::GetCurrent(). 2014-01-27 14:04:34 +08:00
Cheng Zhao
76098255f0 Should decode when setting __filename from location. 2014-01-24 21:20:30 +08:00
Cheng Zhao
e8594b492e It's safe to send message to nil. 2014-01-22 12:00:34 +08:00
Cheng Zhao
d4e362ec89 Add error and update-not-available events for auto updater. 2014-01-21 22:50:46 +08:00
Cheng Zhao
df399f7c8c Implement auto_updater with Squirrel. 2014-01-21 22:13:34 +08:00
Cheng Zhao
ef8e5505c8 Merge branch 'master' into cj-replace-sparkle-with-squirrel 2014-01-21 20:40:19 +08:00
Cheng Zhao
71fd147c47 Fix gyp error on CI. 2014-01-21 20:34:35 +08:00
Cheng Zhao
c271d89677 Fix cpplint warnings. 2014-01-21 20:25:01 +08:00
probablycorey
7cf040e7ca I don't think fix_framework_link_command is needed anymore.
tool -L says Squirrel (and its dependencies) already use @rpath

```
@rpath/Squirrel.framework/Squirrel (compatibility version 1.0.0, current version 1.0.0)
@rpath/ReactiveCocoa.framework/ReactiveCocoa (compatibility version 1.0.0, current version 1.0.0)
@rpath/Mantle.framework/Mantle (compatibility version 1.0.0, current version 1.0.0)
```
2014-01-20 16:32:56 -08:00
probablycorey
a6c92f20c8 Link Sparkle frameworks 2014-01-20 16:25:48 -08:00
probablycorey
400e963b8b Download Squirrel frameworks instead of Sparkle 2014-01-20 16:25:33 -08:00
probablycorey
2a7244a366 Remove references to Sparkle 2014-01-20 16:22:49 -08:00
probablycorey
5741bad918 💄 2014-01-20 16:22:32 -08:00
Cheng Zhao
1d7445c5aa Fix uv loop hack on child_process. 2014-01-18 17:01:30 +08:00
Cheng Zhao
4a1f8cf1c9 Activate uv loop when uv loop's watcher queue changes, fixes #159. 2014-01-18 16:56:46 +08:00
Cheng Zhao
a2bf1b3907 Update to latest apm. 2014-01-18 16:29:24 +08:00
Cheng Zhao
b2d4d76bcf 📝 Update docs on source code structure. 2014-01-16 10:31:59 +08:00
Cheng Zhao
9ac555c302 move atom_menu_controller_mac to browser/ui/cocoa. 2014-01-16 10:22:33 +08:00
Cheng Zhao
43711083f7 Move atom_event_processing_window to browser/ui/cocoa. 2014-01-16 10:09:36 +08:00
Cheng Zhao
9b07c2b894 Move nsalert_synchronous_sheet_mac to browser/ui/cocoa. 2014-01-16 10:06:05 +08:00
Cheng Zhao
2c28725722 gtk: Support frameless window. 2014-01-15 15:15:45 +00:00
Cheng Zhao
53a4f34433 📝 Add docs on window events. 2014-01-15 14:42:47 +00:00
Cheng Zhao
406f0b7bc7 Implement "blur" window event. 2014-01-15 14:38:38 +00:00
Cheng Zhao
6912a0513a gtk: Set WebKit's style from current theme. 2014-01-15 14:31:26 +00:00
Cheng Zhao
0398577e93 gtk: Implement basic native window methods. 2014-01-15 13:28:00 +00:00
Cheng Zhao
42dc9c1ec6 Add dummy implementation of crash reporter. 2014-01-15 12:01:03 +00:00
Cheng Zhao
2f798c5116 Merge branch 'master' into linux
Conflicts:
	vendor/apm
2014-01-15 11:18:40 +00:00
Cheng Zhao
363f1da77e Bump v0.8.6. 2014-01-14 01:34:07 -08:00
Cheng Zhao
8655dec00e Crash when there is fatal error in V8. 2014-01-23 20:30:44 +08:00
Cheng Zhao
fbc68ecce5 Bump v0.8.5. 2014-01-14 16:24:53 +08:00
Cheng Zhao
8d4ac15834 :lipstip: Remove unneed output. 2014-01-14 16:04:47 +08:00
Cheng Zhao
249366c90a Restart renderer process for all navigations and reloads, fixes #157. 2014-01-14 16:03:01 +08:00
Cheng Zhao
931182b677 Fix crash when calling dialog's callback. 2014-01-14 14:18:32 +08:00
Cheng Zhao
2a129f892f Bump v0.8.4. 2014-01-13 18:46:19 +08:00
Cheng Zhao
57a27876ec Fix warnings of node_lib. 2014-01-13 18:43:09 +08:00
Cheng Zhao
fc2e069efe Fix warnings of openssl-cli. 2014-01-13 18:41:40 +08:00
Cheng Zhao
58d4ec5587 Update node-pathwatcher to v0.14.0. 2014-01-13 18:25:04 +08:00
Cheng Zhao
b0c23294fe Also use uv loop fixes in browser process. 2014-01-13 13:57:08 +08:00
Cheng Zhao
290dd36bb0 Activate uv loop when calling childProcess.fork.
Fixes #156.
2014-01-13 11:52:24 +08:00
Cheng Zhao
84529de10d Update apm: update node version to v0.11.10. 2014-01-10 18:50:53 +08:00
Cheng Zhao
bde4a732c4 Bump node version to v0.11.10. 2014-01-10 18:37:05 +08:00
Cheng Zhao
535b936c87 Update node to v0.11.10. 2014-01-10 18:24:44 +08:00
Cheng Zhao
dc880b16f1 Merge pull request #155 from atom/fix-q
Fix executing process.nextTick's callbacks
2014-01-10 02:13:07 -08:00
Cheng Zhao
5eb1f52421 Make sure nextTick is called when activating uv loop. 2014-01-10 16:47:33 +08:00
Cheng Zhao
3747048218 💄 get_uv_env() => uv_env(). 2014-01-10 16:29:38 +08:00
Cheng Zhao
a1a091d805 Add spec for q. 2014-01-10 15:58:14 +08:00
Cheng Zhao
e536d0e7a8 Leak the node environment when unloading. 2014-01-10 11:04:54 +08:00
Cheng Zhao
e050494e5d Merge pull request #154 from atom/safe-context
Wrap uv loop with web page context in renderer
2014-01-09 06:28:35 -08:00
Cheng Zhao
bbc01e704c Monitor file events in pathwatcher spec. 2014-01-09 22:13:48 +08:00
Cheng Zhao
fff743053a Store all created environments in renderer. 2014-01-09 22:13:06 +08:00
Cheng Zhao
e7b7efeb0a Wrap uv loop with web page context in renderer. 2014-01-09 21:35:29 +08:00
Cheng Zhao
968fc71b78 Add spec for using setTimeout in pure uv callback. 2014-01-09 20:34:17 +08:00
Cheng Zhao
d0494024a9 Add process.scheduleCallback.
It will schedule a callback to be executed by pure uv loop.
2014-01-09 20:33:07 +08:00
Cheng Zhao
a12754f980 Add spec for pathwatcher module. 2014-01-09 20:29:54 +08:00
Cheng Zhao
c76f510cea Bump v0.8.3. 2014-01-07 08:26:12 -08:00
Cheng Zhao
968f75529a Fix possible crashes when quiting message loop. 2014-01-08 11:55:54 +08:00
Cheng Zhao
93d5a2e195 Fix invoking non-exist method when quiting. 2014-01-08 10:51:32 +08:00
Cheng Zhao
367285f3f3 Merge pull request #152 from atom/gfx-module
Add screen module
2014-01-07 04:46:24 -08:00
Cheng Zhao
95b2003193 📝 Add docs on screen module. 2014-01-07 20:35:13 +08:00
Cheng Zhao
bcdc44c1c6 Support converting v8 value to arbitrary vector or map. 2014-01-07 20:29:17 +08:00
Cheng Zhao
4ae2738ce5 Add screen.getPrimaryDisplay() API. 2014-01-07 20:15:55 +08:00
Cheng Zhao
e09a2ff811 Add support to convert gfx::Rect and gfx::Size to v8 value. 2014-01-07 20:15:23 +08:00
Cheng Zhao
7253a35455 Add initial screen module. 2014-01-07 20:00:25 +08:00
Cheng Zhao
1b1cf87115 Add support to convert gfx::Point to v8 value. 2014-01-07 20:00:02 +08:00
Cheng Zhao
3ec755e978 💄 2014-01-07 19:44:37 +08:00
Cheng Zhao
cf4616de7f api::EventEmitter could also be used by renderer. 2014-01-07 19:32:40 +08:00
Cheng Zhao
2755fbaadf Update apm. 2014-01-07 02:50:52 -08:00
Cheng Zhao
6f222651d7 Bump v0.8.2. 2014-01-07 18:44:37 +08:00
Cheng Zhao
fe4841a1cd Set module's filename to path of html.
The relative require relies on module.filename to work as expected.
2014-01-07 14:30:18 +08:00
Cheng Zhao
fe8a2b9ee0 Still support 'atom-delegate' API for old apps. 2014-01-07 09:50:00 +08:00
Cheng Zhao
b939232670 mac: Should set default size when creating window. 2014-01-06 18:58:30 +08:00
Cheng Zhao
a4253e3899 linux: Implemnt browser methods. 2014-01-02 14:47:54 +00:00
Cheng Zhao
52b5f769f0 linux: Add empty implementation of auto updater. 2014-01-02 14:15:02 +00:00
Cheng Zhao
b73a114f8f gtk: Implement accelerator_util. 2014-01-02 14:12:05 +00:00
Cheng Zhao
7ca152070a Update brightray. 2014-01-01 02:31:33 +00:00
Cheng Zhao
f24ccd3841 linux: Implement platform_util. 2013-12-31 12:59:33 +00:00
Cheng Zhao
66ac11ca5f linux: Implement brightray's stub functions. 2013-12-31 12:24:53 +00:00
Cheng Zhao
7afef0fcdb Fix entry function under Linux. 2013-12-31 11:51:17 +00:00
Cheng Zhao
627f487b36 Disable compilation errors in node under Linux. 2013-12-31 11:40:19 +00:00
Cheng Zhao
c64a793364 Build with clang under Linux. 2013-12-31 11:27:31 +00:00
Cheng Zhao
63852a8c82 Update brightray for linux_clang flag. 2013-12-31 11:16:18 +00:00
Cheng Zhao
c97afdbdb3 Update apm. 2013-12-31 08:33:17 +00:00
Cheng Zhao
6c5ea4ea32 Compile coffee script on Linux. 2013-12-31 08:01:08 +00:00
Cheng Zhao
cac3973731 Flip the y axis in CapturePage API, fixes #148. 2013-12-31 14:40:42 +08:00
Cheng Zhao
19a35b58f0 Merge pull request #147 from atom/remote-docs
Revise the docs on remote module
2013-12-30 18:02:14 -08:00
Cheng Zhao
5e51ad30d7 Add notes about remote buffer in capturePage API's docs. 2013-12-31 10:00:29 +08:00
Cheng Zhao
e1e5cb5ba4 Add notes on remote buffer. 2013-12-30 23:15:15 +08:00
Cheng Zhao
8d124c7157 Revise the docs of remote module. 2013-12-30 22:06:33 +08:00
Cheng Zhao
67ed72294b Bump v0.8.1. 2013-12-29 23:09:19 +08:00
Cheng Zhao
1bb5481071 Fix circulate require. 2013-12-29 22:33:53 +08:00
Cheng Zhao
876063b1ba Fix console.log under Windows.
The process.log is not added until the next iteration of uv loop.
2013-12-29 22:32:26 +08:00
Cheng Zhao
7d193033f5 💄 Fix wrong order of parameter when killing process. 2013-12-29 22:11:54 +08:00
Cheng Zhao
074ea374e0 We are now on v0.8.0 release. 2013-12-27 16:22:34 +08:00
Cheng Zhao
f6c3a69595 Merge pull request #146 from atom/window-open
Implement window.open in pure js
2013-12-26 23:54:19 -08:00
Cheng Zhao
f28881e203 Fix crash caused by BrowserWindow.destroy(). 2013-12-27 15:41:00 +08:00
Cheng Zhao
6312c1108a Add spec for window.open. 2013-12-27 14:58:13 +08:00
Cheng Zhao
0de40febab Add basic support for window.open's features. 2013-12-27 14:57:53 +08:00
Cheng Zhao
1701f572e2 Fix crash when calling method of destroyed object. 2013-12-27 14:47:50 +08:00
Cheng Zhao
15a9be6b93 Implement a simple window.open with pure js. 2013-12-27 14:39:23 +08:00
Cheng Zhao
a60be1563f Do not implement window.open. 2013-12-27 14:32:24 +08:00
Cheng Zhao
a2522efb25 Build for x64 architecture on OS X, fixes #132. 2013-12-27 14:17:35 +08:00
Cheng Zhao
7c3f22a333 Bump v0.8.0. 2013-12-27 14:09:10 +08:00
Cheng Zhao
2945e1b50a Merge pull request #140 from atom/chrome31
Update to Chrome 31
2013-12-26 22:07:17 -08:00
Cheng Zhao
aedacd39d2 Rename 'finish-launching' event to 'ready',
'finish-launching' is more like a OS X message name, and in atom-shell
it means initialization has done, so 'ready' seems to be a better name
and more easy to remember.

The 'will-finish-launching' event just represents the corresponding
message on OS X and is the same with 'ready' on other platforms, so we
keep its name to indicate that it's only useful for OS X specified
code.
2013-12-27 11:08:26 +08:00
Cheng Zhao
d3f33152d0 Get rid of the ugly ATOM_BROWSER_INTERNAL_NEW message. 2013-12-26 18:41:21 +08:00
Cheng Zhao
cfca12d4a5 Use the gyp vendored by brightray. 2013-12-25 18:47:19 +08:00
Cheng Zhao
754cd88cc2 Update brightray: Fix building on Windows. 2013-12-24 16:05:50 +08:00
Cheng Zhao
031426d54e Use our fork of V8ValueConverter for all cases. 2013-12-23 22:42:21 +08:00
Cheng Zhao
980e8ca4dc Free the node environment when releasing context. 2013-12-23 22:19:51 +08:00
Cheng Zhao
df0094b6cb Move node integration from RenderViewObserver to RendererClient. 2013-12-23 22:08:45 +08:00
Cheng Zhao
02d94c8b2e Print pid when logging. 2013-12-23 22:04:49 +08:00
Cheng Zhao
902be9bab5 Update node: Removed two unused patches. 2013-12-20 14:20:24 +08:00
Cheng Zhao
f646d2dda8 Enable high DPI support. 2013-12-20 14:14:07 +08:00
Cheng Zhao
92b19f89d9 Remove the unzip spec completely. 2013-12-17 23:21:40 +08:00
Cheng Zhao
d8eb465eb9 Fix protocol spec on Windows. 2013-12-17 23:03:36 +08:00
Cheng Zhao
c04a9933cc Fix __filename on Windows. 2013-12-17 22:16:15 +08:00
Cheng Zhao
5b12f80d01 Discard the require('atom-delegate') API. 2013-12-17 22:08:45 +08:00
Cheng Zhao
75c44ca057 Fix initializing V8 on Windows. 2013-12-17 21:55:56 +08:00
Cheng Zhao
56f709ff1f Continue fixing compilation erros on Windows. 2013-12-17 18:34:45 +08:00
Cheng Zhao
0215c2fbee Make all the windows code compile for Chrome 31. 2013-12-17 17:52:57 +08:00
Cheng Zhao
6e079d8bc4 Also search C:/Program Files (x86) for node binary. 2013-12-17 13:14:54 +08:00
Cheng Zhao
a4715f936b Merge branch 'master' into chrome31
Conflicts:
	common/atom_version.h
2013-12-17 12:58:25 +08:00
Cheng Zhao
1d88b31edd Use node-runas for testing native modules. 2013-12-17 12:00:21 +08:00
Cheng Zhao
e07e26ca76 Fix third party module specs. 2013-12-16 22:46:16 +08:00
Cheng Zhao
c82e73a4ec Update apm: Fix installing for node v0.11.x. 2013-12-16 22:37:43 +08:00
Cheng Zhao
eda4249bf8 Add deps/npm and deps/mdb_v8 in node headers. 2013-12-16 22:37:17 +08:00
Cheng Zhao
09201e3e65 Update brightray: Remove webkit hacks. 2013-12-16 21:19:12 +08:00
Cheng Zhao
2ca2d37e93 Clean out node_modules in cibuild. 2013-12-16 15:15:33 +08:00
Cheng Zhao
d3416e2873 Bump node version to v0.11.9. 2013-12-16 14:52:15 +08:00
Cheng Zhao
4e4e316005 Include Environment declarations in node_common.h. 2013-12-16 14:46:05 +08:00
Cheng Zhao
8fc1e055bf Update apm for node version and architecture change. 2013-12-16 14:40:03 +08:00
Cheng Zhao
d51ea21afa Use singular form of spec names. 2013-12-16 00:31:40 +08:00
Cheng Zhao
abf982e4e5 Remove the on_watcher_queue_updated hack. 2013-12-15 19:50:43 +08:00
Cheng Zhao
998e9792fb Make setImmediate have the same side effect with upstream node. 2013-12-15 19:09:00 +08:00
Cheng Zhao
c87b21148c Supress the unzip module spec.
The unzip module is not compatible with node v0.11.x, so we do not need
to test it anymore.
2013-12-15 19:08:10 +08:00
Cheng Zhao
7e67f7632d 💄 Fix cpplint warnings. 2013-12-15 17:09:35 +08:00
Cheng Zhao
cd68396bd5 Disable use of deprecated functions in specs. 2013-12-15 17:02:43 +08:00
Cheng Zhao
474e1fcd3b Fix protocol module specs. 2013-12-15 16:53:07 +08:00
Cheng Zhao
cfeeec37eb Fix capturePage() spec. 2013-12-15 16:32:49 +08:00
Cheng Zhao
0a84c30d3b Redirect window.onerror to uncaughtException. 2013-12-15 16:32:41 +08:00
Cheng Zhao
7ba03ce23d Add setImmediate function in renderer. 2013-12-15 16:21:23 +08:00
Cheng Zhao
cc5db4dab9 Suppress the EventEmitter's warning for ObjectsRegistry.
It's possible that many objects subscribed to it.
2013-12-15 16:15:18 +08:00
Cheng Zhao
aa3e8385df Set __filename to the html file in renderer. 2013-12-15 16:11:00 +08:00
Cheng Zhao
886ebdb002 Use node's Environment feature to add "require" in renderer. 2013-12-15 14:20:28 +08:00
Kevin Sawicki
ea2f87683a Merge pull request #144 from shama/typo
Fix a couple minor typos in docs
2013-12-13 08:44:06 -08:00
Kyle Robinson Young
c116f6b35c Fix a couple minor typos in docs 2013-12-12 22:31:19 -08:00
Cheng Zhao
2413eebd7b Disable accelerated compositing to fix everything. 2013-12-13 00:57:08 +08:00
Cheng Zhao
7708e7a8c4 Update node for renderer node integration fixes. 2013-12-12 16:49:56 +08:00
Cheng Zhao
1c0b391419 Fix the black devtools view.
Without using UnderlayOpenGLHostingWindow the devtools view would just
be black.
2013-12-12 15:49:08 +08:00
Cheng Zhao
28f5d184b3 Do not depend on node to set include_dirs.
Part of atom/node#2.
2013-12-12 14:07:00 +08:00
Cheng Zhao
fc00da9732 Update brightray, which contains all our patches in master. 2013-12-12 10:43:50 +08:00
Cheng Zhao
9ea75b7519 We are now at v0.8.0-pre. 2013-12-12 10:43:34 +08:00
Cheng Zhao
61c63a6af9 Fix crashes about persistent v8 functions. 2013-12-12 00:10:09 +08:00
Cheng Zhao
e4bfa373de Fix node integration to browser after updated to Chrome31. 2013-12-11 23:59:03 +08:00
Cheng Zhao
d53915c6ab Fix recursive calling of handle(). 2013-12-11 23:57:37 +08:00
Cheng Zhao
409a431892 Huge commit to use new V8 and Content APIs.
Still got a lots of linking errors!
2013-12-11 15:48:19 +08:00
Cheng Zhao
d82cfc023f 💄 There should be no space between & and type name. 2013-12-10 14:27:25 +08:00
Cheng Zhao
f9c41f33e5 node::ObjectWrap how had a handle() method. 2013-12-10 14:15:37 +08:00
Cheng Zhao
4ec4b01218 base/string16.h was moved to base/strings/string16.h. 2013-12-10 14:14:05 +08:00
Cheng Zhao
0a37852757 Update to node v0.11.9. 2013-12-10 14:07:32 +08:00
Cheng Zhao
42ffa5813f Update libchromiumcontent and brightray to use Chrome31. 2013-12-09 17:23:32 +08:00
Cheng Zhao
597e17b540 Fix template related compilation errors of VC++. 2013-12-09 16:34:10 +08:00
Cheng Zhao
9ac0591386 Bump v0.7.6. 2013-12-08 22:42:43 -08:00
Cheng Zhao
cb73a3c572 Remove the RestartHangMonitorTimeout API, which is useless now. 2013-12-09 14:17:56 +08:00
Cheng Zhao
2c672052e6 Flatten spec files, make them seem cleaner. 2013-12-06 22:23:02 +08:00
Cheng Zhao
b431e96f9d Update node: Add fs.lstatSyncNoException, closes #138. 2013-12-06 21:51:47 +08:00
Cheng Zhao
36445f8d8b Merge pull request #139 from atom/browser-cleaner
Do not rely on renderer to report the deletion of render view
2013-12-06 05:17:27 -08:00
Cheng Zhao
085b1a45ee Report the right render view that is deleted. 2013-12-06 15:53:40 +08:00
Cheng Zhao
844fccc177 Use random number as id in CallbacksRegistry.
It's very possible that the callbacks got GCed before the render view is
closed (like page getting refreshed), so we should not let browser call
the wrong callback, instead we should throw error whenever a callback is
not found.
2013-12-06 15:04:51 +08:00
Cheng Zhao
0a63395b0f 💄 Restore old settings in app specs. 2013-12-06 14:54:29 +08:00
Cheng Zhao
623e0f3ae4 Release render view's remote objects when it's deleted.
Privously we release them when the window is unloaded, which is not
correct since a render view can have multiple windows (or js contexts)
and when the unload event is emitted the render view could already have
gone.

This PR does the cleaning work purely in browser, so here is no need to
worry about renderer's life time.
2013-12-06 14:44:25 +08:00
Cheng Zhao
e9e90b481a 💄 Fix cpplint warnings. 2013-12-05 23:54:57 +08:00
Cheng Zhao
4a1ee39156 Get rid of manually converting to base::Value when possible. 2013-12-05 23:47:07 +08:00
Cheng Zhao
e5afa72b4d Fail quietly when getting null renderer view.
It happens when the window is closing.
2013-12-05 23:34:43 +08:00
Cheng Zhao
287c948845 Enable getting scoped_ptr type from v8 value.
God damned C++ template.
2013-12-05 23:25:14 +08:00
Cheng Zhao
4625f051c8 Simplify V8 operations in renderer ipc code. 2013-12-05 22:12:27 +08:00
Cheng Zhao
8d271a6655 Update node: Fixed a handle leak in fs.statNoException(). 2013-12-05 21:41:39 +08:00
Cheng Zhao
65b3435156 Bump v0.7.5. 2013-12-05 13:48:19 +08:00
Cheng Zhao
3c60e07653 Merge pull request #136 from atom/fix-ua
Use name and version information of package.json
2013-12-04 21:44:35 -08:00
Cheng Zhao
564c5c1664 Add simple specs for app.getName() and app.getVersion(). 2013-12-05 13:37:01 +08:00
Cheng Zhao
5f4a9316f1 📝 Add usage of productName of package.json. 2013-12-05 11:46:36 +08:00
Cheng Zhao
a0c0bb18b7 Choose a better name for the default_app. 2013-12-05 11:31:16 +08:00
Cheng Zhao
284160bf2d Set application's name and version from the package.json. 2013-12-05 11:30:06 +08:00
Cheng Zhao
0229c3187b Override the user agent to contain application and atom-shell's version. 2013-12-05 11:21:11 +08:00
Cheng Zhao
eec8560119 📝 Update documentation on changes of "app" module. 2013-12-05 11:02:09 +08:00
Cheng Zhao
fc4ed9be12 Use bundle's name as application name when we have one. 2013-12-05 10:42:04 +08:00
Cheng Zhao
a614134144 Simplify V8 operations. 2013-12-05 10:35:57 +08:00
Cheng Zhao
5670ee7693 Add API to get and override application name. 2013-12-05 10:32:58 +08:00
Cheng Zhao
420ae1a2cc Add API to override browser version. 2013-12-05 10:26:01 +08:00
Cheng Zhao
02bbf07d3a Enable overriding UA strings. 2013-12-05 10:08:11 +08:00
Cheng Zhao
121163f9ca Add conversions between V8 Value and GURL. 2013-12-05 10:07:51 +08:00
Kevin Sawicki
d79626f02f 📝 Update repo link to atom/atom 2013-12-04 09:09:30 -08:00
Cheng Zhao
7cffbc8a1a Bump v0.7.4. 2013-12-04 22:12:58 +08:00
Cheng Zhao
170ef2362f Merge pull request #133 from atom/sheet-unresponsive
Do not send "unresponsive" message if window is showing a modal dialog.
2013-12-04 06:11:38 -08:00
Cheng Zhao
e45f83e62a Make sure browserWindow.destroy() doesn't leave zombie processes. 2013-12-04 22:00:20 +08:00
Cheng Zhao
687c9de5d7 win: Implement NativeWindowWin::HasModalDialog(). 2013-12-04 21:18:53 +08:00
Cheng Zhao
e43b39a009 Do not send "unresponsive" message if window is showing a modal dialog. 2013-12-04 17:18:55 +08:00
Cheng Zhao
bfe8928ab1 Do not use flags to mark whether the window is unresponsive.
It's error prone.
2013-12-04 17:10:59 +08:00
Cheng Zhao
d6d1604623 mac: Add API to return whether the window has attached sheet. 2013-12-04 16:32:32 +08:00
Cheng Zhao
7d5826df85 Add "Cmd" and "Control" alias for "Command" and "Ctrl". 2013-11-29 16:31:38 +08:00
Cheng Zhao
9493c1b0bb Bump v0.7.3. 2013-11-29 16:22:27 +08:00
Cheng Zhao
a2aa20b6b2 Add "Edit" menu in specs window. 2013-11-29 16:21:43 +08:00
Cheng Zhao
c8d0968e00 Use CommandOrControl to replace Command in specs windows. 2013-11-29 16:14:44 +08:00
Cheng Zhao
8237edcf0d Add "CommandOrControl" to represent "Command" on OS X and "Ctrl" on other platforms. 2013-11-29 16:11:48 +08:00
Cheng Zhao
13261921a7 Merge pull request #130 from atom/force-closing
Send the "unresponsive" event if window does not close or cancel the close in 500ms when closing it.
2013-11-28 23:42:27 -08:00
Cheng Zhao
adc5495d2b Prompt unresponsive state in spec window. 2013-11-29 15:19:30 +08:00
Cheng Zhao
02d14ed23b Fix returning the chosen option for synchronous dialogs. 2013-11-29 15:19:00 +08:00
Cheng Zhao
a0a5b20ef1 Send the "unresponsive" event if window is not closed in 500ms when closing it. 2013-11-29 14:52:12 +08:00
Cheng Zhao
fd081e162b Bump v0.7.2. 2013-11-28 21:00:40 +08:00
Cheng Zhao
30be4a847f win: Do not generate symbols for static libraries and strip .pdb in symbol name. 2013-11-28 20:53:07 +08:00
Cheng Zhao
0d77ba5222 No need to ship atom.exe.pdb any more. 2013-11-28 20:14:45 +08:00
Cheng Zhao
94569f7f8c Fix executing python script in gyp. 2013-11-28 20:11:06 +08:00
Cheng Zhao
fdfff63119 💄 Wrong IP for default crash reporter server. 2013-11-28 12:38:33 +08:00
Cheng Zhao
da03784610 Bump v0.7.1. 2013-11-23 01:09:42 -08:00
Cheng Zhao
deef68bcf9 Also search libchromiumcontent download dir for dSYMs. 2013-11-23 01:07:38 -08:00
Cheng Zhao
6393e2e1e5 Bump v0.7.0. 2013-11-27 16:11:19 +08:00
Cheng Zhao
bf77fcc03e Merge pull request #124 from atom/breakpad
Use breakpad for crash reporting
2013-11-26 23:33:43 -08:00
Cheng Zhao
386b921914 win: Register msdia80.dll automatically when dumping symbols. 2013-11-26 22:05:32 +08:00
Cheng Zhao
401fe76acd 💄 Add missing ""s. 2013-11-26 21:35:19 +08:00
Cheng Zhao
2fd3616ef3 win: Implement the atom_dump_symbols target. 2013-11-26 21:34:27 +08:00
Cheng Zhao
ffaf535d00 Add script to generate symbols from pdbs on Windows. 2013-11-26 21:23:50 +08:00
Cheng Zhao
9ac5ea5a6c Mention that pyobjc is needed for homebrew python. 2013-11-26 11:46:45 +08:00
Cheng Zhao
edf7496443 Also clean up libchromiumcontent in cibuild. 2013-11-26 11:04:37 +08:00
Cheng Zhao
151b2b5ad5 Also upload product name, company name and version in crash report. 2013-11-26 10:19:50 +08:00
Cheng Zhao
1fc9ef33db Remove the build directory beforing rebuilding in cibuild. 2013-11-26 09:39:24 +08:00
Cheng Zhao
858f21a69c mac: Dump symbols from .dSYM when possible. 2013-11-26 09:30:51 +08:00
Cheng Zhao
3a4835ff1c Also download libchromiumcontent symbols on Mac. 2013-11-25 23:13:58 +08:00
Cheng Zhao
47d37cc1e3 Download libchromiumcontent symbols when creating symbols. 2013-11-25 16:02:35 +08:00
Cheng Zhao
a5224f705d mac: Use "Atom Framework.framework" instead of "Atom.framework".
The "Atom.framework" would confuse breakpad with "App.app" when finding
symbols.
2013-11-25 15:37:39 +08:00
Cheng Zhao
b737e602b7 mac: Store crash dumps under /tmp/ProductName Crashes/.
If we put them under ~/Library/ then we need to clean them, which makes
things more complicated.
2013-11-24 23:42:54 +08:00
Cheng Zhao
59f586ba59 Use "Atom-Shell" instead of "atom-shell" for product names. 2013-11-24 23:17:48 +08:00
Cheng Zhao
70b7659893 win: Set uploading parameters in crash reporter. 2013-11-24 22:57:47 +08:00
Cheng Zhao
717b664802 win: Make out-of-process crash dump work. 2013-11-24 22:22:08 +08:00
Cheng Zhao
75e1fb63c8 Start the crash service process on non-Mac. 2013-11-24 20:45:12 +08:00
Cheng Zhao
a9c20dc42f 💄 Remove ununsed "display_name". 2013-11-24 20:36:08 +08:00
Cheng Zhao
dce7e50636 win: Setup crash service according to command line parameters. 2013-11-24 20:33:26 +08:00
Cheng Zhao
edd2bd74c9 win: Print crash service's log to file. 2013-11-24 18:17:31 +08:00
Cheng Zhao
6f8c46d2f4 win: Start as crash service when ATOM_SHELL_INTERNAL_CRASH_SERVICE is set. 2013-11-24 17:35:58 +08:00
Cheng Zhao
4bab284f2e Add crash_service on Windows. 2013-11-23 20:26:47 +08:00
Cheng Zhao
59b3e74542 Merge branch 'master' into breakpad 2013-11-22 19:37:34 +08:00
Cheng Zhao
4af646b760 Bump v0.6.12. 2013-11-22 15:18:21 +08:00
Cheng Zhao
5720d4f802 Merge pull request #128 from atom/api-capture-page
Add BrowserWindow.capturePage API.
2013-11-21 22:52:22 -08:00
Cheng Zhao
80824b13c6 Add spec for BrowserWindow.capturePage. 2013-11-22 14:42:39 +08:00
Cheng Zhao
33ad68f7a7 doc: Explain BrowserWindow.capturePage. 2013-11-22 14:39:10 +08:00
Cheng Zhao
4af802f215 Enable ignoring |rect| when calling BrowserWindow.capturePage. 2013-11-22 14:29:20 +08:00
Cheng Zhao
3b4a45ac65 Add BrowserWindow.capturePage API. 2013-11-22 14:23:19 +08:00
Cheng Zhao
a0548530e7 Enable converting V8 value to gfx::Rect. 2013-11-22 14:22:28 +08:00
Cheng Zhao
8d6764e0a0 Return screenshot's data buffer instead of directly saving to file. 2013-11-21 22:03:29 +08:00
Cheng Zhao
36ecb35cb1 Add API to capture a page into file. 2013-11-21 21:50:06 +08:00
Cheng Zhao
9ad3b7939f Bump v0.6.11. 2013-11-20 22:51:26 +08:00
Cheng Zhao
8493975840 doc: Mention that Command would not be meaningful on Windows. 2013-11-20 22:48:47 +08:00
Cheng Zhao
ec880d64bf Merge pull request #125 from atom/dont-map-meta
Don't map command to ctrl
2013-11-20 06:35:20 -08:00
Matt Colyer
113d644615 Don't map command to ctrl
We no longer what this behavior because it's confusing unless you
understand that atom-shell does this.
2013-11-19 15:18:54 -08:00
Cheng Zhao
4105527d07 win: Initialize exception handler. 2013-11-19 21:37:02 +08:00
Cheng Zhao
2228184066 Cause a real crash instead of debugger break in process.crash().
On Windows the debugger break would not be treated as crash.
2013-11-19 21:36:18 +08:00
Cheng Zhao
1af4ecfc26 win: Make console output work on cygwin. 2013-11-19 20:56:22 +08:00
Cheng Zhao
9981fd51da win: Fix error when bootstraping. 2013-11-19 20:43:30 +08:00
Cheng Zhao
458ff5c41f Always use atom-shell as product name.
Since the symbols of atom-shell would be used by all third party
applications, it would make server handling more complicated if we allow
users to custom the uploaded product name. We should always use
atom-shell as product name when uploading so the server would not be
confused when searching symbols, and the user specified product name
could be show in UI.
2013-11-19 12:33:02 +08:00
Cheng Zhao
7735d8fbfd Update default crash report submission URL. 2013-11-19 12:27:20 +08:00
Cheng Zhao
20e368eb89 Do not append "Renderer" in product name when uploading. 2013-11-19 12:19:59 +08:00
Cheng Zhao
ed3358e501 Add spec for custom uploading parameters. 2013-11-18 18:37:32 +08:00
Cheng Zhao
d181ff4e7f Enable customing upload parameters for sending crash report. 2013-11-18 18:27:50 +08:00
Cheng Zhao
f8f09eb974 Enable converting v8 object to dict type. 2013-11-18 18:15:34 +08:00
Cheng Zhao
28b692aeaa Always use atom-shell's verion when uploading crash report. 2013-11-18 18:03:41 +08:00
Cheng Zhao
aef6d44a01 Also upload symbols to GitHub Release. 2013-11-18 18:02:38 +08:00
Cheng Zhao
e4b4087fdb Create symbols zip file when creating distribution. 2013-11-18 11:41:44 +08:00
Cheng Zhao
1d2de6d1fb mac: Add target to dump breakpad symbols. 2013-11-15 22:52:08 +08:00
Cheng Zhao
67dd596386 Enable starting crash-reporter without parameters. 2013-11-15 11:00:48 +08:00
Cheng Zhao
bd0836581b Check the upload parameters in crash-reporter spec. 2013-11-15 10:37:22 +08:00
Cheng Zhao
cdb5e24d2f Add spec for crash-reporter 2013-11-15 00:10:43 +08:00
Cheng Zhao
6b02be6da8 Add extra uploading parameters for crash reporter. 2013-11-14 18:02:15 +08:00
Cheng Zhao
d1a5c49843 win: Add stubs for crash reporter. 2013-11-14 13:42:28 +08:00
Cheng Zhao
dd4e43eb02 doc: Update new crash-reporter API. 2013-11-14 13:39:44 +08:00
Cheng Zhao
9007a45051 Refactor crash reporter to be more cross-platform friendly. 2013-11-14 13:33:09 +08:00
Cheng Zhao
801a19504a No more downloading QuincyKit. 2013-11-13 19:19:57 +08:00
Cheng Zhao
a6989847ea Add API to set product name for crash reporter. 2013-11-13 19:12:13 +08:00
Cheng Zhao
e7d25385b0 Add "Renderer" suffix in name when crashing in renderer process. 2013-11-13 19:06:11 +08:00
Cheng Zhao
62f200d252 Mention in doc that crash-reporter is available for renderer. 2013-11-13 17:30:49 +08:00
Cheng Zhao
374cf948e4 Make the crash reporter available for both browser and renderer. 2013-11-13 17:29:35 +08:00
Cheng Zhao
8f558fb252 mac: Tune parameters of breakpad. 2013-11-13 17:20:52 +08:00
Cheng Zhao
8f2dd91e34 Setup breakpad in crash reporter. 2013-11-13 17:20:52 +08:00
Cheng Zhao
896c1793d3 mac: Copy necessary breakpad binaries to package. 2013-11-13 17:20:51 +08:00
Cheng Zhao
85428d8eb3 No more use of QuincyKit. 2013-11-13 17:20:51 +08:00
Cheng Zhao
57bee8b788 Update to latest gyp and depot_tools. 2013-11-12 18:34:01 +08:00
Cheng Zhao
0ad51c394b mac: Get rid of all the third party warnings. 2013-11-12 18:16:37 +08:00
Cheng Zhao
e8455d5c9a Add breakpad as build dependency. 2013-11-12 18:07:25 +08:00
Cheng Zhao
2768eaa676 Add breakpad. 2013-11-12 15:49:03 +08:00
Cheng Zhao
6c0621fe05 Bump v0.6.10. 2013-11-11 20:04:15 +08:00
Cheng Zhao
baa6d9730c win: Enable setting window icon in creation options. 2013-11-11 19:29:40 +08:00
Cheng Zhao
d5ffa4dc77 Fix a possible dead lock when quiting.
It could happen that we are quitting when the embed thread is still
waiting for the main thread, so we make sure embed thread is always
signaled when quitting.
2013-11-11 16:59:57 +08:00
Cheng Zhao
01dd5638d0 Update brightray for fixing the 'ARCHS' issue. 2013-11-08 19:05:30 -08:00
Cheng Zhao
ec5cd2fb1c Do not set sdk_root, it's already set by brightray. 2013-11-08 19:01:56 -08:00
Cheng Zhao
44c0dc9104 Bump v0.6.9. 2013-11-07 16:59:45 +08:00
Cheng Zhao
7324f0468b 💄 fix typo. 2013-11-07 16:59:33 +08:00
Cheng Zhao
64e3a6b437 Add x permission for bump-version.py. 2013-11-07 16:58:09 +08:00
Cheng Zhao
690ab7d4ae Add tag and commit after version is bumped. 2013-11-07 15:41:14 +08:00
Cheng Zhao
48a0ac9a96 Update Info.plist when bumping version. 2013-11-07 15:37:21 +08:00
Cheng Zhao
7212fa1056 Also update atom_version.h and atom.rc in bump-version.py. 2013-11-07 15:19:37 +08:00
Cheng Zhao
8d710609fd win: Fix setting icon after format of atom.rc has changed. 2013-11-07 15:09:45 +08:00
Cheng Zhao
7dcbd11863 Conver atom.rc from unicode file to ASCII file. 2013-11-07 15:06:57 +08:00
Cheng Zhao
e075a8b49e Add tool to help bump version. 2013-11-07 12:52:26 +08:00
Cheng Zhao
d1dc041aaf win: Use exe's icon as window icon, fixed #123. 2013-11-07 11:06:25 +08:00
Cheng Zhao
85243edf4e win: Add an icon. 2013-11-07 09:55:59 +08:00
Cheng Zhao
faeea88b16 Write correct version in .rc file. 2013-11-05 22:26:33 +08:00
Cheng Zhao
139d581e5b Bump v0.6.8. 2013-11-05 13:15:17 +08:00
Cheng Zhao
64b2d0da36 Add a corresponding .h file for atom_main.cc.
It's required if we want to include Chromium headers before C headers
and do not break cpplint rules in the meanwhile.
2013-11-05 13:12:13 +08:00
Cheng Zhao
dc1a8b644a Get the status of devtools from brightray, fixed #27. 2013-11-05 10:32:45 +08:00
Cheng Zhao
8bb3b53833 Make cpplint pass headers test without setting "NOLINT". 2013-11-05 10:00:11 +08:00
Cheng Zhao
8112fe741e Merge pull request #122 from atom/fix-console-stdio
Fix console STDIO
2013-11-04 17:11:53 -08:00
Paul Betts
60f24eb22b This method seems to work, :shipit: 2013-11-04 16:56:50 -08:00
Paul Betts
fd20050fc9 First hack at fixing console IO 2013-11-04 14:15:19 -08:00
Cheng Zhao
c5946bf977 Bump v0.6.7. 2013-11-02 16:49:21 +08:00
Cheng Zhao
618d0c6397 Fix the "'true' is not recognized as an internal or external command" error. 2013-11-01 10:15:41 +08:00
Cheng Zhao
362bb6e68b Mention required options of WDK and Win7 SDK, fixed #114. 2013-10-31 20:06:36 +08:00
Cheng Zhao
b88168c0d2 Bump v0.6.6. 2013-10-28 10:47:57 +08:00
Cheng Zhao
df919a4be8 Expose libuv's symbols. 2013-10-28 10:47:04 +08:00
Cheng Zhao
45f864d2b4 Make atom-shell compile-able with VS 2010 Express. 2013-10-26 19:39:45 +08:00
Cheng Zhao
602f02b867 💄 Fix typo of doc. 2013-10-26 18:09:22 +08:00
Cheng Zhao
5cf61c9ab4 Add more details on building with VS 2010 Express. 2013-10-26 18:07:20 +08:00
Cheng Zhao
49a7954824 Bump v0.6.5. 2013-10-26 17:49:44 +08:00
Cheng Zhao
198b52bf40 win: Ship the pdb file, fixes #112. 2013-10-26 17:44:51 +08:00
Cheng Zhao
cb31140d3a Do "compress" the archive when creating zip.
By default the zipfile module doesn't do the compression unless we
explictly specify the method.
2013-10-26 17:42:12 +08:00
Cheng Zhao
f2c1d8f4b2 Update to latest apm. 2013-10-26 17:24:40 +08:00
Cheng Zhao
3ddba90d94 Fix creating zip distribution on Windows. 2013-10-26 17:23:16 +08:00
Cheng Zhao
887a2a3c00 Bump v0.6.4. 2013-10-22 10:25:53 +08:00
Cheng Zhao
585777e62d Allow single-character accelerators. 2013-10-22 09:38:19 +08:00
Cheng Zhao
640f45a5b3 Fix a possible crash when calling AdapterRequestJob::Kill(). 2013-10-22 09:33:38 +08:00
Cheng Zhao
8bcb545119 Bump v0.6.3. 2013-10-21 18:22:16 +08:00
Cheng Zhao
aa911cdb2e Merge pull request #110 from atom/better-accelerator
Support more accelerators in menu, closes #107.
2013-10-21 01:53:34 -07:00
Cheng Zhao
27be89d39a Should not touch process.argv when starting the default_app. 2013-10-21 16:48:52 +08:00
Cheng Zhao
5ce66fca5c Do not use sscanf. 2013-10-21 15:59:45 +08:00
Cheng Zhao
94e4044160 Allow "Space" in accelerator. 2013-10-21 15:35:54 +08:00
Cheng Zhao
30eabfb9f6 Allow "F1" - "F24" in accelerator. 2013-10-21 15:33:19 +08:00
Cheng Zhao
a6eb261af0 Get rid of the NormalizeShortcutSuggestion function. 2013-10-21 14:34:25 +08:00
Cheng Zhao
6e4f74ae35 Allow more special keys in the accelerator. 2013-10-21 14:25:36 +08:00
Cheng Zhao
f091352c56 Slightly optimize accelerator token comparing. 2013-10-21 14:05:43 +08:00
Cheng Zhao
534ff5efdb Be case-insensible of accelerators. 2013-10-21 13:46:37 +08:00
Cheng Zhao
51d92454ce Map all single symbols in the keyboard to accelerators. 2013-10-21 13:39:55 +08:00
Cheng Zhao
af413b2d97 Bump v0.6.2. 2013-10-17 10:22:35 +08:00
Cheng Zhao
7c30d037a3 mac: Enable to set the 'Help' menu, fixes #109. 2013-10-17 10:21:24 +08:00
Cheng Zhao
acda56210b Specify the version instead of using "*" for dependencies in package.json. 2013-10-17 09:58:55 +08:00
Cheng Zhao
61b2377cf2 Use stream-uploading to upload the asset to GitHub. 2013-10-15 09:04:05 +08:00
Cheng Zhao
7fa6407f65 Bump v0.6.1. 2013-10-14 11:59:19 +08:00
Cheng Zhao
41de0b420a Unescape the script path before passing it to cefode.js, fixed #108. 2013-10-14 11:58:20 +08:00
Cheng Zhao
0ad1fc842d Do not multipart-encode the uploaded file. 2013-10-10 18:05:01 +08:00
Cheng Zhao
7f0e7f3835 Check the build version of Release build in upload script. 2013-10-10 14:39:54 +08:00
Cheng Zhao
6ff644fe60 Bump v0.6.0. 2013-10-10 14:35:37 +08:00
Cheng Zhao
92c68797d0 Enable more common ASCII tokens to be used in accelerator, fixes #107. 2013-10-10 14:33:59 +08:00
Cheng Zhao
9a2fc8f4ea Add 'Quit' to spec window's menu. 2013-10-10 14:33:42 +08:00
Cheng Zhao
6a712d4db4 Merge pull request #105 from atom/windows-menu
Implement menu API on Windows, fixes #75.
2013-10-06 17:58:42 -07:00
Cheng Zhao
a182de20a4 win: Newly created window should also be aware of application menu. 2013-10-07 08:56:52 +08:00
Cheng Zhao
caaab22841 Do not dereference remote callback if its renderer view is released. 2013-10-05 20:53:31 +08:00
Cheng Zhao
1e1fec15b6 Make objects registry code more structured. 2013-10-05 20:47:49 +08:00
Cheng Zhao
1524ced816 Set application menu would set menu for all windows on Windows. 2013-10-05 14:31:30 +08:00
Cheng Zhao
93f1a3dbd5 Make app.setApplicationMenu an alias to Menu.setApplicationMenu. 2013-10-05 13:46:48 +08:00
Cheng Zhao
666f6b3a01 Add app.getBrowserWindows() API. 2013-10-05 13:13:04 +08:00
Cheng Zhao
61cc0bba25 💄 fix typo in doc. 2013-10-05 13:03:08 +08:00
Cheng Zhao
587484a5d0 Make sure application menu always get referenced. 2013-10-05 12:56:30 +08:00
Cheng Zhao
defb6c9882 Don't wait for request in http spec.
This spec is used to crash atom-shell, we don't care if http request
succeeds.
2013-10-04 23:39:34 +08:00
Cheng Zhao
55a35d473d win: Make web view focused initialy. 2013-10-04 23:38:37 +08:00
Cheng Zhao
d86172cc87 win: Make window menu's accelerators work. 2013-10-04 23:36:31 +08:00
Cheng Zhao
32432cc770 Convert "Command" to "Ctrl" in accelerators on non-Mac. 2013-10-04 23:01:29 +08:00
Cheng Zhao
ae98d9c8b6 💄 NativeWindowClientView no longer needs a extra content view. 2013-10-04 09:04:32 +08:00
Cheng Zhao
4e2d3f3d12 win: Make native window a views::View. 2013-10-04 08:52:45 +08:00
Cheng Zhao
a2f679e4bd win: Respond to events of window menu. 2013-10-03 23:34:42 +08:00
Cheng Zhao
06ae5c06b8 Make sure binary version is dumped before uploading. 2013-10-03 11:48:13 +08:00
Cheng Zhao
0483871388 Add --version flag to print atom-shell's version. 2013-10-03 11:36:17 +08:00
Cheng Zhao
7f7e13edc3 Dump v0.5.4. 2013-10-03 10:06:34 +08:00
Cheng Zhao
bbb9c37f70 BrowserWindow.focus() should not make window become visible, fixed #106. 2013-10-03 09:42:20 +08:00
Cheng Zhao
88ce2a5390 Add BrowserWindow.isVisible() API. 2013-10-03 08:28:22 +08:00
Cheng Zhao
6748573dee Show a simple menu in default_app on Windows. 2013-10-02 21:51:19 +08:00
Cheng Zhao
5c8566e0d4 win: Show popup menu at right place. 2013-10-02 21:43:52 +08:00
Cheng Zhao
5a6ff0f80d win: Add BrowserWindow.setMenu API. 2013-10-02 21:24:21 +08:00
Cheng Zhao
2024ae5dba 💄 Fix build on Windows. 2013-10-02 20:43:30 +08:00
Cheng Zhao
aa6d5a3ff6 Update to latest apm. 2013-10-02 20:26:25 +08:00
Cheng Zhao
419da689c9 Dump v0.5.3. 2013-09-29 21:50:19 +08:00
Cheng Zhao
709563c090 Set proxy service at the right place. 2013-09-29 21:43:17 +08:00
Cheng Zhao
b50a2c9dc1 Add spec for sending http request. 2013-09-29 20:57:57 +08:00
Cheng Zhao
43a5453de5 💄 Fix target version of atom-shell's uploading. 2013-09-29 20:18:55 +08:00
Cheng Zhao
87d94ff1ae Do not require uploading a tag before publish release. 2013-09-29 15:31:20 +08:00
Cheng Zhao
8b4414345b Dump v0.5.2. 2013-09-29 15:28:58 +08:00
Cheng Zhao
6e43074586 Still upload distribution file to S3 since Atom hasn't used Releases API yet. 2013-09-29 15:15:16 +08:00
Cheng Zhao
99d901bc9a Switch to use the ProxyResolverV8, fixes atom/atom#894. 2013-09-29 15:06:29 +08:00
Cheng Zhao
95e79124eb Do not publish release when body of release note is empty. 2013-09-27 15:55:46 +08:00
Cheng Zhao
54b0d0c9c0 Free the native window's memory after the event were sent for all observers.
If we delete the window immediately other observers may get a invalid
window and cause random crashes.
2013-09-27 15:24:03 +08:00
Cheng Zhao
10a46b4229 Merge pull request #104 from atom/pylint
Lint python and coffee scripts
2013-09-26 20:06:10 -07:00
Cheng Zhao
af3f07f4cc 💄 Adding trailing comma in package.json. 2013-09-27 11:03:38 +08:00
Cheng Zhao
f4f42b30ee 💄 Fix warnings of coffeelint. 2013-09-27 11:03:23 +08:00
Cheng Zhao
f3eef6cc2e Do not warn about 80 columns in coffeelint, it's not required. 2013-09-27 11:01:40 +08:00
Cheng Zhao
11f387743f Add wrapper script for coffeelint. 2013-09-27 10:49:55 +08:00
Cheng Zhao
561857d640 Add coffeelint to dependencies. 2013-09-27 10:44:16 +08:00
Cheng Zhao
3b3585f575 Skip the check for lib.github. 2013-09-27 10:43:10 +08:00
Cheng Zhao
6be716c6e8 Run pylint in cibuild. 2013-09-27 10:22:13 +08:00
Cheng Zhao
2b923b988c Add wrapper script for pylint. 2013-09-27 10:21:49 +08:00
Cheng Zhao
ef8a05be38 💄 Fix violations against pylint. 2013-09-27 10:21:27 +08:00
Cheng Zhao
c029ff2055 Merge pull request #103 from atom/releases-api
Upload atom-shell's binaries with Releases API
2013-09-26 18:46:35 -07:00
Cheng Zhao
e376850552 💄 Fix cpplint warnings. 2013-09-27 09:26:36 +08:00
Cheng Zhao
1ce61c7845 Get the body of release with current $EDITOR. 2013-09-27 09:10:22 +08:00
Cheng Zhao
68a3fd6f05 Publish the release after the uploading is end. 2013-09-26 22:02:09 +08:00
Cheng Zhao
ce012043fa Upload both atom-shell and node's headers. 2013-09-26 21:20:38 +08:00
Cheng Zhao
ae70d5cb64 Silence the output of upload script. 2013-09-26 20:58:51 +08:00
Cheng Zhao
db359ae75c Upload the asset after release note is created. 2013-09-26 20:32:11 +08:00
Cheng Zhao
3586565bba Handle the assets uploading in the GitHub API library. 2013-09-26 20:31:17 +08:00
Cheng Zhao
fe67ecd7fd 💄 Find the release even when commit isn't tagged. 2013-09-26 19:54:28 +08:00
Cheng Zhao
33c509b867 Create new release note or get the existing one when uploading. 2013-09-26 19:49:09 +08:00
Cheng Zhao
3edfb7d5c3 Correctly deal with API errors. 2013-09-26 19:48:48 +08:00
Cheng Zhao
eed2b0fd81 Accept still-preview apis. 2013-09-26 16:38:08 +08:00
Cheng Zhao
4c4b8a8486 Add a simple wrapper of GitHub API. 2013-09-26 16:32:39 +08:00
Cheng Zhao
2b9a533d1d Add process.getCurrentStackTrace(), returning V8::getCurrentStackTrace(). 2013-09-26 13:31:17 +08:00
Cheng Zhao
b3a2302283 Dumpv 0.5.1. 2013-09-26 11:30:16 +08:00
Cheng Zhao
6bee435170 Destroy the event object immediately after the reply is sent, fixes #102. 2013-09-26 11:28:53 +08:00
Cheng Zhao
5480cf58c2 Add spec for destroying synchronous event. 2013-09-26 11:27:09 +08:00
Cheng Zhao
65176761f4 Dump v0.5.0. 2013-09-25 16:51:55 +08:00
Cheng Zhao
cf75e4ac49 Move atom_event_processing_window to browser/ui. 2013-09-25 16:51:55 +08:00
Cheng Zhao
ac68589291 cocoa: Don't use Chrome's UnderlayOpenGLHostingWindow.
The UnderlayOpenGLHostingWindow would add a semi-transparent layer under
the window, I'm not very sure what does this class exactly do, but
removing it seems no harm to the renderer.

Fixes atom/atom#877.
2013-09-25 16:51:33 +08:00
Cheng Zhao
bc95cac3ed 💄 Same indent. 2013-09-25 16:18:33 +08:00
Cheng Zhao
eed8f6cabc Remove the CustomFrameView, it's no longer needed. 2013-09-25 15:40:22 +08:00
Cheng Zhao
6aefb0f76f Merge pull request #101 from atom/no-blocking-browser
Make the browser non-blocking
2013-09-24 16:48:29 -07:00
Cheng Zhao
14de58a6b7 Calling asynchronous functions in renderer now doesn't block browser. 2013-09-24 18:01:12 +08:00
Cheng Zhao
085f0a2544 win: Implement asynchronous ShowMessageBox. 2013-09-24 16:11:23 +08:00
Cheng Zhao
4000734504 win: Add dummy implementation for asynchronous open/save dialog. 2013-09-24 14:47:39 +08:00
Cheng Zhao
1b5e22f9c4 Default template parameter is not supported on Windows. 2013-09-24 14:41:44 +08:00
Cheng Zhao
53c6d51d56 win: Accept parent window in ShowOpenDialog. 2013-09-24 10:13:43 +08:00
Cheng Zhao
ac76017702 Merge branch 'master' into no-blocking-browser 2013-09-24 10:09:35 +08:00
Cheng Zhao
9927b4bf4c Merge pull request #93 from atom/file-dialog
Implement file dialogs API on Windows
2013-09-23 19:08:00 -07:00
Cheng Zhao
11ca836afc Use the convient V8 wrapper in all files. 2013-09-24 09:41:54 +08:00
Cheng Zhao
a824c88352 Use same name convention in string16_conversions. 2013-09-23 23:00:58 +08:00
Cheng Zhao
8fdd3b3044 Use FromV8Arguments in atom_api_dialog.cc. 2013-09-23 22:52:48 +08:00
Cheng Zhao
1e5e0194bd Add convient function for converting args from V8 Arguments. 2013-09-23 22:48:55 +08:00
Cheng Zhao
a0d1a7620c Put FromV8Value and ToV8Value to a new header. 2013-09-23 21:30:54 +08:00
Cheng Zhao
770a0068a3 Simplify conversions between native types and v8 types. 2013-09-23 21:12:40 +08:00
Cheng Zhao
26f0e49c9a Make dialog.showSaveDialog accept a callback. 2013-09-23 20:08:49 +08:00
Cheng Zhao
c7637c78d1 mac: Add asynchronous ShowSaveDialog. 2013-09-23 20:08:32 +08:00
Cheng Zhao
30ca085fd8 Make dialog.showSaveDialog accept no parent window. 2013-09-23 19:59:00 +08:00
Cheng Zhao
e824b6c910 💄 Pick duplicate code together. 2013-09-23 19:42:07 +08:00
Cheng Zhao
43b492c641 mac: make ShowSaveDialog accept no parent window. 2013-09-23 19:36:52 +08:00
Cheng Zhao
c95cfc9540 Make dialog.showOpenDialog accept callback. 2013-09-23 19:23:49 +08:00
Cheng Zhao
d3dd2b4332 mac: Add asynchronous ShowOpenDialog. 2013-09-23 19:22:36 +08:00
Cheng Zhao
7e86ee37f3 💄 cpplint. 2013-09-23 17:27:32 +08:00
Cheng Zhao
f444e9dc74 💄 CoffeeScript is cute. 2013-09-23 16:51:00 +08:00
Cheng Zhao
76ac8f2719 Enable taking window as parameter in dialog.showOpenDialog. 2013-09-23 16:36:33 +08:00
Cheng Zhao
a4262bc39d mac: Make ShowOpenDialog able to be shown as sheet. 2013-09-23 16:27:22 +08:00
Cheng Zhao
85d6588661 Make dialog.showMessageBox asynchronous. 2013-09-23 14:29:55 +08:00
Cheng Zhao
b70722feb6 mac: Implement async ShowMessageBox. 2013-09-22 18:47:00 +08:00
Cheng Zhao
bfe59480e3 Add header for asynchronous version of ShowMessageBox. 2013-09-22 17:11:09 +08:00
Cheng Zhao
68bdad9a23 Add spec for ipc.sendSync. 2013-09-22 12:06:41 +08:00
Cheng Zhao
761b9d22c8 Do not reply sync messages when window is closed. 2013-09-22 10:44:18 +08:00
Cheng Zhao
1e4762ce92 Do not store the event.returnValue. 2013-09-22 10:03:47 +08:00
Cheng Zhao
d443b36446 Send reply for sync messages when event.returnValue is set. 2013-09-22 09:52:58 +08:00
Cheng Zhao
ef4b36d621 Use string16 instead of std::string when sending IPC messages.
The underlying V8::String is represented in UTF18, by using string16 in
IPC messages we can avoid the overhead of encode conversion.
2013-09-20 22:55:42 +08:00
Cheng Zhao
ef5a4b5fe0 Pass synchronous messages by JSON string.
We are going to use IPC_MESSAGE_HANDLER_DELAY_REPLY to handle
synchronous messages but DictionaryValue is not copyable, so we pass the
JSON string instead.
2013-09-20 22:32:59 +08:00
Cheng Zhao
07b5039c64 Make sure all sync messages get a return value. 2013-09-20 21:39:07 +08:00
Cheng Zhao
a9c824eba1 Use event.returnValue instead of event.result in atom-shell's code.
event.result is still kept for backward compatible.
2013-09-20 21:37:47 +08:00
Cheng Zhao
b225a59a15 Prefer event.returnValue to event.result for sync messages. 2013-09-20 21:37:00 +08:00
Cheng Zhao
50b5272354 Dump v0.4.9. 2013-09-20 18:50:18 +08:00
Cheng Zhao
8879334468 Merge pull request #100 from atom/fix-protocol-crash
Fix crash when using protocol module on startup.
2013-09-20 03:49:33 -07:00
Cheng Zhao
2be1145a9e Guard against using protocol module too early. 2013-09-20 18:45:53 +08:00
Cheng Zhao
e65220adb0 doc: Mention when protocol module is safe to use. 2013-09-20 18:36:16 +08:00
Cheng Zhao
92e157de30 Fix crash when using protocol module on startup.
The job factory was not created before any request was sent, so when the
app used the protocol module on startup it would cause a crash.
2013-09-20 18:32:05 +08:00
Cheng Zhao
c908cae72c Dump v0.4.8. 2013-09-20 16:55:43 +08:00
Cheng Zhao
3f357f184d Use custom url request getter to setup request job factory. 2013-09-20 16:47:47 +08:00
Cheng Zhao
3fdec5c6e3 win: Implement ShowOpenDialog. 2013-09-19 22:28:18 +08:00
Cheng Zhao
6fced224c7 win: Open dialog and save dialog can have different options. 2013-09-18 22:27:40 +08:00
Cheng Zhao
9ed64548d4 💄 Fix comparing extension. 2013-09-18 22:24:46 +08:00
Cheng Zhao
575fe06f29 win: Append extension to save dialog's result according to the selected filter. 2013-09-18 22:21:28 +08:00
Cheng Zhao
6cb2ece285 win: Make common part of ShowSaveDialog a independet class. 2013-09-18 21:42:14 +08:00
Cheng Zhao
29e071a1ad win: Rewrite ShowSaveDialog with IFileSaveDialog. 2013-09-18 20:28:56 +08:00
Cheng Zhao
9e9579a858 Remove dialog hack for Windows XP. 2013-09-18 16:19:32 +08:00
Paul Betts
9849844e89 Merge pull request #92 from atom/paulcbetts-patch-1
Need PathService on Win32
2013-09-17 13:35:12 -07:00
Paul Betts
c578a2cbc2 Need PathService on Win32
This was accidentally left out of 8708d061
2013-09-17 11:53:31 -07:00
Cheng Zhao
583d34b9f7 Dump v0.4.7. 2013-09-13 10:12:02 +08:00
Steve Smith
a2c3690592 Merge pull request #91 from atom/rounded-corner
Round whole frame in Frameless mode
2013-09-12 08:43:30 -07:00
Steve Smith
7a21ae831f Skip the whole AtomFramelessWindow.
Just round the web view and set the bounds to the window, not the main
view.
2013-09-12 11:20:38 -04:00
Cheng Zhao
8708d0611a mac: Force using "Atom" as application name in framework bundle path. 2013-09-12 17:51:45 +08:00
Cheng Zhao
ef92cd8b45 mac: Makes sure MainMenu.nib is alwasys loaded from Atom.framework. 2013-09-12 17:16:33 +08:00
Cheng Zhao
8cb624d828 Dump v0.4.6. 2013-09-12 16:10:11 +08:00
Cheng Zhao
cec640f572 mac: Always use "Atom" as name when find helper process. Fixes #89. 2013-09-12 15:42:36 +08:00
Cheng Zhao
7a1365673e Remove code which are used for borderless window. 2013-09-12 15:13:56 +08:00
Cheng Zhao
6c098deb57 💄 Fix cpplint warnings. 2013-09-12 13:03:57 +08:00
Steve Smith
cf4a566290 Just round the top also and use a standard window.
Using borderless window causes too many issues. Smaller, less
window-like shadows being the most annoying.
2013-09-11 22:02:42 -04:00
Steve Smith
aabba3c641 Fix view autoresizing. 2013-09-11 17:25:42 -04:00
Steve Smith
8f31bf8615 Get radius working with frameless window.
Right now it's set as a constant `AtomWindowCornerRadius`, but it could
be set to a variable.
2013-09-11 16:23:17 -04:00
Cheng Zhao
5d49fc4bee WIP: rounded corner of frameless window. 2013-09-11 18:10:28 +08:00
Cheng Zhao
f38eb1b66f mac: Import chromium's CustomFrameView code. 2013-09-11 13:46:36 +08:00
Cheng Zhao
a567ba08ea Hide the fullscreen button when leaving fullscreen mode. Fixes #88. 2013-09-11 13:05:08 +08:00
Cheng Zhao
91d54a74e1 doc: Metion the frameless-window-demo. 2013-09-09 20:17:47 +08:00
Cheng Zhao
da9cce3f2d Dump v0.4.5. 2013-09-09 16:13:01 +08:00
Cheng Zhao
92241b91ce doc: Separate pages into sub directories. 2013-09-09 15:49:13 +08:00
Cheng Zhao
6b81070f67 doc: Add titles for all pages. 2013-09-09 15:35:57 +08:00
Cheng Zhao
3715dd2a20 💄 Remove a mistyped character. 2013-09-09 15:27:19 +08:00
Cheng Zhao
eb6fa98ed0 Merge pull request #85 from atom/frameless-window
Add frameless window support, fixes #72.
2013-09-09 00:24:20 -07:00
Cheng Zhao
8ddb85774a doc: Add titles for browser-window and frameless-window. 2013-09-09 15:19:09 +08:00
Cheng Zhao
8caf5fac06 doc: Document frameless window. 2013-09-09 14:52:46 +08:00
Cheng Zhao
cc62978ac3 win: Add NativeWindowFramelessView as non-client view. 2013-09-09 14:30:07 +08:00
Cheng Zhao
f833423a2f win: Save draggable region. 2013-09-09 12:12:17 +08:00
Cheng Zhao
3c0671c179 Quit when all windows are closed if running an app by passing it in command line. 2013-09-09 10:54:08 +08:00
Cheng Zhao
a00bf3e1e1 Print stack when got error on startup. 2013-09-09 10:49:28 +08:00
Cheng Zhao
ce487fe1da Make sure child scripts are quit after specs are done. 2013-09-09 09:53:08 +08:00
Cheng Zhao
a73aea3bda Update apm: set both HOME and USERPROFILE in environment under Windows. 2013-09-09 09:24:54 +08:00
Cheng Zhao
b9d994dca2 Make sure the cursor doesn't drift away when dragging window. 2013-09-06 12:12:17 +08:00
Cheng Zhao
b7c2295a1c Don't use setMouseDownCanMoveWindow to implement draggable area.
It would not work when we have the in-window devtools.
2013-09-06 11:54:52 +08:00
Cheng Zhao
da2ded5453 Implement frameless window on OS X.
Most of the code came from Chromium's packaged app window.
2013-09-05 23:52:29 +08:00
Cheng Zhao
a5eb9ea08f Add has_frame_ attribute for NativeWindow. 2013-09-05 21:43:47 +08:00
Cheng Zhao
4223867dbc Send and receive the AtomViewHostMsg_UpdateDraggableRegions message. 2013-09-05 20:06:54 +08:00
Cheng Zhao
40273cf37d Add IPC messages and structs for passing draggable regions. 2013-09-05 19:46:12 +08:00
Cheng Zhao
bc9c95d77d 💄 fix the protocol module spec on OS X. 2013-09-05 18:28:48 +08:00
Cheng Zhao
6a322f8bd6 Update apm for node v0.10.18. 2013-09-05 15:41:44 +08:00
Cheng Zhao
e7bc368785 Dump version to v0.4.4. 2013-09-05 15:17:05 +08:00
Cheng Zhao
aad0c8e996 Update node to v0.10.18. 2013-09-05 15:15:13 +08:00
Cheng Zhao
bf4756fdfb Pass PATH environment in the child_process.fork spec.
The uv_spawn under Windows requires the PATH environment variable to be
there, otherwise it would throw a 203 system error, it should be a bug
of node.
2013-09-05 14:55:22 +08:00
Cheng Zhao
8acd6d6c8a 💄 fix spec failure caused by win32 path delimiter. 2013-09-05 12:24:08 +08:00
Cheng Zhao
256215b749 Use base::Environment to replace getenv. 2013-09-05 12:18:19 +08:00
Cheng Zhao
a3e5b21118 Merge pull request #84 from atom/nested-fork
Use environment variable to detect whether to run as node.

Fixed # 83.
2013-09-04 18:55:20 -07:00
Cheng Zhao
84a3eb5411 Also fix nested child_process.fork on Windows. 2013-09-05 09:49:22 +08:00
Cheng Zhao
e17da272f4 Make child_process.fork work when options.env is set. 2013-09-05 09:47:32 +08:00
Cheng Zhao
88bdff5832 Use environment variable to detect whether to run as node. 2013-09-05 09:22:24 +08:00
Cheng Zhao
ae18a90f7e Add test case for #83. 2013-09-05 09:21:39 +08:00
Cheng Zhao
3b7dd85d3f Merge pull request #65 from atom/custom-protocol
Support custom protocols
2013-09-04 03:33:09 -07:00
Cheng Zhao
128d9c78db Add documentation for protocol module. 2013-09-03 18:22:40 +08:00
Cheng Zhao
c7fed48c4a Emit erros when getting errors in IO thread. 2013-09-03 17:21:10 +08:00
Cheng Zhao
7737708fdd Add protocol interceptor API. 2013-09-03 16:50:10 +08:00
Cheng Zhao
9ba08d5e67 💄 fix reversed flag for updating latest version. 2013-09-02 18:17:06 +08:00
Cheng Zhao
6c3dc9e526 Dump v0.4.3. 2013-09-02 17:59:17 +08:00
Cheng Zhao
75a24a2e67 Update specs to match the documents. 2013-09-02 16:54:54 +08:00
Cheng Zhao
893309aa8a 💄 fix the window specs. 2013-09-02 16:47:53 +08:00
Cheng Zhao
f17864372e Use setTimeout instead of setImmediate in fixtures.
The setImmediate is implemented in node and may have unexpected affects.
2013-09-02 16:46:08 +08:00
Cheng Zhao
610ac5b045 Revert "💄 for the beforeunload handler."
Restore the previous behavior of beforeunload handler.

This reverts commit b1f30c1eb6.
2013-09-02 16:39:00 +08:00
Cheng Zhao
cfb957a603 Add specs for the beforeunload handler. 2013-09-02 16:28:36 +08:00
Cheng Zhao
e423f601c0 Dump v0.4.2. 2013-09-02 13:34:58 +08:00
Cheng Zhao
504f96ae08 Merge pull request #81 from atom/window-native-modules
Fix node native modules support on Windows
2013-09-01 22:31:31 -07:00
Cheng Zhao
3b149945bf Upload a fake empty x64 node.lib.
We only allow building ia32 build of atom-shell, so the x64 node.lib is
not in use, but it's required by node-gyp.
2013-09-02 13:27:26 +08:00
Cheng Zhao
5fe9f281ac Only generate node.lib when we need to upload node headers. 2013-08-31 17:00:13 +08:00
Cheng Zhao
766347ffae Generate node.lib from atom.lib and chromiumcontent.dll.lib. 2013-08-31 16:37:01 +08:00
Cheng Zhao
a5bc2fdb44 Don't use the cmd paramter passed by WinMain.
It doesn't include the argv[0], 💩.
2013-08-31 15:42:41 +08:00
Cheng Zhao
e7d4b44d05 💄 for node version and upload node.lib. 2013-08-31 15:20:59 +08:00
Cheng Zhao
30c9cd4318 Use dummy stdin stream on Windows. 2013-08-31 12:13:08 +08:00
Cheng Zhao
5787b4cd6f Also ship ffmpegsumo.dll in the distribution. 2013-08-31 11:13:11 +08:00
Cheng Zhao
a26308d902 Use node's version for the node headers tarball. 2013-08-31 10:51:53 +08:00
Cheng Zhao
c2093946c8 Add flag for upload script to skip updating version.
When uploading multiple distributions in future, we need to make sure
all distributions have to ben uploaded before triggering the
update-atom-shell script of Atom.
2013-08-31 10:48:47 +08:00
Cheng Zhao
0286379706 Don't require multipart for uploading to S3.
The file we are uploading is not large, and multipart works really bad
on bad networking.
2013-08-31 10:36:13 +08:00
Cheng Zhao
6765ec30f1 The distribution name should contain version and platform. 2013-08-31 10:35:01 +08:00
Cheng Zhao
beba27ed1e Create zip distribution for binaries on Windows. 2013-08-31 09:37:23 +08:00
Cheng Zhao
24f510ca03 Ship correct binaries on Windows. 2013-08-31 09:06:27 +08:00
Cheng Zhao
2cbe823773 Use Chromium V8's headers in the node headers tarball. 2013-08-31 08:22:16 +08:00
Cheng Zhao
790c53825b Merge pull request #79 from atom/message-box-button-order
Fix button order on Win32
2013-08-30 16:41:25 -07:00
Paul Betts
10bd2384d0 Fix button order on Win32
On Windows, the button order is left to right, with the primary action on the
left (i.e. "Ok" "Cancel"). On Mac, the button order is that the primary action
is nearest to the corner.
2013-08-30 12:08:04 -07:00
Cheng Zhao
335db788a5 Add InterceptProtocol AtomURLRequestJobFactory. 2013-08-30 21:15:46 +08:00
Cheng Zhao
d8cd3d78ff Make ReadRawData a public member, so there is no need to detect types. 2013-08-30 20:49:27 +08:00
Cheng Zhao
2a462cc2b7 💄 fix cpplint warning. 2013-08-30 20:24:42 +08:00
Cheng Zhao
df30f130d3 Separate logics between low level URLRequestJob and js calls. 2013-08-30 20:02:17 +08:00
Cheng Zhao
24e613c827 Separate URLRequestStringJob from atom_api_protocol. 2013-08-30 16:16:41 +08:00
Cheng Zhao
7df256f8dc Move atom_url_request_job_factory to browser/net. 2013-08-30 16:10:36 +08:00
Cheng Zhao
2000f88c84 Allow passing a fallback protocol handler for request jobs. 2013-08-30 15:48:57 +08:00
Cheng Zhao
db890feb51 Don't pollute console with error stack. 2013-08-30 13:04:21 +08:00
Cheng Zhao
738cbd4080 💄 Fix protocol specs. 2013-08-30 13:04:02 +08:00
Cheng Zhao
11221979e5 Disable overriding built-in protocols with protocol.registerProtocol. 2013-08-30 12:51:15 +08:00
Cheng Zhao
72c604f741 Custom the implementation of url request job factory.
It's needed for interceptor API.
2013-08-30 12:04:51 +08:00
Cheng Zhao
04910b8391 Skelecton for interceptor APIs. 2013-08-30 10:15:15 +08:00
Paul Betts
132eb09d96 Merge pull request #71 from atom/78-chars-or-death
Indent all the files to 78-characters so that doc diffs are usable
2013-08-29 10:41:39 -07:00
Paul Betts
38b37f2520 Indent all the files to 78-characters so that doc diffs are usable 2013-08-29 16:37:51 +02:00
Cheng Zhao
4bdd1b88ad Wrap passed 'url' and 'referrer' in an 'request' object. 2013-08-29 21:12:48 +08:00
Cheng Zhao
abd3e86fb1 💄 2013-08-29 21:06:22 +08:00
Cheng Zhao
c2fd43c3e8 Add spec for protocol.isHandledProtocol. 2013-08-29 20:57:09 +08:00
Cheng Zhao
261f50701a Add 'registered' and 'unregistered' events for protocol module.
This is only used for writing specs.
2013-08-29 20:56:25 +08:00
Cheng Zhao
bc4201f911 Make protocol module an EventEmitter. 2013-08-29 20:38:04 +08:00
Cheng Zhao
6915f020d9 Add protocol.isHandledProtocol API. 2013-08-29 20:22:52 +08:00
Cheng Zhao
f7de0e8d38 Disable spec for window.close() since it would not be fixed for a while. 2013-08-29 18:03:56 +08:00
Cheng Zhao
efd2bbbede 💄 Avoid duplicate temporary file names. 2013-08-29 18:03:14 +08:00
Cheng Zhao
b1f30c1eb6 💄 for the beforeunload handler.
Returning text in beforeunload handler should prevent the close instead
of allow the close.
2013-08-29 15:36:09 +08:00
Cheng Zhao
34e1800716 Add 'loading-state-changed' event for BrowserWindow.
It's required for testing the BrowserWindow class.
2013-08-29 11:47:07 +08:00
Cheng Zhao
e00d3d4b37 Add spec for #70. 2013-08-29 11:40:07 +08:00
Cheng Zhao
19aa2b7979 Update apm. 2013-08-29 11:30:56 +08:00
Cheng Zhao
dbdf2d8d54 Add OnLoadingStateChanged for NativeWindowObserver. 2013-08-29 11:19:34 +08:00
Cheng Zhao
3be4a01963 Dump v0.4.1.
Should make this automatic in future.
2013-08-29 11:19:34 +08:00
Paul Betts
d0ab7e2c1e Merge pull request #69 from atom/apm-vs2012
Version bump atom/apm to fix script/bootstrap.py on Win32
2013-08-28 04:29:20 -07:00
Paul Betts
566b8136c9 Force pushery? 2013-08-28 13:27:49 +02:00
Paul Betts
c8150e570b Version bump atom/apm to fix script/bootstrap.py on Win32 2013-08-28 13:14:54 +02:00
Cheng Zhao
d2b4b761ba Update node: fix #66. 2013-08-27 18:39:32 +08:00
Cheng Zhao
018a48770a Add spec for heap snapshot crash (#66). 2013-08-27 17:47:44 +08:00
Cheng Zhao
799d9ada7d Make sure referrer is sent to the protocol handler. 2013-08-27 11:37:06 +08:00
Cheng Zhao
15ba32b489 Only redirect output to browser when running in CI. 2013-08-25 20:54:15 +08:00
Cheng Zhao
0f6617ec26 Make sure protocol module's specs do not pollute main.js. 2013-08-25 20:45:34 +08:00
Cheng Zhao
9e16e41bb3 Enable creating object from remote object's member. 2013-08-25 20:44:52 +08:00
Cheng Zhao
c86acc4cd7 Add remote.createFunctionWithReturnValue API. 2013-08-25 17:22:36 +08:00
Cheng Zhao
d88676bf65 💄 2013-08-25 16:49:54 +08:00
Cheng Zhao
d56a7d75de Use jQuery instead of zepto.
zepto always fails when requesting custom protocols, 💩.
2013-08-25 16:23:40 +08:00
Cheng Zhao
244d7eaf17 Allow returning file for custom protocol. 2013-08-25 16:06:29 +08:00
Cheng Zhao
1ed77371c0 Enable customing mime type and charset when returning reqeust string job. 2013-08-25 15:07:07 +08:00
Cheng Zhao
912bac698c Allow returning string in custom protocols. 2013-08-25 12:36:06 +08:00
Cheng Zhao
8464fb4f64 Pass weak pointers when posting tasks to other threads. 2013-08-24 20:32:12 +08:00
Cheng Zhao
0b01e49cd3 💄 2013-08-24 20:21:46 +08:00
Cheng Zhao
8cd7ccdc0d Call the JS handler to get the type of job. 2013-08-24 20:18:12 +08:00
Cheng Zhao
214df5ef69 Use zepto in the specs. 2013-08-24 20:15:31 +08:00
Cheng Zhao
b7c9f8ba1c The request should go through UI thread. 2013-08-24 19:46:38 +08:00
Cheng Zhao
f63661256f Return AdapterRequestJob when creating job. 2013-08-24 19:33:23 +08:00
Cheng Zhao
33279b1a2f Actually set and remove protocol handlers in IO thread.. 2013-08-24 17:59:34 +08:00
Cheng Zhao
96c173217f Remember registered schemes. 2013-08-24 16:38:19 +08:00
Cheng Zhao
b9cbfb8103 Skelecton for the protocol module. 2013-08-24 15:26:10 +08:00
Kevin Sawicki
fd299cb3fe Upgrade apm for more logging on errors 2013-08-21 10:47:48 -07:00
Cheng Zhao
c87956ef4f Make sure cibuild calls all necessary scripts. 2013-08-21 21:41:34 +08:00
Cheng Zhao
833190e8fa 💄 for cpplint. 2013-08-21 21:36:16 +08:00
Cheng Zhao
7cc1589097 Abort when there is a error in cpplint. 2013-08-21 21:35:41 +08:00
Cheng Zhao
e8ecbec3a7 💄 2013-08-21 21:24:18 +08:00
Cheng Zhao
4914dd67b6 Also upload node's headers to S3. 2013-08-21 12:16:40 +08:00
Cheng Zhao
1e895bdf76 Create the tarball containing node's headers. 2013-08-21 12:09:26 +08:00
Cheng Zhao
5b74dff8f1 Generate the distribution file under 'dist' directory. 2013-08-21 11:57:35 +08:00
Cheng Zhao
5b862fdf60 Also copy gyp files when copying headers. 2013-08-21 11:52:13 +08:00
Cheng Zhao
b411657b76 Hide window when running in CI. 2013-08-21 11:41:08 +08:00
Cheng Zhao
d160da7752 Add script to run specs in CI, fixes #61. 2013-08-21 11:41:08 +08:00
Cheng Zhao
0cd3f3cc40 No need to open video when testing webkitGetUserMedia.
The purpose of this test is to test whether the callback can be called.
2013-08-21 11:41:08 +08:00
Cheng Zhao
9105914b9e Merge pull request #58 from atom/windows-bootstrap
Fix invocation of npm on non-Cygwin
2013-08-20 10:14:06 -07:00
Kevin Sawicki
dea52ae767 Upgrade apm for output fixes 2013-08-20 09:41:10 -07:00
Kevin Sawicki
79d6e88d99 Update link to docs 2013-08-20 09:40:40 -07:00
Kevin Sawicki
f63cf3f283 Update apm URL to new location in atom org. 2013-08-20 09:30:05 -07:00
Paul Betts
22c8b55cb9 Fix invocation of npm on non-Cygwin 2013-08-20 16:37:02 +02:00
Cheng Zhao
7c85479e90 Update libchromiumcontent: Add "path" attribute for "File" class. 2013-08-19 21:27:24 +08:00
Cheng Zhao
dde07f03ec [Win] Remove the extra MenuWrapper class. 2013-08-19 16:30:25 +08:00
Cheng Zhao
738a929f8c [Win] Add flag to build window menu. 2013-08-17 17:10:16 +08:00
Cheng Zhao
6193a889ff [Win] Use the modified Menu2 class. 2013-08-17 16:45:21 +08:00
Cheng Zhao
ee10c469c8 [Win] Ship with Chromium's menu library.
I will hack it.
2013-08-17 16:42:12 +08:00
Cheng Zhao
cdbb16d8fe 💄 for cpplint. 2013-08-17 16:28:06 +08:00
Cheng Zhao
16d039ba47 Add spec for child_process.fork. 2013-08-16 18:51:51 +08:00
Cheng Zhao
beb62566e4 [Win] Fix the command line spliting code. 2013-08-16 18:48:02 +08:00
Cheng Zhao
d0b4800282 [Win] Fix conversion between wchar_t* and const wchar_t*. 2013-08-16 16:38:09 +08:00
Cheng Zhao
91a9fe41c9 [Win] Fix compilation error. 2013-08-16 16:33:32 +08:00
Cheng Zhao
979ec05ed3 [Win] Fix running node from python.
There is a mysterious "WindowsError [error 5] Access is denied" error is
the "executable" is not specified under Windows.
2013-08-16 16:28:45 +08:00
Cheng Zhao
a949e9542d Add AtomWindow.isWebViewFocused() API, fixes #57. 2013-08-16 12:56:25 +08:00
Cheng Zhao
a33c068ed1 Should inherit brightray's default web contents delegate, fixes #31. 2013-08-16 10:38:02 +08:00
Cheng Zhao
4a70077b10 The camera could start very slow. 2013-08-16 10:37:01 +08:00
Cheng Zhao
437d8fdb24 Add spec for #31. 2013-08-16 10:30:42 +08:00
Cheng Zhao
fc3bad0d4f 💄 2013-08-15 17:50:30 +08:00
Cheng Zhao
e648689981 Dump v0.3.4. 2013-08-15 16:11:25 +08:00
Cheng Zhao
c700d291e5 Don't overwrite existing fields when build menu from template. 2013-08-15 16:11:25 +08:00
Cheng Zhao
c858066709 Merge pull request #56 from atom/move-wiki-to-docs
Move wiki to docs
2013-08-15 00:04:30 -07:00
probablycorey
44cd21f0fd Normalize document names 2013-08-14 15:57:52 -07:00
probablycorey
41b57c673e Convert wiki links to relative markdown links 2013-08-14 15:52:00 -07:00
probablycorey
6bc2a3a5e8 Move wiki content to docs dir 2013-08-14 15:43:35 -07:00
Cheng Zhao
63b85bccab [Mac] Clean up the menu controller. 2013-08-14 23:03:02 +08:00
Cheng Zhao
f908619630 [Mac] Move the FixMenuTitles hack to MenuController. 2013-08-14 22:33:18 +08:00
Cheng Zhao
22012d41d8 [Mac] Ship the MenuController implementation from Chromium. 2013-08-14 22:24:21 +08:00
Cheng Zhao
ee2c696577 Make sure all MenuItem's options have a default value. 2013-08-14 21:59:49 +08:00
Cheng Zhao
2fd91e8c96 Enable passing objects and arrays when calling remote function. 2013-08-14 21:51:51 +08:00
Cheng Zhao
b39df5ea87 Use Menu.buildFromTemplate instead of raw menu APIs. 2013-08-14 21:49:13 +08:00
Cheng Zhao
5189caa610 💄 2013-08-14 21:19:26 +08:00
Cheng Zhao
341f1be07f Revert "Use named property handler for createObjectWithName."
This reverts commit 0c31494ffa.
2013-08-14 21:17:15 +08:00
Cheng Zhao
00d48b20bd Add spec for changing remote object's properties. 2013-08-14 13:28:15 +08:00
Cheng Zhao
0c31494ffa Use named property handler for createObjectWithName. 2013-08-14 13:14:28 +08:00
Cheng Zhao
971b72c2b6 When calling menu item's click callback, pass the item object. 2013-08-14 12:51:47 +08:00
Cheng Zhao
f267a7812f Add spec for MenuItem.click. 2013-08-14 12:51:37 +08:00
Cheng Zhao
58bfa11f7d Add spec for Menu.insert. 2013-08-14 12:09:53 +08:00
Cheng Zhao
114d247efb Add spec for attaching extra fields to menu items. 2013-08-14 12:04:16 +08:00
Cheng Zhao
d4a148ea52 The Menu object should store items by its index. 2013-08-14 12:03:37 +08:00
Cheng Zhao
c6f18f095e Enable to attach extra fields to menu items. 2013-08-14 11:07:44 +08:00
Cheng Zhao
452c350798 💄 for cpplint. 2013-08-13 17:07:36 +08:00
Cheng Zhao
f4425afb39 Move accelerator_util to browser/ui. 2013-08-13 17:07:25 +08:00
Cheng Zhao
d2f1a03b51 Move nsalert_synchronous_sheet to browser/ui. 2013-08-13 17:00:30 +08:00
Cheng Zhao
97bf979b22 Move file_dialog and message_box to browser/ui. 2013-08-13 16:51:47 +08:00
Cheng Zhao
149e2a4680 Update brightray: Disable Chromium's DataExtension. 2013-08-13 16:38:24 +08:00
Cheng Zhao
543ed1de98 Fix test case for the d3 module. 2013-08-12 17:11:47 +08:00
Cheng Zhao
a27009f0a9 Upload to S3 with readable version. 2013-08-12 15:01:05 +08:00
Cheng Zhao
3da4736a2b Collect header files from vendor/node. 2013-08-12 15:00:50 +08:00
Cheng Zhao
3d9af77b37 💄 2013-08-12 14:15:28 +08:00
Cheng Zhao
f9750f9ea9 Add test for d3 module. 2013-08-12 13:59:34 +08:00
Cheng Zhao
963b73a8aa Use result of git describe as version. 2013-08-08 17:49:35 +08:00
Cheng Zhao
dd05759c01 Add process.versions["atom-shell"]. 2013-08-08 17:26:20 +08:00
Cheng Zhao
6684cdd72a Add version file. 2013-08-08 17:22:35 +08:00
Cheng Zhao
47be87fe5f Only zip specified files. 2013-08-08 17:13:45 +08:00
Cheng Zhao
b0b6214416 Update node: enable running like upstream node. 2013-08-08 16:57:07 +08:00
Cheng Zhao
317bd0debf Discard the extra node binary.
We now use atom-shell's binary to execute scripts.
2013-08-08 16:57:07 +08:00
Cheng Zhao
574811fee0 Fix process.argv[0] for child_process.fork. 2013-08-08 16:57:07 +08:00
Cheng Zhao
216f5917bf When passing --atom-child_process-fork, run like upstream node. 2013-08-08 16:57:07 +08:00
Cheng Zhao
c5d48607d9 Fix README on the license thing. 2013-08-08 16:57:07 +08:00
Paul Betts
beba4efc9f Fix broken submodule reference 2013-08-07 09:49:02 -07:00
Cheng Zhao
3b615d7fad Update README. 2013-08-07 14:20:32 +08:00
Cheng Zhao
b2872eaf60 [Win] Implement context menu. 2013-08-06 21:08:52 +08:00
Cheng Zhao
286335c8f9 Only set application menu on OS X. 2013-08-06 21:08:30 +08:00
Cheng Zhao
296feb1a50 💄 on string comparison. 2013-08-06 20:44:18 +08:00
Cheng Zhao
f46d5eb651 Update apm: Add support for Windows. 2013-08-06 20:24:51 +08:00
Cheng Zhao
c5e0ae6495 Fix calling apm under cygwin. 2013-08-06 20:14:28 +08:00
Cheng Zhao
17a4842eaa [Win] Should filters in the save as dialog. 2013-08-06 19:39:10 +08:00
648 changed files with 51314 additions and 9920 deletions

7
.gitignore vendored
View File

@@ -1,14 +1,13 @@
.DS_Store
atom-shell.zip
version
/build/
/dist/
/frameworks/
/node/
/external_binaries/
/out/
/vendor/brightray/vendor/download/
/vendor/python_26/
/vendor/npm/
node_modules/
*.xcodeproj
*.swp
*.pyc
npm-debug.log

16
.gitmodules vendored
View File

@@ -1,15 +1,15 @@
[submodule "vendor/brightray"]
path = vendor/brightray
url = https://github.com/brightray/brightray.git
url = https://github.com/atom/brightray.git
[submodule "vendor/node"]
path = vendor/node
url = https://github.com/atom/node.git
[submodule "vendor/gyp"]
path = vendor/gyp
url = https://github.com/svn2github/gyp.git
url = https://github.com/atom/node.git
[submodule "vendor/depot_tools"]
path = vendor/depot_tools
url = https://chromium.googlesource.com/chromium/tools/depot_tools.git
[submodule "vendor/apm"]
path = vendor/apm
url = https://github.com/github/apm.git
[submodule "vendor/breakpad"]
path = vendor/breakpad
url = https://github.com/atom/chromium-breakpad.git
[submodule "vendor/native_mate"]
path = vendor/native_mate
url = https://github.com/zcbenz/native-mate.git

15
.travis.yml Normal file
View File

@@ -0,0 +1,15 @@
language: cpp
compiler: clang
os:
- linux
- osx
notifications:
email:
on_success: never
on_failure: change
script: './script/cibuild'
git:
depth: 10

48
LICENSE
View File

@@ -1,28 +1,20 @@
// Copyright (c) 2013 GitHub, Inc. All rights reserved.
// Copyright (c) 2013 The Chromium Authors. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Copyright (c) 2014 GitHub Inc.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@@ -1,19 +1,36 @@
# Atom Shell
# Atom Shell [![Build Status](https://travis-ci.org/atom/atom-shell.svg?branch=master)](https://travis-ci.org/atom/atom-shell)
Experimental native layer for the [Atom](https://github.com/github/atom).
The Atom Shell framework lets you write cross-platform desktop applications
using JavaScript, HTML and CSS. It is based on [io.js](http://iojs.org) and
[Chromium](http://www.chromium.org) and is used in the [Atom
editor](https://github.com/atom/atom).
## Development
## Downloads
### One-time setup
Prebuilt binaries of atom-shell for Linux, Windows and Mac can be found on the
[releases](https://github.com/atom/atom-shell/releases) page.
$ script/bootstrap
You can also use [`npm`](https://docs.npmjs.com/) to install prebuilt atom-shell binaries:
### Building
```
# Install globally in your $PATH
npm install atom-shell -g
$ script/build
# Install as a development dependency
npm install atom-shell --save-dev
```
This will build the app into the `build` directory.
### Mirrors
## License
- [China Mirror](https://npm.taobao.org/mirrors/atom-shell): Improve download speeds for Chinese user.
See the [`LICENSE`](LICENSE) file.
## Documentation
Guides and the API reference are located in the
[docs](https://github.com/atom/atom-shell/tree/master/docs) directory. It also
contains documents describing how to build and contribute to atom-shell.
## Community
There is an [`atom-shell` category on the Atom forums](http://discuss.atom.io/category/atom-shell)
as well as an `#atom-shell` channel on Freenode.

View File

@@ -1,15 +0,0 @@
// Copyright (c) 2013 GitHub, Inc. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "app/atom_library_main.h"
#include "app/atom_main_delegate.h"
#include "content/public/app/content_main.h"
#if defined(OS_MACOSX)
int AtomMain(int argc, const char* argv[]) {
atom::AtomMainDelegate delegate;
return content::ContentMain(argc, argv, &delegate);
}
#endif // OS_MACOSX

View File

@@ -1,17 +0,0 @@
// Copyright (c) 2013 GitHub, Inc. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef ATOM_APP_ATOM_LIBRARY_MAIN_
#define ATOM_APP_ATOM_LIBRARY_MAIN_
#include "base/basictypes.h"
#if defined(OS_MACOSX)
extern "C" {
__attribute__((visibility("default")))
int AtomMain(int argc, const char* argv[]);
}
#endif // OS_MACOSX
#endif // ATOM_APP_ATOM_LIBRARY_MAIN_

View File

@@ -1,28 +0,0 @@
// Copyright (c) 2013 GitHub, Inc. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "content/public/app/content_main.h"
#if defined(OS_WIN)
#include "app/atom_main_delegate.h"
#include "content/public/app/startup_helper_win.h"
#include "sandbox/win/src/sandbox_types.h"
int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE, wchar_t*, int) {
sandbox::SandboxInterfaceInfo sandbox_info = {0};
content::InitializeSandboxInfo(&sandbox_info);
atom::AtomMainDelegate delegate;
return content::ContentMain(instance, &sandbox_info, &delegate);
}
#else
#include "app/atom_library_main.h"
int main(int argc, const char* argv[]) {
return AtomMain(argc, argv);
}
#endif // OS_WIN

View File

@@ -1,59 +0,0 @@
// Copyright (c) 2013 GitHub, Inc. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "app/atom_main_delegate.h"
#include "base/command_line.h"
#include "base/logging.h"
#include "browser/atom_browser_client.h"
#include "content/public/common/content_switches.h"
#include "renderer/atom_renderer_client.h"
namespace atom {
AtomMainDelegate::AtomMainDelegate() {
}
AtomMainDelegate::~AtomMainDelegate() {
}
bool AtomMainDelegate::BasicStartupComplete(int* exit_code) {
// Disable logging out to debug.log on Windows
#if defined(OS_WIN)
logging::InitLogging(
L"debug.log",
#if defined(DEBUG)
logging::LOG_TO_BOTH_FILE_AND_SYSTEM_DEBUG_LOG ,
#else
logging::LOG_ONLY_TO_SYSTEM_DEBUG_LOG,
#endif // defined(NDEBUG)
logging::LOCK_LOG_FILE,
logging::DELETE_OLD_LOG_FILE,
logging::DISABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS);
logging::SetLogItems(true, false, true, false);
#endif // defined(OS_WIN)
return brightray::MainDelegate::BasicStartupComplete(exit_code);
}
void AtomMainDelegate::PreSandboxStartup() {
brightray::MainDelegate::PreSandboxStartup();
// Disable renderer sandbox for most of node's functions.
CommandLine* command_line = CommandLine::ForCurrentProcess();
command_line->AppendSwitch(switches::kNoSandbox);
}
content::ContentBrowserClient* AtomMainDelegate::CreateContentBrowserClient() {
browser_client_.reset(new AtomBrowserClient);
return browser_client_.get();
}
content::ContentRendererClient*
AtomMainDelegate::CreateContentRendererClient() {
renderer_client_.reset(new AtomRendererClient);
return renderer_client_.get();
}
} // namespace atom

View File

@@ -1,34 +0,0 @@
// Copyright (c) 2013 GitHub, Inc. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef ATOM_APP_ATOM_MAIN_DELEGATE_
#define ATOM_APP_ATOM_MAIN_DELEGATE_
#include "brightray/common/main_delegate.h"
namespace atom {
class AtomMainDelegate : public brightray::MainDelegate {
public:
AtomMainDelegate();
~AtomMainDelegate();
protected:
virtual bool BasicStartupComplete(int* exit_code) OVERRIDE;
virtual void PreSandboxStartup() OVERRIDE;
private:
virtual content::ContentBrowserClient* CreateContentBrowserClient() OVERRIDE;
virtual content::ContentRendererClient*
CreateContentRendererClient() OVERRIDE;
scoped_ptr<content::ContentBrowserClient> browser_client_;
scoped_ptr<content::ContentRendererClient> renderer_client_;
DISALLOW_COPY_AND_ASSIGN(AtomMainDelegate);
};
} // namespace atom
#endif // ATOM_APP_ATOM_MAIN_DELEGATE_

Binary file not shown.

28
appveyor.yml Normal file
View File

@@ -0,0 +1,28 @@
# appveyor file
# http://www.appveyor.com/docs/appveyor-yml
version: "{build}"
init:
- git config --global core.autocrlf input
environment:
matrix:
- nodejs_version: 0.10
platform:
- x86
install:
- ps: Install-Product node $env:nodejs_version
- cmd: SET PATH=C:\Program Files (x86)\MSBuild\12.0\bin\;%PATH%
- cmd: SET PATH=C:\python27;%PATH%
- cmd: python script/bootstrap.py
- cmd: python script/build.py -c Debug
test_script:
- node --version
- npm --version
- cmd: python script/cpplint.py
- cmd: python script/coffeelint.py
build: off

999
atom.gyp

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,30 @@
// Copyright (c) 2014 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "atom/app/atom_content_client.h"
#include <string>
#include <vector>
#include "atom/common/chrome_version.h"
namespace atom {
AtomContentClient::AtomContentClient() {
}
AtomContentClient::~AtomContentClient() {
}
std::string AtomContentClient::GetProduct() const {
return "Chrome/" CHROME_VERSION_STRING;
}
void AtomContentClient::AddAdditionalSchemes(
std::vector<std::string>* standard_schemes,
std::vector<std::string>* savable_schemes) {
standard_schemes->push_back("chrome-extension");
}
} // namespace atom

View File

@@ -0,0 +1,33 @@
// Copyright (c) 2014 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef ATOM_APP_ATOM_CONTENT_CLIENT_H_
#define ATOM_APP_ATOM_CONTENT_CLIENT_H_
#include <string>
#include <vector>
#include "brightray/common/content_client.h"
namespace atom {
class AtomContentClient : public brightray::ContentClient {
public:
AtomContentClient();
virtual ~AtomContentClient();
protected:
// content::ContentClient:
std::string GetProduct() const override;
void AddAdditionalSchemes(
std::vector<std::string>* standard_schemes,
std::vector<std::string>* savable_schemes) override;
private:
DISALLOW_COPY_AND_ASSIGN(AtomContentClient);
};
} // namespace atom
#endif // ATOM_APP_ATOM_CONTENT_CLIENT_H_

View File

@@ -0,0 +1,20 @@
// Copyright (c) 2013 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef ATOM_APP_ATOM_LIBRARY_MAIN_H_
#define ATOM_APP_ATOM_LIBRARY_MAIN_H_
#include "base/basictypes.h"
#if defined(OS_MACOSX)
extern "C" {
__attribute__((visibility("default")))
int AtomMain(int argc, const char* argv[]);
__attribute__((visibility("default")))
int AtomInitializeICUandStartNode(int argc, char *argv[]);
}
#endif // OS_MACOSX
#endif // ATOM_APP_ATOM_LIBRARY_MAIN_H_

View File

@@ -0,0 +1,34 @@
// Copyright (c) 2013 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "atom/app/atom_library_main.h"
#include "atom/app/atom_main_delegate.h"
#include "atom/app/node_main.h"
#include "base/at_exit.h"
#include "base/i18n/icu_util.h"
#include "base/mac/bundle_locations.h"
#include "brightray/common/mac/main_application_bundle.h"
#include "content/public/app/content_main.h"
#if defined(OS_MACOSX)
int AtomMain(int argc, const char* argv[]) {
atom::AtomMainDelegate delegate;
content::ContentMainParams params(&delegate);
params.argc = argc;
params.argv = argv;
return content::ContentMain(params);
}
int AtomInitializeICUandStartNode(int argc, char *argv[]) {
base::AtExitManager atexit_manager;
base::mac::SetOverrideFrameworkBundlePath(
brightray::MainApplicationBundlePath()
.Append("Contents")
.Append("Frameworks")
.Append(PRODUCT_NAME " Framework.framework"));
base::i18n::InitializeICU();
return atom::NodeMain(argc, argv);
}
#endif // OS_MACOSX

186
atom/app/atom_main.cc Normal file
View File

@@ -0,0 +1,186 @@
// Copyright (c) 2013 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "atom/app/atom_main.h"
#include <stdlib.h>
#include <string.h>
#if defined(OS_WIN)
#include <stdio.h>
#include <io.h>
#include <fcntl.h>
#include <windows.h>
#include <shellscalingapi.h>
#include <tchar.h>
#include <shellapi.h>
#include "atom/app/atom_main_delegate.h"
#include "atom/common/crash_reporter/win/crash_service_main.h"
#include "base/environment.h"
#include "base/win/windows_version.h"
#include "content/public/app/startup_helper_win.h"
#include "sandbox/win/src/sandbox_types.h"
#include "ui/gfx/win/dpi.h"
#elif defined(OS_LINUX) // defined(OS_WIN)
#include "atom/app/atom_main_delegate.h" // NOLINT
#include "content/public/app/content_main.h"
#else // defined(OS_LINUX)
#include "atom/app/atom_library_main.h"
#endif // defined(OS_MACOSX)
#include "atom/app/node_main.h"
#include "base/i18n/icu_util.h"
#if defined(OS_WIN)
namespace {
// 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();
}
}
} // namespace
int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE, wchar_t* cmd, int) {
int argc = 0;
wchar_t** wargv = ::CommandLineToArgvW(::GetCommandLineW(), &argc);
scoped_ptr<base::Environment> env(base::Environment::Create());
// Make output work in console if we are not in cygiwn.
std::string os;
if (env->GetVar("OS", &os) && os != "cygwin") {
AttachConsole(ATTACH_PARENT_PROCESS);
FILE* dontcare;
freopen_s(&dontcare, "CON", "w", stdout);
freopen_s(&dontcare, "CON", "w", stderr);
freopen_s(&dontcare, "CON", "r", stdin);
}
std::string node_indicator, crash_service_indicator;
if (env->GetVar("ATOM_SHELL_INTERNAL_RUN_AS_NODE", &node_indicator) &&
node_indicator == "1") {
// Convert argv to to UTF8
char** argv = new char*[argc];
for (int i = 0; i < argc; i++) {
// Compute the size of the required buffer
DWORD size = WideCharToMultiByte(CP_UTF8,
0,
wargv[i],
-1,
NULL,
0,
NULL,
NULL);
if (size == 0) {
// This should never happen.
fprintf(stderr, "Could not convert arguments to utf8.");
exit(1);
}
// Do the actual conversion
argv[i] = new char[size];
DWORD result = WideCharToMultiByte(CP_UTF8,
0,
wargv[i],
-1,
argv[i],
size,
NULL,
NULL);
if (result == 0) {
// This should never happen.
fprintf(stderr, "Could not convert arguments to utf8.");
exit(1);
}
}
// Now that conversion is done, we can finally start.
base::i18n::InitializeICU();
return atom::NodeMain(argc, argv);
} else if (env->GetVar("ATOM_SHELL_INTERNAL_CRASH_SERVICE",
&crash_service_indicator) &&
crash_service_indicator == "1") {
return crash_service::Main(cmd);
}
sandbox::SandboxInterfaceInfo sandbox_info = {0};
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;
return content::ContentMain(params);
}
#elif defined(OS_LINUX) // defined(OS_WIN)
int main(int argc, const char* argv[]) {
char* node_indicator = getenv("ATOM_SHELL_INTERNAL_RUN_AS_NODE");
if (node_indicator != NULL && strcmp(node_indicator, "1") == 0) {
base::i18n::InitializeICU();
return atom::NodeMain(argc, const_cast<char**>(argv));
}
atom::AtomMainDelegate delegate;
content::ContentMainParams params(&delegate);
params.argc = argc;
params.argv = argv;
return content::ContentMain(params);
}
#else // defined(OS_LINUX)
int main(int argc, const char* argv[]) {
char* node_indicator = getenv("ATOM_SHELL_INTERNAL_RUN_AS_NODE");
if (node_indicator != NULL && strcmp(node_indicator, "1") == 0) {
return AtomInitializeICUandStartNode(argc, const_cast<char**>(argv));
}
return AtomMain(argc, argv);
}
#endif // defined(OS_MACOSX)

10
atom/app/atom_main.h Normal file
View File

@@ -0,0 +1,10 @@
// Copyright (c) 2013 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef ATOM_APP_ATOM_MAIN_H_
#define ATOM_APP_ATOM_MAIN_H_
#include "content/public/app/content_main.h"
#endif // ATOM_APP_ATOM_MAIN_H_

View File

@@ -0,0 +1,119 @@
// Copyright (c) 2013 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "atom/app/atom_main_delegate.h"
#include <string>
#include "atom/app/atom_content_client.h"
#include "atom/browser/atom_browser_client.h"
#include "atom/common/google_api_key.h"
#include "atom/renderer/atom_renderer_client.h"
#include "base/command_line.h"
#include "base/debug/stack_trace.h"
#include "base/environment.h"
#include "base/logging.h"
#include "content/public/common/content_switches.h"
#include "ui/base/resource/resource_bundle.h"
namespace atom {
AtomMainDelegate::AtomMainDelegate() {
}
AtomMainDelegate::~AtomMainDelegate() {
}
bool AtomMainDelegate::BasicStartupComplete(int* exit_code) {
// Disable logging out to debug.log on Windows
#if defined(OS_WIN)
logging::LoggingSettings settings;
#if defined(DEBUG)
settings.logging_dest = logging::LOG_TO_ALL;
settings.log_file = L"debug.log";
settings.lock_log = logging::LOCK_LOG_FILE;
settings.delete_old = logging::DELETE_OLD_LOG_FILE;
#else
settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG;
#endif
logging::InitLogging(settings);
#endif // defined(OS_WIN)
// Logging with pid and timestamp.
logging::SetLogItems(true, false, true, false);
// Enable convient stack printing.
#if defined(DEBUG) && defined(OS_LINUX)
base::debug::EnableInProcessStackDumping();
#endif
return brightray::MainDelegate::BasicStartupComplete(exit_code);
}
void AtomMainDelegate::PreSandboxStartup() {
brightray::MainDelegate::PreSandboxStartup();
// Set google API key.
scoped_ptr<base::Environment> env(base::Environment::Create());
if (!env->HasVar("GOOGLE_API_KEY"))
env->SetVar("GOOGLE_API_KEY", GOOGLEAPIS_API_KEY);
auto command_line = base::CommandLine::ForCurrentProcess();
std::string process_type = command_line->GetSwitchValueASCII(
switches::kProcessType);
// Only append arguments for browser process.
if (!process_type.empty())
return;
// Add a flag to mark the start of switches added by atom-shell.
command_line->AppendSwitch("atom-shell-switches-start");
#if defined(OS_WIN)
// Disable the LegacyRenderWidgetHostHWND, it made frameless windows unable
// to move and resize. We may consider enabling it again after upgraded to
// Chrome 38, which should have fixed the problem.
command_line->AppendSwitch(switches::kDisableLegacyIntermediateWindow);
#endif
// Disable renderer sandbox for most of node's functions.
command_line->AppendSwitch(switches::kNoSandbox);
#if defined(OS_MACOSX)
// Enable AVFoundation.
command_line->AppendSwitch("enable-avfoundation");
#endif
// Add a flag to mark the end of switches added by atom-shell.
command_line->AppendSwitch("atom-shell-switches-end");
}
content::ContentBrowserClient* AtomMainDelegate::CreateContentBrowserClient() {
browser_client_.reset(new AtomBrowserClient);
return browser_client_.get();
}
content::ContentRendererClient*
AtomMainDelegate::CreateContentRendererClient() {
renderer_client_.reset(new AtomRendererClient);
return renderer_client_.get();
}
scoped_ptr<brightray::ContentClient> AtomMainDelegate::CreateContentClient() {
return scoped_ptr<brightray::ContentClient>(new AtomContentClient).Pass();
}
void AtomMainDelegate::AddDataPackFromPath(
ui::ResourceBundle* bundle, const base::FilePath& pak_dir) {
#if defined(OS_WIN)
bundle->AddDataPackFromPath(
pak_dir.Append(FILE_PATH_LITERAL("ui_resources_200_percent.pak")),
ui::SCALE_FACTOR_200P);
bundle->AddDataPackFromPath(
pak_dir.Append(FILE_PATH_LITERAL("content_resources_200_percent.pak")),
ui::SCALE_FACTOR_200P);
#endif
}
} // namespace atom

View File

@@ -0,0 +1,44 @@
// Copyright (c) 2013 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef ATOM_APP_ATOM_MAIN_DELEGATE_H_
#define ATOM_APP_ATOM_MAIN_DELEGATE_H_
#include "brightray/common/main_delegate.h"
#include "brightray/common/content_client.h"
namespace atom {
class AtomMainDelegate : public brightray::MainDelegate {
public:
AtomMainDelegate();
~AtomMainDelegate();
protected:
// content::ContentMainDelegate:
bool BasicStartupComplete(int* exit_code) override;
void PreSandboxStartup() override;
content::ContentBrowserClient* CreateContentBrowserClient() override;
content::ContentRendererClient* CreateContentRendererClient() override;
// brightray::MainDelegate:
scoped_ptr<brightray::ContentClient> CreateContentClient() override;
void AddDataPackFromPath(
ui::ResourceBundle* bundle, const base::FilePath& pak_dir) override;
#if defined(OS_MACOSX)
void OverrideChildProcessPath() override;
void OverrideFrameworkBundlePath() override;
#endif
private:
brightray::ContentClient content_client_;
scoped_ptr<content::ContentBrowserClient> browser_client_;
scoped_ptr<content::ContentRendererClient> renderer_client_;
DISALLOW_COPY_AND_ASSIGN(AtomMainDelegate);
};
} // namespace atom
#endif // ATOM_APP_ATOM_MAIN_DELEGATE_H_

View File

@@ -0,0 +1,38 @@
// Copyright (c) 2014 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "atom/app/atom_main_delegate.h"
#include "base/mac/bundle_locations.h"
#include "base/files/file_path.h"
#include "base/path_service.h"
#include "brightray/common/mac/main_application_bundle.h"
#include "content/public/common/content_paths.h"
namespace atom {
namespace {
base::FilePath GetFrameworksPath() {
return brightray::MainApplicationBundlePath().Append("Contents")
.Append("Frameworks");
}
} // namespace
void AtomMainDelegate::OverrideFrameworkBundlePath() {
base::mac::SetOverrideFrameworkBundlePath(
GetFrameworksPath().Append(PRODUCT_NAME " Framework.framework"));
}
void AtomMainDelegate::OverrideChildProcessPath() {
base::FilePath helper_path =
GetFrameworksPath().Append(PRODUCT_NAME " Helper.app")
.Append("Contents")
.Append("MacOS")
.Append(PRODUCT_NAME " Helper");
PathService::Override(content::CHILD_PROCESS_EXE, helper_path);
}
} // namespace atom

56
atom/app/node_main.cc Normal file
View File

@@ -0,0 +1,56 @@
// Copyright (c) 2015 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "atom/app/node_main.h"
#include "atom/browser/javascript_environment.h"
#include "atom/common/node_includes.h"
#include "gin/array_buffer.h"
#include "gin/public/isolate_holder.h"
namespace atom {
int NodeMain(int argc, char *argv[]) {
argv = uv_setup_args(argc, argv);
int exec_argc;
const char** exec_argv;
node::Init(&argc, const_cast<const char**>(argv), &exec_argc, &exec_argv);
int exit_code = 1;
{
gin::IsolateHolder::LoadV8Snapshot();
gin::IsolateHolder::Initialize(
gin::IsolateHolder::kNonStrictMode,
gin::ArrayBufferAllocator::SharedInstance());
JavascriptEnvironment gin_env;
node::Environment* env = node::CreateEnvironment(
gin_env.isolate(), gin_env.context(), argc, argv, exec_argc, exec_argv);
bool more;
do {
more = uv_run(env->event_loop(), UV_RUN_ONCE);
if (more == false) {
node::EmitBeforeExit(env);
// Emit `beforeExit` if the loop became alive either after emitting
// event, or after running some callbacks.
more = uv_loop_alive(env->event_loop());
if (uv_run(env->event_loop(), UV_RUN_NOWAIT) != 0)
more = true;
}
} while (more == true);
exit_code = node::EmitExit(env);
node::RunAtExit(env);
env->Dispose();
}
v8::V8::Dispose();
return exit_code;
}
} // namespace atom

14
atom/app/node_main.h Normal file
View File

@@ -0,0 +1,14 @@
// Copyright (c) 2015 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef ATOM_APP_NODE_MAIN_H_
#define ATOM_APP_NODE_MAIN_H_
namespace atom {
int NodeMain(int argc, char *argv[]);
} // namespace atom
#endif // ATOM_APP_NODE_MAIN_H_

View File

@@ -0,0 +1,292 @@
// Copyright (c) 2013 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "atom/browser/api/atom_api_app.h"
#include <string>
#include <vector>
#include "atom/browser/api/atom_api_menu.h"
#include "atom/browser/atom_browser_context.h"
#include "atom/browser/browser.h"
#include "atom/common/native_mate_converters/file_path_converter.h"
#include "atom/common/native_mate_converters/gurl_converter.h"
#include "base/command_line.h"
#include "base/environment.h"
#include "base/files/file_path.h"
#include "base/path_service.h"
#include "brightray/browser/brightray_paths.h"
#include "native_mate/callback.h"
#include "native_mate/dictionary.h"
#include "native_mate/object_template_builder.h"
#include "net/base/load_flags.h"
#include "net/proxy/proxy_service.h"
#include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_context_getter.h"
#include "atom/common/node_includes.h"
using atom::Browser;
namespace mate {
#if defined(OS_WIN)
template<>
struct Converter<Browser::UserTask> {
static bool FromV8(v8::Isolate* isolate, v8::Handle<v8::Value> val,
Browser::UserTask* out) {
mate::Dictionary dict;
if (!ConvertFromV8(isolate, val, &dict))
return false;
if (!dict.Get("program", &(out->program)) ||
!dict.Get("title", &(out->title)))
return false;
if (dict.Get("iconPath", &(out->icon_path)) &&
!dict.Get("iconIndex", &(out->icon_index)))
return false;
dict.Get("arguments", &(out->arguments));
dict.Get("description", &(out->description));
return true;
}
};
#endif
} // namespace mate
namespace atom {
namespace api {
namespace {
// Return the path constant from string.
int GetPathConstant(const std::string& name) {
if (name == "appData")
return brightray::DIR_APP_DATA;
else if (name == "userData")
return brightray::DIR_USER_DATA;
else if (name == "cache")
return brightray::DIR_CACHE;
else if (name == "userCache")
return brightray::DIR_USER_CACHE;
else if (name == "home")
return base::DIR_HOME;
else if (name == "temp")
return base::DIR_TEMP;
else if (name == "userDesktop")
return base::DIR_USER_DESKTOP;
else if (name == "exe")
return base::FILE_EXE;
else if (name == "module")
return base::FILE_MODULE;
else
return -1;
}
class ResolveProxyHelper {
public:
ResolveProxyHelper(const GURL& url, App::ResolveProxyCallback callback)
: callback_(callback) {
net::ProxyService* proxy_service = AtomBrowserContext::Get()->
url_request_context_getter()->GetURLRequestContext()->proxy_service();
// Start the request.
int result = proxy_service->ResolveProxy(
url, net::LOAD_NORMAL, &proxy_info_,
base::Bind(&ResolveProxyHelper::OnResolveProxyCompleted,
base::Unretained(this)),
&pac_req_, nullptr, net::BoundNetLog());
// Completed synchronously.
if (result != net::ERR_IO_PENDING)
OnResolveProxyCompleted(result);
}
void OnResolveProxyCompleted(int result) {
std::string proxy;
if (result == net::OK)
proxy = proxy_info_.ToPacString();
callback_.Run(proxy);
delete this;
}
private:
App::ResolveProxyCallback callback_;
net::ProxyInfo proxy_info_;
net::ProxyService::PacRequest* pac_req_;
DISALLOW_COPY_AND_ASSIGN(ResolveProxyHelper);
};
} // namespace
App::App() {
Browser::Get()->AddObserver(this);
}
App::~App() {
Browser::Get()->RemoveObserver(this);
}
void App::OnBeforeQuit(bool* prevent_default) {
*prevent_default = Emit("before-quit");
}
void App::OnWillQuit(bool* prevent_default) {
*prevent_default = Emit("will-quit");
}
void App::OnWindowAllClosed() {
Emit("window-all-closed");
}
void App::OnQuit() {
Emit("quit");
}
void App::OnOpenFile(bool* prevent_default, const std::string& file_path) {
*prevent_default = Emit("open-file", file_path);
}
void App::OnOpenURL(const std::string& url) {
Emit("open-url", url);
}
void App::OnActivateWithNoOpenWindows() {
Emit("activate-with-no-open-windows");
}
void App::OnWillFinishLaunching() {
Emit("will-finish-launching");
}
void App::OnFinishLaunching() {
Emit("ready");
}
base::FilePath App::GetPath(mate::Arguments* args, const std::string& name) {
bool succeed = false;
base::FilePath path;
int key = GetPathConstant(name);
if (key >= 0)
succeed = PathService::Get(key, &path);
if (!succeed)
args->ThrowError("Failed to get path");
return path;
}
void App::SetPath(mate::Arguments* args,
const std::string& name,
const base::FilePath& path) {
bool succeed = false;
int key = GetPathConstant(name);
if (key >= 0)
succeed = PathService::Override(key, path);
if (!succeed)
args->ThrowError("Failed to set path");
}
void App::ResolveProxy(const GURL& url, ResolveProxyCallback callback) {
new ResolveProxyHelper(url, callback);
}
void App::SetDesktopName(const std::string& desktop_name) {
#if defined(OS_LINUX)
scoped_ptr<base::Environment> env(base::Environment::Create());
env->SetVar("CHROME_DESKTOP", desktop_name);
#endif
}
mate::ObjectTemplateBuilder App::GetObjectTemplateBuilder(
v8::Isolate* isolate) {
auto browser = base::Unretained(Browser::Get());
return mate::ObjectTemplateBuilder(isolate)
.SetMethod("quit", base::Bind(&Browser::Quit, browser))
.SetMethod("focus", base::Bind(&Browser::Focus, browser))
.SetMethod("getVersion", base::Bind(&Browser::GetVersion, browser))
.SetMethod("setVersion", base::Bind(&Browser::SetVersion, browser))
.SetMethod("getName", base::Bind(&Browser::GetName, browser))
.SetMethod("setName", base::Bind(&Browser::SetName, browser))
.SetMethod("isReady", base::Bind(&Browser::is_ready, browser))
.SetMethod("addRecentDocument",
base::Bind(&Browser::AddRecentDocument, browser))
.SetMethod("clearRecentDocuments",
base::Bind(&Browser::ClearRecentDocuments, browser))
#if defined(OS_WIN)
.SetMethod("setUserTasks",
base::Bind(&Browser::SetUserTasks, browser))
#endif
.SetMethod("setPath", &App::SetPath)
.SetMethod("getPath", &App::GetPath)
.SetMethod("resolveProxy", &App::ResolveProxy)
.SetMethod("setDesktopName", &App::SetDesktopName);
}
// static
mate::Handle<App> App::Create(v8::Isolate* isolate) {
return CreateHandle(isolate, new App);
}
} // namespace api
} // namespace atom
namespace {
void AppendSwitch(const std::string& switch_string, mate::Arguments* args) {
auto command_line = base::CommandLine::ForCurrentProcess();
std::string value;
if (args->GetNext(&value))
command_line->AppendSwitchASCII(switch_string, value);
else
command_line->AppendSwitch(switch_string);
}
#if defined(OS_MACOSX)
int DockBounce(const std::string& type) {
int request_id = -1;
if (type == "critical")
request_id = Browser::Get()->DockBounce(Browser::BOUNCE_CRITICAL);
else if (type == "informational")
request_id = Browser::Get()->DockBounce(Browser::BOUNCE_INFORMATIONAL);
return request_id;
}
void DockSetMenu(atom::api::Menu* menu) {
Browser::Get()->DockSetMenu(menu->model());
}
#endif
void Initialize(v8::Handle<v8::Object> exports, v8::Handle<v8::Value> unused,
v8::Handle<v8::Context> context, void* priv) {
v8::Isolate* isolate = context->GetIsolate();
auto command_line = base::CommandLine::ForCurrentProcess();
mate::Dictionary dict(isolate, exports);
dict.Set("app", atom::api::App::Create(isolate));
dict.SetMethod("appendSwitch", &AppendSwitch);
dict.SetMethod("appendArgument",
base::Bind(&base::CommandLine::AppendArg,
base::Unretained(command_line)));
#if defined(OS_MACOSX)
auto browser = base::Unretained(Browser::Get());
dict.SetMethod("dockBounce", &DockBounce);
dict.SetMethod("dockCancelBounce",
base::Bind(&Browser::DockCancelBounce, browser));
dict.SetMethod("dockSetBadgeText",
base::Bind(&Browser::DockSetBadgeText, browser));
dict.SetMethod("dockGetBadgeText",
base::Bind(&Browser::DockGetBadgeText, browser));
dict.SetMethod("dockHide", base::Bind(&Browser::DockHide, browser));
dict.SetMethod("dockShow", base::Bind(&Browser::DockShow, browser));
dict.SetMethod("dockSetMenu", &DockSetMenu);
#endif
}
} // namespace
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_browser_app, Initialize)

View File

@@ -0,0 +1,72 @@
// Copyright (c) 2013 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_APP_H_
#define ATOM_BROWSER_API_ATOM_API_APP_H_
#include <string>
#include "atom/browser/api/event_emitter.h"
#include "atom/browser/browser_observer.h"
#include "base/callback.h"
#include "native_mate/handle.h"
class GURL;
namespace base {
class FilePath;
}
namespace mate {
class Arguments;
}
namespace atom {
namespace api {
class App : public mate::EventEmitter,
public BrowserObserver {
public:
typedef base::Callback<void(std::string)> ResolveProxyCallback;
static mate::Handle<App> Create(v8::Isolate* isolate);
protected:
App();
virtual ~App();
// BrowserObserver:
void OnBeforeQuit(bool* prevent_default) override;
void OnWillQuit(bool* prevent_default) override;
void OnWindowAllClosed() override;
void OnQuit() override;
void OnOpenFile(bool* prevent_default, const std::string& file_path) override;
void OnOpenURL(const std::string& url) override;
void OnActivateWithNoOpenWindows() override;
void OnWillFinishLaunching() override;
void OnFinishLaunching() 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);
void SetPath(mate::Arguments* args,
const std::string& name,
const base::FilePath& path);
void ResolveProxy(const GURL& url, ResolveProxyCallback callback);
void SetDesktopName(const std::string& desktop_name);
DISALLOW_COPY_AND_ASSIGN(App);
};
} // namespace api
} // namespace atom
#endif // ATOM_BROWSER_API_ATOM_API_APP_H_

View File

@@ -0,0 +1,89 @@
// Copyright (c) 2013 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "atom/browser/api/atom_api_auto_updater.h"
#include "base/time/time.h"
#include "atom/browser/auto_updater.h"
#include "atom/browser/browser.h"
#include "native_mate/dictionary.h"
#include "native_mate/object_template_builder.h"
#include "atom/common/node_includes.h"
namespace atom {
namespace api {
AutoUpdater::AutoUpdater() {
auto_updater::AutoUpdater::SetDelegate(this);
}
AutoUpdater::~AutoUpdater() {
auto_updater::AutoUpdater::SetDelegate(NULL);
}
void AutoUpdater::OnError(const std::string& error) {
Emit("error", error);
}
void AutoUpdater::OnCheckingForUpdate() {
Emit("checking-for-update");
}
void AutoUpdater::OnUpdateAvailable() {
Emit("update-available");
}
void AutoUpdater::OnUpdateNotAvailable() {
Emit("update-not-available");
}
void AutoUpdater::OnUpdateDownloaded(const std::string& release_notes,
const std::string& release_name,
const base::Time& release_date,
const std::string& update_url,
const base::Closure& quit_and_install) {
quit_and_install_ = quit_and_install;
Emit("update-downloaded-raw", release_notes, release_name,
release_date.ToJsTime(), update_url);
}
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::QuitAndInstall() {
if (quit_and_install_.is_null())
Browser::Get()->Shutdown();
else
quit_and_install_.Run();
}
// static
mate::Handle<AutoUpdater> AutoUpdater::Create(v8::Isolate* isolate) {
return CreateHandle(isolate, new AutoUpdater);
}
} // namespace api
} // namespace atom
namespace {
void Initialize(v8::Handle<v8::Object> exports, v8::Handle<v8::Value> unused,
v8::Handle<v8::Context> context, void* priv) {
v8::Isolate* isolate = context->GetIsolate();
mate::Dictionary dict(isolate, exports);
dict.Set("autoUpdater", atom::api::AutoUpdater::Create(isolate));
}
} // namespace
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_browser_auto_updater, Initialize)

View File

@@ -0,0 +1,56 @@
// Copyright (c) 2013 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_AUTO_UPDATER_H_
#define ATOM_BROWSER_API_ATOM_API_AUTO_UPDATER_H_
#include <string>
#include "base/callback.h"
#include "atom/browser/api/event_emitter.h"
#include "atom/browser/auto_updater_delegate.h"
#include "native_mate/handle.h"
namespace atom {
namespace api {
class AutoUpdater : public mate::EventEmitter,
public auto_updater::AutoUpdaterDelegate {
public:
static mate::Handle<AutoUpdater> Create(v8::Isolate* isolate);
protected:
AutoUpdater();
virtual ~AutoUpdater();
// AutoUpdaterDelegate implementations.
void OnError(const std::string& error) override;
void OnCheckingForUpdate() override;
void OnUpdateAvailable() override;
void OnUpdateNotAvailable() override;
void OnUpdateDownloaded(
const std::string& release_notes,
const std::string& release_name,
const base::Time& release_date,
const std::string& update_url,
const base::Closure& quit_and_install) override;
// mate::Wrappable implementations:
mate::ObjectTemplateBuilder GetObjectTemplateBuilder(
v8::Isolate* isolate) override;
private:
void QuitAndInstall();
base::Closure quit_and_install_;
DISALLOW_COPY_AND_ASSIGN(AutoUpdater);
};
} // namespace api
} // namespace atom
#endif // ATOM_BROWSER_API_ATOM_API_AUTO_UPDATER_H_

View File

@@ -0,0 +1,89 @@
// Copyright (c) 2014 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include <set>
#include <string>
#include "atom/common/native_mate_converters/file_path_converter.h"
#include "base/bind.h"
#include "content/public/browser/tracing_controller.h"
#include "native_mate/callback.h"
#include "native_mate/dictionary.h"
#include "atom/common/node_includes.h"
using content::TracingController;
namespace mate {
template<typename T>
struct Converter<std::set<T> > {
static v8::Handle<v8::Value> ToV8(v8::Isolate* isolate,
const std::set<T>& val) {
v8::Handle<v8::Array> result = v8::Array::New(
isolate, static_cast<int>(val.size()));
typename std::set<T>::const_iterator it;
int i;
for (i = 0, it = val.begin(); it != val.end(); ++it, ++i)
result->Set(i, Converter<T>::ToV8(isolate, *it));
return result;
}
};
template<>
struct Converter<base::debug::CategoryFilter> {
static bool FromV8(v8::Isolate* isolate,
v8::Handle<v8::Value> val,
base::debug::CategoryFilter* out) {
std::string filter;
if (!ConvertFromV8(isolate, val, &filter))
return false;
*out = base::debug::CategoryFilter(filter);
return true;
}
};
template<>
struct Converter<base::debug::TraceOptions> {
static bool FromV8(v8::Isolate* isolate,
v8::Handle<v8::Value> val,
base::debug::TraceOptions* out) {
std::string options;
if (!ConvertFromV8(isolate, val, &options))
return false;
return out->SetFromString(options);
}
};
} // namespace mate
namespace {
void Initialize(v8::Handle<v8::Object> exports, v8::Handle<v8::Value> unused,
v8::Handle<v8::Context> context, void* priv) {
auto controller = base::Unretained(TracingController::GetInstance());
mate::Dictionary dict(context->GetIsolate(), exports);
dict.SetMethod("getCategories", base::Bind(
&TracingController::GetCategories, controller));
dict.SetMethod("startRecording", base::Bind(
&TracingController::EnableRecording, controller));
dict.SetMethod("stopRecording", base::Bind(
&TracingController::DisableRecording, controller, nullptr));
dict.SetMethod("startMonitoring", base::Bind(
&TracingController::EnableMonitoring, controller));
dict.SetMethod("stopMonitoring", base::Bind(
&TracingController::DisableMonitoring, controller));
dict.SetMethod("captureMonitoringSnapshot", base::Bind(
&TracingController::CaptureMonitoringSnapshot, controller, nullptr));
dict.SetMethod("getTraceBufferUsage", base::Bind(
&TracingController::GetTraceBufferUsage, controller));
dict.SetMethod("setWatchEvent", base::Bind(
&TracingController::SetWatchEvent, controller));
dict.SetMethod("cancelWatchEvent", base::Bind(
&TracingController::CancelWatchEvent, controller));
}
} // namespace
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_browser_content_tracing, Initialize)

View File

@@ -0,0 +1,120 @@
// Copyright (c) 2013 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include <string>
#include <utility>
#include <vector>
#include "atom/browser/api/atom_api_window.h"
#include "atom/browser/native_window.h"
#include "atom/browser/ui/file_dialog.h"
#include "atom/browser/ui/message_box.h"
#include "atom/common/native_mate_converters/file_path_converter.h"
#include "atom/common/native_mate_converters/image_converter.h"
#include "native_mate/callback.h"
#include "native_mate/dictionary.h"
#include "atom/common/node_includes.h"
namespace mate {
template<>
struct Converter<file_dialog::Filter> {
static bool FromV8(v8::Isolate* isolate,
v8::Handle<v8::Value> val,
file_dialog::Filter* out) {
mate::Dictionary dict;
if (!ConvertFromV8(isolate, val, &dict))
return false;
if (!dict.Get("name", &(out->first)))
return false;
if (!dict.Get("extensions", &(out->second)))
return false;
return true;
}
};
} // namespace mate
namespace {
void ShowMessageBox(int type,
const std::vector<std::string>& buttons,
const std::vector<std::string>& texts,
const gfx::ImageSkia& icon,
atom::NativeWindow* window,
mate::Arguments* args) {
// FIXME We are exceeding the parameters limit of base::Bind here, so we have
// to pass some parameters in an array. We should remove this once we have
// variadic template support in base::Bind.
const std::string& title = texts[0];
const std::string& message = texts[1];
const std::string& detail = texts[2];
v8::Handle<v8::Value> peek = args->PeekNext();
atom::MessageBoxCallback callback;
if (mate::Converter<atom::MessageBoxCallback>::FromV8(args->isolate(),
peek,
&callback)) {
atom::ShowMessageBox(window, (atom::MessageBoxType)type, buttons, title,
message, detail, icon, callback);
} else {
int chosen = atom::ShowMessageBox(window, (atom::MessageBoxType)type,
buttons, title, message, detail, icon);
args->Return(chosen);
}
}
void ShowOpenDialog(const std::string& title,
const base::FilePath& default_path,
const file_dialog::Filters& filters,
int properties,
atom::NativeWindow* window,
mate::Arguments* args) {
v8::Handle<v8::Value> peek = args->PeekNext();
file_dialog::OpenDialogCallback callback;
if (mate::Converter<file_dialog::OpenDialogCallback>::FromV8(args->isolate(),
peek,
&callback)) {
file_dialog::ShowOpenDialog(window, title, default_path, filters,
properties, callback);
} else {
std::vector<base::FilePath> paths;
if (file_dialog::ShowOpenDialog(window, title, default_path, filters,
properties, &paths))
args->Return(paths);
}
}
void ShowSaveDialog(const std::string& title,
const base::FilePath& default_path,
const file_dialog::Filters& filters,
atom::NativeWindow* window,
mate::Arguments* args) {
v8::Handle<v8::Value> peek = args->PeekNext();
file_dialog::SaveDialogCallback callback;
if (mate::Converter<file_dialog::SaveDialogCallback>::FromV8(args->isolate(),
peek,
&callback)) {
file_dialog::ShowSaveDialog(window, title, default_path, filters, callback);
} else {
base::FilePath path;
if (file_dialog::ShowSaveDialog(window, title, default_path, filters,
&path))
args->Return(path);
}
}
void Initialize(v8::Handle<v8::Object> exports, v8::Handle<v8::Value> unused,
v8::Handle<v8::Context> context, void* priv) {
mate::Dictionary dict(context->GetIsolate(), exports);
dict.SetMethod("showMessageBox", &ShowMessageBox);
dict.SetMethod("showErrorBox", &atom::ShowErrorBox);
dict.SetMethod("showOpenDialog", &ShowOpenDialog);
dict.SetMethod("showSaveDialog", &ShowSaveDialog);
}
} // namespace
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_browser_dialog, Initialize)

View File

@@ -0,0 +1,98 @@
// Copyright (c) 2014 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "atom/browser/api/atom_api_global_shortcut.h"
#include <string>
#include "atom/common/native_mate_converters/accelerator_converter.h"
#include "base/stl_util.h"
#include "native_mate/callback.h"
#include "native_mate/dictionary.h"
#include "atom/common/node_includes.h"
using extensions::GlobalShortcutListener;
namespace atom {
namespace api {
GlobalShortcut::GlobalShortcut() {
}
GlobalShortcut::~GlobalShortcut() {
UnregisterAll();
}
void GlobalShortcut::OnKeyPressed(const ui::Accelerator& accelerator) {
if (accelerator_callback_map_.find(accelerator) ==
accelerator_callback_map_.end()) {
// This should never occur, because if it does, GlobalGlobalShortcutListener
// notifes us with wrong accelerator.
NOTREACHED();
return;
}
accelerator_callback_map_[accelerator].Run();
}
bool GlobalShortcut::Register(const ui::Accelerator& accelerator,
const base::Closure& callback) {
if (!GlobalShortcutListener::GetInstance()->RegisterAccelerator(
accelerator, this)) {
return false;
}
accelerator_callback_map_[accelerator] = callback;
return true;
}
void GlobalShortcut::Unregister(const ui::Accelerator& accelerator) {
if (!ContainsKey(accelerator_callback_map_, accelerator))
return;
accelerator_callback_map_.erase(accelerator);
GlobalShortcutListener::GetInstance()->UnregisterAccelerator(
accelerator, this);
}
bool GlobalShortcut::IsRegistered(const ui::Accelerator& accelerator) {
return ContainsKey(accelerator_callback_map_, accelerator);
}
void GlobalShortcut::UnregisterAll() {
accelerator_callback_map_.clear();
GlobalShortcutListener::GetInstance()->UnregisterAccelerators(this);
}
mate::ObjectTemplateBuilder GlobalShortcut::GetObjectTemplateBuilder(
v8::Isolate* isolate) {
return mate::ObjectTemplateBuilder(isolate)
.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
namespace {
void Initialize(v8::Handle<v8::Object> exports, v8::Handle<v8::Value> unused,
v8::Handle<v8::Context> context, void* priv) {
v8::Isolate* isolate = context->GetIsolate();
mate::Dictionary dict(isolate, exports);
dict.Set("globalShortcut", atom::api::GlobalShortcut::Create(isolate));
}
} // namespace
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_browser_global_shortcut, Initialize)

View File

@@ -0,0 +1,55 @@
// Copyright (c) 2014 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_GLOBAL_SHORTCUT_H_
#define ATOM_BROWSER_API_ATOM_API_GLOBAL_SHORTCUT_H_
#include <map>
#include <string>
#include "base/callback.h"
#include "chrome/browser/extensions/global_shortcut_listener.h"
#include "native_mate/wrappable.h"
#include "native_mate/handle.h"
#include "ui/base/accelerators/accelerator.h"
namespace atom {
namespace api {
class GlobalShortcut : public extensions::GlobalShortcutListener::Observer,
public mate::Wrappable {
public:
static mate::Handle<GlobalShortcut> Create(v8::Isolate* isolate);
protected:
GlobalShortcut();
virtual ~GlobalShortcut();
// mate::Wrappable implementations:
mate::ObjectTemplateBuilder GetObjectTemplateBuilder(
v8::Isolate* isolate) override;
private:
typedef std::map<ui::Accelerator, base::Closure> AcceleratorCallbackMap;
bool Register(const ui::Accelerator& accelerator,
const base::Closure& callback);
bool IsRegistered(const ui::Accelerator& accelerator);
void Unregister(const ui::Accelerator& accelerator);
void UnregisterAll();
// GlobalShortcutListener::Observer implementation.
void OnKeyPressed(const ui::Accelerator& accelerator) override;
AcceleratorCallbackMap accelerator_callback_map_;
DISALLOW_COPY_AND_ASSIGN(GlobalShortcut);
};
} // namespace api
} // namespace atom
#endif // ATOM_BROWSER_API_ATOM_API_GLOBAL_SHORTCUT_H_

View File

@@ -0,0 +1,200 @@
// Copyright (c) 2013 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "atom/browser/api/atom_api_menu.h"
#include "atom/browser/native_window.h"
#include "atom/common/native_mate_converters/accelerator_converter.h"
#include "atom/common/native_mate_converters/image_converter.h"
#include "atom/common/native_mate_converters/string16_converter.h"
#include "native_mate/callback.h"
#include "native_mate/constructor.h"
#include "native_mate/dictionary.h"
#include "native_mate/object_template_builder.h"
#include "atom/common/node_includes.h"
namespace atom {
namespace api {
Menu::Menu()
: model_(new ui::SimpleMenuModel(this)),
parent_(NULL) {
}
Menu::~Menu() {
}
void Menu::AfterInit(v8::Isolate* isolate) {
mate::Dictionary wrappable(isolate, GetWrapper(isolate));
mate::Dictionary delegate;
if (!wrappable.Get("delegate", &delegate))
return;
delegate.Get("isCommandIdChecked", &is_checked_);
delegate.Get("isCommandIdEnabled", &is_enabled_);
delegate.Get("isCommandIdVisible", &is_visible_);
delegate.Get("getAcceleratorForCommandId", &get_accelerator_);
delegate.Get("executeCommand", &execute_command_);
delegate.Get("menuWillShow", &menu_will_show_);
}
bool Menu::IsCommandIdChecked(int command_id) const {
return is_checked_.Run(command_id);
}
bool Menu::IsCommandIdEnabled(int command_id) const {
return is_enabled_.Run(command_id);
}
bool Menu::IsCommandIdVisible(int command_id) const {
return is_visible_.Run(command_id);
}
bool Menu::GetAcceleratorForCommandId(int command_id,
ui::Accelerator* accelerator) {
v8::Isolate* isolate = v8::Isolate::GetCurrent();
v8::Locker locker(isolate);
v8::HandleScope handle_scope(isolate);
v8::Handle<v8::Value> val = get_accelerator_.Run(command_id);
return mate::ConvertFromV8(isolate, val, accelerator);
}
void Menu::ExecuteCommand(int command_id, int event_flags) {
execute_command_.Run(command_id);
}
void Menu::MenuWillShow(ui::SimpleMenuModel* source) {
menu_will_show_.Run();
}
void Menu::AttachToWindow(Window* window) {
window->window()->SetMenu(model_.get());
}
void Menu::InsertItemAt(
int index, int command_id, const base::string16& label) {
model_->InsertItemAt(index, command_id, label);
}
void Menu::InsertSeparatorAt(int index) {
model_->InsertSeparatorAt(index, ui::NORMAL_SEPARATOR);
}
void Menu::InsertCheckItemAt(int index,
int command_id,
const base::string16& label) {
model_->InsertCheckItemAt(index, command_id, label);
}
void Menu::InsertRadioItemAt(int index,
int command_id,
const base::string16& label,
int group_id) {
model_->InsertRadioItemAt(index, command_id, label, group_id);
}
void Menu::InsertSubMenuAt(int index,
int command_id,
const base::string16& label,
Menu* menu) {
menu->parent_ = this;
model_->InsertSubMenuAt(index, command_id, label, menu->model_.get());
}
void Menu::SetIcon(int index, const gfx::Image& image) {
model_->SetIcon(index, image);
}
void Menu::SetSublabel(int index, const base::string16& sublabel) {
model_->SetSublabel(index, sublabel);
}
void Menu::Clear() {
model_->Clear();
}
int Menu::GetIndexOfCommandId(int command_id) {
return model_->GetIndexOfCommandId(command_id);
}
int Menu::GetItemCount() const {
return model_->GetItemCount();
}
int Menu::GetCommandIdAt(int index) const {
return model_->GetCommandIdAt(index);
}
base::string16 Menu::GetLabelAt(int index) const {
return model_->GetLabelAt(index);
}
base::string16 Menu::GetSublabelAt(int index) const {
return model_->GetSublabelAt(index);
}
bool Menu::IsItemCheckedAt(int index) const {
return model_->IsItemCheckedAt(index);
}
bool Menu::IsEnabledAt(int index) const {
return model_->IsEnabledAt(index);
}
bool Menu::IsVisibleAt(int index) const {
return model_->IsVisibleAt(index);
}
// static
void Menu::BuildPrototype(v8::Isolate* isolate,
v8::Handle<v8::ObjectTemplate> prototype) {
mate::ObjectTemplateBuilder(isolate, prototype)
.SetMethod("insertItem", &Menu::InsertItemAt)
.SetMethod("insertCheckItem", &Menu::InsertCheckItemAt)
.SetMethod("insertRadioItem", &Menu::InsertRadioItemAt)
.SetMethod("insertSeparator", &Menu::InsertSeparatorAt)
.SetMethod("insertSubMenu", &Menu::InsertSubMenuAt)
.SetMethod("setIcon", &Menu::SetIcon)
.SetMethod("setSublabel", &Menu::SetSublabel)
.SetMethod("clear", &Menu::Clear)
.SetMethod("getIndexOfCommandId", &Menu::GetIndexOfCommandId)
.SetMethod("getItemCount", &Menu::GetItemCount)
.SetMethod("getCommandIdAt", &Menu::GetCommandIdAt)
.SetMethod("getLabelAt", &Menu::GetLabelAt)
.SetMethod("getSublabelAt", &Menu::GetSublabelAt)
.SetMethod("isItemCheckedAt", &Menu::IsItemCheckedAt)
.SetMethod("isEnabledAt", &Menu::IsEnabledAt)
.SetMethod("isVisibleAt", &Menu::IsVisibleAt)
.SetMethod("attachToWindow", &Menu::AttachToWindow)
.SetMethod("_popup", &Menu::Popup)
.SetMethod("_popupAt", &Menu::PopupAt);
}
} // namespace api
} // namespace atom
namespace {
void Initialize(v8::Handle<v8::Object> exports, v8::Handle<v8::Value> unused,
v8::Handle<v8::Context> context, void* priv) {
using atom::api::Menu;
v8::Isolate* isolate = context->GetIsolate();
v8::Local<v8::Function> constructor = mate::CreateConstructor<Menu>(
isolate, "Menu", base::Bind(&Menu::Create));
mate::Dictionary dict(isolate, exports);
dict.Set("Menu", static_cast<v8::Handle<v8::Value>>(constructor));
#if defined(OS_MACOSX)
dict.SetMethod("setApplicationMenu", &Menu::SetApplicationMenu);
dict.SetMethod("sendActionToFirstResponder",
&Menu::SendActionToFirstResponder);
#endif
}
} // namespace
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_browser_menu, Initialize)

View File

@@ -0,0 +1,102 @@
// Copyright (c) 2013 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_MENU_H_
#define ATOM_BROWSER_API_ATOM_API_MENU_H_
#include <string>
#include "atom/browser/api/atom_api_window.h"
#include "base/callback.h"
#include "base/memory/scoped_ptr.h"
#include "ui/base/models/simple_menu_model.h"
#include "native_mate/wrappable.h"
namespace atom {
namespace api {
class Menu : public mate::Wrappable,
public ui::SimpleMenuModel::Delegate {
public:
static mate::Wrappable* Create();
static void BuildPrototype(v8::Isolate* isolate,
v8::Handle<v8::ObjectTemplate> prototype);
#if defined(OS_MACOSX)
// Set the global menubar.
static void SetApplicationMenu(Menu* menu);
// Fake sending an action from the application menu.
static void SendActionToFirstResponder(const std::string& action);
#endif
ui::SimpleMenuModel* model() const { return model_.get(); }
protected:
Menu();
virtual ~Menu();
// mate::Wrappable:
void AfterInit(v8::Isolate* isolate) override;
// ui::SimpleMenuModel::Delegate implementations:
bool IsCommandIdChecked(int command_id) const override;
bool IsCommandIdEnabled(int command_id) const override;
bool IsCommandIdVisible(int command_id) const override;
bool GetAcceleratorForCommandId(int command_id,
ui::Accelerator* accelerator) override;
void ExecuteCommand(int command_id, int event_flags) override;
void MenuWillShow(ui::SimpleMenuModel* source) override;
virtual void AttachToWindow(Window* window);
virtual void Popup(Window* window) = 0;
virtual void PopupAt(Window* window, int x, int y) = 0;
scoped_ptr<ui::SimpleMenuModel> model_;
Menu* parent_;
private:
void InsertItemAt(int index, int command_id, const base::string16& label);
void InsertSeparatorAt(int index);
void InsertCheckItemAt(int index,
int command_id,
const base::string16& label);
void InsertRadioItemAt(int index,
int command_id,
const base::string16& label,
int group_id);
void InsertSubMenuAt(int index,
int command_id,
const base::string16& label,
Menu* menu);
void SetIcon(int index, const gfx::Image& image);
void SetSublabel(int index, const base::string16& sublabel);
void Clear();
int GetIndexOfCommandId(int command_id);
int GetItemCount() const;
int GetCommandIdAt(int index) const;
base::string16 GetLabelAt(int index) const;
base::string16 GetSublabelAt(int index) const;
bool IsItemCheckedAt(int index) const;
bool IsEnabledAt(int index) const;
bool IsVisibleAt(int index) const;
// Stored delegate methods.
base::Callback<bool(int)> is_checked_;
base::Callback<bool(int)> is_enabled_;
base::Callback<bool(int)> is_visible_;
base::Callback<v8::Handle<v8::Value>(int)> get_accelerator_;
base::Callback<void(int)> execute_command_;
base::Callback<void()> menu_will_show_;
DISALLOW_COPY_AND_ASSIGN(Menu);
};
} // namespace api
} // namespace atom
#endif // ATOM_BROWSER_API_ATOM_API_MENU_H_

View File

@@ -0,0 +1,39 @@
// Copyright (c) 2013 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_MENU_MAC_H_
#define ATOM_BROWSER_API_ATOM_API_MENU_MAC_H_
#include "atom/browser/api/atom_api_menu.h"
#include <string>
#import "atom/browser/ui/cocoa/atom_menu_controller.h"
namespace atom {
namespace api {
class MenuMac : public Menu {
protected:
MenuMac();
void Popup(Window* window) override;
void PopupAt(Window* window, int x, int y) override;
base::scoped_nsobject<AtomMenuController> menu_controller_;
private:
friend class Menu;
static void SendActionToFirstResponder(const std::string& action);
DISALLOW_COPY_AND_ASSIGN(MenuMac);
};
} // namespace api
} // namespace atom
#endif // ATOM_BROWSER_API_ATOM_API_MENU_MAC_H_

View File

@@ -0,0 +1,96 @@
// Copyright (c) 2013 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#import "atom/browser/api/atom_api_menu_mac.h"
#include "atom/browser/native_window.h"
#include "base/message_loop/message_loop.h"
#include "base/strings/sys_string_conversions.h"
#include "content/public/browser/web_contents.h"
#include "atom/common/node_includes.h"
namespace atom {
namespace api {
MenuMac::MenuMac() {
}
void MenuMac::Popup(Window* window) {
NativeWindow* native_window = window->window();
if (!native_window)
return;
content::WebContents* web_contents = native_window->GetWebContents();
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->GetWebContents();
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();
// Show the menu.
[menu popUpMenuPositioningItem:[menu itemAtIndex:0]
atLocation:NSMakePoint(x, [view frame].size.height - y)
inView:view];
}
// static
void Menu::SetApplicationMenu(Menu* base_menu) {
MenuMac* menu = static_cast<MenuMac*>(base_menu);
base::scoped_nsobject<AtomMenuController> menu_controller(
[[AtomMenuController alloc] initWithModel:menu->model_.get()]);
[NSApp setMainMenu:[menu_controller menu]];
// Ensure the menu_controller_ is destroyed after main menu is set.
menu_controller.swap(menu->menu_controller_);
}
// static
void Menu::SendActionToFirstResponder(const std::string& action) {
SEL selector = NSSelectorFromString(base::SysUTF8ToNSString(action));
[NSApp sendAction:selector to:nil from:[NSApp mainMenu]];
}
// static
mate::Wrappable* Menu::Create() {
return new MenuMac();
}
} // namespace api
} // namespace atom

View File

@@ -0,0 +1,57 @@
// Copyright (c) 2014 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "atom/browser/api/atom_api_menu_views.h"
#include "atom/browser/native_window_views.h"
#include "content/public/browser/render_widget_host_view.h"
#include "ui/gfx/screen.h"
#include "ui/views/controls/menu/menu_runner.h"
namespace atom {
namespace api {
MenuViews::MenuViews() {
}
void MenuViews::Popup(Window* window) {
PopupAtPoint(window, gfx::Screen::GetNativeScreen()->GetCursorScreenPoint());
}
void MenuViews::PopupAt(Window* window, int x, int y) {
NativeWindow* native_window = static_cast<NativeWindow*>(window->window());
if (!native_window)
return;
content::WebContents* web_contents = native_window->GetWebContents();
if (!web_contents)
return;
content::RenderWidgetHostView* view = web_contents->GetRenderWidgetHostView();
if (!view)
return;
gfx::Point origin = view->GetViewBounds().origin();
PopupAtPoint(window, gfx::Point(origin.x() + x, origin.y() + y));
}
void MenuViews::PopupAtPoint(Window* window, const gfx::Point& point) {
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()),
views::MENU_ANCHOR_TOPLEFT,
ui::MENU_SOURCE_MOUSE));
}
// static
mate::Wrappable* Menu::Create() {
return new MenuViews();
}
} // namespace api
} // namespace atom

View File

@@ -0,0 +1,33 @@
// Copyright (c) 2014 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_MENU_VIEWS_H_
#define ATOM_BROWSER_API_ATOM_API_MENU_VIEWS_H_
#include "atom/browser/api/atom_api_menu.h"
#include "ui/gfx/screen.h"
namespace atom {
namespace api {
class MenuViews : public Menu {
public:
MenuViews();
protected:
void Popup(Window* window) override;
void PopupAt(Window* window, int x, int y) override;
private:
void PopupAtPoint(Window* window, const gfx::Point& point);
DISALLOW_COPY_AND_ASSIGN(MenuViews);
};
} // namespace api
} // namespace atom
#endif // ATOM_BROWSER_API_ATOM_API_MENU_VIEWS_H_

View File

@@ -0,0 +1,67 @@
// Copyright (c) 2013 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "atom/browser/api/atom_api_power_monitor.h"
#include "base/power_monitor/power_monitor.h"
#include "base/power_monitor/power_monitor_device_source.h"
#include "native_mate/dictionary.h"
#include "atom/common/node_includes.h"
namespace atom {
namespace api {
PowerMonitor::PowerMonitor() {
base::PowerMonitor::Get()->AddObserver(this);
}
PowerMonitor::~PowerMonitor() {
base::PowerMonitor::Get()->RemoveObserver(this);
}
void PowerMonitor::OnPowerStateChange(bool on_battery_power) {
if (on_battery_power)
Emit("on-battery");
else
Emit("on-ac");
}
void PowerMonitor::OnSuspend() {
Emit("suspend");
}
void PowerMonitor::OnResume() {
Emit("resume");
}
// static
mate::Handle<PowerMonitor> PowerMonitor::Create(v8::Isolate* isolate) {
return CreateHandle(isolate, new PowerMonitor);
}
} // namespace api
} // namespace atom
namespace {
void Initialize(v8::Handle<v8::Object> exports, v8::Handle<v8::Value> unused,
v8::Handle<v8::Context> context, void* priv) {
#if defined(OS_MACOSX)
base::PowerMonitorDeviceSource::AllocateSystemIOPorts();
#endif
using atom::api::PowerMonitor;
v8::Isolate* isolate = context->GetIsolate();
mate::Handle<PowerMonitor> power_monitor = PowerMonitor::Create(isolate);
mate::Dictionary dict(isolate, exports);
dict.Set("powerMonitor", power_monitor);
}
} // namespace
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_browser_power_monitor, Initialize)

View File

@@ -0,0 +1,39 @@
// Copyright (c) 2013 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_POWER_MONITOR_H_
#define ATOM_BROWSER_API_ATOM_API_POWER_MONITOR_H_
#include "atom/browser/api/event_emitter.h"
#include "base/compiler_specific.h"
#include "base/power_monitor/power_observer.h"
#include "native_mate/handle.h"
namespace atom {
namespace api {
class PowerMonitor : public mate::EventEmitter,
public base::PowerObserver {
public:
static mate::Handle<PowerMonitor> Create(v8::Isolate* isolate);
protected:
PowerMonitor();
virtual ~PowerMonitor();
// base::PowerObserver implementations:
void OnPowerStateChange(bool on_battery_power) override;
void OnSuspend() override;
void OnResume() override;
private:
DISALLOW_COPY_AND_ASSIGN(PowerMonitor);
};
} // namespace api
} // namespace atom
#endif // ATOM_BROWSER_API_ATOM_API_POWER_MONITOR_H_

View File

@@ -0,0 +1,342 @@
// Copyright (c) 2013 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "atom/browser/api/atom_api_protocol.h"
#include "atom/browser/atom_browser_context.h"
#include "atom/browser/net/adapter_request_job.h"
#include "atom/browser/net/atom_url_request_job_factory.h"
#include "atom/common/native_mate_converters/file_path_converter.h"
#include "content/public/browser/browser_thread.h"
#include "native_mate/callback.h"
#include "native_mate/dictionary.h"
#include "net/url_request/url_request_context.h"
#include "atom/common/node_includes.h"
using content::BrowserThread;
namespace mate {
template<>
struct Converter<const net::URLRequest*> {
static v8::Handle<v8::Value> ToV8(v8::Isolate* isolate,
const net::URLRequest* val) {
return mate::ObjectTemplateBuilder(isolate)
.SetValue("method", val->method())
.SetValue("url", val->url().spec())
.SetValue("referrer", val->referrer())
.Build()->NewInstance();
}
};
} // namespace mate
namespace atom {
namespace api {
namespace {
typedef net::URLRequestJobFactory::ProtocolHandler ProtocolHandler;
class CustomProtocolRequestJob : public AdapterRequestJob {
public:
CustomProtocolRequestJob(Protocol* registry,
ProtocolHandler* protocol_handler,
net::URLRequest* request,
net::NetworkDelegate* network_delegate)
: AdapterRequestJob(protocol_handler, request, network_delegate),
registry_(registry) {
}
// AdapterRequestJob:
void GetJobTypeInUI() override {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
v8::Isolate* isolate = v8::Isolate::GetCurrent();
v8::Locker locker(isolate);
v8::HandleScope handle_scope(isolate);
// Call the JS handler.
Protocol::JsProtocolHandler callback =
registry_->GetProtocolHandler(request()->url().scheme());
v8::Handle<v8::Value> result = callback.Run(request());
// Determine the type of the job we are going to create.
if (result->IsString()) {
std::string data = mate::V8ToString(result);
BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
base::Bind(&AdapterRequestJob::CreateStringJobAndStart,
GetWeakPtr(), "text/plain", "UTF-8", data));
return;
} else if (result->IsObject()) {
v8::Handle<v8::Object> obj = result->ToObject();
mate::Dictionary dict(isolate, obj);
std::string name = mate::V8ToString(obj->GetConstructorName());
if (name == "RequestStringJob") {
std::string mime_type, charset, data;
dict.Get("mimeType", &mime_type);
dict.Get("charset", &charset);
dict.Get("data", &data);
BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
base::Bind(&AdapterRequestJob::CreateStringJobAndStart,
GetWeakPtr(), mime_type, charset, data));
return;
} else if (name == "RequestBufferJob") {
std::string mime_type, encoding;
v8::Handle<v8::Value> buffer;
dict.Get("mimeType", &mime_type);
dict.Get("encoding", &encoding);
dict.Get("data", &buffer);
BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
base::Bind(&AdapterRequestJob::CreateBufferJobAndStart,
GetWeakPtr(), mime_type, encoding, buffer->ToObject()));
return;
} else if (name == "RequestFileJob") {
base::FilePath path;
dict.Get("path", &path);
BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
base::Bind(&AdapterRequestJob::CreateFileJobAndStart,
GetWeakPtr(), path));
return;
}
}
// Try the default protocol handler if we have.
if (default_protocol_handler()) {
BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
base::Bind(&AdapterRequestJob::CreateJobFromProtocolHandlerAndStart,
GetWeakPtr()));
return;
}
// Fallback to the not implemented error.
BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
base::Bind(&AdapterRequestJob::CreateErrorJobAndStart,
GetWeakPtr(), net::ERR_NOT_IMPLEMENTED));
}
private:
Protocol* registry_; // Weak, the Protocol class is expected to live forever.
};
// Always return the same CustomProtocolRequestJob for all requests, because
// the content API needs the ProtocolHandler to return a job immediately, and
// getting the real job from the JS requires asynchronous calls, so we have
// to create an adapter job first.
// Users can also pass an extra ProtocolHandler as the fallback one when
// registered handler doesn't want to deal with the request.
class CustomProtocolHandler : public ProtocolHandler {
public:
CustomProtocolHandler(api::Protocol* registry,
ProtocolHandler* protocol_handler = NULL)
: registry_(registry), protocol_handler_(protocol_handler) {
}
net::URLRequestJob* MaybeCreateJob(
net::URLRequest* request,
net::NetworkDelegate* network_delegate) const override {
return new CustomProtocolRequestJob(registry_, protocol_handler_.get(),
request, network_delegate);
}
ProtocolHandler* ReleaseDefaultProtocolHandler() {
return protocol_handler_.release();
}
ProtocolHandler* original_handler() { return protocol_handler_.get(); }
private:
Protocol* registry_; // Weak, the Protocol class is expected to live forever.
scoped_ptr<ProtocolHandler> protocol_handler_;
DISALLOW_COPY_AND_ASSIGN(CustomProtocolHandler);
};
} // namespace
Protocol::Protocol()
: job_factory_(AtomBrowserContext::Get()->job_factory()) {
CHECK(job_factory_);
}
Protocol::JsProtocolHandler Protocol::GetProtocolHandler(
const std::string& scheme) {
return protocol_handlers_[scheme];
}
mate::ObjectTemplateBuilder Protocol::GetObjectTemplateBuilder(
v8::Isolate* isolate) {
return mate::ObjectTemplateBuilder(isolate)
.SetMethod("registerProtocol",
base::Bind(&Protocol::RegisterProtocol,
base::Unretained(this)))
.SetMethod("unregisterProtocol",
base::Bind(&Protocol::UnregisterProtocol,
base::Unretained(this)))
.SetMethod("isHandledProtocol",
base::Bind(&Protocol::IsHandledProtocol,
base::Unretained(this)))
.SetMethod("interceptProtocol",
base::Bind(&Protocol::InterceptProtocol,
base::Unretained(this)))
.SetMethod("uninterceptProtocol",
base::Bind(&Protocol::UninterceptProtocol,
base::Unretained(this)));
}
void Protocol::RegisterProtocol(const std::string& scheme,
const JsProtocolHandler& callback) {
if (ContainsKey(protocol_handlers_, scheme) ||
job_factory_->IsHandledProtocol(scheme))
return node::ThrowError("The scheme is already registered");
protocol_handlers_[scheme] = callback;
BrowserThread::PostTask(BrowserThread::IO,
FROM_HERE,
base::Bind(&Protocol::RegisterProtocolInIO,
base::Unretained(this), scheme));
}
void Protocol::UnregisterProtocol(const std::string& scheme) {
ProtocolHandlersMap::iterator it(protocol_handlers_.find(scheme));
if (it == protocol_handlers_.end())
return node::ThrowError("The scheme has not been registered");
protocol_handlers_.erase(it);
BrowserThread::PostTask(BrowserThread::IO,
FROM_HERE,
base::Bind(&Protocol::UnregisterProtocolInIO,
base::Unretained(this), scheme));
}
bool Protocol::IsHandledProtocol(const std::string& scheme) {
return job_factory_->IsHandledProtocol(scheme);
}
void Protocol::InterceptProtocol(const std::string& scheme,
const JsProtocolHandler& callback) {
if (!job_factory_->HasProtocolHandler(scheme))
return node::ThrowError("Scheme does not exist.");
if (ContainsKey(protocol_handlers_, scheme))
return node::ThrowError("Cannot intercept custom procotols");
protocol_handlers_[scheme] = callback;
BrowserThread::PostTask(BrowserThread::IO,
FROM_HERE,
base::Bind(&Protocol::InterceptProtocolInIO,
base::Unretained(this), scheme));
}
void Protocol::UninterceptProtocol(const std::string& scheme) {
ProtocolHandlersMap::iterator it(protocol_handlers_.find(scheme));
if (it == protocol_handlers_.end())
return node::ThrowError("The scheme has not been registered");
protocol_handlers_.erase(it);
BrowserThread::PostTask(BrowserThread::IO,
FROM_HERE,
base::Bind(&Protocol::UninterceptProtocolInIO,
base::Unretained(this), scheme));
}
void Protocol::RegisterProtocolInIO(const std::string& scheme) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
job_factory_->SetProtocolHandler(scheme, new CustomProtocolHandler(this));
BrowserThread::PostTask(BrowserThread::UI,
FROM_HERE,
base::Bind(&Protocol::EmitEventInUI,
base::Unretained(this),
"registered", scheme));
}
void Protocol::UnregisterProtocolInIO(const std::string& scheme) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
job_factory_->SetProtocolHandler(scheme, NULL);
BrowserThread::PostTask(BrowserThread::UI,
FROM_HERE,
base::Bind(&Protocol::EmitEventInUI,
base::Unretained(this),
"unregistered", scheme));
}
void Protocol::InterceptProtocolInIO(const std::string& scheme) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
ProtocolHandler* original_handler = job_factory_->GetProtocolHandler(scheme);
if (original_handler == NULL) {
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, base::Bind(
&Protocol::EmitEventInUI,
base::Unretained(this),
"error", "There is no protocol handler to intercpet"));
return;
}
job_factory_->ReplaceProtocol(
scheme, new CustomProtocolHandler(this, original_handler));
BrowserThread::PostTask(BrowserThread::UI,
FROM_HERE,
base::Bind(&Protocol::EmitEventInUI,
base::Unretained(this),
"intercepted", scheme));
}
void Protocol::UninterceptProtocolInIO(const std::string& scheme) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
CustomProtocolHandler* handler = static_cast<CustomProtocolHandler*>(
job_factory_->GetProtocolHandler(scheme));
if (handler->original_handler() == NULL) {
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, base::Bind(
&Protocol::EmitEventInUI,
base::Unretained(this),
"error", "The protocol is not intercpeted"));
return;
}
// Reset the protocol handler to the orignal one and delete current protocol
// handler.
ProtocolHandler* original_handler = handler->ReleaseDefaultProtocolHandler();
delete job_factory_->ReplaceProtocol(scheme, original_handler);
BrowserThread::PostTask(BrowserThread::UI,
FROM_HERE,
base::Bind(&Protocol::EmitEventInUI,
base::Unretained(this),
"unintercepted", scheme));
}
void Protocol::EmitEventInUI(const std::string& event,
const std::string& parameter) {
Emit(event, parameter);
}
// static
mate::Handle<Protocol> Protocol::Create(v8::Isolate* isolate) {
return CreateHandle(isolate, new Protocol);
}
} // namespace api
} // namespace atom
namespace {
void Initialize(v8::Handle<v8::Object> exports, v8::Handle<v8::Value> unused,
v8::Handle<v8::Context> context, void* priv) {
v8::Isolate* isolate = context->GetIsolate();
mate::Dictionary dict(isolate, exports);
dict.Set("protocol", atom::api::Protocol::Create(isolate));
}
} // namespace
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_browser_protocol, Initialize)

View File

@@ -0,0 +1,79 @@
// Copyright (c) 2013 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_PROTOCOL_H_
#define ATOM_BROWSER_API_ATOM_API_PROTOCOL_H_
#include <string>
#include <map>
#include "atom/browser/api/event_emitter.h"
#include "base/callback.h"
#include "native_mate/handle.h"
namespace net {
class URLRequest;
}
namespace atom {
class AtomURLRequestJobFactory;
namespace api {
class Protocol : public mate::EventEmitter {
public:
typedef base::Callback<v8::Handle<v8::Value>(const net::URLRequest*)>
JsProtocolHandler;
static mate::Handle<Protocol> Create(v8::Isolate* isolate);
JsProtocolHandler GetProtocolHandler(const std::string& scheme);
protected:
Protocol();
// mate::Wrappable implementations:
virtual mate::ObjectTemplateBuilder GetObjectTemplateBuilder(
v8::Isolate* isolate);
private:
typedef std::map<std::string, JsProtocolHandler> ProtocolHandlersMap;
// Register/unregister an networking |scheme| which would be handled by
// |callback|.
void RegisterProtocol(const std::string& scheme,
const JsProtocolHandler& callback);
void UnregisterProtocol(const std::string& scheme);
// Returns whether a scheme has been registered.
// FIXME Should accept a callback and be asynchronous so we do not have to use
// locks.
bool IsHandledProtocol(const std::string& scheme);
// Intercept/unintercept an existing protocol handler.
void InterceptProtocol(const std::string& scheme,
const JsProtocolHandler& callback);
void UninterceptProtocol(const std::string& scheme);
// The networking related operations have to be done in IO thread.
void RegisterProtocolInIO(const std::string& scheme);
void UnregisterProtocolInIO(const std::string& scheme);
void InterceptProtocolInIO(const std::string& scheme);
void UninterceptProtocolInIO(const std::string& scheme);
// Do protocol.emit(event, parameter) under UI thread.
void EmitEventInUI(const std::string& event, const std::string& parameter);
AtomURLRequestJobFactory* job_factory_;
ProtocolHandlersMap protocol_handlers_;
DISALLOW_COPY_AND_ASSIGN(Protocol);
};
} // namespace api
} // namespace atom
#endif // ATOM_BROWSER_API_ATOM_API_PROTOCOL_H_

View File

@@ -0,0 +1,149 @@
// Copyright (c) 2013 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "atom/browser/api/atom_api_screen.h"
#include <algorithm>
#include <string>
#include "atom/browser/browser.h"
#include "atom/common/native_mate_converters/gfx_converter.h"
#include "base/bind.h"
#include "native_mate/dictionary.h"
#include "native_mate/object_template_builder.h"
#include "ui/gfx/screen.h"
#include "atom/common/node_includes.h"
namespace atom {
namespace api {
namespace {
// Find an item in container according to its ID.
template<class T>
typename T::iterator FindById(T* container, int id) {
auto predicate = [id] (const typename T::value_type& item) -> bool {
return item.id() == id;
};
return std::find_if(container->begin(), container->end(), predicate);
}
// Convert the changed_metrics bitmask to string array.
std::vector<std::string> MetricsToArray(uint32_t metrics) {
std::vector<std::string> array;
if (metrics & gfx::DisplayObserver::DISPLAY_METRIC_BOUNDS)
array.push_back("bounds");
if (metrics & gfx::DisplayObserver::DISPLAY_METRIC_WORK_AREA)
array.push_back("workArea");
if (metrics & gfx::DisplayObserver::DISPLAY_METRIC_DEVICE_SCALE_FACTOR)
array.push_back("scaleFactor");
if (metrics & gfx::DisplayObserver::DISPLAY_METRIC_ROTATION)
array.push_back("rotaion");
return array;
}
} // namespace
Screen::Screen(gfx::Screen* screen) : screen_(screen) {
screen_->AddObserver(this);
}
Screen::~Screen() {
screen_->RemoveObserver(this);
}
gfx::Point Screen::GetCursorScreenPoint() {
return screen_->GetCursorScreenPoint();
}
gfx::Display Screen::GetPrimaryDisplay() {
return screen_->GetPrimaryDisplay();
}
std::vector<gfx::Display> Screen::GetAllDisplays() {
// The Screen::GetAllDisplays doesn't update when there is display added or
// removed, so we have to manually maintain the displays_ to make it up to
// date.
if (displays_.size() == 0)
displays_ = screen_->GetAllDisplays();
return displays_;
}
gfx::Display Screen::GetDisplayNearestPoint(const gfx::Point& point) {
return screen_->GetDisplayNearestPoint(point);
}
gfx::Display Screen::GetDisplayMatching(const gfx::Rect& match_rect) {
return screen_->GetDisplayMatching(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::Handle<v8::Value> Screen::Create(v8::Isolate* isolate) {
if (!Browser::Get()->is_ready()) {
isolate->ThrowException(v8::Exception::Error(mate::StringToV8(
isolate, "Can not initialize \"screen\" module before app is ready")));
return v8::Undefined(isolate);
}
gfx::Screen* screen = gfx::Screen::GetNativeScreen();
if (!screen) {
isolate->ThrowException(v8::Exception::Error(mate::StringToV8(
isolate, "Failed to get screen information")));
return v8::Undefined(isolate);
}
return mate::CreateHandle(isolate, new Screen(screen)).ToV8();
}
} // namespace api
} // namespace atom
namespace {
void Initialize(v8::Handle<v8::Object> exports, v8::Handle<v8::Value> unused,
v8::Handle<v8::Context> context, void* priv) {
mate::Dictionary dict(context->GetIsolate(), exports);
dict.Set("screen", atom::api::Screen::Create(context->GetIsolate()));
}
} // namespace
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_common_screen, Initialize)

View File

@@ -0,0 +1,60 @@
// Copyright (c) 2015 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_SCREEN_H_
#define ATOM_BROWSER_API_ATOM_API_SCREEN_H_
#include <vector>
#include "atom/browser/api/event_emitter.h"
#include "native_mate/handle.h"
#include "ui/gfx/display_observer.h"
namespace gfx {
class Point;
class Rect;
class Screen;
}
namespace atom {
namespace api {
class Screen : public mate::EventEmitter,
public gfx::DisplayObserver {
public:
static v8::Handle<v8::Value> Create(v8::Isolate* isolate);
protected:
explicit Screen(gfx::Screen* screen);
virtual ~Screen();
gfx::Point GetCursorScreenPoint();
gfx::Display GetPrimaryDisplay();
std::vector<gfx::Display> GetAllDisplays();
gfx::Display GetDisplayNearestPoint(const gfx::Point& point);
gfx::Display GetDisplayMatching(const gfx::Rect& match_rect);
// gfx::DisplayObserver:
void OnDisplayAdded(const gfx::Display& new_display) override;
void OnDisplayRemoved(const gfx::Display& old_display) override;
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);
};
} // namespace api
} // namespace atom
#endif // ATOM_BROWSER_API_ATOM_API_SCREEN_H_

View File

@@ -0,0 +1,156 @@
// Copyright (c) 2014 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "atom/browser/api/atom_api_tray.h"
#include <string>
#include "atom/browser/api/atom_api_menu.h"
#include "atom/browser/ui/tray_icon.h"
#include "atom/common/native_mate_converters/image_converter.h"
#include "atom/common/native_mate_converters/string16_converter.h"
#include "native_mate/constructor.h"
#include "native_mate/dictionary.h"
#include "ui/gfx/image/image.h"
#include "atom/common/node_includes.h"
namespace atom {
namespace api {
Tray::Tray(const gfx::Image& image)
: tray_icon_(TrayIcon::Create()) {
tray_icon_->SetImage(image);
tray_icon_->AddObserver(this);
}
Tray::~Tray() {
}
// static
mate::Wrappable* Tray::New(const gfx::Image& image) {
return new Tray(image);
}
void Tray::OnClicked() {
Emit("clicked");
}
void Tray::OnDoubleClicked() {
Emit("double-clicked");
}
void Tray::OnBalloonShow() {
Emit("balloon-show");
}
void Tray::OnBalloonClicked() {
Emit("balloon-clicked");
}
void Tray::OnBalloonClosed() {
Emit("balloon-closed");
}
void Tray::Destroy() {
tray_icon_.reset();
}
void Tray::SetImage(mate::Arguments* args, const gfx::Image& image) {
if (!CheckTrayLife(args))
return;
tray_icon_->SetImage(image);
}
void Tray::SetPressedImage(mate::Arguments* args, const gfx::Image& image) {
if (!CheckTrayLife(args))
return;
tray_icon_->SetPressedImage(image);
}
void Tray::SetToolTip(mate::Arguments* args, const std::string& tool_tip) {
if (!CheckTrayLife(args))
return;
tray_icon_->SetToolTip(tool_tip);
}
void Tray::SetTitle(mate::Arguments* args, const std::string& title) {
if (!CheckTrayLife(args))
return;
tray_icon_->SetTitle(title);
}
void Tray::SetHighlightMode(mate::Arguments* args, bool highlight) {
if (!CheckTrayLife(args))
return;
tray_icon_->SetHighlightMode(highlight);
}
void Tray::DisplayBalloon(mate::Arguments* args,
const mate::Dictionary& options) {
if (!CheckTrayLife(args))
return;
gfx::Image icon;
options.Get("icon", &icon);
base::string16 title, content;
if (!options.Get("title", &title) ||
!options.Get("content", &content)) {
args->ThrowError("'title' and 'content' must be defined");
return;
}
tray_icon_->DisplayBalloon(icon, title, content);
}
void Tray::SetContextMenu(mate::Arguments* args, Menu* menu) {
if (!CheckTrayLife(args))
return;
tray_icon_->SetContextMenu(menu->model());
}
bool Tray::CheckTrayLife(mate::Arguments* args) {
if (!tray_icon_) {
args->ThrowError("Tray is already destroyed");
return false;
} else {
return true;
}
}
// static
void Tray::BuildPrototype(v8::Isolate* isolate,
v8::Handle<v8::ObjectTemplate> prototype) {
mate::ObjectTemplateBuilder(isolate, prototype)
.SetMethod("destroy", &Tray::Destroy)
.SetMethod("setImage", &Tray::SetImage)
.SetMethod("setPressedImage", &Tray::SetPressedImage)
.SetMethod("setToolTip", &Tray::SetToolTip)
.SetMethod("setTitle", &Tray::SetTitle)
.SetMethod("setHighlightMode", &Tray::SetHighlightMode)
.SetMethod("displayBalloon", &Tray::DisplayBalloon)
.SetMethod("_setContextMenu", &Tray::SetContextMenu);
}
} // namespace api
} // namespace atom
namespace {
void Initialize(v8::Handle<v8::Object> exports, v8::Handle<v8::Value> unused,
v8::Handle<v8::Context> context, void* priv) {
using atom::api::Tray;
v8::Isolate* isolate = context->GetIsolate();
v8::Handle<v8::Function> constructor = mate::CreateConstructor<Tray>(
isolate, "Tray", base::Bind(&Tray::New));
mate::Dictionary dict(isolate, exports);
dict.Set("Tray", static_cast<v8::Handle<v8::Value>>(constructor));
}
} // namespace
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_browser_tray, Initialize)

View File

@@ -0,0 +1,71 @@
// Copyright (c) 2014 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_TRAY_H_
#define ATOM_BROWSER_API_ATOM_API_TRAY_H_
#include <string>
#include "atom/browser/api/event_emitter.h"
#include "atom/browser/ui/tray_icon_observer.h"
#include "base/memory/scoped_ptr.h"
namespace gfx {
class Image;
}
namespace mate {
class Arguments;
class Dictionary;
}
namespace atom {
class TrayIcon;
namespace api {
class Menu;
class Tray : public mate::EventEmitter,
public TrayIconObserver {
public:
static mate::Wrappable* New(const gfx::Image& image);
static void BuildPrototype(v8::Isolate* isolate,
v8::Handle<v8::ObjectTemplate> prototype);
protected:
explicit Tray(const gfx::Image& image);
virtual ~Tray();
// TrayIconObserver:
void OnClicked() override;
void OnDoubleClicked() override;
void OnBalloonShow() override;
void OnBalloonClicked() override;
void OnBalloonClosed() override;
void Destroy();
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 DisplayBalloon(mate::Arguments* args, const mate::Dictionary& options);
void SetContextMenu(mate::Arguments* args, Menu* menu);
private:
bool CheckTrayLife(mate::Arguments* args);
scoped_ptr<TrayIcon> tray_icon_;
DISALLOW_COPY_AND_ASSIGN(Tray);
};
} // namespace api
} // namespace atom
#endif // ATOM_BROWSER_API_ATOM_API_TRAY_H_

View File

@@ -0,0 +1,642 @@
// Copyright (c) 2014 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "atom/browser/api/atom_api_web_contents.h"
#include "atom/browser/atom_browser_context.h"
#include "atom/browser/native_window.h"
#include "atom/browser/web_dialog_helper.h"
#include "atom/browser/web_view_manager.h"
#include "atom/common/api/api_messages.h"
#include "atom/common/native_mate_converters/gfx_converter.h"
#include "atom/common/native_mate_converters/gurl_converter.h"
#include "atom/common/native_mate_converters/string16_converter.h"
#include "atom/common/native_mate_converters/value_converter.h"
#include "base/strings/utf_string_conversions.h"
#include "brightray/browser/inspectable_web_contents.h"
#include "content/public/browser/navigation_details.h"
#include "content/public/browser/navigation_entry.h"
#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_view.h"
#include "content/public/browser/resource_request_details.h"
#include "content/public/browser/site_instance.h"
#include "content/public/browser/web_contents.h"
#include "native_mate/dictionary.h"
#include "native_mate/object_template_builder.h"
#include "vendor/brightray/browser/media/media_stream_devices_controller.h"
#include "atom/common/node_includes.h"
namespace atom {
namespace api {
namespace {
v8::Persistent<v8::ObjectTemplate> template_;
// Get the window that has the |guest| embedded.
NativeWindow* GetWindowFromGuest(const content::WebContents* guest) {
WebViewManager::WebViewInfo info;
if (WebViewManager::GetInfoForProcess(guest->GetRenderProcessHost(), &info))
return NativeWindow::FromRenderView(
info.embedder->GetRenderProcessHost()->GetID(),
info.embedder->GetRoutingID());
else
return nullptr;
}
} // namespace
WebContents::WebContents(content::WebContents* web_contents)
: content::WebContentsObserver(web_contents),
guest_instance_id_(-1),
element_instance_id_(-1),
guest_opaque_(true),
guest_sizer_(nullptr),
auto_size_enabled_(false) {
}
WebContents::WebContents(const mate::Dictionary& options)
: guest_instance_id_(-1),
element_instance_id_(-1),
guest_opaque_(true),
guest_sizer_(nullptr),
auto_size_enabled_(false) {
options.Get("guestInstanceId", &guest_instance_id_);
auto browser_context = AtomBrowserContext::Get();
content::SiteInstance* site_instance = content::SiteInstance::CreateForURL(
browser_context, GURL("chrome-guest://fake-host"));
content::WebContents::CreateParams params(browser_context, site_instance);
bool is_guest;
if (options.Get("isGuest", &is_guest) && is_guest)
params.guest_delegate = this;
storage_.reset(brightray::InspectableWebContents::Create(params));
Observe(storage_->GetWebContents());
web_contents()->SetDelegate(this);
}
WebContents::~WebContents() {
Destroy();
}
bool WebContents::AddMessageToConsole(content::WebContents* source,
int32 level,
const base::string16& message,
int32 line_no,
const base::string16& source_id) {
Emit("console-message", level, message, line_no, source_id);
return true;
}
bool WebContents::ShouldCreateWebContents(
content::WebContents* web_contents,
int route_id,
int main_frame_route_id,
WindowContainerType window_container_type,
const base::string16& frame_name,
const GURL& target_url,
const std::string& partition_id,
content::SessionStorageNamespace* session_storage_namespace) {
Emit("-new-window",
target_url,
frame_name,
static_cast<int>(NEW_FOREGROUND_TAB));
return false;
}
void WebContents::CloseContents(content::WebContents* source) {
Emit("close");
}
content::WebContents* WebContents::OpenURLFromTab(
content::WebContents* source,
const content::OpenURLParams& params) {
if (params.disposition != CURRENT_TAB) {
Emit("-new-window", params.url, "", static_cast<int>(params.disposition));
return nullptr;
}
// Give user a chance to cancel navigation.
if (Emit("will-navigate", params.url))
return nullptr;
content::NavigationController::LoadURLParams load_url_params(params.url);
load_url_params.referrer = params.referrer;
load_url_params.transition_type = params.transition;
load_url_params.extra_headers = params.extra_headers;
load_url_params.should_replace_current_entry =
params.should_replace_current_entry;
load_url_params.is_renderer_initiated = params.is_renderer_initiated;
load_url_params.transferred_global_request_id =
params.transferred_global_request_id;
web_contents()->GetController().LoadURLWithParams(load_url_params);
return web_contents();
}
void WebContents::RunFileChooser(content::WebContents* guest,
const content::FileChooserParams& params) {
if (!web_dialog_helper_)
web_dialog_helper_.reset(new WebDialogHelper(GetWindowFromGuest(guest)));
web_dialog_helper_->RunFileChooser(guest, params);
}
void WebContents::EnumerateDirectory(content::WebContents* guest,
int request_id,
const base::FilePath& path) {
if (!web_dialog_helper_)
web_dialog_helper_.reset(new WebDialogHelper(GetWindowFromGuest(guest)));
web_dialog_helper_->EnumerateDirectory(guest, request_id, path);
}
bool WebContents::CheckMediaAccessPermission(content::WebContents* web_contents,
const GURL& security_origin,
content::MediaStreamType type) {
return true;
}
void WebContents::RequestMediaAccessPermission(
content::WebContents*,
const content::MediaStreamRequest& request,
const content::MediaResponseCallback& callback) {
brightray::MediaStreamDevicesController controller(request, callback);
controller.TakeAction();
}
void WebContents::HandleKeyboardEvent(
content::WebContents* source,
const content::NativeWebKeyboardEvent& event) {
if (!attached())
return;
// Send the unhandled keyboard events back to the embedder to reprocess them.
embedder_web_contents_->GetDelegate()->HandleKeyboardEvent(
web_contents(), event);
}
void WebContents::RenderViewDeleted(content::RenderViewHost* render_view_host) {
Emit("render-view-deleted",
render_view_host->GetProcess()->GetID(),
render_view_host->GetRoutingID());
}
void WebContents::RenderProcessGone(base::TerminationStatus status) {
Emit("crashed");
}
void WebContents::DidFinishLoad(content::RenderFrameHost* render_frame_host,
const GURL& validated_url) {
bool is_main_frame = !render_frame_host->GetParent();
Emit("did-frame-finish-load", is_main_frame);
if (is_main_frame)
Emit("did-finish-load");
}
// this error occurs when host could not be found
void WebContents::DidFailProvisionalLoad(
content::RenderFrameHost* render_frame_host,
const GURL& validated_url,
int error_code,
const base::string16& error_description) {
Emit("did-fail-load", error_code, error_description);
}
void WebContents::DidFailLoad(content::RenderFrameHost* render_frame_host,
const GURL& validated_url,
int error_code,
const base::string16& error_description) {
Emit("did-fail-load", error_code, error_description);
}
void WebContents::DidStartLoading(content::RenderViewHost* render_view_host) {
Emit("did-start-loading");
}
void WebContents::DidStopLoading(content::RenderViewHost* render_view_host) {
Emit("did-stop-loading");
}
void WebContents::DidGetRedirectForResourceRequest(
content::RenderFrameHost* render_frame_host,
const content::ResourceRedirectDetails& details) {
Emit("did-get-redirect-request",
details.url,
details.new_url,
(details.resource_type == content::RESOURCE_TYPE_MAIN_FRAME));
}
void WebContents::DidNavigateMainFrame(
const content::LoadCommittedDetails& details,
const content::FrameNavigateParams& params) {
if (details.is_navigation_to_different_page())
Emit("did-navigate-to-different-page");
}
bool WebContents::OnMessageReceived(const IPC::Message& message) {
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(WebContents, message)
IPC_MESSAGE_HANDLER(AtomViewHostMsg_Message, OnRendererMessage)
IPC_MESSAGE_HANDLER_DELAY_REPLY(AtomViewHostMsg_Message_Sync,
OnRendererMessageSync)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
return handled;
}
void WebContents::RenderViewReady() {
if (!is_guest())
return;
// We don't want to accidentally set the opacity of an interstitial page.
// WebContents::GetRenderWidgetHostView will return the RWHV of an
// interstitial page if one is showing at this time. We only want opacity
// to apply to web pages.
if (guest_opaque_) {
web_contents()
->GetRenderViewHost()
->GetView()
->SetBackgroundColorToDefault();
} else {
web_contents()->GetRenderViewHost()->GetView()->SetBackgroundColor(
SK_ColorTRANSPARENT);
}
}
void WebContents::WebContentsDestroyed() {
// The RenderViewDeleted was not called when the WebContents is destroyed.
RenderViewDeleted(web_contents()->GetRenderViewHost());
Emit("destroyed");
}
void WebContents::NavigationEntryCommitted(
const content::LoadCommittedDetails& load_details) {
auto entry = web_contents()->GetController().GetLastCommittedEntry();
entry->SetVirtualURL(load_details.entry->GetOriginalRequestURL());
}
void WebContents::DidAttach(int guest_proxy_routing_id) {
Emit("did-attach");
}
void WebContents::ElementSizeChanged(const gfx::Size& size) {
element_size_ = size;
// Only resize if needed.
if (!size.IsEmpty())
guest_sizer_->SizeContents(size);
}
content::WebContents* WebContents::GetOwnerWebContents() const {
return embedder_web_contents_;
}
void WebContents::GuestSizeChanged(const gfx::Size& old_size,
const gfx::Size& new_size) {
if (!auto_size_enabled_)
return;
guest_size_ = new_size;
GuestSizeChangedDueToAutoSize(old_size, new_size);
}
void WebContents::RegisterDestructionCallback(
const DestructionCallback& callback) {
destruction_callback_ = callback;
}
void WebContents::SetGuestSizer(content::GuestSizer* guest_sizer) {
guest_sizer_ = guest_sizer;
}
void WebContents::WillAttach(content::WebContents* embedder_web_contents,
int element_instance_id,
bool is_full_page_plugin) {
embedder_web_contents_ = embedder_web_contents;
element_instance_id_ = element_instance_id;
}
void WebContents::Destroy() {
if (storage_) {
if (!destruction_callback_.is_null())
destruction_callback_.Run();
// When force destroying the "destroyed" event is not emitted.
WebContentsDestroyed();
Observe(nullptr);
storage_.reset();
}
}
bool WebContents::IsAlive() const {
return web_contents() != NULL;
}
void WebContents::LoadURL(const GURL& url, const mate::Dictionary& options) {
content::NavigationController::LoadURLParams params(url);
GURL http_referrer;
if (options.Get("httpreferrer", &http_referrer))
params.referrer = content::Referrer(http_referrer.GetAsReferrer(),
blink::WebReferrerPolicyDefault);
params.transition_type = ui::PAGE_TRANSITION_TYPED;
params.override_user_agent = content::NavigationController::UA_OVERRIDE_TRUE;
web_contents()->GetController().LoadURLWithParams(params);
}
GURL WebContents::GetURL() const {
auto entry = web_contents()->GetController().GetLastCommittedEntry();
return entry->GetVirtualURL();
}
base::string16 WebContents::GetTitle() const {
return web_contents()->GetTitle();
}
bool WebContents::IsLoading() const {
return web_contents()->IsLoading();
}
bool WebContents::IsWaitingForResponse() const {
return web_contents()->IsWaitingForResponse();
}
void WebContents::Stop() {
web_contents()->Stop();
}
void WebContents::Reload(const mate::Dictionary& options) {
// Navigating to a URL would always restart the renderer process, we want this
// because normal reloading will break our node integration.
// This is done by AtomBrowserClient::ShouldSwapProcessesForNavigation.
LoadURL(GetURL(), options);
}
void WebContents::ReloadIgnoringCache(const mate::Dictionary& options) {
Reload(options);
}
bool WebContents::CanGoBack() const {
return web_contents()->GetController().CanGoBack();
}
bool WebContents::CanGoForward() const {
return web_contents()->GetController().CanGoForward();
}
bool WebContents::CanGoToOffset(int offset) const {
return web_contents()->GetController().CanGoToOffset(offset);
}
void WebContents::GoBack() {
web_contents()->GetController().GoBack();
}
void WebContents::GoForward() {
web_contents()->GetController().GoForward();
}
void WebContents::GoToIndex(int index) {
web_contents()->GetController().GoToIndex(index);
}
void WebContents::GoToOffset(int offset) {
web_contents()->GetController().GoToOffset(offset);
}
int WebContents::GetRoutingID() const {
return web_contents()->GetRoutingID();
}
int WebContents::GetProcessID() const {
return web_contents()->GetRenderProcessHost()->GetID();
}
bool WebContents::IsCrashed() const {
return web_contents()->IsCrashed();
}
void WebContents::SetUserAgent(const std::string& user_agent) {
web_contents()->SetUserAgentOverride(user_agent);
}
void WebContents::InsertCSS(const std::string& css) {
web_contents()->InsertCSS(css);
}
void WebContents::ExecuteJavaScript(const base::string16& code) {
web_contents()->GetMainFrame()->ExecuteJavaScript(code);
}
void WebContents::OpenDevTools() {
storage_->SetCanDock(false);
storage_->ShowDevTools();
}
void WebContents::CloseDevTools() {
storage_->CloseDevTools();
}
bool WebContents::IsDevToolsOpened() {
return storage_->IsDevToolsViewShowing();
}
void WebContents::Undo() {
web_contents()->Undo();
}
void WebContents::Redo() {
web_contents()->Redo();
}
void WebContents::Cut() {
web_contents()->Cut();
}
void WebContents::Copy() {
web_contents()->Copy();
}
void WebContents::Paste() {
web_contents()->Paste();
}
void WebContents::Delete() {
web_contents()->Delete();
}
void WebContents::SelectAll() {
web_contents()->SelectAll();
}
void WebContents::Unselect() {
web_contents()->Unselect();
}
void WebContents::Replace(const base::string16& word) {
web_contents()->Replace(word);
}
void WebContents::ReplaceMisspelling(const base::string16& word) {
web_contents()->ReplaceMisspelling(word);
}
bool WebContents::SendIPCMessage(const base::string16& channel,
const base::ListValue& args) {
return Send(new AtomViewMsg_Message(routing_id(), channel, args));
}
void WebContents::SetAutoSize(bool enabled,
const gfx::Size& min_size,
const gfx::Size& max_size) {
min_auto_size_ = min_size;
min_auto_size_.SetToMin(max_size);
max_auto_size_ = max_size;
max_auto_size_.SetToMax(min_size);
enabled &= !min_auto_size_.IsEmpty() && !max_auto_size_.IsEmpty();
if (!enabled && !auto_size_enabled_)
return;
auto_size_enabled_ = enabled;
if (!attached())
return;
content::RenderViewHost* rvh = web_contents()->GetRenderViewHost();
if (auto_size_enabled_) {
rvh->EnableAutoResize(min_auto_size_, max_auto_size_);
} else {
rvh->DisableAutoResize(element_size_);
guest_size_ = element_size_;
GuestSizeChangedDueToAutoSize(guest_size_, element_size_);
}
}
void WebContents::SetAllowTransparency(bool allow) {
if (guest_opaque_ != allow)
return;
guest_opaque_ = !allow;
if (!web_contents()->GetRenderViewHost()->GetView())
return;
if (guest_opaque_) {
web_contents()
->GetRenderViewHost()
->GetView()
->SetBackgroundColorToDefault();
} else {
web_contents()->GetRenderViewHost()->GetView()->SetBackgroundColor(
SK_ColorTRANSPARENT);
}
}
mate::ObjectTemplateBuilder WebContents::GetObjectTemplateBuilder(
v8::Isolate* isolate) {
if (template_.IsEmpty())
template_.Reset(isolate, mate::ObjectTemplateBuilder(isolate)
.SetMethod("destroy", &WebContents::Destroy)
.SetMethod("isAlive", &WebContents::IsAlive)
.SetMethod("_loadUrl", &WebContents::LoadURL)
.SetMethod("getUrl", &WebContents::GetURL)
.SetMethod("getTitle", &WebContents::GetTitle)
.SetMethod("isLoading", &WebContents::IsLoading)
.SetMethod("isWaitingForResponse", &WebContents::IsWaitingForResponse)
.SetMethod("stop", &WebContents::Stop)
.SetMethod("_reload", &WebContents::Reload)
.SetMethod("_reloadIgnoringCache", &WebContents::ReloadIgnoringCache)
.SetMethod("canGoBack", &WebContents::CanGoBack)
.SetMethod("canGoForward", &WebContents::CanGoForward)
.SetMethod("canGoToOffset", &WebContents::CanGoToOffset)
.SetMethod("goBack", &WebContents::GoBack)
.SetMethod("goForward", &WebContents::GoForward)
.SetMethod("goToIndex", &WebContents::GoToIndex)
.SetMethod("goToOffset", &WebContents::GoToOffset)
.SetMethod("getRoutingId", &WebContents::GetRoutingID)
.SetMethod("getProcessId", &WebContents::GetProcessID)
.SetMethod("isCrashed", &WebContents::IsCrashed)
.SetMethod("setUserAgent", &WebContents::SetUserAgent)
.SetMethod("insertCSS", &WebContents::InsertCSS)
.SetMethod("_executeJavaScript", &WebContents::ExecuteJavaScript)
.SetMethod("openDevTools", &WebContents::OpenDevTools)
.SetMethod("closeDevTools", &WebContents::CloseDevTools)
.SetMethod("isDevToolsOpened", &WebContents::IsDevToolsOpened)
.SetMethod("undo", &WebContents::Undo)
.SetMethod("redo", &WebContents::Redo)
.SetMethod("cut", &WebContents::Cut)
.SetMethod("copy", &WebContents::Copy)
.SetMethod("paste", &WebContents::Paste)
.SetMethod("delete", &WebContents::Delete)
.SetMethod("selectAll", &WebContents::SelectAll)
.SetMethod("unselect", &WebContents::Unselect)
.SetMethod("replace", &WebContents::Replace)
.SetMethod("replaceMisspelling", &WebContents::ReplaceMisspelling)
.SetMethod("_send", &WebContents::SendIPCMessage)
.SetMethod("setAutoSize", &WebContents::SetAutoSize)
.SetMethod("setAllowTransparency", &WebContents::SetAllowTransparency)
.SetMethod("isGuest", &WebContents::is_guest)
.Build());
return mate::ObjectTemplateBuilder(
isolate, v8::Local<v8::ObjectTemplate>::New(isolate, template_));
}
void WebContents::OnRendererMessage(const base::string16& channel,
const base::ListValue& args) {
// webContents.emit(channel, new Event(), args...);
Emit(base::UTF16ToUTF8(channel), args);
}
void WebContents::OnRendererMessageSync(const base::string16& channel,
const base::ListValue& args,
IPC::Message* message) {
// webContents.emit(channel, new Event(sender, message), args...);
EmitWithSender(base::UTF16ToUTF8(channel), web_contents(), message, args);
}
void WebContents::GuestSizeChangedDueToAutoSize(const gfx::Size& old_size,
const gfx::Size& new_size) {
Emit("size-changed",
old_size.width(), old_size.height(),
new_size.width(), new_size.height());
}
// static
mate::Handle<WebContents> WebContents::CreateFrom(
v8::Isolate* isolate, content::WebContents* web_contents) {
return mate::CreateHandle(isolate, new WebContents(web_contents));
}
// static
mate::Handle<WebContents> WebContents::Create(
v8::Isolate* isolate, const mate::Dictionary& options) {
return mate::CreateHandle(isolate, new WebContents(options));
}
} // namespace api
} // namespace atom
namespace {
void Initialize(v8::Handle<v8::Object> exports, v8::Handle<v8::Value> unused,
v8::Handle<v8::Context> context, void* priv) {
v8::Isolate* isolate = context->GetIsolate();
mate::Dictionary dict(isolate, exports);
dict.SetMethod("create", &atom::api::WebContents::Create);
}
} // namespace
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_browser_web_contents, Initialize)

View File

@@ -0,0 +1,247 @@
// Copyright (c) 2014 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_WEB_CONTENTS_H_
#define ATOM_BROWSER_API_ATOM_API_WEB_CONTENTS_H_
#include <string>
#include "atom/browser/api/event_emitter.h"
#include "brightray/browser/default_web_contents_delegate.h"
#include "content/public/browser/browser_plugin_guest_delegate.h"
#include "content/public/browser/web_contents_delegate.h"
#include "content/public/browser/web_contents_observer.h"
#include "native_mate/handle.h"
namespace brightray {
class InspectableWebContents;
}
namespace mate {
class Dictionary;
}
namespace atom {
class WebDialogHelper;
namespace api {
class WebContents : public mate::EventEmitter,
public content::BrowserPluginGuestDelegate,
public content::WebContentsDelegate,
public content::WebContentsObserver {
public:
// Create from an existing WebContents.
static mate::Handle<WebContents> CreateFrom(
v8::Isolate* isolate, content::WebContents* web_contents);
// Create a new WebContents.
static mate::Handle<WebContents> Create(
v8::Isolate* isolate, const mate::Dictionary& options);
void Destroy();
bool IsAlive() const;
void LoadURL(const GURL& url, const mate::Dictionary& options);
GURL GetURL() const;
base::string16 GetTitle() const;
bool IsLoading() const;
bool IsWaitingForResponse() const;
void Stop();
void Reload(const mate::Dictionary& options);
void ReloadIgnoringCache(const mate::Dictionary& options);
bool CanGoBack() const;
bool CanGoForward() const;
bool CanGoToOffset(int offset) const;
void GoBack();
void GoForward();
void GoToIndex(int index);
void GoToOffset(int offset);
int GetRoutingID() const;
int GetProcessID() const;
bool IsCrashed() const;
void SetUserAgent(const std::string& user_agent);
void InsertCSS(const std::string& css);
void ExecuteJavaScript(const base::string16& code);
void OpenDevTools();
void CloseDevTools();
bool IsDevToolsOpened();
// Editing commands.
void Undo();
void Redo();
void Cut();
void Copy();
void Paste();
void Delete();
void SelectAll();
void Unselect();
void Replace(const base::string16& word);
void ReplaceMisspelling(const base::string16& word);
// Sending messages to browser.
bool SendIPCMessage(const base::string16& channel,
const base::ListValue& args);
// Toggles autosize mode for corresponding <webview>.
void SetAutoSize(bool enabled,
const gfx::Size& min_size,
const gfx::Size& max_size);
// Sets the transparency of the guest.
void SetAllowTransparency(bool allow);
// Returns whether this is a guest view.
bool is_guest() const { return guest_instance_id_ != -1; }
// Returns whether this guest has an associated embedder.
bool attached() const { return !!embedder_web_contents_; }
content::WebContents* web_contents() const {
return content::WebContentsObserver::web_contents();
}
protected:
explicit WebContents(content::WebContents* web_contents);
explicit WebContents(const mate::Dictionary& options);
~WebContents();
// mate::Wrappable:
mate::ObjectTemplateBuilder GetObjectTemplateBuilder(
v8::Isolate* isolate) override;
// content::WebContentsDelegate:
bool AddMessageToConsole(content::WebContents* source,
int32 level,
const base::string16& message,
int32 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 base::string16& frame_name,
const GURL& target_url,
const std::string& partition_id,
content::SessionStorageNamespace* session_storage_namespace) override;
void CloseContents(content::WebContents* source) override;
content::WebContents* OpenURLFromTab(
content::WebContents* source,
const content::OpenURLParams& params) override;
void RunFileChooser(content::WebContents* web_contents,
const content::FileChooserParams& params) override;
void EnumerateDirectory(content::WebContents* web_contents,
int request_id,
const base::FilePath& path) override;
bool CheckMediaAccessPermission(content::WebContents* web_contents,
const GURL& security_origin,
content::MediaStreamType type) override;
void RequestMediaAccessPermission(
content::WebContents*,
const content::MediaStreamRequest&,
const content::MediaResponseCallback&) override;
void HandleKeyboardEvent(
content::WebContents* source,
const content::NativeWebKeyboardEvent& event) override;
// content::WebContentsObserver:
void RenderViewDeleted(content::RenderViewHost*) override;
void RenderProcessGone(base::TerminationStatus status) override;
void DidFinishLoad(content::RenderFrameHost* render_frame_host,
const GURL& validated_url) override;
void DidFailLoad(content::RenderFrameHost* render_frame_host,
const GURL& validated_url,
int error_code,
const base::string16& error_description) override;
void DidFailProvisionalLoad(content::RenderFrameHost* render_frame_host,
const GURL& validated_url,
int error_code,
const base::string16& error_description) override;
void DidStartLoading(content::RenderViewHost* render_view_host) override;
void DidStopLoading(content::RenderViewHost* render_view_host) override;
void DidGetRedirectForResourceRequest(
content::RenderFrameHost* render_frame_host,
const content::ResourceRedirectDetails& details) override;
void DidNavigateMainFrame(
const content::LoadCommittedDetails& details,
const content::FrameNavigateParams& params) override;
bool OnMessageReceived(const IPC::Message& message) override;
void RenderViewReady() override;
void WebContentsDestroyed() override;
void NavigationEntryCommitted(
const content::LoadCommittedDetails& load_details) override;
// content::BrowserPluginGuestDelegate:
void DidAttach(int guest_proxy_routing_id) final;
void ElementSizeChanged(const gfx::Size& size) final;
content::WebContents* GetOwnerWebContents() const final;
void GuestSizeChanged(const gfx::Size& old_size,
const gfx::Size& new_size) final;
void RegisterDestructionCallback(const DestructionCallback& callback) final;
void SetGuestSizer(content::GuestSizer* guest_sizer) final;
void WillAttach(content::WebContents* embedder_web_contents,
int element_instance_id,
bool is_full_page_plugin) final;
private:
// Called when received a message from renderer.
void OnRendererMessage(const base::string16& channel,
const base::ListValue& args);
// Called when received a synchronous message from renderer.
void OnRendererMessageSync(const base::string16& channel,
const base::ListValue& args,
IPC::Message* message);
void GuestSizeChangedDueToAutoSize(const gfx::Size& old_size,
const gfx::Size& new_size);
scoped_ptr<WebDialogHelper> web_dialog_helper_;
// Unique ID for a guest WebContents.
int guest_instance_id_;
// |element_instance_id_| is an identifer that's unique to a particular
// element.
int element_instance_id_;
DestructionCallback destruction_callback_;
// Stores whether the contents of the guest can be transparent.
bool guest_opaque_;
// Stores the WebContents that managed by this class.
scoped_ptr<brightray::InspectableWebContents> storage_;
// The WebContents that attaches this guest view.
content::WebContents* embedder_web_contents_;
// The size of the container element.
gfx::Size element_size_;
// The size of the guest content. Note: In autosize mode, the container
// element may not match the size of the guest.
gfx::Size guest_size_;
// A pointer to the guest_sizer.
content::GuestSizer* guest_sizer_;
// Indicates whether autosize mode is enabled or not.
bool auto_size_enabled_;
// The maximum size constraints of the container element in autosize mode.
gfx::Size max_auto_size_;
// The minimum size constraints of the container element in autosize mode.
gfx::Size min_auto_size_;
DISALLOW_COPY_AND_ASSIGN(WebContents);
};
} // namespace api
} // namespace atom
#endif // ATOM_BROWSER_API_ATOM_API_WEB_CONTENTS_H_

View File

@@ -0,0 +1,93 @@
// Copyright (c) 2015 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_web_contents.h"
#include "atom/browser/web_view_manager.h"
#include "atom/common/native_mate_converters/gurl_converter.h"
#include "content/public/browser/browser_context.h"
#include "native_mate/dictionary.h"
#include "net/base/filename_util.h"
#include "atom/common/node_includes.h"
namespace mate {
template<>
struct Converter<content::WebContents*> {
static bool FromV8(v8::Isolate* isolate, v8::Handle<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;
}
};
template<>
struct Converter<atom::WebViewManager::WebViewInfo> {
static bool FromV8(v8::Isolate* isolate, v8::Handle<v8::Value> val,
atom::WebViewManager::WebViewInfo* out) {
Dictionary options;
if (!ConvertFromV8(isolate, val, &options))
return false;
GURL preload_url;
if (!options.Get("preloadUrl", &preload_url))
return false;
if (!preload_url.is_empty() &&
!net::FileURLToFilePath(preload_url, &(out->preload_script)))
return false;
return options.Get("nodeIntegration", &(out->node_integration)) &&
options.Get("plugins", &(out->plugins)) &&
options.Get("disableWebSecurity", &(out->disable_web_security));
}
};
} // 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,
atom::WebViewManager::WebViewInfo info) {
auto manager = GetWebViewManager(embedder);
if (manager) {
info.guest_instance_id = guest_instance_id;
info.embedder = embedder;
manager->AddGuest(guest_instance_id, element_instance_id, embedder,
guest_web_contents, info);
}
}
void RemoveGuest(content::WebContents* embedder, int guest_instance_id) {
auto manager = GetWebViewManager(embedder);
if (manager)
manager->RemoveGuest(guest_instance_id);
}
void Initialize(v8::Handle<v8::Object> exports, v8::Handle<v8::Value> unused,
v8::Handle<v8::Context> context, void* priv) {
mate::Dictionary dict(context->GetIsolate(), exports);
dict.SetMethod("addGuest", &AddGuest);
dict.SetMethod("removeGuest", &RemoveGuest);
}
} // namespace
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_browser_web_view_manager, Initialize)

View File

@@ -0,0 +1,524 @@
// Copyright (c) 2013 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "atom/browser/api/atom_api_window.h"
#include "atom/browser/api/atom_api_web_contents.h"
#include "atom/browser/browser.h"
#include "atom/browser/native_window.h"
#include "atom/common/native_mate_converters/gfx_converter.h"
#include "atom/common/native_mate_converters/gurl_converter.h"
#include "atom/common/native_mate_converters/image_converter.h"
#include "atom/common/native_mate_converters/string16_converter.h"
#include "content/public/browser/render_process_host.h"
#include "native_mate/callback.h"
#include "native_mate/constructor.h"
#include "native_mate/dictionary.h"
#include "atom/common/node_includes.h"
namespace {
struct PrintSettings {
bool silent;
bool print_background;
};
} // namespace
namespace mate {
template<>
struct Converter<PrintSettings> {
static bool FromV8(v8::Isolate* isolate, v8::Handle<v8::Value> val,
PrintSettings* out) {
mate::Dictionary dict;
if (!ConvertFromV8(isolate, val, &dict))
return false;
dict.Get("silent", &(out->silent));
dict.Get("printBackground", &(out->print_background));
return true;
}
};
} // namespace mate
namespace atom {
namespace api {
namespace {
void OnCapturePageDone(
v8::Isolate* isolate,
const base::Callback<void(const gfx::Image&)>& callback,
const SkBitmap& bitmap) {
v8::Locker locker(isolate);
v8::HandleScope handle_scope(isolate);
callback.Run(gfx::Image::CreateFrom1xBitmap(bitmap));
}
} // namespace
Window::Window(const mate::Dictionary& options)
: window_(NativeWindow::Create(options)) {
window_->InitFromOptions(options);
window_->AddObserver(this);
}
Window::~Window() {
if (window_)
Destroy();
}
void Window::OnPageTitleUpdated(bool* prevent_default,
const std::string& title) {
*prevent_default = Emit("page-title-updated", title);
}
void Window::WillCreatePopupWindow(const base::string16& frame_name,
const GURL& target_url,
const std::string& partition_id,
WindowOpenDisposition disposition) {
Emit("-new-window", target_url, frame_name, static_cast<int>(disposition));
}
void Window::WillNavigate(bool* prevent_default, const GURL& url) {
*prevent_default = Emit("-will-navigate", url);
}
void Window::WillCloseWindow(bool* prevent_default) {
*prevent_default = Emit("close");
}
void Window::OnWindowClosed() {
Emit("closed");
window_->RemoveObserver(this);
}
void Window::OnWindowBlur() {
Emit("blur");
}
void Window::OnWindowFocus() {
Emit("focus");
}
void Window::OnWindowMaximize() {
Emit("maximize");
}
void Window::OnWindowUnmaximize() {
Emit("unmaximize");
}
void Window::OnWindowMinimize() {
Emit("minimize");
}
void Window::OnWindowRestore() {
Emit("restore");
}
void Window::OnWindowEnterFullScreen() {
Emit("enter-full-screen");
}
void Window::OnWindowLeaveFullScreen() {
Emit("leave-full-screen");
}
void Window::OnRendererUnresponsive() {
Emit("unresponsive");
}
void Window::OnRendererResponsive() {
Emit("responsive");
}
// static
mate::Wrappable* Window::New(v8::Isolate* isolate,
const mate::Dictionary& options) {
if (Browser::Get()->is_ready()) {
return new Window(options);
} else {
isolate->ThrowException(v8::Exception::TypeError(mate::StringToV8(
isolate, "Can not create BrowserWindow before app is ready")));
return nullptr;
}
}
void Window::Destroy() {
window_->DestroyWebContents();
window_->CloseImmediately();
}
void Window::Close() {
window_->Close();
}
bool Window::IsClosed() {
return window_->IsClosed();
}
void Window::Focus() {
window_->Focus(true);
}
bool Window::IsFocused() {
return window_->IsFocused();
}
void Window::Show() {
window_->Show();
}
void Window::ShowInactive() {
window_->ShowInactive();
}
void Window::Hide() {
window_->Hide();
}
bool Window::IsVisible() {
return window_->IsVisible();
}
void Window::Maximize() {
window_->Maximize();
}
void Window::Unmaximize() {
window_->Unmaximize();
}
bool Window::IsMaximized() {
return window_->IsMaximized();
}
void Window::Minimize() {
window_->Minimize();
}
void Window::Restore() {
window_->Restore();
}
bool Window::IsMinimized() {
return window_->IsMinimized();
}
void Window::SetFullScreen(bool fullscreen) {
window_->SetFullScreen(fullscreen);
}
bool Window::IsFullscreen() {
return window_->IsFullscreen();
}
void Window::SetSize(int width, int height) {
window_->SetSize(gfx::Size(width, height));
}
std::vector<int> Window::GetSize() {
std::vector<int> result(2);
gfx::Size size = window_->GetSize();
result[0] = size.width();
result[1] = size.height();
return result;
}
void Window::SetContentSize(int width, int height) {
window_->SetContentSize(gfx::Size(width, height));
}
std::vector<int> Window::GetContentSize() {
std::vector<int> result(2);
gfx::Size size = window_->GetContentSize();
result[0] = size.width();
result[1] = size.height();
return result;
}
void Window::SetMinimumSize(int width, int height) {
window_->SetMinimumSize(gfx::Size(width, height));
}
std::vector<int> Window::GetMinimumSize() {
std::vector<int> result(2);
gfx::Size size = window_->GetMinimumSize();
result[0] = size.width();
result[1] = size.height();
return result;
}
void Window::SetMaximumSize(int width, int height) {
window_->SetMaximumSize(gfx::Size(width, height));
}
std::vector<int> Window::GetMaximumSize() {
std::vector<int> result(2);
gfx::Size size = window_->GetMaximumSize();
result[0] = size.width();
result[1] = size.height();
return result;
}
void Window::SetResizable(bool resizable) {
window_->SetResizable(resizable);
}
bool Window::IsResizable() {
return window_->IsResizable();
}
void Window::SetAlwaysOnTop(bool top) {
window_->SetAlwaysOnTop(top);
}
bool Window::IsAlwaysOnTop() {
return window_->IsAlwaysOnTop();
}
void Window::Center() {
window_->Center();
}
void Window::SetPosition(int x, int y) {
window_->SetPosition(gfx::Point(x, y));
}
std::vector<int> Window::GetPosition() {
std::vector<int> result(2);
gfx::Point pos = window_->GetPosition();
result[0] = pos.x();
result[1] = pos.y();
return result;
}
void Window::SetTitle(const std::string& title) {
window_->SetTitle(title);
}
std::string Window::GetTitle() {
return window_->GetTitle();
}
void Window::FlashFrame(bool flash) {
window_->FlashFrame(flash);
}
void Window::SetSkipTaskbar(bool skip) {
window_->SetSkipTaskbar(skip);
}
void Window::SetKiosk(bool kiosk) {
window_->SetKiosk(kiosk);
}
bool Window::IsKiosk() {
return window_->IsKiosk();
}
void Window::OpenDevTools() {
window_->OpenDevTools();
}
void Window::CloseDevTools() {
window_->CloseDevTools();
}
bool Window::IsDevToolsOpened() {
return window_->IsDevToolsOpened();
}
void Window::InspectElement(int x, int y) {
window_->InspectElement(x, y);
}
void Window::FocusOnWebView() {
window_->FocusOnWebView();
}
void Window::BlurWebView() {
window_->BlurWebView();
}
bool Window::IsWebViewFocused() {
return window_->IsWebViewFocused();
}
void Window::SetRepresentedFilename(const std::string& filename) {
window_->SetRepresentedFilename(filename);
}
std::string Window::GetRepresentedFilename() {
return window_->GetRepresentedFilename();
}
void Window::SetDocumentEdited(bool edited) {
window_->SetDocumentEdited(edited);
}
bool Window::IsDocumentEdited() {
return window_->IsDocumentEdited();
}
void Window::CapturePage(mate::Arguments* args) {
gfx::Rect rect;
base::Callback<void(const gfx::Image&)> callback;
if (!(args->Length() == 1 && args->GetNext(&callback)) &&
!(args->Length() == 2 && args->GetNext(&rect)
&& args->GetNext(&callback))) {
args->ThrowError();
return;
}
window_->CapturePage(
rect, base::Bind(&OnCapturePageDone, args->isolate(), callback));
}
void Window::Print(mate::Arguments* args) {
PrintSettings settings = { false, false };;
if (args->Length() == 1 && !args->GetNext(&settings)) {
args->ThrowError();
return;
}
window_->Print(settings.silent, settings.print_background);
}
void Window::SetProgressBar(double progress) {
window_->SetProgressBar(progress);
}
void Window::SetOverlayIcon(const gfx::Image& overlay,
const std::string& description) {
window_->SetOverlayIcon(overlay, description);
}
void Window::SetAutoHideMenuBar(bool auto_hide) {
window_->SetAutoHideMenuBar(auto_hide);
}
bool Window::IsMenuBarAutoHide() {
return window_->IsMenuBarAutoHide();
}
void Window::SetMenuBarVisibility(bool visible) {
window_->SetMenuBarVisibility(visible);
}
bool Window::IsMenuBarVisible() {
return window_->IsMenuBarVisible();
}
#if defined(OS_MACOSX)
void Window::ShowDefinitionForSelection() {
window_->ShowDefinitionForSelection();
}
#endif
mate::Handle<WebContents> Window::GetWebContents(v8::Isolate* isolate) const {
return WebContents::CreateFrom(isolate, window_->GetWebContents());
}
mate::Handle<WebContents> Window::GetDevToolsWebContents(
v8::Isolate* isolate) const {
return WebContents::CreateFrom(isolate, window_->GetDevToolsWebContents());
}
// static
void Window::BuildPrototype(v8::Isolate* isolate,
v8::Handle<v8::ObjectTemplate> prototype) {
mate::ObjectTemplateBuilder(isolate, prototype)
.SetMethod("destroy", &Window::Destroy)
.SetMethod("close", &Window::Close)
.SetMethod("isClosed", &Window::IsClosed)
.SetMethod("focus", &Window::Focus)
.SetMethod("isFocused", &Window::IsFocused)
.SetMethod("show", &Window::Show)
.SetMethod("showInactive", &Window::ShowInactive)
.SetMethod("hide", &Window::Hide)
.SetMethod("isVisible", &Window::IsVisible)
.SetMethod("maximize", &Window::Maximize)
.SetMethod("unmaximize", &Window::Unmaximize)
.SetMethod("isMaximized", &Window::IsMaximized)
.SetMethod("minimize", &Window::Minimize)
.SetMethod("restore", &Window::Restore)
.SetMethod("isMinimized", &Window::IsMinimized)
.SetMethod("setFullScreen", &Window::SetFullScreen)
.SetMethod("isFullScreen", &Window::IsFullscreen)
.SetMethod("getSize", &Window::GetSize)
.SetMethod("setSize", &Window::SetSize)
.SetMethod("getContentSize", &Window::GetContentSize)
.SetMethod("setContentSize", &Window::SetContentSize)
.SetMethod("setMinimumSize", &Window::SetMinimumSize)
.SetMethod("getMinimumSize", &Window::GetMinimumSize)
.SetMethod("setMaximumSize", &Window::SetMaximumSize)
.SetMethod("getMaximumSize", &Window::GetMaximumSize)
.SetMethod("setResizable", &Window::SetResizable)
.SetMethod("isResizable", &Window::IsResizable)
.SetMethod("setAlwaysOnTop", &Window::SetAlwaysOnTop)
.SetMethod("isAlwaysOnTop", &Window::IsAlwaysOnTop)
.SetMethod("center", &Window::Center)
.SetMethod("setPosition", &Window::SetPosition)
.SetMethod("getPosition", &Window::GetPosition)
.SetMethod("setTitle", &Window::SetTitle)
.SetMethod("getTitle", &Window::GetTitle)
.SetMethod("flashFrame", &Window::FlashFrame)
.SetMethod("setSkipTaskbar", &Window::SetSkipTaskbar)
.SetMethod("setKiosk", &Window::SetKiosk)
.SetMethod("isKiosk", &Window::IsKiosk)
.SetMethod("setRepresentedFilename", &Window::SetRepresentedFilename)
.SetMethod("getRepresentedFilename", &Window::GetRepresentedFilename)
.SetMethod("setDocumentEdited", &Window::SetDocumentEdited)
.SetMethod("isDocumentEdited", &Window::IsDocumentEdited)
.SetMethod("_openDevTools", &Window::OpenDevTools)
.SetMethod("closeDevTools", &Window::CloseDevTools)
.SetMethod("isDevToolsOpened", &Window::IsDevToolsOpened)
.SetMethod("inspectElement", &Window::InspectElement)
.SetMethod("focusOnWebView", &Window::FocusOnWebView)
.SetMethod("blurWebView", &Window::BlurWebView)
.SetMethod("isWebViewFocused", &Window::IsWebViewFocused)
.SetMethod("capturePage", &Window::CapturePage)
.SetMethod("print", &Window::Print)
.SetMethod("setProgressBar", &Window::SetProgressBar)
.SetMethod("setOverlayIcon", &Window::SetOverlayIcon)
.SetMethod("setAutoHideMenuBar", &Window::SetAutoHideMenuBar)
.SetMethod("isMenuBarAutoHide", &Window::IsMenuBarAutoHide)
.SetMethod("setMenuBarVisibility", &Window::SetMenuBarVisibility)
.SetMethod("isMenuBarVisible", &Window::IsMenuBarVisible)
#if defined(OS_MACOSX)
.SetMethod("showDefinitionForSelection",
&Window::ShowDefinitionForSelection)
#endif
.SetMethod("_getWebContents", &Window::GetWebContents)
.SetMethod("_getDevToolsWebContents", &Window::GetDevToolsWebContents);
}
} // namespace api
} // namespace atom
namespace {
void Initialize(v8::Handle<v8::Object> exports, v8::Handle<v8::Value> unused,
v8::Handle<v8::Context> context, void* priv) {
using atom::api::Window;
v8::Isolate* isolate = context->GetIsolate();
v8::Local<v8::Function> constructor = mate::CreateConstructor<Window>(
isolate, "BrowserWindow", base::Bind(&Window::New));
mate::Dictionary dict(isolate, exports);
dict.Set("BrowserWindow", static_cast<v8::Handle<v8::Value>>(constructor));
}
} // namespace
NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_browser_window, Initialize)

View File

@@ -0,0 +1,169 @@
// Copyright (c) 2013 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_WINDOW_H_
#define ATOM_BROWSER_API_ATOM_API_WINDOW_H_
#include <string>
#include <vector>
#include "base/memory/scoped_ptr.h"
#include "ui/gfx/image/image.h"
#include "atom/browser/native_window_observer.h"
#include "atom/browser/api/event_emitter.h"
#include "native_mate/handle.h"
class GURL;
namespace mate {
class Arguments;
class Dictionary;
}
namespace atom {
class NativeWindow;
namespace api {
class WebContents;
class Window : public mate::EventEmitter,
public NativeWindowObserver {
public:
static mate::Wrappable* New(v8::Isolate* isolate,
const mate::Dictionary& options);
static void BuildPrototype(v8::Isolate* isolate,
v8::Handle<v8::ObjectTemplate> prototype);
NativeWindow* window() const { return window_.get(); }
protected:
explicit Window(const mate::Dictionary& options);
virtual ~Window();
// NativeWindowObserver:
void OnPageTitleUpdated(bool* prevent_default,
const std::string& title) override;
void WillCreatePopupWindow(const base::string16& frame_name,
const GURL& target_url,
const std::string& partition_id,
WindowOpenDisposition disposition) override;
void WillNavigate(bool* prevent_default, const GURL& url) override;
void WillCloseWindow(bool* prevent_default) override;
void OnWindowClosed() override;
void OnWindowBlur() override;
void OnWindowFocus() override;
void OnWindowMaximize() override;
void OnWindowUnmaximize() override;
void OnWindowMinimize() override;
void OnWindowRestore() override;
void OnWindowEnterFullScreen() override;
void OnWindowLeaveFullScreen() override;
void OnRendererUnresponsive() override;
void OnRendererResponsive() override;
private:
// APIs for NativeWindow.
void Destroy();
void Close();
bool IsClosed();
void Focus();
bool IsFocused();
void Show();
void ShowInactive();
void Hide();
bool IsVisible();
void Maximize();
void Unmaximize();
bool IsMaximized();
void Minimize();
void Restore();
bool IsMinimized();
void SetFullScreen(bool fullscreen);
bool IsFullscreen();
void SetSize(int width, int height);
std::vector<int> GetSize();
void SetContentSize(int width, int height);
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 SetResizable(bool resizable);
bool IsResizable();
void SetAlwaysOnTop(bool top);
bool IsAlwaysOnTop();
void Center();
void SetPosition(int x, int y);
std::vector<int> GetPosition();
void SetTitle(const std::string& title);
std::string GetTitle();
void FlashFrame(bool flash);
void SetSkipTaskbar(bool skip);
void SetKiosk(bool kiosk);
bool IsKiosk();
void OpenDevTools();
void CloseDevTools();
bool IsDevToolsOpened();
void InspectElement(int x, int y);
void FocusOnWebView();
void BlurWebView();
bool IsWebViewFocused();
void SetRepresentedFilename(const std::string& filename);
std::string GetRepresentedFilename();
void SetDocumentEdited(bool edited);
bool IsDocumentEdited();
void CapturePage(mate::Arguments* args);
void Print(mate::Arguments* args);
void SetProgressBar(double progress);
void SetOverlayIcon(const gfx::Image& overlay,
const std::string& description);
void SetAutoHideMenuBar(bool auto_hide);
bool IsMenuBarAutoHide();
void SetMenuBarVisibility(bool visible);
bool IsMenuBarVisible();
#if defined(OS_MACOSX)
void ShowDefinitionForSelection();
#endif
// APIs for WebContents.
mate::Handle<WebContents> GetWebContents(v8::Isolate* isolate) const;
mate::Handle<WebContents> GetDevToolsWebContents(v8::Isolate* isolate) const;
scoped_ptr<NativeWindow> window_;
DISALLOW_COPY_AND_ASSIGN(Window);
};
} // namespace api
} // namespace atom
namespace mate {
template<>
struct Converter<atom::NativeWindow*> {
static bool FromV8(v8::Isolate* isolate, v8::Handle<v8::Value> val,
atom::NativeWindow** out) {
// null would be tranfered to NULL.
if (val->IsNull()) {
*out = NULL;
return true;
}
atom::api::Window* window;
if (!Converter<atom::api::Window*>::FromV8(isolate, val, &window))
return false;
*out = window->window();
return true;
}
};
} // namespace mate
#endif // ATOM_BROWSER_API_ATOM_API_WINDOW_H_

72
atom/browser/api/event.cc Normal file
View File

@@ -0,0 +1,72 @@
// Copyright (c) 2014 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "atom/browser/api/event.h"
#include "atom/common/api/api_messages.h"
#include "atom/common/native_mate_converters/string16_converter.h"
#include "content/public/browser/web_contents.h"
#include "native_mate/object_template_builder.h"
namespace mate {
namespace {
v8::Persistent<v8::ObjectTemplate> template_;
} // namespace
Event::Event()
: sender_(NULL),
message_(NULL) {
}
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_);
DCHECK(!message_);
sender_ = sender;
message_ = message;
Observe(sender);
}
void Event::WebContentsDestroyed() {
sender_ = NULL;
message_ = NULL;
}
void Event::PreventDefault(v8::Isolate* isolate) {
GetWrapper(isolate)->Set(StringToV8(isolate, "defaultPrevented"),
v8::True(isolate));
}
bool Event::SendReply(const base::string16& json) {
if (message_ == NULL || sender_ == NULL)
return false;
AtomViewHostMsg_Message_Sync::WriteReplyParams(message_, json);
return sender_->Send(message_);
}
// static
Handle<Event> Event::Create(v8::Isolate* isolate) {
return CreateHandle(isolate, new Event);
}
} // namespace mate

52
atom/browser/api/event.h Normal file
View File

@@ -0,0 +1,52 @@
// Copyright (c) 2014 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef ATOM_BROWSER_API_EVENT_H_
#define ATOM_BROWSER_API_EVENT_H_
#include "content/public/browser/web_contents_observer.h"
#include "native_mate/wrappable.h"
#include "native_mate/handle.h"
namespace IPC {
class Message;
}
namespace mate {
class Event : public Wrappable,
public content::WebContentsObserver {
public:
static Handle<Event> Create(v8::Isolate* isolate);
// Pass the sender and message to be replied.
void SetSenderAndMessage(content::WebContents* sender, IPC::Message* message);
// event.PreventDefault().
void PreventDefault(v8::Isolate* isolate);
// event.sendReply(json), used for replying synchronous message.
bool SendReply(const base::string16& json);
protected:
Event();
virtual ~Event();
// Wrappable implementations:
ObjectTemplateBuilder GetObjectTemplateBuilder(v8::Isolate* isolate) override;
// content::WebContentsObserver implementations:
void WebContentsDestroyed() override;
private:
// Replyer for the synchronous messages.
content::WebContents* sender_;
IPC::Message* message_;
DISALLOW_COPY_AND_ASSIGN(Event);
};
} // namespace mate
#endif // ATOM_BROWSER_API_EVENT_H_

View File

@@ -0,0 +1,68 @@
// Copyright (c) 2014 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "atom/browser/api/event_emitter.h"
#include "atom/browser/api/event.h"
#include "native_mate/arguments.h"
#include "native_mate/object_template_builder.h"
#include "atom/common/node_includes.h"
namespace mate {
namespace {
v8::Persistent<v8::ObjectTemplate> event_template;
void PreventDefault(mate::Arguments* args) {
args->GetThis()->Set(StringToV8(args->isolate(), "defaultPrevented"),
v8::True(args->isolate()));
}
// Create a pure JavaScript Event object.
v8::Local<v8::Object> CreateEventObject(v8::Isolate* isolate) {
if (event_template.IsEmpty()) {
event_template.Reset(isolate, ObjectTemplateBuilder(isolate)
.SetMethod("preventDefault", &PreventDefault)
.Build());
}
return v8::Local<v8::ObjectTemplate>::New(
isolate, event_template)->NewInstance();
}
} // namespace
EventEmitter::EventEmitter() {
}
bool EventEmitter::CallEmit(v8::Isolate* isolate,
const base::StringPiece& name,
content::WebContents* sender,
IPC::Message* message,
ValueArray args) {
v8::Handle<v8::Object> event;
bool use_native_event = sender && message;
if (use_native_event) {
mate::Handle<mate::Event> native_event = mate::Event::Create(isolate);
native_event->SetSenderAndMessage(sender, message);
event = v8::Handle<v8::Object>::Cast(native_event.ToV8());
} else {
event = CreateEventObject(isolate);
}
// args = [name, event, args...];
args.insert(args.begin(), event);
args.insert(args.begin(), mate::StringToV8(isolate, name));
// this.emit.apply(this, args);
node::MakeCallback(isolate, GetWrapper(isolate), "emit", args.size(),
&args[0]);
return event->Get(StringToV8(isolate, "defaultPrevented"))->BooleanValue();
}
} // namespace mate

View File

@@ -0,0 +1,63 @@
// Copyright (c) 2014 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef ATOM_BROWSER_API_EVENT_EMITTER_H_
#define ATOM_BROWSER_API_EVENT_EMITTER_H_
#include <vector>
#include "native_mate/wrappable.h"
namespace content {
class WebContents;
}
namespace IPC {
class Message;
}
namespace mate {
// Provide helperers to emit event in JavaScript.
class EventEmitter : public Wrappable {
public:
typedef std::vector<v8::Handle<v8::Value>> ValueArray;
protected:
EventEmitter();
// this.emit(name, new Event(), args...);
template<typename... Args>
bool Emit(const base::StringPiece& name, const Args&... args) {
return EmitWithSender(name, nullptr, nullptr, args...);
}
// this.emit(name, new Event(sender, message), args...);
template<typename... Args>
bool EmitWithSender(const base::StringPiece& name,
content::WebContents* sender,
IPC::Message* message,
const Args&... args) {
v8::Isolate* isolate = v8::Isolate::GetCurrent();
v8::Locker locker(isolate);
v8::HandleScope handle_scope(isolate);
ValueArray converted = { ConvertToV8(isolate, args)... };
return CallEmit(isolate, name, sender, message, converted);
}
private:
// Lower level implementations.
bool CallEmit(v8::Isolate* isolate,
const base::StringPiece& name,
content::WebContents* sender,
IPC::Message* message,
ValueArray args);
DISALLOW_COPY_AND_ASSIGN(EventEmitter);
};
} // namespace mate
#endif // ATOM_BROWSER_API_EVENT_EMITTER_H_

View File

@@ -0,0 +1,37 @@
EventEmitter = require('events').EventEmitter
bindings = process.atomBinding 'app'
app = bindings.app
app.__proto__ = EventEmitter.prototype
app.setApplicationMenu = (menu) ->
require('menu').setApplicationMenu menu
app.getApplicationMenu = ->
require('menu').getApplicationMenu()
app.commandLine =
appendSwitch: bindings.appendSwitch,
appendArgument: bindings.appendArgument
if process.platform is 'darwin'
app.dock =
bounce: (type='informational') -> bindings.dockBounce type
cancelBounce: bindings.dockCancelBounce
setBadge: bindings.dockSetBadgeText
getBadge: bindings.dockGetBadgeText
hide: bindings.dockHide
show: bindings.dockShow
setMenu: bindings.dockSetMenu
# Be compatible with old API.
app.once 'ready', -> app.emit 'finish-launching'
app.terminate = app.quit
app.exit = process.exit
app.getHomeDir = -> app.getPath 'home'
app.getDataPath = -> app.getPath 'userData'
app.setDataPath = (path) -> app.setPath 'userData', path
# Only one App object pemitted.
module.exports = app

View File

@@ -0,0 +1,6 @@
module.exports =
browserMainParts:
preMainMessageLoopRun: ->
setImmediate ->
module.exports.browserMainParts.preMainMessageLoopRun()

View File

@@ -0,0 +1,24 @@
autoUpdater = process.atomBinding('auto_updater').autoUpdater
EventEmitter = require('events').EventEmitter
autoUpdater.__proto__ = EventEmitter.prototype
autoUpdater.on 'update-downloaded-raw', (args...) ->
args[3] = new Date(args[3]) # releaseDate
@emit 'update-downloaded', args..., => @quitAndInstall()
autoUpdater.quitAndInstall = ->
# If we don't have any window then quitAndInstall immediately.
BrowserWindow = require 'browser-window'
windows = BrowserWindow.getAllWindows()
if windows.length is 0
@_quitAndInstall()
return
# Do the restart after all windows have been closed.
app = require 'app'
app.removeAllListeners 'window-all-closed'
app.once 'window-all-closed', @_quitAndInstall.bind(this)
win.close() for win in windows
module.exports = autoUpdater

View File

@@ -0,0 +1,110 @@
EventEmitter = require('events').EventEmitter
IDWeakMap = require 'id-weak-map'
app = require 'app'
ipc = require 'ipc'
wrapWebContents = require('web-contents').wrap
BrowserWindow = process.atomBinding('window').BrowserWindow
BrowserWindow::__proto__ = EventEmitter.prototype
# Store all created windows in the weak map.
BrowserWindow.windows = new IDWeakMap
BrowserWindow::_init = ->
# Simulate the application menu on platforms other than OS X.
if process.platform isnt 'darwin'
menu = app.getApplicationMenu()
@setMenu menu if menu?
@webContents = @getWebContents()
@devToolsWebContents = null
@webContents.once 'destroyed', => @webContents = null
# Remember the window ID.
Object.defineProperty this, 'id',
value: BrowserWindow.windows.add(this)
enumerable: true
# Make new windows requested by links behave like "window.open"
@on '-new-window', (event, url, frameName) =>
event.sender = @webContents
options = show: true, width: 800, height: 600
ipc.emit 'ATOM_SHELL_GUEST_WINDOW_MANAGER_WINDOW_OPEN', event, url, frameName, options
# Redirect "will-navigate" to webContents.
@on '-will-navigate', (event, url) =>
@webContents.emit 'will-navigate', event, url
# Remove the window from weak map immediately when it's destroyed, since we
# could be iterating windows before GC happened.
@once 'closed', =>
BrowserWindow.windows.remove @id if BrowserWindow.windows.has @id
BrowserWindow::openDevTools = ->
@_openDevTools()
# Force devToolsWebContents to be created.
@devToolsWebContents = @getDevToolsWebContents()
@devToolsWebContents.once 'destroyed', => @devToolsWebContents = null
# Emit devtools events.
@devToolsWebContents.once 'did-finish-load', => @emit 'devtools-opened'
@devToolsWebContents.once 'destroyed', => @emit 'devtools-closed'
BrowserWindow::toggleDevTools = ->
if @isDevToolsOpened() then @closeDevTools() else @openDevTools()
BrowserWindow::getWebContents = ->
wrapWebContents @_getWebContents()
BrowserWindow::getDevToolsWebContents = ->
wrapWebContents @_getDevToolsWebContents()
BrowserWindow::setMenu = (menu) ->
if process.platform is 'darwin'
throw new Error('BrowserWindow.setMenu is not available on OS X')
throw new TypeError('Invalid menu') unless menu?.constructor?.name is 'Menu'
@menu = menu # Keep a reference of menu in case of GC.
@menu.attachToWindow this
BrowserWindow.getAllWindows = ->
windows = BrowserWindow.windows
windows.get key for key in windows.keys()
BrowserWindow.getFocusedWindow = ->
windows = BrowserWindow.getAllWindows()
return window for window in windows when window.isFocused()
BrowserWindow.fromWebContents = (webContents) ->
windows = BrowserWindow.getAllWindows()
return window for window in windows when webContents.equal window.webContents
BrowserWindow.fromDevToolsWebContents = (webContents) ->
windows = BrowserWindow.getAllWindows()
return window for window in windows when webContents.equal window.devToolsWebContents
BrowserWindow.fromId = (id) ->
BrowserWindow.windows.get id
# Helpers.
BrowserWindow::loadUrl = -> @webContents.loadUrl.apply @webContents, arguments
BrowserWindow::send = -> @webContents.send.apply @webContents, arguments
# Be compatible with old API.
BrowserWindow::restart = -> @webContents.reload()
BrowserWindow::getUrl = -> @webContents.getUrl()
BrowserWindow::reload = -> @webContents.reload.apply @webContents, arguments
BrowserWindow::reloadIgnoringCache = -> @webContents.reloadIgnoringCache.apply @webContents, arguments
BrowserWindow::getPageTitle = -> @webContents.getTitle()
BrowserWindow::isLoading = -> @webContents.isLoading()
BrowserWindow::isWaitingForResponse = -> @webContents.isWaitingForResponse()
BrowserWindow::stop = -> @webContents.stop()
BrowserWindow::getRoutingId = -> @webContents.getRoutingId()
BrowserWindow::getProcessId = -> @webContents.getProcessId()
BrowserWindow::isCrashed = -> @webContents.isCrashed()
BrowserWindow::executeJavaScriptInDevTools = (code) ->
@devToolsWebContents.executeJavaScript code
module.exports = BrowserWindow

View File

@@ -0,0 +1,7 @@
module.exports = process.atomBinding 'content_tracing'
# Mirrored from content::TracingController::Options
module.exports.DEFAULT_OPTIONS = 0
module.exports.ENABLE_SYSTRACE = 1 << 0
module.exports.ENABLE_SAMPLING = 1 << 1
module.exports.RECORD_CONTINUOUSLY = 1 << 2

View File

@@ -0,0 +1,107 @@
binding = process.atomBinding 'dialog'
v8Util = process.atomBinding 'v8_util'
app = require 'app'
BrowserWindow = require 'browser-window'
fileDialogProperties =
openFile: 1 << 0
openDirectory: 1 << 1
multiSelections: 1 << 2
createDirectory: 1 << 3
messageBoxTypes = ['none', 'info', 'warning']
parseArgs = (window, options, callback) ->
unless window is null or window?.constructor is BrowserWindow
# Shift.
callback = options
options = window
window = null
if not callback? and typeof options is 'function'
# Shift.
callback = options
options = null
[window, options, callback]
checkAppInitialized = ->
throw new Error('dialog module can only be used after app is ready') unless app.isReady()
module.exports =
showOpenDialog: (args...) ->
checkAppInitialized()
[window, options, callback] = parseArgs args...
options ?= title: 'Open', properties: ['openFile']
options.properties ?= ['openFile']
throw new TypeError('Properties need to be array') unless Array.isArray options.properties
properties = 0
for prop, value of fileDialogProperties
properties |= value if prop in options.properties
options.title ?= ''
options.defaultPath ?= ''
options.filters ?= []
wrappedCallback =
if typeof callback is 'function'
(success, result) -> callback(if success then result)
else
null
binding.showOpenDialog String(options.title),
String(options.defaultPath),
options.filters
properties,
window,
wrappedCallback
showSaveDialog: (args...) ->
checkAppInitialized()
[window, options, callback] = parseArgs args...
options ?= title: 'Save'
options.title ?= ''
options.defaultPath ?= ''
options.filters ?= []
wrappedCallback =
if typeof callback is 'function'
(success, result) -> callback(if success then result)
else
null
binding.showSaveDialog String(options.title),
String(options.defaultPath),
options.filters
window,
wrappedCallback
showMessageBox: (args...) ->
checkAppInitialized()
[window, options, callback] = parseArgs args...
options ?= type: 'none'
options.type ?= 'none'
messageBoxType = messageBoxTypes.indexOf options.type
throw new TypeError('Invalid message box type') unless messageBoxType > -1
throw new TypeError('Buttons need to be array') unless Array.isArray options.buttons
options.title ?= ''
options.message ?= ''
options.detail ?= ''
options.icon ?= null
binding.showMessageBox messageBoxType,
options.buttons,
[options.title, options.message, options.detail],
options.icon,
window,
callback
showErrorBox: (args...) ->
binding.showErrorBox args...
# Mark standard asynchronous functions.
v8Util.setHiddenValue f, 'asynchronous', true for k, f of module.exports

View File

@@ -0,0 +1,5 @@
bindings = process.atomBinding 'global_shortcut'
globalShortcut = bindings.globalShortcut
module.exports = globalShortcut

View File

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

View File

@@ -0,0 +1,49 @@
BrowserWindow = require 'browser-window'
v8Util = process.atomBinding 'v8_util'
nextCommandId = 0
class MenuItem
@types = ['normal', 'separator', 'submenu', 'checkbox', 'radio']
constructor: (options) ->
Menu = require 'menu'
{click, @selector, @type, @label, @sublabel, @accelerator, @icon, @enabled, @visible, @checked, @submenu} = options
@type = 'submenu' if not @type? and @submenu?
throw new Error('Invalid submenu') if @type is 'submenu' and @submenu?.constructor isnt Menu
@overrideReadOnlyProperty 'type', 'normal'
@overrideReadOnlyProperty 'accelerator'
@overrideReadOnlyProperty 'icon'
@overrideReadOnlyProperty 'submenu'
@overrideProperty 'label', ''
@overrideProperty 'sublabel', ''
@overrideProperty 'enabled', true
@overrideProperty 'visible', true
@overrideProperty 'checked', false
throw new Error("Unknown menu type #{@type}") if MenuItem.types.indexOf(@type) is -1
@commandId = ++nextCommandId
@click = =>
# Manually flip the checked flags when clicked.
@checked = !@checked if @type in ['checkbox', 'radio']
if typeof click is 'function'
click this, BrowserWindow.getFocusedWindow()
else if typeof @selector is 'string'
Menu.sendActionToFirstResponder @selector
overrideProperty: (name, defaultValue=null) ->
this[name] ?= defaultValue
overrideReadOnlyProperty: (name, defaultValue=null) ->
this[name] ?= defaultValue
Object.defineProperty this, name,
enumerable: true
writable: false
value: this[name]
module.exports = MenuItem

View File

@@ -0,0 +1,131 @@
BrowserWindow = require 'browser-window'
EventEmitter = require('events').EventEmitter
MenuItem = require 'menu-item'
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 = (items, pos) ->
if pos > 0
for i in [pos - 1..0]
item = items[i]
return item.groupId if item.type is 'radio'
break if item.type is 'separator'
else if pos < items.length
for i in [pos..items.length - 1]
item = items[i]
return item.groupId if item.type is 'radio'
break if item.type is 'separator'
++nextGroupId
Menu = bindings.Menu
Menu::__proto__ = EventEmitter.prototype
Menu::_init = ->
@commandsMap = {}
@groupsMap = {}
@items = []
@delegate =
isCommandIdChecked: (commandId) => @commandsMap[commandId]?.checked
isCommandIdEnabled: (commandId) => @commandsMap[commandId]?.enabled
isCommandIdVisible: (commandId) => @commandsMap[commandId]?.visible
getAcceleratorForCommandId: (commandId) => @commandsMap[commandId]?.accelerator
getIconForCommandId: (commandId) => @commandsMap[commandId]?.icon
executeCommand: (commandId) => @commandsMap[commandId]?.click()
menuWillShow: =>
# Make sure radio groups have at least one menu item seleted.
for id, group of @groupsMap
checked = false
for radioItem in group when radioItem.checked
checked = true
break
v8Util.setHiddenValue group[0], 'checked', true unless checked
Menu::popup = (window, x, y) ->
throw new TypeError('Invalid window') unless window?.constructor is BrowserWindow
if x? and y?
@_popupAt(window, x, y)
else
@_popup window
Menu::append = (item) ->
@insert @getItemCount(), item
Menu::insert = (pos, item) ->
throw new TypeError('Invalid item') unless item?.constructor is MenuItem
switch item.type
when 'normal' then @insertItem pos, item.commandId, item.label
when 'checkbox' then @insertCheckItem pos, item.commandId, item.label
when 'separator' then @insertSeparator pos
when 'submenu' then @insertSubMenu pos, item.commandId, item.label, item.submenu
when 'radio'
# Grouping radio menu items.
item.overrideReadOnlyProperty 'groupId', generateGroupId(@items, pos)
@groupsMap[item.groupId] ?= []
@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: -> v8Util.getHiddenValue item, 'checked'
set: (val) =>
for otherItem in @groupsMap[item.groupId] when otherItem isnt item
v8Util.setHiddenValue otherItem, 'checked', false
v8Util.setHiddenValue item, 'checked', true
@insertRadioItem pos, item.commandId, item.label, item.groupId
@setSublabel pos, item.sublabel if item.sublabel?
@setIcon pos, item.icon if item.icon?
# Make menu accessable to items.
item.overrideReadOnlyProperty 'menu', this
# Remember the items.
@items.splice pos, 0, item
@commandsMap[item.commandId] = item
# Force menuWillShow to be called
Menu::_callMenuWillShow = ->
@delegate?.menuWillShow()
item.submenu._callMenuWillShow() for item in @items when item.submenu?
applicationMenu = null
Menu.setApplicationMenu = (menu) ->
throw new TypeError('Invalid menu') unless menu?.constructor is Menu
applicationMenu = menu # Keep a reference.
if process.platform is 'darwin'
menu._callMenuWillShow()
bindings.setApplicationMenu menu
else
windows = BrowserWindow.getAllWindows()
w.setMenu menu for w in windows
Menu.getApplicationMenu = -> applicationMenu
Menu.sendActionToFirstResponder = bindings.sendActionToFirstResponder
Menu.buildFromTemplate = (template) ->
throw new TypeError('Invalid template for Menu') unless Array.isArray template
menu = new Menu
for item in template
throw new TypeError('Invalid template for MenuItem') unless typeof item is 'object'
item.submenu = Menu.buildFromTemplate item.submenu if item.submenu?
menuItem = new MenuItem(item)
menuItem[key] = value for key, value of item when not menuItem[key]?
menu.append menuItem
menu
module.exports = Menu

View File

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

View File

@@ -0,0 +1,33 @@
app = require 'app'
throw new Error('Can not initialize protocol module before app is ready') unless app.isReady()
protocol = process.atomBinding('protocol').protocol
EventEmitter = require('events').EventEmitter
protocol.__proto__ = EventEmitter.prototype
protocol.RequestStringJob =
class RequestStringJob
constructor: ({mimeType, charset, data}) ->
if typeof data isnt 'string' and not data instanceof Buffer
throw new TypeError('Data should be string or Buffer')
@mimeType = mimeType ? 'text/plain'
@charset = charset ? 'UTF-8'
@data = String data
protocol.RequestBufferJob =
class RequestBufferJob
constructor: ({mimeType, encoding, data}) ->
if not data instanceof Buffer
throw new TypeError('Data should be Buffer')
@mimeType = mimeType ? 'application/octet-stream'
@encoding = encoding ? 'utf8'
@data = new Buffer(data)
protocol.RequestFileJob =
class RequestFileJob
constructor: (@path) ->
module.exports = protocol

View File

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

View File

@@ -0,0 +1,10 @@
EventEmitter = require('events').EventEmitter
bindings = process.atomBinding 'tray'
Tray = bindings.Tray
Tray::__proto__ = EventEmitter.prototype
Tray::setContextMenu = (menu) ->
@_setContextMenu menu
@menu = menu # Keep a strong reference of menu.
module.exports = Tray

View File

@@ -0,0 +1,64 @@
EventEmitter = require('events').EventEmitter
binding = process.atomBinding 'web_contents'
ipc = require 'ipc'
module.exports.wrap = (webContents) ->
return null unless webContents.isAlive()
# webContents is an EventEmitter.
webContents.__proto__ = EventEmitter.prototype
# WebContents::send(channel, args..)
webContents.send = (channel, args...) ->
@_send channel, [args...]
# Make sure webContents.executeJavaScript would run the code only when the
# web contents has been loaded.
webContents.loaded = false
webContents.once 'did-finish-load', -> @loaded = true
webContents.executeJavaScript = (code) ->
if @loaded
@_executeJavaScript code
else
webContents.once 'did-finish-load', @_executeJavaScript.bind(this, code)
# The processId and routingId and identify a webContents.
webContents.getId = -> "#{@getProcessId()}-#{@getRoutingId()}"
webContents.equal = (other) -> @getId() is other.getId()
# Provide a default parameter for |urlOptions|.
webContents.loadUrl = (url, urlOptions={}) -> @_loadUrl url, urlOptions
webContents.reload = (urlOptions={}) -> @_reload urlOptions
webContents.reloadIgnoringCache = (urlOptions={}) -> @_reloadIgnoringCache urlOptions
# Translate |disposition| to string for 'new-window' event.
webContents.on '-new-window', (args..., disposition) ->
disposition =
switch disposition
when 2 then 'default'
when 4 then 'foreground-tab'
when 5 then 'background-tab'
when 6, 7 then 'new-window'
else 'other'
@emit 'new-window', args..., disposition
# Tell the rpc server that a render view has been deleted and we need to
# release all objects owned by it.
webContents.on 'render-view-deleted', (event, processId, routingId) ->
process.emit 'ATOM_BROWSER_RELEASE_RENDER_VIEW', "#{processId}-#{routingId}"
# Dispatch IPC messages to the ipc module.
webContents.on 'ipc-message', (event, packed) ->
[channel, args...] = packed
Object.defineProperty event, 'sender', value: webContents
ipc.emit channel, event, args...
webContents.on 'ipc-message-sync', (event, packed) ->
[channel, args...] = packed
Object.defineProperty event, 'returnValue', set: (value) -> event.sendReply JSON.stringify(value)
Object.defineProperty event, 'sender', value: webContents
ipc.emit channel, event, args...
webContents
module.exports.create = (options={}) ->
@wrap binding.create(options)

View File

@@ -0,0 +1,50 @@
// Copyright (c) 2014 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "atom/browser/atom_access_token_store.h"
#include <utility>
#include "atom/browser/atom_browser_context.h"
#include "atom/common/google_api_key.h"
namespace atom {
namespace {
// Notice that we just combined the api key with the url together here, because
// if we use the standard {url: key} format Chromium would override our key with
// the predefined one in common.gypi of libchromiumcontent, which is empty.
const char* kGeolocationProviderUrl =
"https://www.googleapis.com/geolocation/v1/geolocate?key="
GOOGLEAPIS_API_KEY;
} // namespace
AtomAccessTokenStore::AtomAccessTokenStore() {
}
AtomAccessTokenStore::~AtomAccessTokenStore() {
}
void AtomAccessTokenStore::LoadAccessTokens(
const LoadAccessTokensCallbackType& callback) {
AccessTokenSet access_token_set;
// Equivelent to access_token_set[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);
callback.Run(access_token_set,
AtomBrowserContext::Get()->url_request_context_getter());
}
void AtomAccessTokenStore::SaveAccessToken(const GURL& server_url,
const base::string16& access_token) {
}
} // namespace atom

View File

@@ -0,0 +1,31 @@
// Copyright (c) 2014 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef ATOM_BROWSER_ATOM_ACCESS_TOKEN_STORE_H_
#define ATOM_BROWSER_ATOM_ACCESS_TOKEN_STORE_H_
#include "content/public/browser/access_token_store.h"
namespace atom {
class AtomBrowserContext;
class AtomAccessTokenStore : public content::AccessTokenStore {
public:
AtomAccessTokenStore();
virtual ~AtomAccessTokenStore();
// content::AccessTokenStore:
void LoadAccessTokens(
const LoadAccessTokensCallbackType& callback) override;
void SaveAccessToken(const GURL& server_url,
const base::string16& access_token) override;
private:
DISALLOW_COPY_AND_ASSIGN(AtomAccessTokenStore);
};
} // namespace atom
#endif // ATOM_BROWSER_ATOM_ACCESS_TOKEN_STORE_H_

View File

@@ -0,0 +1,191 @@
// Copyright (c) 2013 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "atom/browser/atom_browser_client.h"
#include "atom/browser/atom_access_token_store.h"
#include "atom/browser/atom_browser_context.h"
#include "atom/browser/atom_browser_main_parts.h"
#include "atom/browser/atom_resource_dispatcher_host_delegate.h"
#include "atom/browser/atom_speech_recognition_manager_delegate.h"
#include "atom/browser/native_window.h"
#include "atom/browser/web_view_manager.h"
#include "atom/browser/window_list.h"
#include "atom/common/options_switches.h"
#include "base/command_line.h"
#include "base/strings/string_number_conversions.h"
#include "chrome/browser/printing/printing_message_filter.h"
#include "chrome/browser/speech/tts_message_filter.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/resource_dispatcher_host.h"
#include "content/public/browser/site_instance.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/web_preferences.h"
#include "ui/base/l10n/l10n_util.h"
namespace atom {
namespace {
struct FindByProcessId {
explicit FindByProcessId(int child_process_id)
: child_process_id_(child_process_id) {
}
bool operator() (NativeWindow* const window) {
content::WebContents* web_contents = window->GetWebContents();
if (!web_contents)
return false;
int id = window->GetWebContents()->GetRenderProcessHost()->GetID();
return id == child_process_id_;
}
int child_process_id_;
};
} // namespace
AtomBrowserClient::AtomBrowserClient()
: dying_render_process_(NULL) {
}
AtomBrowserClient::~AtomBrowserClient() {
}
void AtomBrowserClient::RenderProcessWillLaunch(
content::RenderProcessHost* host) {
int id = host->GetID();
host->AddFilter(new printing::PrintingMessageFilter(host->GetID()));
host->AddFilter(new TtsMessageFilter(id, host->GetBrowserContext()));
}
content::SpeechRecognitionManagerDelegate*
AtomBrowserClient::CreateSpeechRecognitionManagerDelegate() {
return new AtomSpeechRecognitionManagerDelegate;
}
content::AccessTokenStore* AtomBrowserClient::CreateAccessTokenStore() {
return new AtomAccessTokenStore;
}
void AtomBrowserClient::ResourceDispatcherHostCreated() {
resource_dispatcher_delegate_.reset(new AtomResourceDispatcherHostDelegate);
content::ResourceDispatcherHost::Get()->SetDelegate(
resource_dispatcher_delegate_.get());
}
void AtomBrowserClient::OverrideWebkitPrefs(
content::RenderViewHost* render_view_host,
const GURL& url,
content::WebPreferences* prefs) {
prefs->javascript_enabled = true;
prefs->web_security_enabled = true;
prefs->javascript_can_open_windows_automatically = true;
prefs->plugins_enabled = true;
prefs->dom_paste_enabled = true;
prefs->java_enabled = false;
prefs->allow_scripts_to_close_windows = true;
prefs->javascript_can_access_clipboard = true;
prefs->local_storage_enabled = true;
prefs->databases_enabled = true;
prefs->application_cache_enabled = true;
prefs->allow_universal_access_from_file_urls = true;
prefs->allow_file_access_from_file_urls = true;
prefs->experimental_webgl_enabled = true;
prefs->allow_displaying_insecure_content = false;
prefs->allow_running_insecure_content = false;
// Turn off web security for devtools.
if (url.SchemeIs("chrome-devtools")) {
prefs->web_security_enabled = false;
return;
}
// Custom preferences of guest page.
auto process = render_view_host->GetProcess();
WebViewManager::WebViewInfo info;
if (WebViewManager::GetInfoForProcess(process, &info)) {
prefs->web_security_enabled = !info.disable_web_security;
return;
}
NativeWindow* window = NativeWindow::FromRenderView(
process->GetID(), render_view_host->GetRoutingID());
if (window)
window->OverrideWebkitPrefs(url, prefs);
}
bool AtomBrowserClient::ShouldSwapBrowsingInstancesForNavigation(
content::SiteInstance* site_instance,
const GURL& current_url,
const GURL& new_url) {
if (site_instance->HasProcess())
dying_render_process_ = site_instance->GetProcess();
// Restart renderer process for all navigations, this relies on a patch to
// Chromium: http://git.io/_PaNyg.
return true;
}
std::string AtomBrowserClient::GetApplicationLocale() {
return l10n_util::GetApplicationLocale("");
}
void AtomBrowserClient::AppendExtraCommandLineSwitches(
base::CommandLine* command_line,
int child_process_id) {
WindowList* list = WindowList::GetInstance();
NativeWindow* window = NULL;
// Find the owner of this child process.
WindowList::const_iterator iter = std::find_if(
list->begin(), list->end(), FindByProcessId(child_process_id));
if (iter != list->end())
window = *iter;
// If the render process is a newly started one, which means the window still
// uses the old going-to-be-swapped render process, then we try to find the
// window from the swapped render process.
if (window == NULL && dying_render_process_ != NULL) {
child_process_id = dying_render_process_->GetID();
WindowList::const_iterator iter = std::find_if(
list->begin(), list->end(), FindByProcessId(child_process_id));
if (iter != list->end())
window = *iter;
}
if (window != NULL) {
window->AppendExtraCommandLineSwitches(command_line, child_process_id);
} else {
// Append commnad line arguments for guest web view.
auto child_process = content::RenderProcessHost::FromID(child_process_id);
WebViewManager::WebViewInfo info;
if (WebViewManager::GetInfoForProcess(child_process, &info)) {
command_line->AppendSwitchASCII(
switches::kGuestInstanceID,
base::IntToString(info.guest_instance_id));
command_line->AppendSwitchASCII(
switches::kNodeIntegration,
info.node_integration ? "true" : "false");
if (info.plugins)
command_line->AppendSwitch(switches::kEnablePlugins);
if (!info.preload_script.empty())
command_line->AppendSwitchPath(
switches::kPreloadScript,
info.preload_script);
}
}
dying_render_process_ = NULL;
}
brightray::BrowserMainParts* AtomBrowserClient::OverrideCreateBrowserMainParts(
const content::MainFunctionParams&) {
v8::V8::Initialize(); // Init V8 before creating main parts.
return new AtomBrowserMainParts;
}
} // namespace atom

View File

@@ -0,0 +1,53 @@
// Copyright (c) 2013 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef ATOM_BROWSER_ATOM_BROWSER_CLIENT_H_
#define ATOM_BROWSER_ATOM_BROWSER_CLIENT_H_
#include <string>
#include "brightray/browser/browser_client.h"
namespace atom {
class AtomResourceDispatcherHostDelegate;
class AtomBrowserClient : public brightray::BrowserClient {
public:
AtomBrowserClient();
virtual ~AtomBrowserClient();
protected:
// content::ContentBrowserClient:
void RenderProcessWillLaunch(content::RenderProcessHost* host) override;
content::SpeechRecognitionManagerDelegate*
CreateSpeechRecognitionManagerDelegate() override;
content::AccessTokenStore* CreateAccessTokenStore() override;
void ResourceDispatcherHostCreated() override;
void OverrideWebkitPrefs(content::RenderViewHost* render_view_host,
const GURL& url,
content::WebPreferences* prefs) override;
bool ShouldSwapBrowsingInstancesForNavigation(
content::SiteInstance* site_instance,
const GURL& current_url,
const GURL& new_url) override;
std::string GetApplicationLocale() override;
void AppendExtraCommandLineSwitches(base::CommandLine* command_line,
int child_process_id) override;
private:
brightray::BrowserMainParts* OverrideCreateBrowserMainParts(
const content::MainFunctionParams&) override;
scoped_ptr<AtomResourceDispatcherHostDelegate> resource_dispatcher_delegate_;
// The render process which would be swapped out soon.
content::RenderProcessHost* dying_render_process_;
DISALLOW_COPY_AND_ASSIGN(AtomBrowserClient);
};
} // namespace atom
#endif // ATOM_BROWSER_ATOM_BROWSER_CLIENT_H_

View File

@@ -0,0 +1,96 @@
// Copyright (c) 2013 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "atom/browser/atom_browser_context.h"
#include "atom/browser/atom_browser_main_parts.h"
#include "atom/browser/net/atom_url_request_job_factory.h"
#include "atom/browser/net/asar/asar_protocol_handler.h"
#include "atom/browser/web_view_manager.h"
#include "atom/common/options_switches.h"
#include "base/command_line.h"
#include "base/threading/sequenced_worker_pool.h"
#include "base/threading/worker_pool.h"
#include "chrome/browser/browser_process.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/common/url_constants.h"
#include "net/url_request/data_protocol_handler.h"
#include "net/url_request/url_request_intercepting_job_factory.h"
#include "url/url_constants.h"
using content::BrowserThread;
namespace atom {
namespace {
class NoCacheBackend : public net::HttpCache::BackendFactory {
int CreateBackend(net::NetLog* net_log,
scoped_ptr<disk_cache::Backend>* backend,
const net::CompletionCallback& callback) override {
return net::ERR_FAILED;
}
};
} // namespace
AtomBrowserContext::AtomBrowserContext()
: fake_browser_process_(new BrowserProcess),
job_factory_(new AtomURLRequestJobFactory) {
}
AtomBrowserContext::~AtomBrowserContext() {
}
net::URLRequestJobFactory* AtomBrowserContext::CreateURLRequestJobFactory(
content::ProtocolHandlerMap* handlers,
content::URLRequestInterceptorScopedVector* interceptors) {
scoped_ptr<AtomURLRequestJobFactory> job_factory(job_factory_);
for (content::ProtocolHandlerMap::iterator it = handlers->begin();
it != handlers->end(); ++it)
job_factory->SetProtocolHandler(it->first, it->second.release());
handlers->clear();
job_factory->SetProtocolHandler(
url::kDataScheme, new net::DataProtocolHandler);
job_factory->SetProtocolHandler(
url::kFileScheme, new asar::AsarProtocolHandler(
BrowserThread::GetBlockingPool()->GetTaskRunnerWithShutdownBehavior(
base::SequencedWorkerPool::SKIP_ON_SHUTDOWN)));
// Set up interceptors in the reverse order.
scoped_ptr<net::URLRequestJobFactory> top_job_factory = job_factory.Pass();
content::URLRequestInterceptorScopedVector::reverse_iterator it;
for (it = interceptors->rbegin(); it != interceptors->rend(); ++it)
top_job_factory.reset(new net::URLRequestInterceptingJobFactory(
top_job_factory.Pass(), make_scoped_ptr(*it)));
interceptors->weak_clear();
return top_job_factory.release();
}
net::HttpCache::BackendFactory*
AtomBrowserContext::CreateHttpCacheBackendFactory(
const base::FilePath& base_path) {
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
if (command_line->HasSwitch(switches::kDisableHttpCache))
return new NoCacheBackend;
else
return brightray::BrowserContext::CreateHttpCacheBackendFactory(base_path);
}
content::BrowserPluginGuestManager* AtomBrowserContext::GetGuestManager() {
if (!guest_manager_)
guest_manager_.reset(new WebViewManager(this));
return guest_manager_.get();
}
// static
AtomBrowserContext* AtomBrowserContext::Get() {
return static_cast<AtomBrowserContext*>(
AtomBrowserMainParts::Get()->browser_context());
}
} // namespace atom

View File

@@ -0,0 +1,49 @@
// Copyright (c) 2013 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef ATOM_BROWSER_ATOM_BROWSER_CONTEXT_H_
#define ATOM_BROWSER_ATOM_BROWSER_CONTEXT_H_
#include "brightray/browser/browser_context.h"
class BrowserProcess;
namespace atom {
class AtomURLRequestJobFactory;
class WebViewManager;
class AtomBrowserContext : public brightray::BrowserContext {
public:
AtomBrowserContext();
virtual ~AtomBrowserContext();
// Returns the browser context singleton.
static AtomBrowserContext* Get();
// brightray::URLRequestContextGetter::Delegate:
net::URLRequestJobFactory* CreateURLRequestJobFactory(
content::ProtocolHandlerMap* handlers,
content::URLRequestInterceptorScopedVector* interceptors) override;
net::HttpCache::BackendFactory* CreateHttpCacheBackendFactory(
const base::FilePath& base_path) override;
// content::BrowserContext:
content::BrowserPluginGuestManager* GetGuestManager() override;
AtomURLRequestJobFactory* job_factory() const { return job_factory_; }
private:
// A fake BrowserProcess object that used to feed the source code from chrome.
scoped_ptr<BrowserProcess> fake_browser_process_;
scoped_ptr<WebViewManager> guest_manager_;
AtomURLRequestJobFactory* job_factory_; // Weak reference.
DISALLOW_COPY_AND_ASSIGN(AtomBrowserContext);
};
} // namespace atom
#endif // ATOM_BROWSER_ATOM_BROWSER_CONTEXT_H_

View File

@@ -0,0 +1,106 @@
// Copyright (c) 2013 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "atom/browser/atom_browser_main_parts.h"
#include "atom/browser/atom_browser_client.h"
#include "atom/browser/atom_browser_context.h"
#include "atom/browser/browser.h"
#include "atom/browser/javascript_environment.h"
#include "atom/browser/node_debugger.h"
#include "atom/common/api/atom_bindings.h"
#include "atom/common/node_bindings.h"
#include "base/command_line.h"
#include "v8/include/v8-debug.h"
#if defined(USE_X11)
#include "chrome/browser/ui/libgtk2ui/gtk2_util.h"
#endif
#include "atom/common/node_includes.h"
namespace atom {
// static
AtomBrowserMainParts* AtomBrowserMainParts::self_ = NULL;
AtomBrowserMainParts::AtomBrowserMainParts()
: browser_(new Browser),
node_bindings_(NodeBindings::Create(true)),
atom_bindings_(new AtomBindings),
gc_timer_(true, true) {
DCHECK(!self_) << "Cannot have two AtomBrowserMainParts";
self_ = this;
}
AtomBrowserMainParts::~AtomBrowserMainParts() {
}
// static
AtomBrowserMainParts* AtomBrowserMainParts::Get() {
DCHECK(self_);
return self_;
}
brightray::BrowserContext* AtomBrowserMainParts::CreateBrowserContext() {
return new AtomBrowserContext();
}
void AtomBrowserMainParts::PostEarlyInitialization() {
brightray::BrowserMainParts::PostEarlyInitialization();
#if defined(USE_X11)
SetDPIFromGSettings();
#endif
// The ProxyResolverV8 has setup a complete V8 environment, in order to avoid
// conflicts we only initialize our V8 environment after that.
js_env_.reset(new JavascriptEnvironment);
node_bindings_->Initialize();
// Support the "--debug" switch.
node_debugger_.reset(new NodeDebugger(js_env_->isolate()));
// Create the global environment.
global_env = node_bindings_->CreateEnvironment(js_env_->context());
// Make sure node can get correct environment when debugging.
if (node_debugger_->IsRunning())
global_env->AssignToContext(v8::Debug::GetDebugContext());
// Add atom-shell extended APIs.
atom_bindings_->BindTo(js_env_->isolate(), global_env->process_object());
// Load everything.
node_bindings_->LoadEnvironment(global_env);
}
void AtomBrowserMainParts::PreMainMessageLoopRun() {
// Run user's main script before most things get initialized, so we can have
// a chance to setup everything.
node_bindings_->PrepareMessageLoop();
node_bindings_->RunMessageLoop();
// Start idle gc.
gc_timer_.Start(
FROM_HERE, base::TimeDelta::FromMinutes(1),
base::Bind(base::IgnoreResult(&v8::Isolate::IdleNotification),
base::Unretained(js_env_->isolate()),
1000));
brightray::BrowserMainParts::PreMainMessageLoopRun();
#if defined(USE_X11)
libgtk2ui::GtkInitFromCommandLine(*base::CommandLine::ForCurrentProcess());
#endif
#if !defined(OS_MACOSX)
// The corresponding call in OS X is in AtomApplicationDelegate.
Browser::Get()->WillFinishLaunching();
Browser::Get()->DidFinishLaunching();
#endif
}
} // namespace atom

View File

@@ -0,0 +1,60 @@
// Copyright (c) 2013 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef ATOM_BROWSER_ATOM_BROWSER_MAIN_PARTS_H_
#define ATOM_BROWSER_ATOM_BROWSER_MAIN_PARTS_H_
#include "base/timer/timer.h"
#include "brightray/browser/browser_main_parts.h"
namespace atom {
class AtomBindings;
class Browser;
class JavascriptEnvironment;
class NodeBindings;
class NodeDebugger;
class AtomBrowserMainParts : public brightray::BrowserMainParts {
public:
AtomBrowserMainParts();
virtual ~AtomBrowserMainParts();
static AtomBrowserMainParts* Get();
Browser* browser() { return browser_.get(); }
protected:
// Implementations of brightray::BrowserMainParts.
brightray::BrowserContext* CreateBrowserContext() override;
// Implementations of content::BrowserMainParts.
void PostEarlyInitialization() override;
void PreMainMessageLoopRun() override;
#if defined(OS_MACOSX)
void PreMainMessageLoopStart() override;
void PostDestroyThreads() override;
#endif
private:
#if defined(USE_X11)
void SetDPIFromGSettings();
#endif
scoped_ptr<Browser> browser_;
scoped_ptr<JavascriptEnvironment> js_env_;
scoped_ptr<NodeBindings> node_bindings_;
scoped_ptr<AtomBindings> atom_bindings_;
scoped_ptr<NodeDebugger> node_debugger_;
base::Timer gc_timer_;
static AtomBrowserMainParts* self_;
DISALLOW_COPY_AND_ASSIGN(AtomBrowserMainParts);
};
} // namespace atom
#endif // ATOM_BROWSER_ATOM_BROWSER_MAIN_PARTS_H_

View File

@@ -0,0 +1,82 @@
// Copyright (c) 2014 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "atom/browser/atom_browser_main_parts.h"
#include "base/command_line.h"
#include "base/strings/string_number_conversions.h"
#include "library_loaders/libgio.h"
#include "ui/gfx/switches.h"
namespace atom {
namespace {
const char* kInterfaceSchema = "org.gnome.desktop.interface";
const char* kScaleFactor = "scaling-factor";
bool SchemaExists(const LibGioLoader& libgio_loader, const char* schema_name) {
const gchar* const* schemas = libgio_loader.g_settings_list_schemas();
while (*schemas) {
if (strcmp(schema_name, static_cast<const char*>(*schemas)) == 0)
return true;
schemas++;
}
return false;
}
bool KeyExists(const LibGioLoader& libgio_loader, GSettings* client,
const char* key) {
gchar** keys = libgio_loader.g_settings_list_keys(client);
if (!keys)
return false;
gchar** iter = keys;
while (*iter) {
if (strcmp(*iter, key) == 0)
break;
iter++;
}
bool exists = *iter != NULL;
g_strfreev(keys);
return exists;
}
void GetDPIFromGSettings(guint* scale_factor) {
LibGioLoader libgio_loader;
// Try also without .0 at the end; on some systems this may be required.
if (!libgio_loader.Load("libgio-2.0.so.0") &&
!libgio_loader.Load("libgio-2.0.so")) {
VLOG(1) << "Cannot load gio library. Will fall back to gconf.";
return;
}
GSettings* client = nullptr;
if (!SchemaExists(libgio_loader, kInterfaceSchema) ||
!(client = libgio_loader.g_settings_new(kInterfaceSchema))) {
VLOG(1) << "Cannot create gsettings client.";
return;
}
if (KeyExists(libgio_loader, client, kScaleFactor))
*scale_factor = libgio_loader.g_settings_get_uint(client, kScaleFactor);
g_object_unref(client);
}
} // namespace
void AtomBrowserMainParts::SetDPIFromGSettings() {
guint scale_factor = 1;
GetDPIFromGSettings(&scale_factor);
if (scale_factor == 0)
scale_factor = 1;
base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
switches::kForceDeviceScaleFactor, base::UintToString(scale_factor));
}
} // namespace atom

View File

@@ -0,0 +1,48 @@
// Copyright (c) 2013 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "atom/browser/atom_browser_main_parts.h"
#import "atom/browser/mac/atom_application.h"
#import "atom/browser/mac/atom_application_delegate.h"
#include "base/files/file_path.h"
#import "base/mac/foundation_util.h"
#include "ui/base/l10n/l10n_util_mac.h"
#import "vendor/brightray/common/mac/main_application_bundle.h"
namespace atom {
void AtomBrowserMainParts::PreMainMessageLoopStart() {
// Initialize locale setting.
l10n_util::OverrideLocaleWithCocoaLocale();
// Force the NSApplication subclass to be used.
NSApplication* application = [AtomApplication sharedApplication];
AtomApplicationDelegate* delegate = [[AtomApplicationDelegate alloc] init];
[NSApp setDelegate:(id<NSFileManagerDelegate>)delegate];
base::FilePath frameworkPath = brightray::MainApplicationBundlePath()
.Append("Contents")
.Append("Frameworks")
.Append(PRODUCT_NAME " Framework.framework");
NSBundle* frameworkBundle = [NSBundle
bundleWithPath:base::mac::FilePathToNSString(frameworkPath)];
NSNib* mainNib = [[NSNib alloc] initWithNibNamed:@"MainMenu"
bundle:frameworkBundle];
[mainNib instantiateWithOwner:application topLevelObjects:nil];
[mainNib release];
// Prevent Cocoa from turning command-line arguments into
// |-application:openFiles:|, since we already handle them directly.
[[NSUserDefaults standardUserDefaults]
setObject:@"NO" forKey:@"NSTreatUnknownArgumentsAsOpen"];
}
void AtomBrowserMainParts::PostDestroyThreads() {
[[NSApp delegate] release];
[NSApp setDelegate:nil];
}
} // namespace atom

View File

@@ -0,0 +1,36 @@
// Copyright (c) 2013 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "atom/browser/atom_javascript_dialog_manager.h"
#include <string>
#include "base/strings/utf_string_conversions.h"
namespace atom {
void AtomJavaScriptDialogManager::RunJavaScriptDialog(
content::WebContents* web_contents,
const GURL& origin_url,
const std::string& accept_lang,
content::JavaScriptMessageType javascript_message_type,
const base::string16& message_text,
const base::string16& default_prompt_text,
const DialogClosedCallback& callback,
bool* did_suppress_message) {
callback.Run(false, base::string16());
}
void AtomJavaScriptDialogManager::RunBeforeUnloadDialog(
content::WebContents* web_contents,
const base::string16& message_text,
bool is_reload,
const DialogClosedCallback& callback) {
bool prevent_reload = message_text.empty() ||
message_text == base::ASCIIToUTF16("false");
callback.Run(!prevent_reload, message_text);
}
} // namespace atom

View File

@@ -0,0 +1,38 @@
// Copyright (c) 2013 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef ATOM_BROWSER_ATOM_JAVASCRIPT_DIALOG_MANAGER_H_
#define ATOM_BROWSER_ATOM_JAVASCRIPT_DIALOG_MANAGER_H_
#include <string>
#include "content/public/browser/javascript_dialog_manager.h"
namespace atom {
class AtomJavaScriptDialogManager : public content::JavaScriptDialogManager {
public:
// content::JavaScriptDialogManager implementations.
void RunJavaScriptDialog(
content::WebContents* web_contents,
const GURL& origin_url,
const std::string& accept_lang,
content::JavaScriptMessageType javascript_message_type,
const base::string16& message_text,
const base::string16& default_prompt_text,
const DialogClosedCallback& callback,
bool* did_suppress_message) override;
void RunBeforeUnloadDialog(
content::WebContents* web_contents,
const base::string16& message_text,
bool is_reload,
const DialogClosedCallback& callback) override;
void CancelActiveAndPendingDialogs(
content::WebContents* web_contents) override {}
void WebContentsDestroyed(content::WebContents* web_contents) override {}
};
} // namespace atom
#endif // ATOM_BROWSER_ATOM_JAVASCRIPT_DIALOG_MANAGER_H_

View File

@@ -0,0 +1,33 @@
// Copyright (c) 2014 GitHub, Inc. All rights reserved.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "atom/browser/atom_resource_dispatcher_host_delegate.h"
#include <string>
#include "base/logging.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/resource_request_info.h"
#include "net/http/http_response_headers.h"
#include "net/url_request/url_request.h"
namespace atom {
AtomResourceDispatcherHostDelegate::AtomResourceDispatcherHostDelegate() {
}
void AtomResourceDispatcherHostDelegate::OnResponseStarted(
net::URLRequest* request,
content::ResourceContext* resource_context,
content::ResourceResponse* response,
IPC::Sender* sender) {
// Remove the "X-Frame-Options" from response headers for devtools.
if (request->url().SchemeIs("chrome-devtools")) {
net::HttpResponseHeaders* response_headers = request->response_headers();
if (response_headers && response_headers->HasHeader("x-frame-options"))
response_headers->RemoveHeader("x-frame-options");
}
}
} // namespace atom

View File

@@ -0,0 +1,30 @@
// Copyright (c) 2014 GitHub, Inc. All rights reserved.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef ATOM_BROWSER_ATOM_RESOURCE_DISPATCHER_HOST_DELEGATE_H_
#define ATOM_BROWSER_ATOM_RESOURCE_DISPATCHER_HOST_DELEGATE_H_
#include "base/compiler_specific.h"
#include "content/public/browser/resource_dispatcher_host_delegate.h"
namespace atom {
class AtomResourceDispatcherHostDelegate
: public content::ResourceDispatcherHostDelegate {
public:
AtomResourceDispatcherHostDelegate();
// content::ResourceDispatcherHostDelegate:
void OnResponseStarted(net::URLRequest* request,
content::ResourceContext* resource_context,
content::ResourceResponse* response,
IPC::Sender* sender) override;
private:
DISALLOW_COPY_AND_ASSIGN(AtomResourceDispatcherHostDelegate);
};
} // namespace atom
#endif // ATOM_BROWSER_ATOM_RESOURCE_DISPATCHER_HOST_DELEGATE_H_

View File

@@ -0,0 +1,74 @@
// Copyright (c) 2014 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "atom/browser/atom_speech_recognition_manager_delegate.h"
#include <string>
#include "base/callback.h"
namespace atom {
AtomSpeechRecognitionManagerDelegate::AtomSpeechRecognitionManagerDelegate() {
}
AtomSpeechRecognitionManagerDelegate::~AtomSpeechRecognitionManagerDelegate() {
}
void AtomSpeechRecognitionManagerDelegate::OnRecognitionStart(int session_id) {
}
void AtomSpeechRecognitionManagerDelegate::OnAudioStart(int session_id) {
}
void AtomSpeechRecognitionManagerDelegate::OnEnvironmentEstimationComplete(
int session_id) {
}
void AtomSpeechRecognitionManagerDelegate::OnSoundStart(int session_id) {
}
void AtomSpeechRecognitionManagerDelegate::OnSoundEnd(int session_id) {
}
void AtomSpeechRecognitionManagerDelegate::OnAudioEnd(int session_id) {
}
void AtomSpeechRecognitionManagerDelegate::OnRecognitionEnd(int session_id) {
}
void AtomSpeechRecognitionManagerDelegate::OnRecognitionResults(
int session_id, const content::SpeechRecognitionResults& result) {
}
void AtomSpeechRecognitionManagerDelegate::OnRecognitionError(
int session_id, const content::SpeechRecognitionError& error) {
}
void AtomSpeechRecognitionManagerDelegate::OnAudioLevelsChange(
int session_id, float volume, float noise_volume) {
}
void AtomSpeechRecognitionManagerDelegate::GetDiagnosticInformation(
bool* can_report_metrics, std::string* hardware_info) {
*can_report_metrics = false;
}
void AtomSpeechRecognitionManagerDelegate::CheckRecognitionIsAllowed(
int session_id,
base::Callback<void(bool ask_user, bool is_allowed)> callback) {
callback.Run(true, true);
}
content::SpeechRecognitionEventListener*
AtomSpeechRecognitionManagerDelegate::GetEventListener() {
return this;
}
bool AtomSpeechRecognitionManagerDelegate::FilterProfanities(
int render_process_id) {
return false;
}
} // namespace atom

View File

@@ -0,0 +1,52 @@
// Copyright (c) 2014 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef ATOM_BROWSER_ATOM_SPEECH_RECOGNITION_MANAGER_DELEGATE_H_
#define ATOM_BROWSER_ATOM_SPEECH_RECOGNITION_MANAGER_DELEGATE_H_
#include <string>
#include "content/public/browser/speech_recognition_event_listener.h"
#include "content/public/browser/speech_recognition_manager_delegate.h"
namespace atom {
class AtomSpeechRecognitionManagerDelegate
: public content::SpeechRecognitionManagerDelegate,
public content::SpeechRecognitionEventListener {
public:
AtomSpeechRecognitionManagerDelegate();
virtual ~AtomSpeechRecognitionManagerDelegate();
// content::SpeechRecognitionEventListener:
void OnRecognitionStart(int session_id) override;
void OnAudioStart(int session_id) override;
void OnEnvironmentEstimationComplete(int session_id) override;
void OnSoundStart(int session_id) override;
void OnSoundEnd(int session_id) override;
void OnAudioEnd(int session_id) override;
void OnRecognitionEnd(int session_id) override;
void OnRecognitionResults(
int session_id, const content::SpeechRecognitionResults& result) override;
void OnRecognitionError(
int session_id, const content::SpeechRecognitionError& error) override;
void OnAudioLevelsChange(int session_id, float volume,
float noise_volume) override;
// content::SpeechRecognitionManagerDelegate:
void GetDiagnosticInformation(bool* can_report_metrics,
std::string* hardware_info) override;
void CheckRecognitionIsAllowed(
int session_id,
base::Callback<void(bool ask_user, bool is_allowed)> callback) override;
content::SpeechRecognitionEventListener* GetEventListener() override;
bool FilterProfanities(int render_process_id) override;
private:
DISALLOW_COPY_AND_ASSIGN(AtomSpeechRecognitionManagerDelegate);
};
} // namespace atom
#endif // ATOM_BROWSER_ATOM_SPEECH_RECOGNITION_MANAGER_DELEGATE_H_

View File

@@ -1,8 +1,8 @@
// Copyright (c) 2013 GitHub, Inc. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// Copyright (c) 2013 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "browser/auto_updater.h"
#include "atom/browser/auto_updater.h"
namespace auto_updater {

View File

@@ -1,5 +1,5 @@
// Copyright (c) 2013 GitHub, Inc. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// Copyright (c) 2013 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef ATOM_BROWSER_AUTO_UPDATER_H_
@@ -19,13 +19,8 @@ class AutoUpdater {
static AutoUpdaterDelegate* GetDelegate();
static void SetDelegate(AutoUpdaterDelegate* delegate);
static void Init();
static void SetFeedURL(const std::string& url);
static void SetAutomaticallyChecksForUpdates(bool yes);
static void SetAutomaticallyDownloadsUpdates(bool yes);
static void CheckForUpdates();
static void CheckForUpdatesInBackground();
private:
static AutoUpdaterDelegate* delegate_;

View File

@@ -0,0 +1,45 @@
// Copyright (c) 2013 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef ATOM_BROWSER_AUTO_UPDATER_DELEGATE_H_
#define ATOM_BROWSER_AUTO_UPDATER_DELEGATE_H_
#include <string>
#include "base/callback_forward.h"
namespace base {
class Time;
}
namespace auto_updater {
class AutoUpdaterDelegate {
public:
// An error happened.
virtual void OnError(const std::string& error) {}
// Checking to see if there is an update
virtual void OnCheckingForUpdate() {}
// There is an update available and it is being downloaded
virtual void OnUpdateAvailable() {}
// There is no available update.
virtual void OnUpdateNotAvailable() {}
// There is a new update which has been downloaded.
virtual void OnUpdateDownloaded(const std::string& release_notes,
const std::string& release_name,
const base::Time& release_date,
const std::string& update_url,
const base::Closure& quit_and_install) {}
protected:
virtual ~AutoUpdaterDelegate() {}
};
} // namespace auto_updater
#endif // ATOM_BROWSER_AUTO_UPDATER_DELEGATE_H_

View File

@@ -0,0 +1,17 @@
// Copyright (c) 2013 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "atom/browser/auto_updater.h"
namespace auto_updater {
// static
void AutoUpdater::SetFeedURL(const std::string& url) {
}
// static
void AutoUpdater::CheckForUpdates() {
}
} // namespace auto_updater

View File

@@ -0,0 +1,95 @@
// Copyright (c) 2013 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "atom/browser/auto_updater.h"
#import <ReactiveCocoa/RACCommand.h>
#import <ReactiveCocoa/RACSignal.h>
#import <ReactiveCocoa/NSObject+RACPropertySubscribing.h>
#import <Squirrel/Squirrel.h>
#include "base/bind.h"
#include "base/time/time.h"
#include "base/strings/sys_string_conversions.h"
#include "atom/browser/auto_updater_delegate.h"
#include <iostream>
namespace auto_updater {
namespace {
// The gloal SQRLUpdater object.
SQRLUpdater* g_updater = nil;
void RelaunchToInstallUpdate() {
[[g_updater relaunchToInstallUpdate] subscribeError:^(NSError* error) {
AutoUpdaterDelegate* delegate = AutoUpdater::GetDelegate();
if (delegate)
delegate->OnError(base::SysNSStringToUTF8(error.localizedDescription));
}];
}
} // namespace
// static
void AutoUpdater::SetFeedURL(const std::string& feed) {
if (g_updater == nil) {
// Initialize the SQRLUpdater.
NSURL* url = [NSURL URLWithString:base::SysUTF8ToNSString(feed)];
NSURLRequest* urlRequest = [NSURLRequest requestWithURL:url];
g_updater = [[SQRLUpdater alloc] initWithUpdateRequest:urlRequest];
AutoUpdaterDelegate* delegate = GetDelegate();
if (!delegate)
return;
[[g_updater rac_valuesForKeyPath:@"state" observer:g_updater]
subscribeNext:^(NSNumber *stateNumber) {
int state = [stateNumber integerValue];
// Dispatching the event on main thread.
dispatch_async(dispatch_get_main_queue(), ^{
if (state == SQRLUpdaterStateCheckingForUpdate)
delegate->OnCheckingForUpdate();
else if (state == SQRLUpdaterStateDownloadingUpdate)
delegate->OnUpdateAvailable();
});
}];
}
}
// static
void AutoUpdater::CheckForUpdates() {
AutoUpdaterDelegate* delegate = GetDelegate();
if (!delegate)
return;
[[[[g_updater.checkForUpdatesCommand
execute:nil]
// Send a `nil` after everything...
concat:[RACSignal return:nil]]
// But only take the first value. If an update is sent, we'll get that.
// Otherwise, we'll get our inserted `nil` value.
take:1]
subscribeNext:^(SQRLDownloadedUpdate *downloadedUpdate) {
if (downloadedUpdate) {
SQRLUpdate* update = downloadedUpdate.update;
// There is a new update that has been downloaded.
delegate->OnUpdateDownloaded(
base::SysNSStringToUTF8(update.releaseNotes),
base::SysNSStringToUTF8(update.releaseName),
base::Time::FromDoubleT(update.releaseDate.timeIntervalSince1970),
base::SysNSStringToUTF8(update.updateURL.absoluteString),
base::Bind(RelaunchToInstallUpdate));
} else {
// When the completed event is sent with no update, then we know there
// is no update available.
delegate->OnUpdateNotAvailable();
}
} error:^(NSError *error) {
delegate->OnError(base::SysNSStringToUTF8(error.localizedDescription));
}];
}
} // namespace auto_updater

View File

@@ -0,0 +1,17 @@
// Copyright (c) 2013 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "atom/browser/auto_updater.h"
namespace auto_updater {
// static
void AutoUpdater::SetFeedURL(const std::string& url) {
}
// static
void AutoUpdater::CheckForUpdates() {
}
} // namespace auto_updater

142
atom/browser/browser.cc Normal file
View File

@@ -0,0 +1,142 @@
// Copyright (c) 2013 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "atom/browser/browser.h"
#include <string>
#include "atom/browser/atom_browser_main_parts.h"
#include "atom/browser/window_list.h"
#include "base/message_loop/message_loop.h"
namespace atom {
Browser::Browser()
: is_quiting_(false),
is_ready_(false) {
WindowList::AddObserver(this);
}
Browser::~Browser() {
WindowList::RemoveObserver(this);
}
// static
Browser* Browser::Get() {
return AtomBrowserMainParts::Get()->browser();
}
void Browser::Quit() {
is_quiting_ = HandleBeforeQuit();
if (!is_quiting_)
return;
atom::WindowList* window_list = atom::WindowList::GetInstance();
if (window_list->size() == 0)
NotifyAndShutdown();
window_list->CloseAllWindows();
}
void Browser::Shutdown() {
FOR_EACH_OBSERVER(BrowserObserver, observers_, OnQuit());
is_quiting_ = true;
base::MessageLoop::current()->Quit();
}
std::string Browser::GetVersion() const {
if (version_override_.empty()) {
std::string version = GetExecutableFileVersion();
if (!version.empty())
return version;
}
return version_override_;
}
void Browser::SetVersion(const std::string& version) {
version_override_ = version;
}
std::string Browser::GetName() const {
if (name_override_.empty()) {
std::string name = GetExecutableFileProductName();
if (!name.empty())
return name;
}
return name_override_;
}
void Browser::SetName(const std::string& name) {
name_override_ = name;
#if defined(OS_WIN)
SetAppUserModelID(name);
#endif
}
bool Browser::OpenFile(const std::string& file_path) {
bool prevent_default = false;
FOR_EACH_OBSERVER(BrowserObserver,
observers_,
OnOpenFile(&prevent_default, file_path));
return prevent_default;
}
void Browser::OpenURL(const std::string& url) {
FOR_EACH_OBSERVER(BrowserObserver, observers_, OnOpenURL(url));
}
void Browser::ActivateWithNoOpenWindows() {
FOR_EACH_OBSERVER(BrowserObserver, observers_, OnActivateWithNoOpenWindows());
}
void Browser::WillFinishLaunching() {
FOR_EACH_OBSERVER(BrowserObserver, observers_, OnWillFinishLaunching());
}
void Browser::DidFinishLaunching() {
is_ready_ = true;
FOR_EACH_OBSERVER(BrowserObserver, observers_, OnFinishLaunching());
}
void Browser::NotifyAndShutdown() {
bool prevent_default = false;
FOR_EACH_OBSERVER(BrowserObserver, observers_, OnWillQuit(&prevent_default));
if (prevent_default) {
is_quiting_ = false;
return;
}
Shutdown();
}
bool Browser::HandleBeforeQuit() {
bool prevent_default = false;
FOR_EACH_OBSERVER(BrowserObserver,
observers_,
OnBeforeQuit(&prevent_default));
return !prevent_default;
}
void Browser::OnWindowCloseCancelled(NativeWindow* window) {
if (is_quiting_)
// Once a beforeunload handler has prevented the closing, we think the quit
// is cancelled too.
is_quiting_ = false;
}
void Browser::OnWindowAllClosed() {
if (is_quiting_)
NotifyAndShutdown();
else
FOR_EACH_OBSERVER(BrowserObserver, observers_, OnWindowAllClosed());
}
} // namespace atom

167
atom/browser/browser.h Normal file
View File

@@ -0,0 +1,167 @@
// Copyright (c) 2013 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef ATOM_BROWSER_BROWSER_H_
#define ATOM_BROWSER_BROWSER_H_
#include <string>
#include <vector>
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/observer_list.h"
#include "atom/browser/browser_observer.h"
#include "atom/browser/window_list_observer.h"
#if defined(OS_WIN)
#include "base/files/file_path.h"
#include "base/strings/string16.h"
#endif
namespace base {
class FilePath;
}
namespace ui {
class MenuModel;
}
namespace atom {
// This class is used for control application-wide operations.
class Browser : public WindowListObserver {
public:
Browser();
~Browser();
static Browser* Get();
// Try to close all windows and quit the application.
void Quit();
// Cleanup everything and shutdown the application gracefully.
void Shutdown();
// Focus the application.
void Focus();
// Returns the version of the executable (or bundle).
std::string GetVersion() const;
// Overrides the application version.
void SetVersion(const std::string& version);
// Returns the application's name, default is just Atom-Shell.
std::string GetName() const;
// Overrides the application name.
void SetName(const std::string& name);
// Add the |path| to recent documents list.
void AddRecentDocument(const base::FilePath& path);
// Clear the recent documents list.
void ClearRecentDocuments();
#if defined(OS_MACOSX)
// Bounce the dock icon.
enum BounceType {
BOUNCE_CRITICAL = 0,
BOUNCE_INFORMATIONAL = 10,
};
int DockBounce(BounceType type);
void DockCancelBounce(int request_id);
// Set/Get dock's badge text.
void DockSetBadgeText(const std::string& label);
std::string DockGetBadgeText();
// Hide/Show dock.
void DockHide();
void DockShow();
// Set docks' menu.
void DockSetMenu(ui::MenuModel* model);
#endif // defined(OS_MACOSX)
#if defined(OS_WIN)
struct UserTask {
base::FilePath program;
base::string16 arguments;
base::string16 title;
base::string16 description;
base::FilePath icon_path;
int icon_index;
};
// Add a custom task to jump list.
void SetUserTasks(const std::vector<UserTask>& tasks);
// Set the application user model ID, called when "SetName" is called.
void SetAppUserModelID(const std::string& name);
#endif
// Tell the application to open a file.
bool OpenFile(const std::string& file_path);
// Tell the application to open a url.
void OpenURL(const std::string& url);
// Tell the application that application is activated with no open windows.
void ActivateWithNoOpenWindows();
// Tell the application the loading has been done.
void WillFinishLaunching();
void DidFinishLaunching();
void AddObserver(BrowserObserver* obs) {
observers_.AddObserver(obs);
}
void RemoveObserver(BrowserObserver* obs) {
observers_.RemoveObserver(obs);
}
bool is_quiting() const { return is_quiting_; }
bool is_ready() const { return is_ready_; }
protected:
// Returns the version of application bundle or executable file.
std::string GetExecutableFileVersion() const;
// Returns the name of application bundle or executable file.
std::string GetExecutableFileProductName() const;
// Send the will-quit message and then shutdown the application.
void NotifyAndShutdown();
// Send the before-quit message and start closing windows.
bool HandleBeforeQuit();
bool is_quiting_;
private:
// WindowListObserver implementations:
void OnWindowCloseCancelled(NativeWindow* window) override;
void OnWindowAllClosed() override;
// Observers of the browser.
ObserverList<BrowserObserver> observers_;
// Whether "ready" event has been emitted.
bool is_ready_;
std::string version_override_;
std::string name_override_;
#if defined(OS_WIN)
base::string16 app_user_model_id_;
#endif
DISALLOW_COPY_AND_ASSIGN(Browser);
};
} // namespace atom
#endif // ATOM_BROWSER_BROWSER_H_

View File

@@ -0,0 +1,41 @@
// Copyright (c) 2013 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "atom/browser/browser.h"
#include <stdlib.h>
#include "atom/browser/native_window.h"
#include "atom/browser/window_list.h"
#include "atom/common/atom_version.h"
namespace atom {
void Browser::Focus() {
// Focus on the first visible window.
WindowList* list = WindowList::GetInstance();
for (WindowList::iterator iter = list->begin(); iter != list->end(); ++iter) {
NativeWindow* window = *iter;
if (window->IsVisible()) {
window->Focus(true);
break;
}
}
}
void Browser::AddRecentDocument(const base::FilePath& path) {
}
void Browser::ClearRecentDocuments() {
}
std::string Browser::GetExecutableFileVersion() const {
return ATOM_VERSION_STRING;
}
std::string Browser::GetExecutableFileProductName() const {
return "Atom-Shell";
}
} // namespace atom

View File

@@ -0,0 +1,78 @@
// Copyright (c) 2013 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "atom/browser/browser.h"
#import "atom/browser/mac/atom_application.h"
#import "atom/browser/mac/atom_application_delegate.h"
#include "atom/browser/native_window.h"
#include "atom/browser/window_list.h"
#import "base/mac/bundle_locations.h"
#import "base/mac/foundation_util.h"
#include "base/strings/sys_string_conversions.h"
namespace atom {
void Browser::Focus() {
[[AtomApplication sharedApplication] activateIgnoringOtherApps:YES];
}
void Browser::AddRecentDocument(const base::FilePath& path) {
NSURL* u = [NSURL fileURLWithPath:base::mac::FilePathToNSString(path)];
[[NSDocumentController sharedDocumentController] noteNewRecentDocumentURL:u];
}
void Browser::ClearRecentDocuments() {
}
std::string Browser::GetExecutableFileVersion() const {
NSDictionary* infoDictionary = base::mac::OuterBundle().infoDictionary;
NSString *version = [infoDictionary objectForKey:@"CFBundleVersion"];
return base::SysNSStringToUTF8(version);
}
std::string Browser::GetExecutableFileProductName() const {
NSDictionary* infoDictionary = base::mac::OuterBundle().infoDictionary;
NSString *version = [infoDictionary objectForKey:@"CFBundleName"];
return base::SysNSStringToUTF8(version);
}
int Browser::DockBounce(BounceType type) {
return [[AtomApplication sharedApplication] requestUserAttention:(NSRequestUserAttentionType)type];
}
void Browser::DockCancelBounce(int rid) {
[[AtomApplication sharedApplication] cancelUserAttentionRequest:rid];
}
void Browser::DockSetBadgeText(const std::string& label) {
NSDockTile *tile = [[AtomApplication sharedApplication] dockTile];
[tile setBadgeLabel:base::SysUTF8ToNSString(label)];
}
std::string Browser::DockGetBadgeText() {
NSDockTile *tile = [[AtomApplication sharedApplication] dockTile];
return base::SysNSStringToUTF8([tile badgeLabel]);
}
void Browser::DockHide() {
WindowList* list = WindowList::GetInstance();
for (WindowList::iterator it = list->begin(); it != list->end(); ++it)
[(*it)->GetNativeWindow() setCanHide:NO];
ProcessSerialNumber psn = { 0, kCurrentProcess };
TransformProcessType(&psn, kProcessTransformToUIElementApplication);
}
void Browser::DockShow() {
ProcessSerialNumber psn = { 0, kCurrentProcess };
TransformProcessType(&psn, kProcessTransformToForegroundApplication);
}
void Browser::DockSetMenu(ui::MenuModel* model) {
AtomApplicationDelegate* delegate = (AtomApplicationDelegate*)[NSApp delegate];
[delegate setApplicationDockMenu:model];
}
} // namespace atom

View File

@@ -1,9 +1,9 @@
// Copyright (c) 2013 GitHub, Inc. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// Copyright (c) 2013 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef ATOM_BROSER_BROWSER_OBSERVER_H_
#define ATOM_BROSER_BROWSER_OBSERVER_H_
#ifndef ATOM_BROWSER_BROWSER_OBSERVER_H_
#define ATOM_BROWSER_BROWSER_OBSERVER_H_
#include <string>
@@ -11,6 +11,9 @@ namespace atom {
class BrowserObserver {
public:
// The browser is about to close all windows.
virtual void OnBeforeQuit(bool* prevent_default) {}
// The browser has closed all windows and will quit.
virtual void OnWillQuit(bool* prevent_default) {}
@@ -18,6 +21,9 @@ class BrowserObserver {
// method will not be called, instead it will call OnWillQuit.
virtual void OnWindowAllClosed() {}
// The browser is quitting.
virtual void OnQuit() {}
// The browser has opened a file by double clicking in Finder or dragging the
// file to the Dock icon. (OS X only)
virtual void OnOpenFile(bool* prevent_default,
@@ -26,6 +32,10 @@ class BrowserObserver {
// Browser is used to open a url.
virtual void OnOpenURL(const std::string& url) {}
// The browser is activated with no open windows (usually by clicking on the
// dock icon).
virtual void OnActivateWithNoOpenWindows() {}
// The browser has finished loading.
virtual void OnWillFinishLaunching() {}
virtual void OnFinishLaunching() {}
@@ -36,4 +46,4 @@ class BrowserObserver {
} // namespace atom
#endif // ATOM_BROSER_BROWSER_OBSERVER_H_
#endif // ATOM_BROWSER_BROWSER_OBSERVER_H_

148
atom/browser/browser_win.cc Normal file
View File

@@ -0,0 +1,148 @@
// Copyright (c) 2013 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "atom/browser/browser.h"
#include <atlbase.h>
#include <propkey.h>
#include <windows.h>
#include <shlobj.h>
#include <shobjidl.h>
#include "base/base_paths.h"
#include "base/file_version_info.h"
#include "base/files/file_path.h"
#include "base/memory/scoped_ptr.h"
#include "base/path_service.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/win/win_util.h"
#include "base/win/windows_version.h"
#include "atom/common/atom_version.h"
namespace atom {
namespace {
BOOL CALLBACK WindowsEnumerationHandler(HWND hwnd, LPARAM param) {
DWORD target_process_id = *reinterpret_cast<DWORD*>(param);
DWORD process_id = 0;
GetWindowThreadProcessId(hwnd, &process_id);
if (process_id == target_process_id) {
SetFocus(hwnd);
return FALSE;
}
return TRUE;
}
} // namespace
void Browser::Focus() {
// On Windows we just focus on the first window found for this process.
DWORD pid = GetCurrentProcessId();
EnumWindows(&WindowsEnumerationHandler, reinterpret_cast<LPARAM>(&pid));
}
void Browser::AddRecentDocument(const base::FilePath& path) {
if (base::win::GetVersion() < base::win::VERSION_WIN7)
return;
CComPtr<IShellItem> item;
HRESULT hr = SHCreateItemFromParsingName(
path.value().c_str(), NULL, IID_PPV_ARGS(&item));
if (SUCCEEDED(hr)) {
SHARDAPPIDINFO info;
info.psi = item;
info.pszAppID = app_user_model_id_.c_str();
SHAddToRecentDocs(SHARD_APPIDINFO, &info);
}
}
void Browser::ClearRecentDocuments() {
CComPtr<IApplicationDestinations> destinations;
if (FAILED(destinations.CoCreateInstance(CLSID_ApplicationDestinations,
NULL, CLSCTX_INPROC_SERVER)))
return;
if (FAILED(destinations->SetAppID(app_user_model_id_.c_str())))
return;
destinations->RemoveAllDestinations();
}
void Browser::SetUserTasks(const std::vector<UserTask>& tasks) {
CComPtr<ICustomDestinationList> destinations;
if (FAILED(destinations.CoCreateInstance(CLSID_DestinationList)))
return;
if (FAILED(destinations->SetAppID(app_user_model_id_.c_str())))
return;
// Start a transaction that updates the JumpList of this application.
UINT max_slots;
CComPtr<IObjectArray> removed;
if (FAILED(destinations->BeginList(&max_slots, IID_PPV_ARGS(&removed))))
return;
CComPtr<IObjectCollection> collection;
if (FAILED(collection.CoCreateInstance(CLSID_EnumerableObjectCollection)))
return;
for (auto& task : tasks) {
CComPtr<IShellLink> link;
if (FAILED(link.CoCreateInstance(CLSID_ShellLink)) ||
FAILED(link->SetPath(task.program.value().c_str())) ||
FAILED(link->SetArguments(task.arguments.c_str())) ||
FAILED(link->SetDescription(task.description.c_str())))
return;
if (!task.icon_path.empty() &&
FAILED(link->SetIconLocation(task.icon_path.value().c_str(),
task.icon_index)))
return;
CComQIPtr<IPropertyStore> property_store = link;
if (!base::win::SetStringValueForPropertyStore(property_store, PKEY_Title,
task.title.c_str()))
return;
if (FAILED(collection->AddObject(link)))
return;
}
// When the list is empty "AddUserTasks" could fail, so we don't check return
// value for it.
CComQIPtr<IObjectArray> task_array = collection;
destinations->AddUserTasks(task_array);
destinations->CommitList();
}
void Browser::SetAppUserModelID(const std::string& name) {
app_user_model_id_ = base::string16(L"atom-shell.app.");
app_user_model_id_ += base::UTF8ToUTF16(name);
SetCurrentProcessExplicitAppUserModelID(app_user_model_id_.c_str());
}
std::string Browser::GetExecutableFileVersion() const {
base::FilePath path;
if (PathService::Get(base::FILE_EXE, &path)) {
scoped_ptr<FileVersionInfo> version_info(
FileVersionInfo::CreateFileVersionInfo(path));
return base::UTF16ToUTF8(version_info->product_version());
}
return ATOM_VERSION_STRING;
}
std::string Browser::GetExecutableFileProductName() const {
base::FilePath path;
if (PathService::Get(base::FILE_EXE, &path)) {
scoped_ptr<FileVersionInfo> version_info(
FileVersionInfo::CreateFileVersionInfo(path));
return base::UTF16ToUTF8(version_info->product_name());
}
return "Atom-Shell";
}
} // namespace atom

View File

@@ -0,0 +1,191 @@
var app = require('app');
var Menu = require('menu');
var MenuItem = require('menu-item');
var BrowserWindow = require('browser-window');
var mainWindow = null;
var menu = null;
// Quit when all windows are closed.
app.on('window-all-closed', function() {
app.quit();
});
app.on('ready', function() {
mainWindow = new BrowserWindow({
width: 800,
height: 600,
resizable: false,
'auto-hide-menu-bar': true,
'use-content-size': true,
});
mainWindow.loadUrl('file://' + __dirname + '/index.html');
mainWindow.focus();
if (process.platform == 'darwin') {
var template = [
{
label: 'Atom Shell',
submenu: [
{
label: 'About Atom Shell',
selector: 'orderFrontStandardAboutPanel:'
},
{
type: 'separator'
},
{
label: 'Services',
submenu: []
},
{
type: 'separator'
},
{
label: 'Hide Atom Shell',
accelerator: 'Command+H',
selector: 'hide:'
},
{
label: 'Hide Others',
accelerator: 'Command+Shift+H',
selector: 'hideOtherApplications:'
},
{
label: 'Show All',
selector: 'unhideAllApplications:'
},
{
type: 'separator'
},
{
label: 'Quit',
accelerator: 'Command+Q',
click: function() { app.quit(); }
},
]
},
{
label: 'Edit',
submenu: [
{
label: 'Undo',
accelerator: 'Command+Z',
selector: 'undo:'
},
{
label: 'Redo',
accelerator: 'Shift+Command+Z',
selector: 'redo:'
},
{
type: 'separator'
},
{
label: 'Cut',
accelerator: 'Command+X',
selector: 'cut:'
},
{
label: 'Copy',
accelerator: 'Command+C',
selector: 'copy:'
},
{
label: 'Paste',
accelerator: 'Command+V',
selector: 'paste:'
},
{
label: 'Select All',
accelerator: 'Command+A',
selector: 'selectAll:'
},
]
},
{
label: 'View',
submenu: [
{
label: 'Reload',
accelerator: 'Command+R',
click: function() { mainWindow.restart(); }
},
{
label: 'Enter Fullscreen',
click: function() { mainWindow.setFullScreen(true); }
},
{
label: 'Toggle DevTools',
accelerator: 'Alt+Command+I',
click: function() { mainWindow.toggleDevTools(); }
},
]
},
{
label: 'Window',
submenu: [
{
label: 'Minimize',
accelerator: 'Command+M',
selector: 'performMiniaturize:'
},
{
label: 'Close',
accelerator: 'Command+W',
selector: 'performClose:'
},
{
type: 'separator'
},
{
label: 'Bring All to Front',
selector: 'arrangeInFront:'
},
]
},
];
menu = Menu.buildFromTemplate(template);
Menu.setApplicationMenu(menu);
} else {
var template = [
{
label: '&File',
submenu: [
{
label: '&Open',
accelerator: 'Ctrl+O',
},
{
label: '&Close',
accelerator: 'Ctrl+W',
click: function() { mainWindow.close(); }
},
]
},
{
label: '&View',
submenu: [
{
label: '&Reload',
accelerator: 'Ctrl+R',
click: function() { mainWindow.restart(); }
},
{
label: '&Enter Fullscreen',
click: function() { mainWindow.setFullScreen(true); }
},
{
label: '&Toggle DevTools',
accelerator: 'Alt+Ctrl+I',
click: function() { mainWindow.toggleDevTools(); }
},
]
},
];
menu = Menu.buildFromTemplate(template);
mainWindow.setMenu(menu);
}
});

View File

@@ -0,0 +1,121 @@
<html>
<head>
<title>Atom Shell</title>
<style>
body {
color: #555;
font-family: 'Open Sans',Helvetica,Arial,sans-serif;
padding: 30px;
}
h2 {
color: #2b6cc2;
font-family: "Crimson Text",Georgia,serif;
font-weight: 400;
line-height: 1.1;
letter-spacing: -0.015em;
}
a {
color: #2b6cc2;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
pre, code {
font-family: "Menlo","Lucida Console",monospace;
border: 1px solid #ddd;
background-color: #f8f8f8;
border-radius: 3px;
}
pre {
white-space: pre-wrap;
font-size: 13px;
line-height: 19px;
overflow: auto;
padding: 6px 10px;
}
#holder {
border: 4px dashed #ccc;
margin: 0 auto;
height: 300px;
color: #ccc;
font-size: 40px;
line-height: 300px;
text-align: center;
-webkit-user-select: none;
}
#holder.hover {
border: 4px dashed #999;
color: #eee;
}
</style>
</head>
<body>
<script>
var execPath = require('remote').process.execPath;
var command = execPath + ' path-to-your-app';
document.onclick = function(e) {
e.preventDefault();
if (e.target.tagName == 'A')
require('shell').openExternal(e.target.href);
return false;
};
document.ondragover = document.ondrop = function(e) {
e.preventDefault();
return false;
};
</script>
<h2 style="-webkit-app-region: drag">Welcome to Atom Shell</h2>
<p>
To run your app with atom-shell, execute the following command under your
Console (or Terminal):
</p>
<script>document.write('<pre>' + command + '</pre>')</script>
<p>
The <code>path-to-your-app</code> should be the path to your own atom-shell
app, you can read the <a href='https://github.com/atom/atom-shell/blob/master/docs/tutorial/quick-start.md'>quick start</a>
guide in atom-shell's <a href='https://github.com/atom/atom-shell/blob/master/docs'>docs</a>
on how to write one.
</p>
<p>
Or you can just drag your app here to run it:
</p>
<div id="holder">
Drag your app here to run it
</div>
<script>
var holder = document.getElementById('holder');
holder.ondragover = function () {
this.className = 'hover';
return false;
};
holder.ondragleave = holder.ondragend = function () {
this.className = '';
return false;
};
holder.ondrop = function (e) {
this.className = '';
e.preventDefault();
var file = e.dataTransfer.files[0];
require('child_process').execFile(execPath, [file.path], {
detached: true, stdio: 'ignore'
}).unref();
return false;
};
</script>
</body>
</html>

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