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 || {}; | 8 var GetChromeHidden = natives.GetChromeHidden; |
9 (function() { | 9 var GetExtensionAPIDefinition = natives.GetExtensionAPIDefinition; |
10 native function GetChromeHidden(); | 10 var GetNextRequestId = natives.GetNextRequestId; |
11 native function GetExtensionAPIDefinition(); | 11 var StartRequest = natives.StartRequest; |
12 native function GetNextRequestId(); | 12 var SetIconCommon = natives.SetIconCommon; |
13 native function StartRequest(); | |
14 native function SetIconCommon(); | |
15 | 13 |
16 var chromeHidden = GetChromeHidden(); | 14 var chromeHidden = GetChromeHidden(); |
17 | 15 |
18 if (!chrome) | 16 if (!chrome) |
19 chrome = {}; | 17 chrome = {}; |
20 | 18 |
21 function apiExists(path) { | 19 function apiExists(path) { |
22 var resolved = chrome; | 20 var resolved = chrome; |
23 path.split(".").forEach(function(next) { | 21 path.split(".").forEach(function(next) { |
24 if (resolved) | 22 if (resolved) |
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
573 // beginInstallWithManifest2. | 571 // beginInstallWithManifest2. |
574 // See http://crbug.com/100242 | 572 // See http://crbug.com/100242 |
575 if (apiExists("webstorePrivate")) { | 573 if (apiExists("webstorePrivate")) { |
576 chrome.webstorePrivate.beginInstallWithManifest2 = | 574 chrome.webstorePrivate.beginInstallWithManifest2 = |
577 chrome.webstorePrivate.beginInstallWithManifest3; | 575 chrome.webstorePrivate.beginInstallWithManifest3; |
578 } | 576 } |
579 | 577 |
580 if (apiExists("test")) | 578 if (apiExists("test")) |
581 chrome.test.getApiDefinitions = GetExtensionAPIDefinition; | 579 chrome.test.getApiDefinitions = GetExtensionAPIDefinition; |
582 }); | 580 }); |
583 })(); | |
OLD | NEW |