diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/gtk_dnd_util.cc | 17 | ||||
-rw-r--r-- | app/gtk_dnd_util.h | 6 |
2 files changed, 21 insertions, 2 deletions
diff --git a/app/gtk_dnd_util.cc b/app/gtk_dnd_util.cc index fb2f492..32c5150 100644 --- a/app/gtk_dnd_util.cc +++ b/app/gtk_dnd_util.cc @@ -49,6 +49,16 @@ GdkAtom GtkDndUtil::GetAtomForTarget(int target) { const_cast<char*>("_NETSCAPE_URL"), false); return netscape_url; + case TEXT_PLAIN_NO_CHARSET: + static GdkAtom text_no_charset_atom = gdk_atom_intern( + const_cast<char*>("text/plain"), false); + return text_no_charset_atom; + + case DIRECT_SAVE_FILE: + static GdkAtom xds_atom = gdk_atom_intern( + const_cast<char*>("XdndDirectSave0"), false); + return xds_atom; + default: NOTREACHED(); } @@ -114,10 +124,15 @@ void GtkDndUtil::AddTargetToList(GtkTargetList* targets, int target_code) { case CHROME_TAB: case CHROME_BOOKMARK_ITEM: case CHROME_NAMED_URL: - gtk_target_list_add(targets, GtkDndUtil::GetAtomForTarget(target_code), + gtk_target_list_add(targets, GetAtomForTarget(target_code), GTK_TARGET_SAME_APP, target_code); break; + case DIRECT_SAVE_FILE: + gtk_target_list_add(targets, GetAtomForTarget(DIRECT_SAVE_FILE), 0, + DIRECT_SAVE_FILE); + break; + default: NOTREACHED() << " Unexpected target code: " << target_code; } diff --git a/app/gtk_dnd_util.h b/app/gtk_dnd_util.h index 4b6155e..efa249c 100644 --- a/app/gtk_dnd_util.h +++ b/app/gtk_dnd_util.h @@ -31,7 +31,11 @@ class GtkDndUtil { // apps. NETSCAPE_URL = 1 << 7, - INVALID_TARGET = 1 << 8, + // Used for drag-out download. + TEXT_PLAIN_NO_CHARSET = 1 << 8, + DIRECT_SAVE_FILE = 1 << 9, + + INVALID_TARGET = 1 << 10, }; // Get the atom for a given target (of the above enum type). Will return NULL |