How can I open irc:// links in Pidgin from Chromium?

OK I found it!So I will answer here.

FOR UBUNTU(>=11.04)

Gconf settings(/desktop/gnome/url-handlers) didn't do anything since as of Natty the file-open functionality is handled by gvfs-open, which doesn't use gconf settings. Rather, gvfs-open looks at the ".desktop" files bundled with each application to determine what file types can be handled.if it is not installed, run :

   sudo apt-get install gvfs-bin

In all x-scheme handler urls( like irc://, xmpp://, sip://, aim://) are handled by purple-url-handler.We are going to create a desktop file for it.

gksudo gedit /usr/share/applications/purple-url-handler.desktop

& put following content in it:

[Desktop Entry]
Name=Purple URL Handler
GenericName=Internet Messenger
Comment=URL handler forGoogle Talk, Jabber/XMPP, MSN, Yahoo and more
Exec=purple-url-handler %U
Icon=pidgin
StartupNotify=true
Terminal=false
Type=Application
MimeType=x-scheme-handler/irc;
Categories=Network;InstantMessaging;
X-Ubuntu-Gettext-Domain=pidgin

Now to make irc:// links open with purple-url-handler run :

xdg-mime default purple-url-handler.desktop x-scheme-handler/irc

This informator is stored in ~/.local/share/applications/mimeapps.list.

Now when you click any irc:// link in chromium for the first time, the following prompt will appear:

chromium-prompt

Select remember my choice & launch application. If you are already logged in it will open the room in pidgin.

DONE!