diff options
author | rafaelw@chromium.org <rafaelw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-17 04:55:08 +0000 |
---|---|---|
committer | rafaelw@chromium.org <rafaelw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-17 04:55:08 +0000 |
commit | 3b3cc646c182ca1578e745c110ba47af34468b15 (patch) | |
tree | 94cc697f442b8032de6032ab41e771da15bca752 /chrome/renderer | |
parent | 44e13fcffd006cf0640145420f1f2d6f6e4355e3 (diff) | |
download | chromium_src-3b3cc646c182ca1578e745c110ba47af34468b15.zip chromium_src-3b3cc646c182ca1578e745c110ba47af34468b15.tar.gz chromium_src-3b3cc646c182ca1578e745c110ba47af34468b15.tar.bz2 |
added windows.getWindows() and tabs.moveTab()
Review URL: http://codereview.chromium.org/79026
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13919 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer')
-rwxr-xr-x | chrome/renderer/renderer_resources.grd | 2 | ||||
-rw-r--r-- | chrome/renderer/resources/extension_process_bindings.js | 41 |
2 files changed, 41 insertions, 2 deletions
diff --git a/chrome/renderer/renderer_resources.grd b/chrome/renderer/renderer_resources.grd index c59e98c..cda253b 100755 --- a/chrome/renderer/renderer_resources.grd +++ b/chrome/renderer/renderer_resources.grd @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- This comment is only here because changes to resources are not picked up -without changes to the corresponding grd file. --> +without changes to the corresponding grd file. --> <grit latest_public_release="0" current_release="1"> <outputs> <output filename="grit/renderer_resources.h" type="rc_header"> diff --git a/chrome/renderer/resources/extension_process_bindings.js b/chrome/renderer/resources/extension_process_bindings.js index 7b74283..f533228 100644 --- a/chrome/renderer/resources/extension_process_bindings.js +++ b/chrome/renderer/resources/extension_process_bindings.js @@ -1,10 +1,12 @@ var chromium; (function() { native function GetNextCallbackId(); + native function GetWindows(); native function GetTabsForWindow(); native function GetTab(); native function CreateTab(); native function UpdateTab(); + native function MoveTab(); native function RemoveTab(); if (!chromium) @@ -70,6 +72,27 @@ var chromium; // Tabs chromium.tabs = {}; + + chromium.tabs.getWindows = function(windowQuery, callback) { + validate(arguments, arguments.callee.params); + sendRequest(GetWindows, windowQuery, callback); + }; + chromium.tabs.getWindows.params = [ + { + type: "object", + properties: { + ids: { + type: "array", + items: chromium.types.pInt, + minItems: 1 + } + }, + optional: true, + additionalProperties: false + }, + chromium.types.optFun + ]; + // TODO(aa): This should eventually take an optional windowId param. chromium.tabs.getTabsForWindow = function(callback) { validate(arguments, arguments.callee.params); @@ -88,7 +111,7 @@ var chromium; chromium.types.optFun ]; - chromium.tabs.createTab = function(tab, callback) { + chromium.tabs.createTab = function(tab, callback) { validate(arguments, arguments.callee.params); sendRequest(CreateTab, tab, callback); }; @@ -122,6 +145,22 @@ var chromium; } ]; + chromium.tabs.moveTab = function(tab) { + validate(arguments, arguments.callee.params); + sendRequest(MoveTab, tab); + }; + chromium.tabs.moveTab.params = [ + { + type: "object", + properties: { + id: chromium.types.pInt, + windowId: chromium.types.optPInt, + index: chromium.types.pInt + }, + additionalProperties: false + } + ]; + chromium.tabs.removeTab = function(tabId) { validate(arguments, arguments.callee.params); sendRequest(RemoveTab, tabId); |