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

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

Issue 558813002: <webview>: Fix an issue with destroying an opener that has unattached guests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 // Event management for WebViewInternal. 5 // Event management for WebViewInternal.
6 6
7 var DeclarativeWebRequestSchema = 7 var DeclarativeWebRequestSchema =
8 requireNative('schema_registry').GetSchema('declarativeWebRequest'); 8 requireNative('schema_registry').GetSchema('declarativeWebRequest');
9 var EventBindings = require('event_bindings'); 9 var EventBindings = require('event_bindings');
10 var IdGenerator = requireNative('id_generator'); 10 var IdGenerator = requireNative('id_generator');
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 return; 476 return;
477 } 477 }
478 478
479 if (defaultPrevented) { 479 if (defaultPrevented) {
480 // Make browser plugin track lifetime of |windowObj|. 480 // Make browser plugin track lifetime of |windowObj|.
481 MessagingNatives.BindToGC(windowObj, function() { 481 MessagingNatives.BindToGC(windowObj, function() {
482 // Avoid showing a warning message if the decision has already been made. 482 // Avoid showing a warning message if the decision has already been made.
483 if (actionTaken) { 483 if (actionTaken) {
484 return; 484 return;
485 } 485 }
486
487 var guestInstanceId = getGuestInstanceId();
488 if (!guestInstanceId) {
489 // If the opener is already gone, then we won't have its
490 // guestInstanceId.
491 return;
492 }
493
486 WebView.setPermission( 494 WebView.setPermission(
487 getGuestInstanceId(), requestId, 'default', '', function(allowed) { 495 guestInstanceId, requestId, 'default', '', function(allowed) {
488 if (allowed) { 496 if (allowed) {
489 return; 497 return;
490 } 498 }
491 showWarningMessage(); 499 showWarningMessage();
492 }); 500 });
493 }); 501 });
494 } else { 502 } else {
495 actionTaken = true; 503 actionTaken = true;
496 // The default action is to discard the window. 504 // The default action is to discard the window.
497 WebView.setPermission( 505 WebView.setPermission(
498 getGuestInstanceId(), requestId, 'default', '', function(allowed) { 506 getGuestInstanceId(), requestId, 'default', '', function(allowed) {
499 if (allowed) { 507 if (allowed) {
500 return; 508 return;
501 } 509 }
502 showWarningMessage(); 510 showWarningMessage();
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 } 607 }
600 }; 608 };
601 609
602 WebViewEvents.prototype.handleSizeChangedEvent = function( 610 WebViewEvents.prototype.handleSizeChangedEvent = function(
603 event, webViewEvent) { 611 event, webViewEvent) {
604 this.webViewInternal.onSizeChanged(webViewEvent); 612 this.webViewInternal.onSizeChanged(webViewEvent);
605 }; 613 };
606 614
607 exports.WebViewEvents = WebViewEvents; 615 exports.WebViewEvents = WebViewEvents;
608 exports.CreateEvent = CreateEvent; 616 exports.CreateEvent = CreateEvent;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698