Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(489)

Side by Side Diff: chrome/renderer/resources/extensions/web_view.js

Issue 497833003: <webview>: Add test coverage for deferred newwindow attachment. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698