map webframe zoom api to use HostZoomMap

This commit is contained in:
deepak1556 2017-01-30 22:36:50 +05:30
parent 63c0e4cbb1
commit e3fe3cc490
9 changed files with 113 additions and 18 deletions

View file

@ -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)) {