OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 unprivileged javascript APIs related to chrome | 5 // This script contains unprivileged javascript APIs related to chrome |
6 // extensions. It is loaded by any extension-related context, such as content | 6 // extensions. It is loaded by any extension-related context, such as content |
7 // scripts or toolstrips. | 7 // scripts or toolstrips. |
8 // See user_script_slave.cc for script that is loaded by content scripts only. | 8 // See user_script_slave.cc for script that is loaded by content scripts only. |
9 // TODO(mpcomplete): we also load this in regular web pages, but don't need | 9 // TODO(mpcomplete): we also load this in regular web pages, but don't need |
10 // to. | 10 // to. |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 // developers trying to call extension API's that aren't allowed to be | 236 // developers trying to call extension API's that aren't allowed to be |
237 // called from content scripts. | 237 // called from content scripts. |
238 function setupApiStubs() { | 238 function setupApiStubs() { |
239 // TODO(asargent) It would be nice to eventually generate this | 239 // TODO(asargent) It would be nice to eventually generate this |
240 // programmatically from extension_api.json (there is already a browser test | 240 // programmatically from extension_api.json (there is already a browser test |
241 // that should prevent it from getting stale). | 241 // that should prevent it from getting stale). |
242 var privileged = [ | 242 var privileged = [ |
243 // Entire namespaces. | 243 // Entire namespaces. |
244 "bookmarks", | 244 "bookmarks", |
245 "browserAction", | 245 "browserAction", |
| 246 "contextMenus", |
246 "cookies", | 247 "cookies", |
247 "devtools", | 248 "devtools", |
248 "experimental.accessibility", | 249 "experimental.accessibility", |
249 "experimental.bookmarkManager", | 250 "experimental.bookmarkManager", |
250 "experimental.clipboard", | 251 "experimental.clipboard", |
251 "experimental.contextMenus", | |
252 "experimental.extension", | 252 "experimental.extension", |
253 "experimental.infobars", | 253 "experimental.infobars", |
254 "experimental.metrics", | 254 "experimental.metrics", |
255 "experimental.omnibox", | 255 "experimental.omnibox", |
256 "experimental.popup", | 256 "experimental.popup", |
257 "experimental.processes", | 257 "experimental.processes", |
258 "experimental.rlz", | 258 "experimental.rlz", |
259 "history", | 259 "history", |
260 "idle", | 260 "idle", |
261 "pageAction", | 261 "pageAction", |
(...skipping 12 matching lines...) Expand all Loading... |
274 "extension.onConnectExternal", | 274 "extension.onConnectExternal", |
275 "extension.onRequestExternal", | 275 "extension.onRequestExternal", |
276 "i18n.getAcceptLanguages" | 276 "i18n.getAcceptLanguages" |
277 ]; | 277 ]; |
278 for (var i = 0; i < privileged.length; i++) { | 278 for (var i = 0; i < privileged.length; i++) { |
279 createStub(privileged[i]); | 279 createStub(privileged[i]); |
280 } | 280 } |
281 } | 281 } |
282 | 282 |
283 })(); | 283 })(); |
OLD | NEW |