Index: chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.cc |
diff --git a/chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.cc b/chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.cc |
index 4da5a629c7dabcea8af65a4d2c6bd517e09efee5..53cd58a136297790a0c6c85e1194ac5a0859130b 100644 |
--- a/chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.cc |
+++ b/chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.cc |
@@ -290,6 +290,7 @@ int GetCodeMask(bool folder) { |
int rv = ui::CHROME_BOOKMARK_ITEM; |
if (!folder) { |
rv |= ui::TEXT_URI_LIST | |
+ ui::TEXT_HTML | |
ui::TEXT_PLAIN | |
ui::NETSCAPE_URL; |
} |
@@ -351,6 +352,18 @@ void WriteBookmarksToSelection(const std::vector<const BookmarkNode*>& nodes, |
free(uris); |
break; |
} |
+ case ui::TEXT_HTML: { |
+ std::string utf8_title = UTF16ToUTF8(nodes[0]->GetTitle()); |
+ std::string utf8_html = StringPrintf("<a href=\"%s\">%s</a>", |
+ nodes[0]->GetURL().spec().c_str(), |
+ utf8_title.c_str()); |
+ gtk_selection_data_set(selection_data, |
+ GetAtomForTarget(ui::TEXT_HTML), |
+ kBitsInAByte, |
+ reinterpret_cast<const guchar*>(utf8_html.data()), |
+ utf8_html.size()); |
+ break; |
+ } |
case ui::TEXT_PLAIN: { |
gtk_selection_data_set_text(selection_data, |
nodes[0]->GetURL().spec().c_str(), -1); |