Commit graph

3947 commits

Author SHA1 Message Date
Birunthan Mohanathas
8b9f7e5b00 Implement initial, experimental BrowserView API
Right now, `<webview>` is the only way to embed additional content in a
`BrowserWindow`. Unfortunately `<webview>` suffers from a [number of
problems](https://github.com/electron/electron/issues?utf8=%E2%9C%93&q=is%3Aissue%20is%3Aopen%20label%3Awebview%20).
To make matters worse, many of these are upstream Chromium bugs instead
of Electron-specific bugs.

For us at [Figma](https://www.figma.com), the main issue is very slow
performance.

Despite the upstream improvements to `<webview>` through the OOPIF work, it is
probable that there will continue to be `<webview>`-specific bugs in the
future.

Therefore, this introduces a `<webview>` alternative to called `BrowserView`,
which...

- is a thin wrapper around `api::WebContents` (so bugs in `BrowserView` will
  likely also be bugs in `BrowserWindow` web contents)

- is instantiated in the main process like `BrowserWindow` (and unlike
  `<webview>`, which lives in the DOM of a `BrowserWindow` web contents)

- needs to be added to a `BrowserWindow` to display something on the screen

This implements the most basic API. The API is expected to evolve and change in
the near future and has consequently been marked as experimental. Please do not
use this API in production unless you are prepared to deal with breaking
changes.

In the future, we will want to change the API to support multiple
`BrowserView`s per window. We will also want to consider z-ordering
auto-resizing, and possibly even nested views.
2017-04-13 01:27:27 +03:00
Kevin Sawicki
1c44bcf654 Merge pull request #8786 from electron/per-monitor-dpi-aware
Enable per-monitor DPI for Win10
2017-04-12 12:27:41 -07:00
Kevin Sawicki
e7b679ead6 Add IsEmpty helper and remove GetInstance public usage 2017-04-11 09:09:17 -07:00
Kevin Sawicki
da5d7d72b0 Add GetWindows helper that returns a vector 2017-04-11 09:09:17 -07:00
Kevin Sawicki
0883a9f966 Use CloseAllWindows helper 2017-04-11 09:09:17 -07:00
Kevin Sawicki
8311aa667c Add DestroyAllWindows helper that uses vector copy 2017-04-11 09:09:17 -07:00
Cheng Zhao
c59ef0efc5 Enable per-monitor DPI 2017-04-11 15:17:15 +09:00
Kevin Sawicki
8a324a9375 Bump v1.6.6 2017-04-07 09:01:28 -07:00
Ales Pergl
73e3fd01eb Fixed a couple of failing debug checks when calling Chromium APIs 2017-04-05 14:45:46 +02:00
Kevin Sawicki
6a22c6645e Guard against missing popover identifier 2017-04-04 13:51:39 -07:00
Kevin Sawicki
9c73c991d7 Use const references for params 2017-04-04 13:51:39 -07:00
Samuel Attard
bea56bbdc8 Update as per feedback 2017-04-04 13:51:38 -07:00
Samuel Attard
2fd62d090a Allow items to be assigned to multiple popovers 2017-04-04 13:51:33 -07:00
Samuel Attard
f05dfc74da Store parent popover in popover touch bar items 2017-04-04 13:51:13 -07:00
Kevin Sawicki
7f8e490839 Take const reference 2017-04-04 12:50:41 -07:00
Kevin Sawicki
d596d85288 🎨 2017-04-04 12:50:41 -07:00
Kevin Sawicki
df0f468dea Add escapeKeyReplacementItemIdentifier forward declaration 2017-04-04 12:50:41 -07:00
Samuel Attard
60cc862031 Make everything pointer like 2017-04-04 12:50:41 -07:00
Samuel Attard
4d6b0fc01b Add a method to set the escape identifier on the touch bar 2017-04-04 12:50:41 -07:00
Kevin Sawicki
3e9014c371 Merge pull request #9099 from electron/certificate-trust
macOS: Add certificate trust API
2017-04-04 11:17:09 -07:00
joshaber
146e1ed3ce Don't pass the result through
It's meaningless on macOS, at least.
2017-04-04 09:21:15 -04:00
joshaber
8d465234e4 Appease our linty overlords 2017-04-03 21:40:46 -04:00
joshaber
2badfbe04f Remove the intermediate function 2017-04-03 21:22:37 -04:00
joshaber
b3e865a478 Fix some style things 2017-04-03 21:22:14 -04:00
Ryohei Ikegami
24fedb2e20 No extra linebreak 2017-04-04 09:40:38 +09:00
Ryohei Ikegami
4a7eec8f2d Pass app path as command line argument 2017-04-04 09:36:01 +09:00
joshaber
74c0cbddae Linebreak to keep the linter happy 2017-04-03 16:07:02 -04:00
joshaber
b8ff4666c8 Remove stale includes 2017-04-03 15:48:47 -04:00
joshaber
06643e525a Const ref that message 2017-04-03 15:28:44 -04:00
joshaber
11f5c942ce Conditionalize 2017-04-03 15:25:09 -04:00
joshaber
bcecba20e6 Fix indentation 2017-04-03 15:09:24 -04:00
joshaber
4ffaf2cd99 Remove old unnecssary change on app 2017-04-03 15:09:04 -04:00
joshaber
6e89cb9d7c Move it into dialog 2017-04-03 15:05:24 -04:00
joshaber
4bbbcd093b Handle the callback and cleanup properly 2017-04-03 14:01:48 -04:00
joshaber
1ed443ea29 Do the callback & release dance 2017-04-03 13:21:44 -04:00
Kevin Sawicki
f5a75c4e87 Merge pull request #9076 from electron/cleanup-cpp
Cleanup cpp codebase
2017-04-03 08:30:08 -07:00
Haojian Wu
34a91434aa Remove extra spaces. 2017-04-01 22:01:29 +02:00
joshaber
4f3d3557cc Notify that the cert changed 2017-03-31 21:51:29 -04:00
Kevin Sawicki
a724b6555f Bump v1.6.5 2017-03-31 12:10:09 -07:00
Kevin Sawicki
08db63c3cc Only define NSWindowTabbingModeDisallowed on pre-10.12 2017-03-31 11:28:55 -07:00
Haojian Wu
8ae91682cb Lines should be <= 80 characters. 2017-03-31 20:09:13 +02:00
joshaber
16cc79354c Errrrybody's a scoped_refptr now 2017-03-31 13:53:42 -04:00
joshaber
653b2d15c3 Expose the certificate trust panel as part of app 2017-03-30 17:25:55 -04:00
joshaber
64369cd07f Show a certificate trust panel 2017-03-30 17:25:44 -04:00
Haojian Wu
328cf4789b Should override the virtual destructor. 2017-03-30 23:19:43 +02:00
Haojian Wu
e8abee9ca9 Replace C-style casts with static_cast. 2017-03-30 23:05:47 +02:00
Haojian Wu
ff745e1a82 Use prefix increment in for loops. 2017-03-30 22:56:21 +02:00
Haojian Wu
8d8c7ce6ad Correct type cast. 2017-03-30 22:53:20 +02:00
Kevin Sawicki
42300ae58e Make tabbing identifier var local 2017-03-30 13:47:11 -07:00
Kevin Sawicki
c8b992fa39 Remove 10.12 check handled by respondsToSelector 2017-03-30 13:46:34 -07:00
Haojian Wu
1b9780035c Remove redundant calls to smart pointer's get method. 2017-03-30 22:22:40 +02:00
Haojian Wu
d425b63b0d NULL => nullptr 2017-03-30 22:12:14 +02:00
Haojian Wu
00693ba075 Replace "size()" with "empty()". 2017-03-30 21:59:18 +02:00
Haojian Wu
6ef3be23fd Avoid copy in for range loop. 2017-03-30 21:56:28 +02:00
Tony Ganch
bd935b213f Fix compilation against macOS 10.10 SDK 2017-03-30 15:13:49 +02:00
Haojian Wu
5f724e57bc Avoid unnecessary copy of parameters. 2017-03-29 22:06:07 +02:00
Haojian Wu
99293dd57f Fix namespace comments. 2017-03-29 20:47:41 +02:00
Tony Ganch
a7565f0d57 Enable native tabs on macOS 2017-03-29 13:51:39 +02:00
Tony Ganch
9e02c60e22 Revert "Disable Show Tab Bar menu item on macOS Sierrra"
This reverts commit 24b9313958.
2017-03-29 13:50:56 +02:00
Tony Ganch
ed76e03730 Revert "Add forward declaration of NSWindow.allowsAutomaticWindowTabbing"
This reverts commit 770a3509cf.
2017-03-29 13:50:56 +02:00
Kevin Sawicki
4441d557a2 Merge pull request #9007 from electron/net_redirect_patch
net: allow controlling redirects
2017-03-28 09:31:05 -07:00
Kevin Sawicki
03b2167f6c Merge pull request #9001 from electron/net_source_stream_error_patch
net: catch source stream creation failure for content encoding
2017-03-28 09:24:18 -07:00
deepak1556
3ae62615f4 net: allow controlling redirects 2017-03-28 18:46:21 +05:30
Cheng Zhao
637bdc239b Merge pull request #8923 from electron/geolocation_request_context_patch
browser: Create separate request context for geolocation service.
2017-03-27 22:45:46 -07:00
Kevin Sawicki
b1275a8ef0 Merge pull request #8984 from hansenzhang/display-menuitem-label
Fix '&'  not showing in MenuItem label
2017-03-27 09:47:50 -07:00
deepak1556
93b444eef9 net: catch source stream creation failure for content encoding 2017-03-23 23:36:05 +05:30
Kevin Sawicki
46aed5ff6f Bump v1.6.4 2017-03-22 09:16:08 -07:00
Cheng Zhao
e539129db2 Merge pull request #8852 from electron/web-worker-hook
Add Node.js integration to WebWorker
2017-03-22 09:01:42 -07:00
Hansen Zhang
426563a843 #8881 - Display '&' in MenuItem label 2017-03-22 11:52:25 -04:00
deepak1556
4ab2c92418 CommonWebContentsDelegate::DestroyWebContents => ResetManagedWebContents 2017-03-22 07:30:36 +05:30
Cheng Zhao
99d3fce3c7 node::Environment should be destroyed before AtomBindings
The shutdown code may still uses the APIs provieded by AtomBindings.
2017-03-20 13:01:28 -07:00
Cheng Zhao
a49af26e39 Add nodeIntegrationInWorker option 2017-03-20 12:52:46 -07:00
Cheng Zhao
e496e18f6e Make Archive thread safe 2017-03-20 12:52:46 -07:00
Cheng Zhao
c068285ff8 AtomBindings should not use default uv loop 2017-03-20 12:52:46 -07:00
Cheng Zhao
b467c3939e Add a new type of NodeBindings 2017-03-20 12:52:45 -07:00
deepak1556
72adbf7a2f destroy guest webcontents before embedder 2017-03-19 10:25:13 +05:30
deepak1556
16f9754445 Create separate request context for geolocation service.
* Geolocation service cannot hold reference to browser context,
    since it is destroyed at the end of everything and this will
    confuse the shutdown path of browser context.
  * Geolocation service run on its own thread.
2017-03-19 01:11:55 +05:30
Kevin Sawicki
da0d0e7aac Merge pull request #8910 from electron/touchbar-scrubber
Touchbar NSScrubber
2017-03-16 09:10:59 -07:00
Kevin Sawicki
e98ac94d51 🎨 2017-03-15 11:22:31 -07:00
Kevin Sawicki
f41db87e47 Use NSZeroRect for scrubber frame 2017-03-15 09:45:50 -07:00
Kevin Sawicki
466c39ed19 Use icon for consistency with other touch bar APIs 2017-03-15 09:33:11 -07:00
Kevin Sawicki
6175ee05e2 Remove unneeded long cast 2017-03-14 13:59:29 -07:00
Kevin Sawicki
8b7675baee Add more forward declarations for scrubber APIs 2017-03-14 13:57:39 -07:00
Samuel Attard
a55cddaa53
Add more options 2017-03-14 18:57:57 +11:00
deepak1556
15e2b2335f address review comments 2017-03-14 00:26:27 +05:30
deepak1556
d022d108a3 Dont intercept pdf request for subframes
Will not work without OOPIF support
2017-03-14 00:26:27 +05:30
deepak1556
4381e0895f propagate zoom changes to pdf plugin 2017-03-14 00:26:27 +05:30
deepak1556
eda413861a update spec 2017-03-14 00:26:27 +05:30
deepak1556
b28e686228 code cleanup 2017-03-14 00:26:27 +05:30
deepak1556
5a8e522526 StreamManager class is no longer required.
Stream lifetime is managed by webui
2017-03-14 00:26:27 +05:30
deepak1556
c982af991d request for pdf resource from the webui 2017-03-14 00:26:27 +05:30
Cheng Zhao
422b7acece Do not store resource_path as FilePath
On Windows the path value returned by PathWithoutParams also uses "/" as
separator, so there is no need to use the FilePath class.
2017-03-14 00:26:27 +05:30
Cheng Zhao
cca1db47ee Print error when path is not found 2017-03-14 00:26:27 +05:30
deepak1556
528853efbf handle reload api call from pdf ui 2017-03-14 00:26:27 +05:30
deepak1556
6987e3ecd0 check if target stream is intercepted for correct request 2017-03-14 00:26:27 +05:30
deepak1556
b9710532e1 update api changes 2017-03-14 00:26:27 +05:30
deepak1556
a4400dc549 add basic spec 2017-03-14 00:26:27 +05:30
deepak1556
3aba23b471 view_id=>stream_id and add some code comments. 2017-03-14 00:26:27 +05:30
deepak1556
e90fd1444f move constants to atom_constants.h 2017-03-14 00:26:27 +05:30
deepak1556
671a8a2cd6 address review comments 2017-03-14 00:26:27 +05:30
deepak1556
cc09b9ac7d BINDINGS_POLICY_WEB_UI is not required 2017-03-14 00:26:27 +05:30
Paul Betts
846d516584 Get us compiling on macOS 2017-03-14 00:26:27 +05:30
Paul Betts
8580a34f9f Get us compiling on Win32 2017-03-14 00:26:27 +05:30
deepak1556
c15f6af892 fix crash when pdf viewer is reloaded 2017-03-14 00:25:59 +05:30
deepak1556
ddc2e0df71 code cleanup 2017-03-14 00:25:59 +05:30
deepak1556
de7dcdedba setup strings for ui 2017-03-14 00:25:59 +05:30
deepak1556
0c7bb72891 listen to ipc messages from plugin to perform SaveAs op 2017-03-14 00:25:59 +05:30
deepak1556
fd8c450ef3 move pdfviewer ui data source to separate file 2017-03-14 00:25:59 +05:30
deepak1556
945e26750e manage the lifetime of streams created 2017-03-14 00:25:59 +05:30
deepak1556
0ab37da785 replace redundant mimetype helper with net utility 2017-03-14 00:25:59 +05:30
deepak1556
578b717b5f fix cpplint error 2017-03-14 00:25:59 +05:30
deepak1556
c4dd2f4f56 add pdf webui as submodule 2017-03-14 00:25:59 +05:30
deepak1556
3c90fabab7 update pdf ui to work with webui 2017-03-14 00:25:59 +05:30
deepak1556
41c1623824 handle more messages from webui 2017-03-14 00:25:59 +05:30
deepak1556
a2db14476a create webui message handler 2017-03-14 00:25:59 +05:30
deepak1556
8a2b9c893e initialize webui with message handlers 2017-03-14 00:25:59 +05:30
deepak1556
be480fb634 import pdf ui 2017-03-14 00:25:59 +05:30
deepak1556
fdd574cea5 browser: implement pdf renderer as webui 2017-03-14 00:25:59 +05:30
Kevin Sawicki
268dd1a6c2 Remove unneeded include 2017-03-13 11:15:36 -07:00
Kevin Sawicki
e52ece1a1e Implement NSScrubberDataSource in AtomTouchBar 2017-03-13 11:06:41 -07:00
Kevin Sawicki
4f31a5c452 Fix duplicate protocol method declaration 2017-03-13 10:39:42 -07:00
Kevin Sawicki
d7f458d232 Add protocol methods 2017-03-13 10:31:51 -07:00
Kevin Sawicki
2fe21ecdd0 🎨 2017-03-13 10:28:30 -07:00
Kevin Sawicki
37c9d76cd5 Take const references 2017-03-13 10:25:30 -07:00
Kevin Sawicki
634bd7b17f Add NSScrubber forward declarations 2017-03-13 10:07:48 -07:00
Samuel Attard
a85ae27d68
Fix linting 2017-03-13 11:00:10 +11:00
Samuel Attard
25a231fc50
Initial NSScrubber implementation 2017-03-13 10:51:12 +11:00
Kevin Sawicki
5b1d5b39a2 Set automatic via else block 2017-03-10 10:11:56 -08:00
Kevin Sawicki
3349e32196 Verify selectedIndex to prevent NSRangeException 2017-03-10 10:09:18 -08:00
Kevin Sawicki
458e4be77c Add forward declaration for 10.12 API 2017-03-10 09:53:47 -08:00
Samuel Attard
1c027c526b
Add segmented control implementation 2017-03-10 17:40:39 +11:00
Kevin Sawicki
14e8e463b3 Merge pull request #8864 from electron/zoom_controller_webview_patch
browser: track origin zoom with HostZoomMap
2017-03-09 11:27:34 -08:00
John Kleinschmidt
d5a658bbe4 Fixed pass by reference and added spec 2017-03-08 22:06:26 -05:00
John Kleinschmidt
1c2a78a896 Add WebRTCIPPolicy setting to webContents and webview
Resolves #8777
Code to set and get the policy come from the muon framework code:
https://github.com/brave/muon/blob/master/atom/browser/api/atom_api_web_
contents.cc#L1324...L1343
2017-03-08 10:15:48 -05:00
deepak1556
b5cfa2e92d track host zoom levels with HostZoomMap 2017-03-08 19:03:43 +05:30
Kevin Sawicki
e0260d6f53 Bump v1.6.3 2017-03-07 09:49:39 -08:00
Kevin Sawicki
f549bda9fc Merge pull request #8799 from nitsakh/baseURLForDataURL
Support base URL option to loadURL for data URLs
2017-03-06 10:25:53 -08:00
Kevin Sawicki
886b47e713 Merge pull request #8724 from electron/defer_load_url
webContents: defer url load when there is a pending navigation entry
2017-03-06 10:18:36 -08:00
Kevin Sawicki
479af3c9e2 Merge pull request #8678 from liusy182/download-item
only emit `download-item done` event once
2017-03-06 10:11:22 -08:00
Cheng Zhao
aaa8e81cd4 Merge pull request #8811 from electron/clean-node-on-exit
Clean up node Environment on exit
2017-03-06 20:36:59 +09:00
deepak1556
e936143da2 listen for browser initiated pending nav entries too 2017-03-06 00:21:52 +05:30
deepak1556
dead1ae1ba webContents: defer url load when there is a pending navigation entry 2017-03-06 00:10:46 +05:30
Kevin Sawicki
4d6c779839 identList -> identifiers 2017-03-03 15:28:32 -08:00
Kevin Sawicki
b879872317 Always set properties in update calls 2017-03-03 15:24:32 -08:00
Kevin Sawicki
2680ee9f8f Add support for setting TouchBarLabel text color 2017-03-03 15:14:51 -08:00
Kevin Sawicki
9f323104e7 Remove unused include 2017-03-03 14:11:09 -08:00
Kevin Sawicki
edebb32014 Drop nullable for consistency 2017-03-03 14:07:59 -08:00
Kevin Sawicki
ca2898a60e Check that window responds to touchBar selector for pre-10.12.1 compat 2017-03-03 14:00:39 -08:00
Kevin Sawicki
002369576f Add initial touch bar docs 2017-03-03 14:00:39 -08:00
Kevin Sawicki
ce12dcd3b4 Add live popover icon property 2017-03-03 14:00:39 -08:00