| Index: chrome/background.js |
| =================================================================== |
| --- a/chrome/background.js |
| +++ b/chrome/background.js |
| @@ -196,26 +196,37 @@ |
| var sendMessage = chrome.tabs.sendMessage || chrome.tabs.sendRequest; |
| - var PageAction = function(tabId) |
| + var BrowserAction = function(tabId) |
| { |
| this._tabId = tabId; |
| }; |
| - PageAction.prototype = { |
| + BrowserAction.prototype = { |
| setIcon: function(path) |
| { |
| - chrome.pageAction.setIcon({tabId: this._tabId, path: path}); |
| + chrome.browserAction.setIcon({tabId: this._tabId, path: path}); |
| }, |
| setTitle: function(title) |
| { |
| - chrome.pageAction.setTitle({tabId: this._tabId, title: title}); |
| + chrome.browserAction.setTitle({tabId: this._tabId, title: title}); |
| }, |
| hide: function() |
| { |
| - chrome.pageAction.hide(this._tabId); |
| + chrome.browserAction.hide(this._tabId); |
| }, |
| show: function() |
| { |
| - chrome.pageAction.show(this._tabId); |
| + chrome.browserAction.show(this._tabId); |
| + }, |
| + setBadgeBackgroundColor: function(color) |
| + { |
| + chrome.browserAction.setBadgeBackgroundColor({tabId: this._tabId, color: color}); |
| + }, |
| + setBadgeNumber: function(number) |
| + { |
| + chrome.browserAction.setBadgeText({ |
| + tabId: this._tabId, |
| + text: (number === null) ? "" : number.toString() |
| + }); |
| } |
| }; |
| @@ -224,7 +235,7 @@ |
| this._id = tab.id; |
| this.url = tab.url; |
| - this.pageAction = new PageAction(tab.id); |
| + this.browserAction = new BrowserAction(tab.id); |
| this.onLoading = ext.tabs.onLoading._bindToTab(this); |
| this.onCompleted = ext.tabs.onCompleted._bindToTab(this); |