Commit graph

236 commits

Author SHA1 Message Date
Yuya Ochiai
75184046f6 Add events to manage sheets of macOS BrowserWindow 2017-04-15 16:26:45 +09:00
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
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
51f1c5a557 Use SetTouchBar withe empty vector instead of DestroyTouchBar 2017-03-03 14:00:39 -08:00
Kevin Sawicki
812beb240b Remove unneeded includes 2017-03-03 14:00:38 -08:00
Kevin Sawicki
823b3baed0 Use vector of dictionaries instead of mate::Arguments 2017-03-03 14:00:38 -08:00
Kevin Sawicki
98f5858b11 Initial support for dynamic properties 2017-03-03 14:00:38 -08:00
Kevin Sawicki
cbb6f8c33e Store event listeners in each TouchBar class 2017-03-03 14:00:38 -08:00
Samuel Attard
dd09c91cf2 initial work on updating touch bar item config without rerender 2017-03-03 14:00:38 -08:00
Samuel Attard
d1b3ba39bd Fix cpp linting 2017-03-03 14:00:38 -08:00
Samuel Attard
18c7c3ece8 Make label and colorpicker types work 2017-03-03 14:00:38 -08:00
Samuel Attard
7857c83ea1 Make dynamic buttons work along with click events 2017-03-03 14:00:38 -08:00
Samuel Attard
703b5738c8 Initial TouchBar Magic
* Make the AtomNSWindow also a NSTouchbarDelegate
* Implement basic makeTouchBar and makeItemForIdentifier methods
* Initial sending of touch / update events through IPC to BrowserWindowObjects

TODO:
* JS API
* JS Object Converters
* Generalize methods so that popovers can work
2017-03-03 14:00:38 -08:00
Gary Wilber
f19924bcb0 Add Invalidate method to NativeWindow and add Mac implementation 2017-02-13 19:41:24 -08:00
leethomas
1f5518b91e throw an error for out of bounds window levels 2017-01-24 20:14:09 -08:00
leethomas
7a0a87a6f3 implement relative window levels, closes #8153 2017-01-23 23:42:33 -08:00
Birunthan Mohanathas
18c49285a8 Add BrowserWindow.setAutoHideCursor for macOS
The `disableAutoHideCursor` BrowserWindow option can be used to control
auto-hiding behavior when the window is created. This new API is needed
to dynamically change the behavior after the fact.
2016-11-29 09:46:00 -08:00
Daniel Pham
d5a0dd39a1 🎁 Add 'win.closeFilePreview()' 2016-11-28 14:25:11 -08:00
gellert
2cf30c0d63 remove method transferred to set with null 2016-11-11 08:49:57 -08:00
gellert
8ad50d1e35 adds vibrancy effect for macos 2016-11-11 08:49:57 -08:00
Kevin Sawicki
d982376fc4 filename -> displayName 2016-10-26 09:47:38 +09:00
Pierre Laurac
9b19e6ee38 Changing names and memory leak fix 2016-10-26 09:05:42 +09:00
Pierre Laurac
18ac4178fe Validation with linter 2016-10-26 09:04:22 +09:00
Pierre Laurac
9673cee4d7 Using string from the std 2016-10-26 09:02:36 +09:00
Pierre Laurac
526debb5ab Adding easy way to preview files 2016-10-26 09:02:29 +09:00
Pierre Laurac
fb444f646b default template for PreviewFile 2016-10-26 09:02:21 +09:00
Kevin Sawicki
bce62622bb Fix compiler errors 2016-09-22 09:22:28 -07:00
adammeyer
783d47f78b custom window level as string 2016-09-21 22:49:06 -04:00
adammeyer
fbb3a288ec Allow custom window level when sending window to top 2016-09-21 13:35:59 -04:00
Anthony Tseng
269a87b26f Emit scroll-touch-edge event instead of changing the behavior of scroll-touch-begin/end
fix #6873
2016-09-17 22:50:10 +08:00
Felix Rieseberg
8b85ee8a20 🔧 Use enum to declare ProgressState
As recommended in #6768, this commit adds an enum for progress states for windows.
2016-08-10 08:56:26 -07:00
Felix Rieseberg
73c91dae9e 🔧 Enable mode indication for setProgressBar
This commit enables setting a mode for the setProgressBar method.
Old behavior is kept intact, usage is entirely optional.
2016-08-08 15:52:20 -07:00
Kevin Sawicki
52199a008d Add initial setContentBounds method 2016-08-04 12:02:24 -07:00
Kevin Sawicki
a190495df3 Use bounds for converting window/content sizes 2016-08-04 11:27:27 -07:00
Kevin Sawicki
48cc13d009 Add BrowserWindow.getClientBounds API 2016-08-04 09:58:35 -07:00
Cheng Zhao
b57665330c Merge branch 'master' into chrome52 2016-07-21 05:34:36 -06:00
Cheng Zhao
7848608198 Replace DialogScope with UnresponsiveSuppressor
The latter is global-wide.
2016-07-11 15:29:03 +09:00
Kevin Sawicki
2faf00dc19 Only use default accelerator in Windows/Linux app menu 2016-07-07 11:50:19 -07:00
Kevin Sawicki
f7b72f0948 Move capturePage to WebContents 2016-07-06 09:21:28 -07:00
Cheng Zhao
1ba3907038 Update to API changes of Chrome 52 2016-07-04 15:32:43 +09:00
Milan Burda
c243cf0c0f Add BrowserWindow.prototype.setContentProtection(enable) 2016-06-22 10:40:33 +02:00
Cheng Zhao
5674e8d114 Only define enable/disable API for views 2016-06-20 15:44:50 +09:00
Cheng Zhao
e33e4be257 macOS: Use sheet window as modal window 2016-06-20 14:49:24 +09:00
Cheng Zhao
1866dbe608 Move disable counter to NativeWindow from api::Window 2016-06-20 11:48:46 +09:00
Cheng Zhao
f4bec78ccb linux: Implement win.setParentWindow(parent) 2016-06-20 11:16:41 +09:00
Cheng Zhao
85ba382027 Add "parent" option for BrowserWindow 2016-06-20 11:16:41 +09:00
Cheng Zhao
f2cbd7cb36 mac: Add win.beginSheet(sheet)/endSheet(sheet) API 2016-06-20 11:16:41 +09:00
Cheng Zhao
1a4b4a65c9 mac: Add win.disable/enable/isEnabled() API 2016-06-20 11:16:41 +09:00
Cheng Zhao
fd42e3dc84 mac: Add win.setParentWindow(parent) API 2016-06-20 11:16:41 +09:00