diff options
author | tony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-15 01:27:13 +0000 |
---|---|---|
committer | tony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-15 01:27:13 +0000 |
commit | c114d071107fd3997bb1feb66767156f9b85f84d (patch) | |
tree | 75997b4cb378933b109193e69ff16e51e129dff0 /app/gtk_dnd_util.cc | |
parent | 46fc912073cc67de0e21ac4e3bc7db33980d2376 (diff) | |
download | chromium_src-c114d071107fd3997bb1feb66767156f9b85f84d.zip chromium_src-c114d071107fd3997bb1feb66767156f9b85f84d.tar.gz chromium_src-c114d071107fd3997bb1feb66767156f9b85f84d.tar.bz2 |
Allow link drags from Chrome to create a shortcut on the desktop.
This required adding the netscape link+title format to the drag data
(we were already doing this on windows) and adding GDK_ACTION_LINK
to the GdkDragAction passed into gtk_drag_begin.
BUG=27337
TEST=Drag a link to the desktop, it should create a shortcut (.desktop file).
Review URL: http://codereview.chromium.org/542072
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36321 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app/gtk_dnd_util.cc')
-rw-r--r-- | app/gtk_dnd_util.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/app/gtk_dnd_util.cc b/app/gtk_dnd_util.cc index a7933ab..da4362dc 100644 --- a/app/gtk_dnd_util.cc +++ b/app/gtk_dnd_util.cc @@ -44,6 +44,11 @@ GdkAtom GtkDndUtil::GetAtomForTarget(int target) { const_cast<char*>("application/x-chrome-named-url"), false); return named_url; + case NETSCAPE_URL: + static GdkAtom netscape_url = gdk_atom_intern( + const_cast<char*>("_NETSCAPE_URL"), false); + return netscape_url; + default: NOTREACHED(); } @@ -101,6 +106,11 @@ void GtkDndUtil::AddTargetToList(GtkTargetList* targets, int target_code) { gtk_target_list_add(targets, GetAtomForTarget(TEXT_PLAIN), 0, TEXT_HTML); break; + case NETSCAPE_URL: + gtk_target_list_add(targets, GetAtomForTarget(NETSCAPE_URL), 0, + NETSCAPE_URL); + break; + case CHROME_TAB: case CHROME_BOOKMARK_ITEM: case CHROME_NAMED_URL: |