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

Unified Diff: safari/background.js

Issue 29317001: Relocated icon and redesigned icon popup (Closed)
Patch Set: Merged setBadgeNumber and setBadgeBackgroundColor Created Dec. 13, 2013, 10:36 a.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
Index: safari/background.js
===================================================================
--- a/safari/background.js
+++ b/safari/background.js
@@ -77,8 +77,7 @@
this._tab.activate();
},
sendMessage: sendMessage,
- pageAction: {
- // there are no page actions in safari, so we use toolbar items instead
+ browserAction: {
setIcon: function(path)
{
safari.extension.toolbarItems[0].image = safari.extension.baseURI + path;
@@ -87,8 +86,15 @@
{
safari.extension.toolbarItems[0].toolTip = title;
},
+ setBadge: function(badge)
+ {
+ if (!badge)
+ safari.extension.toolbarItems[0].badge = 0;
+ else if ("number" in badge)
+ safari.extension.toolbarItems[0].badge = badge.number;
+ },
- // toolbar items in safari can"t get hidden
+ // The following features aren't supported by Safari
hide: function() {},
show: function() {}
}

Powered by Google App Engine
This is Rietveld