diff options
| author | Daniel MacDougall | 2012-08-18 23:29:52 -0700 | 
|---|---|---|
| committer | Daniel MacDougall | 2012-08-18 23:29:52 -0700 | 
| commit | 038ae30e4275aa5b59d84833f2cdca38a40bfc71 (patch) | |
| tree | f6e9965098f1399b7cc46883ae1563741d381c27 | |
| parent | a3fb35be007a44e5ba35e5ee9d75af3634bf5dac (diff) | |
| download | vimium-038ae30e4275aa5b59d84833f2cdca38a40bfc71.tar.bz2 | |
Re-enable browser action with new icons
| -rw-r--r-- | background_scripts/main.js | 11 | ||||
| -rw-r--r-- | icons/browser_action_disabled.png | bin | 0 -> 32025 bytes | |||
| -rw-r--r-- | icons/browser_action_enabled.png | bin | 0 -> 37455 bytes | |||
| -rw-r--r-- | manifest.json | 6 | 
4 files changed, 9 insertions, 8 deletions
| 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) { diff --git a/icons/browser_action_disabled.png b/icons/browser_action_disabled.pngBinary files differ new file mode 100644 index 00000000..458ffe72 --- /dev/null +++ b/icons/browser_action_disabled.png diff --git a/icons/browser_action_enabled.png b/icons/browser_action_enabled.pngBinary files differ new file mode 100644 index 00000000..fe4c36bb --- /dev/null +++ b/icons/browser_action_enabled.png diff --git a/manifest.json b/manifest.json index 5c451700..f872660d 100644 --- a/manifest.json +++ b/manifest.json @@ -39,5 +39,9 @@        "run_at": "document_start",        "all_frames": true      } -  ] +  ], +  "browser_action": { +    "default_icon": "icons/browser_action_disabled.png", +    "default_popup": "popup.html" +  }  } | 
