Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(121)

Side by Side Diff: chrome/renderer/resources/extension_process_bindings.js

Issue 7720002: Chrome Extensions chrome.experimental.offscreenTabs.* API implementation, docs, and test. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 989 matching lines...) Expand 10 before | Expand all | Expand 10 after
1000 // the rest of the API. See crbug/29215 . 1000 // the rest of the API. See crbug/29215 .
1001 if (arguments.length == 2 && typeof(arguments[1]) == "function") { 1001 if (arguments.length == 2 && typeof(arguments[1]) == "function") {
1002 // If the old signature is used, add a null details object. 1002 // If the old signature is used, add a null details object.
1003 newArgs = [arguments[0], null, arguments[1]]; 1003 newArgs = [arguments[0], null, arguments[1]];
1004 } else { 1004 } else {
1005 newArgs = arguments; 1005 newArgs = arguments;
1006 } 1006 }
1007 return newArgs; 1007 return newArgs;
1008 }; 1008 };
1009 1009
1010 apiFunctions["experimental.offscreenTabs.sendKeyboardEvent"].
1011 updateArgumentsPreValidate = function() {
1012 // Delete properties that are objects in order to be able to serialize
1013 for (prop in arguments[1])
1014 if (typeof arguments[1][prop] == "object")
1015 delete arguments[1][prop];
Ken Russell (switch to Gerrit) 2011/08/26 00:57:48 How about using a local variable for arguments[1]?
alexbost 2011/08/26 22:07:23 Done.
1016
1017 return arguments;
1018 };
1019
1020 apiFunctions["experimental.offscreenTabs.sendMouseEvent"].
1021 updateArgumentsPreValidate =
1022 apiFunctions["experimental.offscreenTabs.sendKeyboardEvent"].
1023 updateArgumentsPreValidate;
1024
1010 apiFunctions["omnibox.sendSuggestions"].updateArgumentsPostValidate = 1025 apiFunctions["omnibox.sendSuggestions"].updateArgumentsPostValidate =
1011 function(requestId, userSuggestions) { 1026 function(requestId, userSuggestions) {
1012 var suggestions = []; 1027 var suggestions = [];
1013 for (var i = 0; i < userSuggestions.length; i++) { 1028 for (var i = 0; i < userSuggestions.length; i++) {
1014 var parseResult = parseOmniboxDescription( 1029 var parseResult = parseOmniboxDescription(
1015 userSuggestions[i].description); 1030 userSuggestions[i].description);
1016 parseResult.content = userSuggestions[i].content; 1031 parseResult.content = userSuggestions[i].content;
1017 suggestions.push(parseResult); 1032 suggestions.push(parseResult);
1018 } 1033 }
1019 return [requestId, suggestions]; 1034 return [requestId, suggestions];
(...skipping 29 matching lines...) Expand all
1049 1064
1050 if (!chrome.tts) 1065 if (!chrome.tts)
1051 chrome.tts = {}; 1066 chrome.tts = {};
1052 1067
1053 if (!chrome.ttsEngine) 1068 if (!chrome.ttsEngine)
1054 chrome.ttsEngine = {}; 1069 chrome.ttsEngine = {};
1055 1070
1056 if (!chrome.experimental.downloads) 1071 if (!chrome.experimental.downloads)
1057 chrome.experimental.downloads = {}; 1072 chrome.experimental.downloads = {};
1058 })(); 1073 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698