OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 chrome = chrome || {}; |
9 (function() { | 9 (function() { |
10 native function GetExtensionAPIDefinition(); | 10 native function GetExtensionAPIDefinition(); |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 }; | 332 }; |
333 ChromeSetting.prototype = new CustomBindingsObject(); | 333 ChromeSetting.prototype = new CustomBindingsObject(); |
334 customBindings['ChromeSetting'] = ChromeSetting; | 334 customBindings['ChromeSetting'] = ChromeSetting; |
335 } | 335 } |
336 | 336 |
337 function setupContentSetting() { | 337 function setupContentSetting() { |
338 function ContentSetting(contentType, settingSchema) { | 338 function ContentSetting(contentType, settingSchema) { |
339 this.get = function(details, callback) { | 339 this.get = function(details, callback) { |
340 var getSchema = this.parameters.get; | 340 var getSchema = this.parameters.get; |
341 chromeHidden.validate([details, callback], getSchema); | 341 chromeHidden.validate([details, callback], getSchema); |
342 return sendRequest('experimental.contentSettings.get', | 342 return sendRequest('contentSettings.get', |
343 [contentType, details, callback], | 343 [contentType, details, callback], |
344 extendSchema(getSchema)); | 344 extendSchema(getSchema)); |
345 }; | 345 }; |
346 this.set = function(details, callback) { | 346 this.set = function(details, callback) { |
347 var setSchema = this.parameters.set.slice(); | 347 var setSchema = this.parameters.set.slice(); |
348 setSchema[0].properties.setting = settingSchema; | 348 setSchema[0].properties.setting = settingSchema; |
349 chromeHidden.validate([details, callback], setSchema); | 349 chromeHidden.validate([details, callback], setSchema); |
350 return sendRequest('experimental.contentSettings.set', | 350 return sendRequest('contentSettings.set', |
351 [contentType, details, callback], | 351 [contentType, details, callback], |
352 extendSchema(setSchema)); | 352 extendSchema(setSchema)); |
353 }; | 353 }; |
354 this.clear = function(details, callback) { | 354 this.clear = function(details, callback) { |
355 var clearSchema = this.parameters.clear; | 355 var clearSchema = this.parameters.clear; |
356 chromeHidden.validate([details, callback], clearSchema); | 356 chromeHidden.validate([details, callback], clearSchema); |
357 return sendRequest('experimental.contentSettings.clear', | 357 return sendRequest('contentSettings.clear', |
358 [contentType, details, callback], | 358 [contentType, details, callback], |
359 extendSchema(clearSchema)); | 359 extendSchema(clearSchema)); |
360 }; | 360 }; |
361 this.getResourceIdentifiers = function(callback) { | 361 this.getResourceIdentifiers = function(callback) { |
362 var schema = this.parameters.getResourceIdentifiers; | 362 var schema = this.parameters.getResourceIdentifiers; |
363 chromeHidden.validate([callback], schema); | 363 chromeHidden.validate([callback], schema); |
364 return sendRequest( | 364 return sendRequest( |
365 'experimental.contentSettings.getResourceIdentifiers', | 365 'contentSettings.getResourceIdentifiers', |
366 [contentType, callback], | 366 [contentType, callback], |
367 extendSchema(schema)); | 367 extendSchema(schema)); |
368 }; | 368 }; |
369 } | 369 } |
370 ContentSetting.prototype = new CustomBindingsObject(); | 370 ContentSetting.prototype = new CustomBindingsObject(); |
371 customBindings['ContentSetting'] = ContentSetting; | 371 customBindings['ContentSetting'] = ContentSetting; |
372 } | 372 } |
373 | 373 |
374 function setupInputEvents() { | 374 function setupInputEvents() { |
375 chrome.experimental.input.onKeyEvent.dispatch = | 375 chrome.experimental.input.onKeyEvent.dispatch = |
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1033 | 1033 |
1034 if (!chrome.tts) | 1034 if (!chrome.tts) |
1035 chrome.tts = {}; | 1035 chrome.tts = {}; |
1036 | 1036 |
1037 if (!chrome.ttsEngine) | 1037 if (!chrome.ttsEngine) |
1038 chrome.ttsEngine = {}; | 1038 chrome.ttsEngine = {}; |
1039 | 1039 |
1040 if (!chrome.experimental.downloads) | 1040 if (!chrome.experimental.downloads) |
1041 chrome.experimental.downloads = {}; | 1041 chrome.experimental.downloads = {}; |
1042 })(); | 1042 })(); |
OLD | NEW |