| 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 // Shim that simulates a <webview> tag via Mutation Observers. | 5 // Shim that simulates a <webview> tag via Mutation Observers. |
| 6 // | 6 // |
| 7 // The actual tag is implemented via the browser plugin. The internals of this | 7 // The actual tag is implemented via the browser plugin. The internals of this |
| 8 // are hidden via Shadow DOM. | 8 // are hidden via Shadow DOM. |
| 9 | 9 |
| 10 'use strict'; | 10 'use strict'; |
| (...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 828 | 828 |
| 829 proto.attributeChangedCallback = function(name, oldValue, newValue) { | 829 proto.attributeChangedCallback = function(name, oldValue, newValue) { |
| 830 if (!this.internal_) { | 830 if (!this.internal_) { |
| 831 return; | 831 return; |
| 832 } | 832 } |
| 833 var internal = this.internal_(secret); | 833 var internal = this.internal_(secret); |
| 834 internal.handleBrowserPluginAttributeMutation_(name, newValue); | 834 internal.handleBrowserPluginAttributeMutation_(name, newValue); |
| 835 }; | 835 }; |
| 836 | 836 |
| 837 WebViewInternal.BrowserPlugin = | 837 WebViewInternal.BrowserPlugin = |
| 838 DocumentNatives.RegisterElement('browser-plugin', {prototype: proto}); | 838 DocumentNatives.RegisterElement('browser-plugin', {extends: 'object', |
| 839 prototype: proto}); |
| 839 | 840 |
| 840 delete proto.createdCallback; | 841 delete proto.createdCallback; |
| 841 delete proto.enteredDocumentCallback; | 842 delete proto.enteredDocumentCallback; |
| 842 delete proto.leftDocumentCallback; | 843 delete proto.leftDocumentCallback; |
| 843 delete proto.attributeChangedCallback; | 844 delete proto.attributeChangedCallback; |
| 844 } | 845 } |
| 845 | 846 |
| 846 // Registers <webview> custom element. | 847 // Registers <webview> custom element. |
| 847 function registerWebViewElement() { | 848 function registerWebViewElement() { |
| 848 var proto = Object.create(HTMLElement.prototype); | 849 var proto = Object.create(HTMLElement.prototype); |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 932 | 933 |
| 933 /** | 934 /** |
| 934 * Implemented when the experimental API is available. | 935 * Implemented when the experimental API is available. |
| 935 * @private | 936 * @private |
| 936 */ | 937 */ |
| 937 WebViewInternal.prototype.maybeAttachWebRequestEventToWebview_ = function() {}; | 938 WebViewInternal.prototype.maybeAttachWebRequestEventToWebview_ = function() {}; |
| 938 | 939 |
| 939 exports.WebView = WebView; | 940 exports.WebView = WebView; |
| 940 exports.WebViewInternal = WebViewInternal; | 941 exports.WebViewInternal = WebViewInternal; |
| 941 exports.CreateEvent = CreateEvent; | 942 exports.CreateEvent = CreateEvent; |
| OLD | NEW |