From 038ae30e4275aa5b59d84833f2cdca38a40bfc71 Mon Sep 17 00:00:00 2001 From: Daniel MacDougall Date: Sat, 18 Aug 2012 23:29:52 -0700 Subject: Re-enable browser action with new icons --- background_scripts/main.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'background_scripts') diff --git a/background_scripts/main.js b/background_scripts/main.js index 41fb3441..605eeb0c 100644 --- a/background_scripts/main.js +++ b/background_scripts/main.js @@ -359,16 +359,13 @@ function updateOpenTabs(tab) { * 3. Active tab is enabled but should be disabled -> disable icon and disable vimium */ function updateActiveState(tabId) { - // TODO(philc): Re-enable once we've restyled the browser action icon. - return; - var enabledIcon = "icons/icon48.png"; - var disabledIcon = "icons/icon48disabled.png"; + var enabledIcon = "icons/browser_action_enabled.png"; + var disabledIcon = "icons/browser_action_disabled.png"; chrome.tabs.get(tabId, function(tab) { // Default to disabled state in case we can't connect to Vimium, primarily for the "New Tab" page. - // TODO(philc): Re-enable once we've restyled the browser action icon. - // chrome.browserAction.setIcon({ path: disabledIcon }); + chrome.browserAction.setIcon({ path: disabledIcon }); chrome.tabs.sendRequest(tabId, { name: "getActiveState" }, function(response) { - var isCurrentlyEnabled = response.enabled; + var isCurrentlyEnabled = response !== undefined && response.enabled; var shouldBeEnabled = isEnabledForUrl({url: tab.url}).isEnabledForUrl; if (isCurrentlyEnabled) { -- cgit v1.2.3