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

Side by Side Diff: chrome/test/data/extensions/platform_apps/web_view/newwindow/embedder.js

Issue 444813002: Remove BrowserPlugin's -internal-attach method (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move AttachToBrowserPlugin to RenderFrame 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 var embedder = {}; 5 var embedder = {};
6 embedder.test = {}; 6 embedder.test = {};
7 embedder.baseGuestURL = ''; 7 embedder.baseGuestURL = '';
8 embedder.guestURL = ''; 8 embedder.guestURL = '';
9 embedder.guestWithLinkURL = ''; 9 embedder.guestWithLinkURL = '';
10 embedder.newWindowURL = ''; 10 embedder.newWindowURL = '';
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 chrome.app.window.create('newwindow.html', { 428 chrome.app.window.create('newwindow.html', {
429 width: 640, 429 width: 640,
430 height: 480 430 height: 480
431 }, function(newwindow) { 431 }, function(newwindow) {
432 newwindow.contentWindow.onload = function(evt) { 432 newwindow.contentWindow.onload = function(evt) {
433 var newwebview = 433 var newwebview =
434 newwindow.contentWindow.document.querySelector('webview'); 434 newwindow.contentWindow.document.querySelector('webview');
435 newwebview.request.onBeforeRequest.addListener(function(e) { 435 newwebview.request.onBeforeRequest.addListener(function(e) {
436 if (!calledWebRequestEvent) { 436 if (!calledWebRequestEvent) {
437 calledWebRequestEvent = true; 437 calledWebRequestEvent = true;
438 window.console.log('removing newwebview');
438 newwebview.parentElement.removeChild(newwebview); 439 newwebview.parentElement.removeChild(newwebview);
440 window.console.log('after removeChild');
439 setTimeout(function() { 441 setTimeout(function() {
442 window.console.log('navigating webview');
440 webview.src = embedder.guestURL; 443 webview.src = embedder.guestURL;
444 window.console.log('after navigating webview');
441 }, 0); 445 }, 0);
442 } 446 }
443 }, {urls: ['<all_urls>']}); 447 }, {urls: ['<all_urls>']});
444 try { 448 try {
445 e.window.attach(newwebview); 449 e.window.attach(newwebview);
446 } catch (e) { 450 } catch (e) {
447 embedder.test.fail(); 451 embedder.test.fail();
448 } 452 }
449 }; 453 };
450 }); 454 });
(...skipping 17 matching lines...) Expand all
468 'testNewWindowWebRequestCloseWindow': testNewWindowWebRequestCloseWindow, 472 'testNewWindowWebRequestCloseWindow': testNewWindowWebRequestCloseWindow,
469 'testNewWindowWebRequestRemoveElement': testNewWindowWebRequestRemoveElement 473 'testNewWindowWebRequestRemoveElement': testNewWindowWebRequestRemoveElement
470 }; 474 };
471 475
472 onload = function() { 476 onload = function() {
473 chrome.test.getConfig(function(config) { 477 chrome.test.getConfig(function(config) {
474 embedder.setUp_(config); 478 embedder.setUp_(config);
475 chrome.test.sendMessage('Launched'); 479 chrome.test.sendMessage('Launched');
476 }); 480 });
477 }; 481 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698