Chromium Code Reviews| 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; |
| - }); |