OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // This script contains privileged chrome extension related javascript APIs. | 5 // This script contains privileged chrome extension related javascript APIs. |
6 // It is loaded by pages whose URL has the chrome-extension protocol. | 6 // It is loaded by pages whose URL has the chrome-extension protocol. |
7 | 7 |
8 var chrome = chrome || {}; | |
9 (function() { | 8 (function() { |
10 native function GetChromeHidden(); | 9 var natives = requireNative('schema_generated_bindings'); |
11 native function GetExtensionAPIDefinition(); | 10 var GetExtensionAPIDefinition = natives.GetExtensionAPIDefinition; |
12 native function GetNextRequestId(); | 11 var GetNextRequestId = natives.GetNextRequestId; |
13 native function StartRequest(); | 12 var StartRequest = natives.StartRequest; |
14 native function SetIconCommon(); | 13 var SetIconCommon = natives.SetIconCommon; |
15 | 14 |
16 var chromeHidden = GetChromeHidden(); | 15 var chromeHidden = requireNative('chrome_hidden').GetChromeHidden(); |
17 | 16 |
18 // The object to generate the bindings for "internal" APIs in, so that | 17 // The object to generate the bindings for "internal" APIs in, so that |
19 // extensions can't directly call them (without access to chromeHidden), | 18 // extensions can't directly call them (without access to chromeHidden), |
20 // but are still needed for internal mechanisms of extensions (e.g. events). | 19 // but are still needed for internal mechanisms of extensions (e.g. events). |
21 // | 20 // |
22 // This is distinct to the "*Private" APIs which are controlled via | 21 // This is distinct to the "*Private" APIs which are controlled via |
23 // having strict permissions and aren't generated *anywhere* unless needed. | 22 // having strict permissions and aren't generated *anywhere* unless needed. |
24 var internalAPIs = {}; | 23 var internalAPIs = {}; |
25 chromeHidden.internalAPIs = internalAPIs; | 24 chromeHidden.internalAPIs = internalAPIs; |
26 | 25 |
(...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
627 // See http://crbug.com/100242 | 626 // See http://crbug.com/100242 |
628 if (chrome.webstorePrivate) { | 627 if (chrome.webstorePrivate) { |
629 chrome.webstorePrivate.beginInstallWithManifest2 = | 628 chrome.webstorePrivate.beginInstallWithManifest2 = |
630 chrome.webstorePrivate.beginInstallWithManifest3; | 629 chrome.webstorePrivate.beginInstallWithManifest3; |
631 } | 630 } |
632 | 631 |
633 if (chrome.test) | 632 if (chrome.test) |
634 chrome.test.getApiDefinitions = GetExtensionAPIDefinition; | 633 chrome.test.getApiDefinitions = GetExtensionAPIDefinition; |
635 }); | 634 }); |
636 })(); | 635 })(); |
OLD | NEW |