Commit graph

6220 commits

Author SHA1 Message Date
Samuel Attard
5b5c161601
feat: new makeSingleInstance API (#12782)
* Refactor app.makeSingleInstance
* new API `app.isPrimaryInstance()`
* new API `app.isSingleInstance()`
* new event `app.on('second-instance')`
* deprecated old syntax `app.makeSingleInstance(cb)`
* deprecated old syntax of `app.makeSingleInstance() --> bool` in favor
of `app.isPrimaryInstance()`
* Fix spec, we don't need process.nextTick hacks any more
* Make deprecation TODO for the return value of makeSingleInstance
* Refactor makeSingleInstance to requestSingleInstanceLock and add appropriate deprecation comments
* I swear this isn't tricking the linter
* Make const
* Add deprecation warnings for release, and add to planned-breaking-changes

BREAKING CHANGE
2018-05-08 01:29:18 +10:00
Jeremy Apthorp
118da36b52 Send document-start/end to the right context when contextIsolation=true (#12738) 2018-05-04 23:39:54 -07:00
Jeremy Apthorp
b280ea5579 chromium-style fixes (#12826) 2018-05-03 23:45:12 -07:00
Cheng Zhao
a2c3db666e viewDidMoveToSuperview may not be implemented 2018-05-04 09:55:09 +09:00
Cheng Zhao
5547df6073 report correct content size in AtomNSWindow
The views framework relies on NSWindow to return content size of window,
since we don't use the borderless window, the original result would
include titlebar. We have to override the function to return correct
result for frameless window.
2018-05-04 09:55:09 +09:00
Cheng Zhao
28fc58067b remove usage of FullSizeContentView 2018-05-04 09:55:09 +09:00
Cheng Zhao
a9709a635c display WebContents as views::View on macOS 2018-05-04 09:55:09 +09:00
Cheng Zhao
ada884a129 refactor: setup contentView on initialization 2018-05-04 09:55:09 +09:00
Alexey Kuzmin
3fd0ec99ae Better OSR tests (#12817)
* Add features.isOffscreenRenderingEnabled()

* Use .isOffscreenRenderingEnabled() to determine if OSR is available

* Add a helper closeTheWindow() function

* Skip OSR tests if they are disabled
2018-05-03 11:10:25 -05:00
Jeremy Apthorp
cdc5022305 Fix chromium-style errors (#12802) 2018-05-03 09:04:22 -05:00
Jeremy Apthorp
78ab97ab04 Fix crash when releasing a script context that never had node injected (#12741) 2018-05-01 20:00:46 -04:00
bughit
55a7f6f0ce add did-frame-navigate event to WebContents (#12723)
* add did-frame-navigate event to WebContents, pass http response code to it and did-navigate

* docs for frame routing id related api changes on WebFrame and WebContents
2018-05-01 13:34:41 +09:00
Cheng Zhao
c67d1b62e3
refactor: NativeWindowViews should not be a View (#12750) 2018-05-01 13:28:22 +09:00
Samuel Attard
338a816ffd
Screen Lock / Unlock events (#12714)
* initial lock-screen and unlock-screen event implementation for macOS

* Implementation of lock-screen and unlock-screen on windows
2018-05-01 02:04:27 +10:00
Cheng Zhao
089428857c remove unnecessary defines 2018-04-30 10:56:54 +09:00
Cheng Zhao
e07ea24610 remove unnecessary static_cast 2018-04-30 10:56:54 +09:00
Cheng Zhao
2225cc9608 refactor: manage widget_ in NativeWindow 2018-04-30 10:56:54 +09:00
Cheng Zhao
727cd68cee refactor: Use widget() instead of window_ 2018-04-30 10:56:54 +09:00
Cheng Zhao
6d18bd0633 refactor: Make NativeWindow inherit WidgetDelegate 2018-04-30 10:56:54 +09:00
Zeke Sikelianos
cc98bd6b6d
Merge pull request #12662 from electron/prevent-default
Stop overwriting prevent_default if default wasn't prevented
2018-04-26 12:12:18 -07:00
Jeremy Apthorp
dd7e0f80fe Turn off visual zoom by default (#12679) 2018-04-26 10:27:35 -05:00
Jeremy Apthorp
1a64b9f0c2 Disable navigating on drag/drop (#12655)
* Disable navigating on drag/drop

* Add a WebPreferences option to re-enable navigate on drag/drop
2018-04-26 10:23:27 -05:00
bughit
4fcd178c36 expose WebFrame#routingId (#12614)
* expose WebFrame#routingId and pass it to WebContents frame specific events along with frameProcessId; add WebContets.did-start-navigation event
* fix compilation error on ia32 Windows
2018-04-26 19:17:55 +09:00
Cheng Zhao
cf70267871 remove unnecessary overrides 2018-04-26 09:48:12 +09:00
Cheng Zhao
5e48dd9d45 be aware of views::Widget's layer 2018-04-25 15:10:29 +09:00
Cheng Zhao
39242c978f fix failed BrowserWindow tests 2018-04-25 15:10:29 +09:00
Cheng Zhao
75a624434c refactor: use views::Widget on macOS 2018-04-25 15:10:29 +09:00
Nitish Sakhawalkar
2579071b98 Deprecate did-get-response-details and did-get-redirect-request (#12615)
* Deprecate webContents events did-get-response-details and did-get-redirect-request.

* Update guest view files

* Update webview tag docs and update specs

* Update deprecate.event function

* Update comment

* Update more

* Update documentation for other deprecated event
2018-04-23 14:46:12 -05:00
Shelley Vohr
12a57ff1c2 clang-format objc files (#12673) 2018-04-20 11:47:04 -07:00
Cheng Zhao
28b85762fd
Merge pull request #12660 from electron/mac-views
Refactor NativeWindow (Part 8): Prepare work for using views::Widget on macOS
2018-04-20 21:31:28 +09:00
Robo
ff571f3b5d Part I: Move from base::Bind to base::BindOnce and remove unneeded base::Passed (#12661) 2018-04-20 19:55:05 +09:00
Cheng Zhao
aa5c80f8a6 Fix new clang warnings 2018-04-20 19:26:20 +09:00
Cheng Zhao
c44279bb10 Move AtomNSWindow to a new file 2018-04-20 19:26:20 +09:00
Cheng Zhao
569967ac21 Move QLPreviewPanelDataSource to AtomNSWindowDelegate 2018-04-20 19:17:08 +09:00
Cheng Zhao
f6a7e5ea23 Move NSTouchBarDelegate to AtomNSWindowDelegate 2018-04-20 19:15:45 +09:00
Cheng Zhao
8e9667d86c Manage AtomTouchBar in NativeWindow instead of AtomNSWindow 2018-04-20 19:15:01 +09:00
Cheng Zhao
ce54fd334d Move AtomNSWindowDelegate to a new file 2018-04-20 19:12:17 +09:00
Cheng Zhao
1c6c75da4f Merge the logic of managing ViewsDelegate 2018-04-20 19:10:37 +09:00
Cheng Zhao
9bc79f840e mac: Override NativeWidgetMac 2018-04-20 19:10:37 +09:00
Cheng Zhao
37a7df49d6 mac: Provide ViewsDelegate 2018-04-20 19:10:37 +09:00
deepak1556
30f1d0991b enable chromium style checker plugin for electron and brightray targets 2018-04-19 11:12:58 -07:00
Jeremy Apthorp
eb7ccf8afa Bring mac code into conformance with -Wobjc-missing-property-synthesis 2018-04-19 11:12:58 -07:00
Jeremy Apthorp
f3c00e96aa Bring mac code into conformance with -Wunguarded-availability 2018-04-19 11:12:58 -07:00
Jeremy Apthorp
27cee90e5e [chromium-style] move methods out of headers 2018-04-19 11:12:58 -07:00
Jeremy Apthorp
f1587da480 [chromium-style] out-of-line default constructors and destructors 2018-04-19 11:12:58 -07:00
Jeremy Apthorp
6c26bb1cf8 [chromium-style] destructors of ref-counted objects should be private 2018-04-19 11:12:10 -07:00
Jeremy Apthorp
e6695cf2ec [chromium-style] override / virtual warnings 2018-04-19 11:12:10 -07:00
Jeremy Apthorp
a635f078c6 [chromium-style] auto variable type must not deduce to a raw pointer type 2018-04-19 11:10:52 -07:00
Birunthan Mohanathas
cd407d1c3f Stop overwriting prevent_default if default wasn't prevented
This didn't actually cause any issues because there is only one listener
for the affected methods right now. Should we have added more, the last
called observer would have overwritten `prevent_default`. Lets only set
it when necessary to avoid this footgun in the future.
2018-04-19 12:45:21 +02:00
Cheng Zhao
7473b612c5 Make Menu API accept TopLevelWindow 2018-04-19 13:08:37 +09:00