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

Unified Diff: chrome/renderer/resources/extensions/web_view.js

Issue 16975007: Run shim's watchForTag on document.DOMContentLoaded (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/renderer/resources/extensions/web_view.js
diff --git a/chrome/renderer/resources/extensions/web_view.js b/chrome/renderer/resources/extensions/web_view.js
index 1a210ab96808ca0fd140316c3525b979c619112a..53508c9e7bd33789b25fec4c1c26a50f33337246 100644
--- a/chrome/renderer/resources/extensions/web_view.js
+++ b/chrome/renderer/resources/extensions/web_view.js
@@ -7,6 +7,7 @@
// The actual tag is implemented via the browser plugin. The internals of this
// are hidden via Shadow DOM.
+var appWindowNatives = requireNative('app_window_natives');
var forEach = require('utils').forEach;
var watchForTag = require('tagWatcher').watchForTag;
@@ -44,9 +45,9 @@ var WEB_VIEW_EVENTS = {
'unresponsive' : ['processId']
};
-window.addEventListener('DOMContentLoaded', function() {
- watchForTag('WEBVIEW', function(addedNode) { new WebView(addedNode); });
-});
+//window.addEventListener('DOMContentLoaded', function() {
+// watchForTag('WEBVIEW', function(addedNode) { new WebView(addedNode); });
+//});
/**
* @constructor
@@ -383,4 +384,15 @@ WebView.prototype.setupExecuteCodeAPI_ = function() {
*/
WebView.prototype.maybeSetupExperimentalAPI_ = function() {};
+var w = chrome.app.window.current();
+window.console.log('***** current: ' + w);
not at google - send to devlin 2013/06/13 22:08:32 i presume this doesn't really do anything?
lazyboy 2013/06/14 00:09:50 Right, debug code, removed.
+
+appWindowNatives.OnCurrentContextReady(function() {
+ window.console.log('******* OnCurrentContextReady ********');
+ document.addEventListener('DOMContentLoaded', function() {
not at google - send to devlin 2013/06/13 22:08:32 from reading the code it looks like this extra lis
lazyboy 2013/06/14 00:09:50 This is the point where (new) document is created.
+ window.console.log('shim.DOMContentLoaded');
+ watchForTag('WEBVIEW', function(addedNode) { new WebView(addedNode); });
+ });
+});
+
exports.WebView = WebView;

Powered by Google App Engine
This is Rietveld 408576698