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

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 973 matching lines...) Expand 10 before | Expand all | Expand 10 after
984 // the rest of the API. See crbug/29215 . 984 // the rest of the API. See crbug/29215 .
985 if (arguments.length == 2 && typeof(arguments[1]) == "function") { 985 if (arguments.length == 2 && typeof(arguments[1]) == "function") {
986 // If the old signature is used, add a null details object. 986 // If the old signature is used, add a null details object.
987 newArgs = [arguments[0], null, arguments[1]]; 987 newArgs = [arguments[0], null, arguments[1]];
988 } else { 988 } else {
989 newArgs = arguments; 989 newArgs = arguments;
990 } 990 }
991 return newArgs; 991 return newArgs;
992 }; 992 };
993 993
994 apiFunctions["experimental.offscreenTabs.sendKeyboardEvent"].
995 updateArgumentsPreValidate = function() {
996 // Delete properties that are objects in order to be able to serialize
997 var arg1 = arguments[1];
998
999 for (prop in arg1)
1000 if (typeof arg1[prop] == "object")
1001 delete arg1[prop];
1002
1003 return arguments;
1004 };
1005
1006 apiFunctions["experimental.offscreenTabs.sendMouseEvent"].
1007 updateArgumentsPreValidate =
1008 apiFunctions["experimental.offscreenTabs.sendKeyboardEvent"].
1009 updateArgumentsPreValidate;
1010
994 apiFunctions["omnibox.sendSuggestions"].updateArgumentsPostValidate = 1011 apiFunctions["omnibox.sendSuggestions"].updateArgumentsPostValidate =
995 function(requestId, userSuggestions) { 1012 function(requestId, userSuggestions) {
996 var suggestions = []; 1013 var suggestions = [];
997 for (var i = 0; i < userSuggestions.length; i++) { 1014 for (var i = 0; i < userSuggestions.length; i++) {
998 var parseResult = parseOmniboxDescription( 1015 var parseResult = parseOmniboxDescription(
999 userSuggestions[i].description); 1016 userSuggestions[i].description);
1000 parseResult.content = userSuggestions[i].content; 1017 parseResult.content = userSuggestions[i].content;
1001 suggestions.push(parseResult); 1018 suggestions.push(parseResult);
1002 } 1019 }
1003 return [requestId, suggestions]; 1020 return [requestId, suggestions];
(...skipping 29 matching lines...) Expand all
1033 1050
1034 if (!chrome.tts) 1051 if (!chrome.tts)
1035 chrome.tts = {}; 1052 chrome.tts = {};
1036 1053
1037 if (!chrome.ttsEngine) 1054 if (!chrome.ttsEngine)
1038 chrome.ttsEngine = {}; 1055 chrome.ttsEngine = {};
1039 1056
1040 if (!chrome.experimental.downloads) 1057 if (!chrome.experimental.downloads)
1041 chrome.experimental.downloads = {}; 1058 chrome.experimental.downloads = {};
1042 })(); 1059 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698