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

Side by Side Diff: chrome/test/data/extensions/platform_apps/web_view/shim/inject_comm_channel.js

Issue 910073003: <webview>: Make contentWindow available prior to attachment (on display:none). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed nit Created 5 years, 9 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
« no previous file with comments | « no previous file | chrome/test/data/extensions/platform_apps/web_view/shim/main.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 = null; 5 var embedder = null;
6 6
7 function reportConnected() { 7 function reportConnected() {
8 window.console.log('Reporting connection to embedder.');
8 var msg = ['connected']; 9 var msg = ['connected'];
9 embedder.postMessage(JSON.stringify(msg), '*'); 10 embedder.postMessage(JSON.stringify(msg), '*');
10 } 11 }
11 12
12 window.addEventListener('message', function(e) { 13 window.addEventListener('message', function(e) {
13 embedder = e.source; 14 embedder = e.source;
14 var data = JSON.parse(e.data); 15 var data = JSON.parse(e.data);
15 switch (data[0]) { 16 switch (data[0]) {
16 case 'connect': { 17 case 'connect': {
17 reportConnected(); 18 reportConnected();
18 break; 19 break;
19 } 20 }
20 } 21 }
21 }); 22 });
22 23
24
25 window.console.log('Script has been successfully injected.');
OLDNEW
« no previous file with comments | « no previous file | chrome/test/data/extensions/platform_apps/web_view/shim/main.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698