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

Unified Diff: chrome/common/extensions/docs/examples/api/eventPage/basic/background.js

Issue 11818010: Make chrome.alarms API accept non-integers and too-short delays. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: After discussion, switch to 1-minute minimum alarm time Created 7 years, 11 months 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
Index: chrome/common/extensions/docs/examples/api/eventPage/basic/background.js
diff --git a/chrome/common/extensions/docs/examples/api/eventPage/basic/background.js b/chrome/common/extensions/docs/examples/api/eventPage/basic/background.js
index ec6d68f3f9654f828cffdbd51e81dec04ed7cab8..64819d9c480f0bd5f8b8490e0fb544f6a04ec2ec 100644
--- a/chrome/common/extensions/docs/examples/api/eventPage/basic/background.js
+++ b/chrome/common/extensions/docs/examples/api/eventPage/basic/background.js
@@ -52,12 +52,14 @@ chrome.browserAction.onClicked.addListener(function() {
});
});
-chrome.experimental.keybinding.onCommand.addListener(function(command) {
+chrome.commands.onCommand.addListener(function(command) {
chrome.tabs.create({url: "http://www.google.com/"});
});
chrome.runtime.onMessage.addListener(function(msg, _, sendResponse) {
if (msg.setAlarm) {
+ // For testing only. delayInMinutes will be rounded up to at least 5 in a
+ // packed or released extension.
chrome.alarms.create({delayInMinutes: 0.1});
} else if (msg.delayedResponse) {
// Note: setTimeout itself does NOT keep the page awake. We return true

Powered by Google App Engine
This is Rietveld 408576698