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 796 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
807 try { | 807 try { |
808 if (responseCallback) | 808 if (responseCallback) |
809 responseCallback(response); | 809 responseCallback(response); |
810 } finally { | 810 } finally { |
811 port.disconnect(); | 811 port.disconnect(); |
812 port = null; | 812 port = null; |
813 } | 813 } |
814 }); | 814 }); |
815 }; | 815 }; |
816 | 816 |
817 apiFunctions["experimental.savePage.saveAsMHTML"].customCallback = | 817 apiFunctions["pageCapture.saveAsMHTML"].customCallback = |
818 function(name, request, response) { | 818 function(name, request, response) { |
819 var params = chromeHidden.JSON.parse(response); | 819 var params = chromeHidden.JSON.parse(response); |
820 var path = params.mhtmlFilePath; | 820 var path = params.mhtmlFilePath; |
821 var size = params.mhtmlFileLength; | 821 var size = params.mhtmlFileLength; |
822 | 822 |
823 if (request.callback) | 823 if (request.callback) |
824 request.callback(CreateBlob(path, size)); | 824 request.callback(CreateBlob(path, size)); |
825 request.callback = null; | 825 request.callback = null; |
826 | 826 |
827 // Notify the browser. Now that the blob is referenced from JavaScript, | 827 // Notify the browser. Now that the blob is referenced from JavaScript, |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1108 | 1108 |
1109 if (!chrome.tts) | 1109 if (!chrome.tts) |
1110 chrome.tts = {}; | 1110 chrome.tts = {}; |
1111 | 1111 |
1112 if (!chrome.ttsEngine) | 1112 if (!chrome.ttsEngine) |
1113 chrome.ttsEngine = {}; | 1113 chrome.ttsEngine = {}; |
1114 | 1114 |
1115 if (!chrome.experimental.downloads) | 1115 if (!chrome.experimental.downloads) |
1116 chrome.experimental.downloads = {}; | 1116 chrome.experimental.downloads = {}; |
1117 })(); | 1117 })(); |
OLD | NEW |