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

Side by Side Diff: extensions/renderer/resources/guest_view/web_view/web_view_action_requests.js

Issue 1165773004: Extract the element implementation logic to function mods in <webview>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@qui
Patch Set: sync @tott Created 5 years, 6 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 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
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
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;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698