| 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 require('json_schema'); |
| 11 native function GetExtensionAPIDefinition(); | 10 require('event_bindings'); |
| 12 native function GetNextRequestId(); | 11 var natives = requireNative('schema_generated_bindings'); |
| 13 native function StartRequest(); | 12 var GetExtensionAPIDefinition = natives.GetExtensionAPIDefinition; |
| 14 native function SetIconCommon(); | 13 var GetNextRequestId = natives.GetNextRequestId; |
| 14 var StartRequest = natives.StartRequest; |
| 15 var SetIconCommon = natives.SetIconCommon; |
| 15 | 16 |
| 16 var chromeHidden = GetChromeHidden(); | 17 var chromeHidden = requireNative('chrome_hidden').GetChromeHidden(); |
| 17 | 18 |
| 18 // The object to generate the bindings for "internal" APIs in, so that | 19 // The object to generate the bindings for "internal" APIs in, so that |
| 19 // extensions can't directly call them (without access to chromeHidden), | 20 // extensions can't directly call them (without access to chromeHidden), |
| 20 // but are still needed for internal mechanisms of extensions (e.g. events). | 21 // but are still needed for internal mechanisms of extensions (e.g. events). |
| 21 // | 22 // |
| 22 // This is distinct to the "*Private" APIs which are controlled via | 23 // This is distinct to the "*Private" APIs which are controlled via |
| 23 // having strict permissions and aren't generated *anywhere* unless needed. | 24 // having strict permissions and aren't generated *anywhere* unless needed. |
| 24 var internalAPIs = {}; | 25 var internalAPIs = {}; |
| 25 chromeHidden.internalAPIs = internalAPIs; | 26 chromeHidden.internalAPIs = internalAPIs; |
| 26 | 27 |
| (...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 627 // See http://crbug.com/100242 | 628 // See http://crbug.com/100242 |
| 628 if (chrome.webstorePrivate) { | 629 if (chrome.webstorePrivate) { |
| 629 chrome.webstorePrivate.beginInstallWithManifest2 = | 630 chrome.webstorePrivate.beginInstallWithManifest2 = |
| 630 chrome.webstorePrivate.beginInstallWithManifest3; | 631 chrome.webstorePrivate.beginInstallWithManifest3; |
| 631 } | 632 } |
| 632 | 633 |
| 633 if (chrome.test) | 634 if (chrome.test) |
| 634 chrome.test.getApiDefinitions = GetExtensionAPIDefinition; | 635 chrome.test.getApiDefinitions = GetExtensionAPIDefinition; |
| 635 }); | 636 }); |
| 636 })(); | 637 })(); |
| OLD | NEW |