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

Unified Diff: chrome/renderer/resources/extensions/schema_generated_bindings.js

Issue 8969011: Added populate parameter to chrome.windows.get, chrome.windows.getCurrent, (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 9 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/extensions/api/windows.json ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/resources/extensions/schema_generated_bindings.js
===================================================================
--- chrome/renderer/resources/extensions/schema_generated_bindings.js (revision 114958)
+++ chrome/renderer/resources/extensions/schema_generated_bindings.js (working copy)
@@ -1105,17 +1105,16 @@
chromeHidden.contextMenus.handlers = {};
});
+ // TODO(skerner,mtytel): The next step to omitting optional arguments is the
+ // replacement of this code with code that matches arguments by type.
+ // Once this is working for captureVisibleTab() it can be enabled for
+ // the rest of the API. See crbug/29215 .
apiFunctions.setUpdateArgumentsPreValidate("tabs.captureVisibleTab",
function() {
// Old signature:
// captureVisibleTab(int windowId, function callback);
// New signature:
// captureVisibleTab(int windowId, object details, function callback);
- //
- // TODO(skerner): The next step to omitting optional arguments is the
- // replacement of this code with code that matches arguments by type.
- // Once this is working for captureVisibleTab() it can be enabled for
- // the rest of the API. See crbug/29215 .
if (arguments.length == 2 && typeof(arguments[1]) == "function") {
// If the old signature is used, add a null details object.
newArgs = [arguments[0], null, arguments[1]];
@@ -1125,6 +1124,66 @@
return newArgs;
});
+ apiFunctions.setUpdateArgumentsPreValidate("windows.get",
+ function() {
+ // Old signature:
+ // get(int windowId, function callback);
+ // New signature:
+ // get(int windowId, object populate, function callback);
+ if (arguments.length == 2 && typeof(arguments[1]) == "function") {
+ // If the old signature is used, add a null populate object.
+ newArgs = [arguments[0], null, arguments[1]];
+ } else {
+ newArgs = arguments;
+ }
+ return newArgs;
+ });
+
+ apiFunctions.setUpdateArgumentsPreValidate("windows.getCurrent",
+ function() {
+ // Old signature:
+ // getCurrent(function callback);
+ // New signature:
+ // getCurrent(object populate, function callback);
+ if (arguments.length == 1 && typeof(arguments[0]) == "function") {
+ // If the old signature is used, add a null populate object.
+ newArgs = [null, arguments[0]];
+ } else {
+ newArgs = arguments;
+ }
+ return newArgs;
+ });
+
+ apiFunctions.setUpdateArgumentsPreValidate("windows.getLastFocused",
+ function() {
+ // Old signature:
+ // getLastFocused(function callback);
+ // New signature:
+ // getLastFocused(object populate, function callback);
+ if (arguments.length == 1 && typeof(arguments[0]) == "function") {
+ // If the old signature is used, add a null populate object.
+ newArgs = [null, arguments[0]];
+ } else {
+ newArgs = arguments;
+ }
+ return newArgs;
+ });
+
+ apiFunctions.setUpdateArgumentsPreValidate("windows.getAll",
+ function() {
+ // Old signature:
+ // getAll(function callback);
+ // New signature:
+ // getAll(object populate, function callback);
+ if (arguments.length == 1 && typeof(arguments[0]) == "function") {
+ // If the old signature is used, add a null populate object.
+ newArgs = [null, arguments[0]];
+ } else {
+ newArgs = arguments;
+ }
+ return newArgs;
+ });
+
apiFunctions.setUpdateArgumentsPostValidate("omnibox.sendSuggestions",
function(requestId, userSuggestions) {
var suggestions = [];
« no previous file with comments | « chrome/common/extensions/api/windows.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698