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

Side by Side Diff: chrome/test/data/extensions/platform_apps/web_view/simple/main.js

Issue 890183002: Allow Signin page to open other chrome:// URLs if login content in <webview> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments Created 5 years, 10 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
(Empty)
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
3 // found in the LICENSE file.
4
5 function CreateWebViewAndGuest(callback) {
6 var webview = document.createElement('webview');
7 var onLoadStop = function(e) {
8 chrome.test.sendMessage('WebViewTest.LAUNCHED');
9 webview.removeEventListener('loadstop', onLoadStop);
10 webview.removeEventListener('loadabort', onLoadAbort);
11 callback();
12 };
13 webview.addEventListener('loadstop', onLoadStop);
14
15 var onLoadAbort = function(e) {
16 chrome.test.sendMessage('WebViewTest.FAILURE');
17 webview.removeEventListener('loadstop', onLoadStop);
18 webview.removeEventListener('loadabort', onLoadAbort);
19 };
20 webview.src = 'data:text/html,<html><body>simple test</body></html>';
21 return webview;
22 }
23
24 onload = function() {
25 var webview = CreateWebViewAndGuest(function() {
26 webview.addEventListener('newwindow', function(e) {
27 var newwebview = document.createElement('webview');
28 newwebview.addEventListener('loadstop', function(e) {
29 chrome.test.sendMessage('WebViewTest.NEWWINDOW');
30 });
31 e.window.attach(newwebview);
32 document.body.appendChild(newwebview);
33 });
34
35 webview.addEventListener('loadstop', function(e) {
36 chrome.test.sendMessage('WebViewTest.LOADSTOP');
37 });
38 });
39 document.body.appendChild(webview);
40 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698