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 // TODO(battre): cleanup the usage of packages everywhere, as described here | 8 // TODO(battre): cleanup the usage of packages everywhere, as described here |
9 // http://codereview.chromium.org/10392008/diff/38/chrome/renderer/resources/e
xtensions/schema_generated_bindings.js | 9 // http://codereview.chromium.org/10392008/diff/38/chrome/renderer/resources/e
xtensions/schema_generated_bindings.js |
10 | 10 |
11 require('json_schema'); | 11 require('json_schema'); |
12 require('event_bindings'); | 12 require('event_bindings'); |
13 var GetExtensionAPIDefinition = | 13 var GetExtensionAPIDefinition = |
14 requireNative('apiDefinitions').GetExtensionAPIDefinition; | 14 requireNative('apiDefinitions').GetExtensionAPIDefinition; |
15 var sendRequest = require('sendRequest').sendRequest; | 15 var sendRequest = require('sendRequest').sendRequest; |
16 var utils = require('utils'); | 16 var utils = require('utils'); |
17 var isDevChannel = requireNative('channel').IsDevChannel; | |
18 var chromeHidden = requireNative('chrome_hidden').GetChromeHidden(); | 17 var chromeHidden = requireNative('chrome_hidden').GetChromeHidden(); |
19 var schemaUtils = require('schemaUtils'); | 18 var schemaUtils = require('schemaUtils'); |
20 | 19 |
21 // The object to generate the bindings for "internal" APIs in, so that | 20 // The object to generate the bindings for "internal" APIs in, so that |
22 // extensions can't directly call them (without access to chromeHidden), | 21 // extensions can't directly call them (without access to chromeHidden), |
23 // but are still needed for internal mechanisms of extensions (e.g. events). | 22 // but are still needed for internal mechanisms of extensions (e.g. events). |
24 // | 23 // |
25 // This is distinct to the "*Private" APIs which are controlled via | 24 // This is distinct to the "*Private" APIs which are controlled via |
26 // having strict permissions and aren't generated *anywhere* unless needed. | 25 // having strict permissions and aren't generated *anywhere* unless needed. |
27 var internalAPIs = {}; | 26 var internalAPIs = {}; |
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 // beginInstallWithManifest2. | 433 // beginInstallWithManifest2. |
435 // See http://crbug.com/100242 | 434 // See http://crbug.com/100242 |
436 if (chrome.webstorePrivate) { | 435 if (chrome.webstorePrivate) { |
437 chrome.webstorePrivate.beginInstallWithManifest2 = | 436 chrome.webstorePrivate.beginInstallWithManifest2 = |
438 chrome.webstorePrivate.beginInstallWithManifest3; | 437 chrome.webstorePrivate.beginInstallWithManifest3; |
439 } | 438 } |
440 | 439 |
441 if (chrome.test) | 440 if (chrome.test) |
442 chrome.test.getApiDefinitions = GetExtensionAPIDefinition; | 441 chrome.test.getApiDefinitions = GetExtensionAPIDefinition; |
443 }); | 442 }); |
OLD | NEW |