| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 Webview (<webview>) as a custom element that wraps a | 5 // This module implements Webview (<webview>) as a custom element that wraps a |
| 6 // BrowserPlugin object element. The object element is hidden within | 6 // BrowserPlugin object element. The object element is hidden within |
| 7 // the shadow DOM of the Webview element. | 7 // the shadow DOM of the Webview element. |
| 8 | 8 |
| 9 var DocumentNatives = requireNative('document_natives'); | 9 var DocumentNatives = requireNative('document_natives'); |
| 10 var GuestViewInternal = | 10 var GuestViewInternal = |
| (...skipping 848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 859 return params; | 859 return params; |
| 860 }; | 860 }; |
| 861 | 861 |
| 862 WebViewInternal.prototype.attachWindow = function(guestInstanceId, | 862 WebViewInternal.prototype.attachWindow = function(guestInstanceId, |
| 863 isNewWindow) { | 863 isNewWindow) { |
| 864 this.guestInstanceId = guestInstanceId; | 864 this.guestInstanceId = guestInstanceId; |
| 865 var params = this.buildAttachParams(isNewWindow); | 865 var params = this.buildAttachParams(isNewWindow); |
| 866 | 866 |
| 867 if (!this.isPluginInRenderTree()) { | 867 if (!this.isPluginInRenderTree()) { |
| 868 this.deferredAttachState = {isNewWindow: isNewWindow}; | 868 this.deferredAttachState = {isNewWindow: isNewWindow}; |
| 869 return false; | 869 return true; |
| 870 } | 870 } |
| 871 | 871 |
| 872 this.deferredAttachState = null; | 872 this.deferredAttachState = null; |
| 873 return guestViewInternalNatives.AttachGuest( | 873 return guestViewInternalNatives.AttachGuest( |
| 874 this.internalInstanceId, | 874 this.internalInstanceId, |
| 875 this.guestInstanceId, | 875 this.guestInstanceId, |
| 876 params); | 876 params); |
| 877 }; | 877 }; |
| 878 | 878 |
| 879 // Registers browser plugin <object> custom element. | 879 // Registers browser plugin <object> custom element. |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1033 }; | 1033 }; |
| 1034 | 1034 |
| 1035 /** | 1035 /** |
| 1036 * Implemented when the experimental API is available. | 1036 * Implemented when the experimental API is available. |
| 1037 * @private | 1037 * @private |
| 1038 */ | 1038 */ |
| 1039 WebViewInternal.prototype.setupExperimentalContextMenus = function() {}; | 1039 WebViewInternal.prototype.setupExperimentalContextMenus = function() {}; |
| 1040 | 1040 |
| 1041 exports.WebView = WebView; | 1041 exports.WebView = WebView; |
| 1042 exports.WebViewInternal = WebViewInternal; | 1042 exports.WebViewInternal = WebViewInternal; |
| OLD | NEW |