OLD | NEW |
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 function CreateWebViewAndGuest(callback) { | 5 function CreateWebViewAndGuest(callback) { |
6 var webview = document.createElement('webview'); | 6 var webview = document.createElement('webview'); |
| 7 webview.allowtransparency = true; |
| 8 webview.allowscaling = true; |
7 var onLoadStop = function(e) { | 9 var onLoadStop = function(e) { |
8 chrome.test.sendMessage('WebViewTest.LAUNCHED'); | 10 chrome.test.sendMessage('WebViewTest.LAUNCHED'); |
9 webview.removeEventListener('loadstop', onLoadStop); | 11 webview.removeEventListener('loadstop', onLoadStop); |
10 webview.removeEventListener('loadabort', onLoadAbort); | 12 webview.removeEventListener('loadabort', onLoadAbort); |
11 callback(); | 13 callback(); |
12 }; | 14 }; |
13 webview.addEventListener('loadstop', onLoadStop); | 15 webview.addEventListener('loadstop', onLoadStop); |
14 | 16 |
15 var onLoadAbort = function(e) { | 17 var onLoadAbort = function(e) { |
16 chrome.test.sendMessage('WebViewTest.FAILURE'); | 18 chrome.test.sendMessage('WebViewTest.FAILURE'); |
(...skipping 14 matching lines...) Expand all Loading... |
31 e.window.attach(newwebview); | 33 e.window.attach(newwebview); |
32 document.body.appendChild(newwebview); | 34 document.body.appendChild(newwebview); |
33 }); | 35 }); |
34 | 36 |
35 webview.addEventListener('loadstop', function(e) { | 37 webview.addEventListener('loadstop', function(e) { |
36 chrome.test.sendMessage('WebViewTest.LOADSTOP'); | 38 chrome.test.sendMessage('WebViewTest.LOADSTOP'); |
37 }); | 39 }); |
38 }); | 40 }); |
39 document.body.appendChild(webview); | 41 document.body.appendChild(webview); |
40 }; | 42 }; |
OLD | NEW |