summaryrefslogtreecommitdiffstats
path: root/chrome/renderer
diff options
context:
space:
mode:
authorrafaelw@chromium.org <rafaelw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-30 00:48:51 +0000
committerrafaelw@chromium.org <rafaelw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-30 00:48:51 +0000
commitc01639b7d1dfe57d3242cb26b1169e6c7ba8f797 (patch)
tree1d9e926ccc281d5e816642b0c8ca7f3c8343757a /chrome/renderer
parent9e91e12a3f7a9629245cc8f37547531d3a98b1f2 (diff)
downloadchromium_src-c01639b7d1dfe57d3242cb26b1169e6c7ba8f797.zip
chromium_src-c01639b7d1dfe57d3242cb26b1169e6c7ba8f797.tar.gz
chromium_src-c01639b7d1dfe57d3242cb26b1169e6c7ba8f797.tar.bz2
Implement removeWindow, onWindowCreated, onWindowRemoved.
BUG=11200 R=aa Review URL: http://codereview.chromium.org/100164 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14924 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer')
-rwxr-xr-xchrome/renderer/renderer_resources.grd2
-rw-r--r--chrome/renderer/resources/extension_process_bindings.js38
2 files changed, 33 insertions, 7 deletions
diff --git a/chrome/renderer/renderer_resources.grd b/chrome/renderer/renderer_resources.grd
index cda253b..c59e98c 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 1abb06f..199f436 100644
--- a/chrome/renderer/resources/extension_process_bindings.js
+++ b/chrome/renderer/resources/extension_process_bindings.js
@@ -11,6 +11,7 @@ var chromium;
(function() {
native function GetNextCallbackId();
native function CreateWindow();
+ native function RemoveWindow();
native function GetWindows();
native function GetTabsForWindow();
native function GetTab();
@@ -90,15 +91,15 @@ var chromium;
//----------------------------------------------------------------------------
- // Tabs
- chromium.tabs = {};
+ // Windows
+ chromium.windows = {};
- chromium.tabs.getWindows = function(windowQuery, callback) {
+ chromium.windows.getWindows = function(windowQuery, callback) {
validate(arguments, arguments.callee.params);
sendRequest(GetWindows, windowQuery, callback);
};
- chromium.tabs.getWindows.params = [
+ chromium.windows.getWindows.params = [
{
type: "object",
properties: {
@@ -113,11 +114,11 @@ var chromium;
chromium.types.optFun
];
- chromium.tabs.createWindow = function(createData, callback) {
+ chromium.windows.createWindow = function(createData, callback) {
validate(arguments, arguments.callee.params);
sendRequest(CreateWindow, createData, callback);
};
- chromium.tabs.createWindow.params = [
+ chromium.windows.createWindow.params = [
{
type: "object",
properties: {
@@ -131,6 +132,31 @@ var chromium;
},
chromium.types.optFun
];
+
+ chromium.windows.removeWindow = function(windowId, callback) {
+ validate(arguments, arguments.callee.params);
+ sendRequest(RemoveWindow, windowId, callback);
+ };
+
+ chromium.windows.removeWindow.params = [
+ chromium.types.pInt,
+ chromium.types.optFun
+ ];
+
+ // sends (windowId).
+ // *WILL* be followed by tab-attached AND then tab-selection-changed.
+ chromium.windows.onWindowCreated = new chromium.Event("window-created");
+
+ // sends (windowId).
+ // *WILL* be preceded by sequences of tab-removed AND then
+ // tab-selection-changed -- one for each tab that was contained in the window
+ // that closed
+ chromium.windows.onWindowRemoved = new chromium.Event("window-removed");
+
+ //----------------------------------------------------------------------------
+
+ // Tabs
+ chromium.tabs = {};
// TODO(aa): This should eventually take an optional windowId param.
chromium.tabs.getTabsForWindow = function(callback) {