[the-board] [chrome] Add browser action to current current url as a label



commit 2c29e9d3d65948bf6a2b5a1737545a364d6a9ead
Author: Lucas Rocha <lucasr gnome org>
Date:   Wed Apr 13 12:04:58 2011 +0100

    [chrome] Add browser action to current current url as a label

 src/chrome/background.js |    9 +++++++++
 src/chrome/manifest.json |    4 ++++
 2 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/src/chrome/background.js b/src/chrome/background.js
index 940564a..b1d149b 100644
--- a/src/chrome/background.js
+++ b/src/chrome/background.js
@@ -182,4 +182,13 @@ function addContextMenuItem() {
                                      onclick: onMenuClick });
 }
 
+function onBrowserActionClick(tab) {
+    addLabelToTheBoard(tab.url);
+}
+
+function addBrowserActionHandler() {
+    chrome.browserAction.onClicked.addListener(onBrowserActionClick);
+}
+
 addContextMenuItem();
+addBrowserActionHandler();
diff --git a/src/chrome/manifest.json b/src/chrome/manifest.json
index 77a53c9..063eaba 100644
--- a/src/chrome/manifest.json
+++ b/src/chrome/manifest.json
@@ -3,6 +3,10 @@
   "version": "0.1.0",
   "description": "Chrome's integration with The Board",
   "background_page": "background.html",
+  "browser_action": {
+    "default_icon": "icon-19.png",
+    "default_title": "Add to The Board"
+  },
   "permissions": [
     "tabs",
     "contextMenus",



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]