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 require('json_schema'); | 8 require('json_schema'); |
9 require('event_bindings'); | 9 require('event_bindings'); |
10 var natives = requireNative('schema_generated_bindings'); | 10 var GetExtensionAPIDefinition = |
11 var GetExtensionAPIDefinition = natives.GetExtensionAPIDefinition; | 11 requireNative('apiDefinitions').GetExtensionAPIDefinition; |
12 var sendRequest = require('sendRequest').sendRequest; | 12 var sendRequest = require('sendRequest').sendRequest; |
13 | 13 |
14 var chromeHidden = requireNative('chrome_hidden').GetChromeHidden(); | 14 var chromeHidden = requireNative('chrome_hidden').GetChromeHidden(); |
15 | 15 |
16 // The object to generate the bindings for "internal" APIs in, so that | 16 // The object to generate the bindings for "internal" APIs in, so that |
17 // extensions can't directly call them (without access to chromeHidden), | 17 // extensions can't directly call them (without access to chromeHidden), |
18 // but are still needed for internal mechanisms of extensions (e.g. events). | 18 // but are still needed for internal mechanisms of extensions (e.g. events). |
19 // | 19 // |
20 // This is distinct to the "*Private" APIs which are controlled via | 20 // This is distinct to the "*Private" APIs which are controlled via |
21 // having strict permissions and aren't generated *anywhere* unless needed. | 21 // having strict permissions and aren't generated *anywhere* unless needed. |
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
580 // beginInstallWithManifest2. | 580 // beginInstallWithManifest2. |
581 // See http://crbug.com/100242 | 581 // See http://crbug.com/100242 |
582 if (chrome.webstorePrivate) { | 582 if (chrome.webstorePrivate) { |
583 chrome.webstorePrivate.beginInstallWithManifest2 = | 583 chrome.webstorePrivate.beginInstallWithManifest2 = |
584 chrome.webstorePrivate.beginInstallWithManifest3; | 584 chrome.webstorePrivate.beginInstallWithManifest3; |
585 } | 585 } |
586 | 586 |
587 if (chrome.test) | 587 if (chrome.test) |
588 chrome.test.getApiDefinitions = GetExtensionAPIDefinition; | 588 chrome.test.getApiDefinitions = GetExtensionAPIDefinition; |
589 }); | 589 }); |
OLD | NEW |