| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // This module implements helper objects for the dialog, newwindow, and | 5 // This module implements helper objects for the dialog, newwindow, and |
| 6 // permissionrequest <webview> events. | 6 // permissionrequest <webview> events. |
| 7 | 7 |
| 8 var MessagingNatives = requireNative('messaging_natives'); | 8 var MessagingNatives = requireNative('messaging_natives'); |
| 9 var WebViewConstants = require('webViewConstants').WebViewConstants; | 9 var WebViewConstants = require('webViewConstants').WebViewConstants; |
| 10 var WebViewInternal = require('webViewInternal').WebViewInternal; | 10 var WebViewInternal = require('webViewInternal').WebViewInternal; |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 if (!webview || !webview.tagName || webview.tagName != 'WEBVIEW') { | 156 if (!webview || !webview.tagName || webview.tagName != 'WEBVIEW') { |
| 157 throw new Error(ERROR_MSG_WEBVIEW_EXPECTED); | 157 throw new Error(ERROR_MSG_WEBVIEW_EXPECTED); |
| 158 } | 158 } |
| 159 | 159 |
| 160 var webViewImpl = privates(webview).internal; | 160 var webViewImpl = privates(webview).internal; |
| 161 // Update the partition. | 161 // Update the partition. |
| 162 if (this.event.partition) { | 162 if (this.event.partition) { |
| 163 webViewImpl.onAttach(this.event.partition); | 163 webViewImpl.onAttach(this.event.partition); |
| 164 } | 164 } |
| 165 | 165 |
| 166 var attached = webViewImpl.attachWindow(this.event.windowId); | 166 var attached = webViewImpl.attachWindow$(this.event.windowId); |
| 167 if (!attached) { | 167 if (!attached) { |
| 168 window.console.error(ERROR_MSG_NEWWINDOW_UNABLE_TO_ATTACH); | 168 window.console.error(ERROR_MSG_NEWWINDOW_UNABLE_TO_ATTACH); |
| 169 } | 169 } |
| 170 | 170 |
| 171 if (this.guestInstanceId != this.webViewImpl.guest.getId()) { | 171 if (this.guestInstanceId != this.webViewImpl.guest.getId()) { |
| 172 // If the opener is already gone, then its guestInstanceId will be | 172 // If the opener is already gone, then its guestInstanceId will be |
| 173 // stale. | 173 // stale. |
| 174 return; | 174 return; |
| 175 } | 175 } |
| 176 | 176 |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 var WebViewActionRequests = { | 281 var WebViewActionRequests = { |
| 282 WebViewActionRequest: WebViewActionRequest, | 282 WebViewActionRequest: WebViewActionRequest, |
| 283 Dialog: Dialog, | 283 Dialog: Dialog, |
| 284 NewWindow: NewWindow, | 284 NewWindow: NewWindow, |
| 285 PermissionRequest: PermissionRequest, | 285 PermissionRequest: PermissionRequest, |
| 286 FullscreenPermissionRequest: FullscreenPermissionRequest | 286 FullscreenPermissionRequest: FullscreenPermissionRequest |
| 287 }; | 287 }; |
| 288 | 288 |
| 289 // Exports. | 289 // Exports. |
| 290 exports.WebViewActionRequests = WebViewActionRequests; | 290 exports.WebViewActionRequests = WebViewActionRequests; |
| OLD | NEW |