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

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

Issue 10698163: Make miscellaneous_bindings.js not depend on onLoad(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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/miscellaneous_bindings.js
diff --git a/chrome/renderer/resources/extensions/miscellaneous_bindings.js b/chrome/renderer/resources/extensions/miscellaneous_bindings.js
index 1124e8b724238adb70eaf322e53e371fc6acf140..01ba28351d92f5d2fe52b384cd89026f084d609b 100644
--- a/chrome/renderer/resources/extensions/miscellaneous_bindings.js
+++ b/chrome/renderer/resources/extensions/miscellaneous_bindings.js
@@ -18,8 +18,19 @@
var BindToGC = miscNatives.BindToGC;
var chromeHidden = requireNative('chrome_hidden').GetChromeHidden();
- var manifestVersion;
- var extensionId;
+
+ var processNatives = requireNative('process');
+ var manifestVersion = processNatives.GetManifestVersion();
+ var extensionId = processNatives.GetExtensionId();
+
+ chrome.extension = chrome.extension || {};
+
+ if (manifestVersion < 2) {
+ chrome.self = chrome.extension;
+ chrome.extension.inIncognitoTab = inIncognitoContext;
not at google - send to devlin 2012/07/12 05:47:41 A more appropriate place for this stuff would be i
koz (OOO until 15th September) 2012/07/12 06:06:12 Done.
+ }
+
+ chrome.extension.inIncognitoContext = inIncognitoContext;
// The reserved channel name for the sendRequest/sendMessage APIs.
// Note: sendRequest is deprecated.
@@ -288,22 +299,3 @@
}
});
}
-
- // This function is called on context initialization for both content scripts
- // and extension contexts.
- chromeHidden.onLoad.addListener(function(tempExtensionId,
- isExtensionProcess,
- inIncognitoContext,
- tempManifestVersion) {
- extensionId = tempExtensionId;
- manifestVersion = tempManifestVersion;
-
- chrome.extension = chrome.extension || {};
-
- if (manifestVersion < 2) {
- chrome.self = chrome.extension;
- chrome.extension.inIncognitoTab = inIncognitoContext;
- }
-
- chrome.extension.inIncognitoContext = inIncognitoContext;
- });

Powered by Google App Engine
This is Rietveld 408576698