map webframe zoom api to use HostZoomMap
This commit is contained in:
parent
63c0e4cbb1
commit
e3fe3cc490
9 changed files with 113 additions and 18 deletions
|
@ -34,12 +34,6 @@ class WebViewImpl {
|
|||
this.viewInstanceId = getNextId()
|
||||
shadowRoot.appendChild(this.browserPluginNode)
|
||||
|
||||
// Subscribe to host's zoom level changes.
|
||||
this.onZoomLevelChanged = (zoomLevel) => {
|
||||
this.webviewNode.setZoomLevel(zoomLevel)
|
||||
}
|
||||
webFrame.on('zoom-level-changed', this.onZoomLevelChanged)
|
||||
|
||||
this.onVisibilityChanged = (event, visibilityState) => {
|
||||
this.webviewNode.send('ELECTRON_RENDERER_WINDOW_VISIBILITY_CHANGE', visibilityState)
|
||||
}
|
||||
|
@ -56,8 +50,6 @@ class WebViewImpl {
|
|||
|
||||
// Resets some state upon reattaching <webview> element to the DOM.
|
||||
reset () {
|
||||
// Unlisten the zoom-level-changed event.
|
||||
webFrame.removeListener('zoom-level-changed', this.onZoomLevelChanged)
|
||||
ipcRenderer.removeListener('ELECTRON_RENDERER_WINDOW_VISIBILITY_CHANGE', this.onVisibilityChanged)
|
||||
|
||||
// If guestInstanceId is defined then the <webview> has navigated and has
|
||||
|
@ -230,7 +222,7 @@ class WebViewImpl {
|
|||
buildParams () {
|
||||
const params = {
|
||||
instanceId: this.viewInstanceId,
|
||||
userAgentOverride: this.userAgentOverride,
|
||||
userAgentOverride: this.userAgentOverride
|
||||
}
|
||||
for (const attributeName in this.attributes) {
|
||||
if (hasProp.call(this.attributes, attributeName)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue