Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: chrome/background.js

Issue 29317001: Relocated icon and redesigned icon popup (Closed)
Patch Set: Created Dec. 11, 2013, 1:08 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « background.js ('k') | iconAnimation.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « background.js ('k') | iconAnimation.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld