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 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 [namespace].concat(Array.prototype.slice.call(arguments)), | 401 [namespace].concat(Array.prototype.slice.call(arguments)), |
402 extendSchema(schema)); | 402 extendSchema(schema)); |
403 }; | 403 }; |
404 } | 404 } |
405 ['get', 'set', 'remove', 'clear'].forEach(bindApiFunction.bind(this)); | 405 ['get', 'set', 'remove', 'clear'].forEach(bindApiFunction.bind(this)); |
406 } | 406 } |
407 StorageNamespace.prototype = new CustomBindingsObject(); | 407 StorageNamespace.prototype = new CustomBindingsObject(); |
408 customBindings['StorageNamespace'] = StorageNamespace; | 408 customBindings['StorageNamespace'] = StorageNamespace; |
409 } | 409 } |
410 function setupInputEvents() { | 410 function setupInputEvents() { |
| 411 if (chrome.experimental.input == undefined || |
| 412 chrome.experimental.input.ime == undefined) { |
| 413 // The IME api is not available, don't set up the event. |
| 414 return; |
| 415 } |
411 chrome.experimental.input.ime.onKeyEvent.dispatch = | 416 chrome.experimental.input.ime.onKeyEvent.dispatch = |
412 function(engineID, keyData) { | 417 function(engineID, keyData) { |
413 var args = Array.prototype.slice.call(arguments); | 418 var args = Array.prototype.slice.call(arguments); |
414 if (this.validate_) { | 419 if (this.validate_) { |
415 var validationErrors = this.validate_(args); | 420 var validationErrors = this.validate_(args); |
416 if (validationErrors) { | 421 if (validationErrors) { |
417 chrome.experimental.input.ime.eventHandled(requestId, false); | 422 chrome.experimental.input.ime.eventHandled(requestId, false); |
418 return validationErrors; | 423 return validationErrors; |
419 } | 424 } |
420 } | 425 } |
(...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1111 | 1116 |
1112 if (!chrome.tts) | 1117 if (!chrome.tts) |
1113 chrome.tts = {}; | 1118 chrome.tts = {}; |
1114 | 1119 |
1115 if (!chrome.ttsEngine) | 1120 if (!chrome.ttsEngine) |
1116 chrome.ttsEngine = {}; | 1121 chrome.ttsEngine = {}; |
1117 | 1122 |
1118 if (!chrome.experimental.downloads) | 1123 if (!chrome.experimental.downloads) |
1119 chrome.experimental.downloads = {}; | 1124 chrome.experimental.downloads = {}; |
1120 })(); | 1125 })(); |
OLD | NEW |