diff options
author | DHNishi@gmail.com <DHNishi@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-11 22:25:33 +0000 |
---|---|---|
committer | DHNishi@gmail.com <DHNishi@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-11 22:25:33 +0000 |
commit | 676fd48483e09deb32255e2e9189bca5fa664ecc (patch) | |
tree | 2d06f35d6ea0b03e372719fe4f0f64142f6e17f7 /chrome/common/extensions/docs/examples/api/messaging/timer | |
parent | bfe76950b14157c957460227ae4563313ef95c41 (diff) | |
download | chromium_src-676fd48483e09deb32255e2e9189bca5fa664ecc.zip chromium_src-676fd48483e09deb32255e2e9189bca5fa664ecc.tar.gz chromium_src-676fd48483e09deb32255e2e9189bca5fa664ecc.tar.bz2 |
Replace references to deprecated tabs.getSelected with tabs.query.
BUG=128869
Review URL: https://chromiumcodereview.appspot.com/18769008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@211233 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/extensions/docs/examples/api/messaging/timer')
-rw-r--r-- | chrome/common/extensions/docs/examples/api/messaging/timer/popup.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/chrome/common/extensions/docs/examples/api/messaging/timer/popup.js b/chrome/common/extensions/docs/examples/api/messaging/timer/popup.js index c213baf..8b70f59 100644 --- a/chrome/common/extensions/docs/examples/api/messaging/timer/popup.js +++ b/chrome/common/extensions/docs/examples/api/messaging/timer/popup.js @@ -16,10 +16,10 @@ function setChildTextNode(elementId, text) { function testRequest() { setChildTextNode("resultsRequest", "running..."); - chrome.tabs.getSelected(null, function(tab) { + chrome.tabs.query({active: true, currentWindow: true}, function(tabs) { var timer = new chrome.Interval(); timer.start(); - + var tab = tabs[0]; chrome.tabs.sendRequest(tab.id, {counter: 1}, function handler(response) { if (response.counter < 1000) { chrome.tabs.sendRequest(tab.id, {counter: response.counter}, handler); @@ -36,11 +36,11 @@ function testRequest() { function testConnect() { setChildTextNode("resultsConnect", "running..."); - chrome.tabs.getSelected(null, function(tab) { + chrome.tabs.query({active: true, currentWindow: true}, function(tabs) { var timer = new chrome.Interval(); timer.start(); - var port = chrome.tabs.connect(tab.id); + var port = chrome.tabs.connect(tabs[0].id); port.postMessage({counter: 1}); port.onMessage.addListener(function getResp(response) { if (response.counter < 1000) { |