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 771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
782 try { | 782 try { |
783 if (responseCallback) | 783 if (responseCallback) |
784 responseCallback(response); | 784 responseCallback(response); |
785 } finally { | 785 } finally { |
786 port.disconnect(); | 786 port.disconnect(); |
787 port = null; | 787 port = null; |
788 } | 788 } |
789 }); | 789 }); |
790 }; | 790 }; |
791 | 791 |
792 apiFunctions["experimental.savePage.saveAsMHTML"].customCallback = | 792 apiFunctions["pageCapture.saveAsMhtml"].customCallback = |
793 function(name, request, response) { | 793 function(name, request, response) { |
794 var params = chromeHidden.JSON.parse(response); | 794 var params = chromeHidden.JSON.parse(response); |
795 var path = params.mhtmlFilePath; | 795 var path = params.mhtmlFilePath; |
796 var size = params.mhtmlFileLength; | 796 var size = params.mhtmlFileLength; |
797 | 797 |
798 if (request.callback) | 798 if (request.callback) |
799 request.callback(CreateBlob(path, size)); | 799 request.callback(CreateBlob(path, size)); |
800 request.callback = null; | 800 request.callback = null; |
801 | 801 |
802 // Notify the browser. Now that the blob is referenced from JavaScript, | 802 // Notify the browser. Now that the blob is referenced from JavaScript, |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1083 | 1083 |
1084 if (!chrome.tts) | 1084 if (!chrome.tts) |
1085 chrome.tts = {}; | 1085 chrome.tts = {}; |
1086 | 1086 |
1087 if (!chrome.ttsEngine) | 1087 if (!chrome.ttsEngine) |
1088 chrome.ttsEngine = {}; | 1088 chrome.ttsEngine = {}; |
1089 | 1089 |
1090 if (!chrome.experimental.downloads) | 1090 if (!chrome.experimental.downloads) |
1091 chrome.experimental.downloads = {}; | 1091 chrome.experimental.downloads = {}; |
1092 })(); | 1092 })(); |
OLD | NEW |