summaryrefslogtreecommitdiffstats
path: root/chrome/test
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/test
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/test')
-rw-r--r--chrome/test/data/extensions/samples/tabs/tabs_api.html21
1 files changed, 16 insertions, 5 deletions
diff --git a/chrome/test/data/extensions/samples/tabs/tabs_api.html b/chrome/test/data/extensions/samples/tabs/tabs_api.html
index a506fd2..022d1a7 100644
--- a/chrome/test/data/extensions/samples/tabs/tabs_api.html
+++ b/chrome/test/data/extensions/samples/tabs/tabs_api.html
@@ -7,7 +7,7 @@ tabs = {};
tabIds = [];
function loadWindowList() {
- chromium.tabs.getWindows(undefined, function(windowList) {
+ chromium.windows.getWindows(undefined, function(windowList) {
tabs = {};
tabIds = [];
for (var i = 0; i < windowList.length; i++) {
@@ -84,6 +84,16 @@ function clearLog() {
document.getElementById('log').innerHTML = '';
}
+chromium.windows.onWindowCreated.addListener(function(windowId) {
+ appendToLog('onWindowCreated -- window: ' + windowId);
+ loadWindowList();
+});
+
+chromium.windows.onWindowRemoved.addListener(function(windowId) {
+ appendToLog('onWindowRemoved -- window: ' + windowId);
+ loadWindowList();
+});
+
chromium.tabs.onTabCreated.addListener(function(data) {
appendToLog('onTabCreated -- window: ' + data.windowId + ' tab: ' + data.tabId + ' index ' + data.index);
loadWindowList();
@@ -109,8 +119,8 @@ chromium.tabs.onTabSelectionChanged.addListener(function(data) {
loadWindowList();
});
-chromium.tabs.onTabRemoved.addListener(function(data) {
- appendToLog('onTabRemoved -- window: ' + data.windowId + ' tab: ' + data.tabId + ' index ' + data.index);
+chromium.tabs.onTabRemoved.addListener(function(tabId) {
+ appendToLog('onTabRemoved -- tab: ' + tabId);
loadWindowList();
});
@@ -138,7 +148,7 @@ function createWindow() {
if (!args.url)
delete args.url;
- chromium.tabs.createWindow(args);
+ chromium.windows.createWindow(args);
}
</script>
@@ -181,6 +191,7 @@ function createWindow() {
<button onclick="chromium.tabs.removeTab(this.jstdata);" jsvalues=".jstdata:id">Close Tab</button>
</div>
</div>
+ <button onclick="chromium.windows.removeWindow(this.jstdata);" jsvalues=".jstdata:id">Close Window</button>
</div>
</div>
<div style="background-color: #EEEEBB; margin: 20px; padding: 8px">
@@ -228,7 +239,7 @@ function createWindow() {
<button onclick="updateAll();">Update All</button>
<button onclick="moveAll();">Move All</button>
<button onclick="clearLog();">-->Clear Log</button>
- <button onclick="chromium.tabs.createWindow();">New Window</button>
+ <button onclick="chromium.windows.createWindow();">New Window</button>
</div>
<div id="log" style="background-color: #EEAAEE; margin: 20px; padding: 8px">
</div>