Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(110)

Unified Diff: chrome/browser/bookmarks/bookmark_drag_data.cc

Issue 1691018: GTK: make tabbed bookmark manager compatible with more types of drops. (Closed) Base URL: git://codf21.jail/chromium.git
Patch Set: naming Created 10 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/bookmarks/bookmark_drag_data.h ('k') | chrome/browser/tab_contents/web_drag_dest_gtk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/bookmarks/bookmark_drag_data.cc
diff --git a/chrome/browser/bookmarks/bookmark_drag_data.cc b/chrome/browser/bookmarks/bookmark_drag_data.cc
index d7226599c72ba0b6b06217b09b5a0b1be14bdb6c..b1663fcc8a845d49b380d6fe5d0a40c7c982d081 100644
--- a/chrome/browser/bookmarks/bookmark_drag_data.cc
+++ b/chrome/browser/bookmarks/bookmark_drag_data.cc
@@ -105,6 +105,20 @@ bool BookmarkDragData::ReadFromVector(
return true;
}
+bool BookmarkDragData::ReadFromTuple(const GURL& url, const string16& title) {
+ Clear();
+
+ if (!url.is_valid())
+ return false;
+
+ Element element;
+ element.title = title;
+ element.url = url;
+ element.is_url = true;
+
+ elements.push_back(element);
+}
+
#if !defined(OS_MACOSX)
void BookmarkDragData::WriteToClipboard(Profile* profile) const {
ScopedClipboardWriter scw(g_browser_process->clipboard());
@@ -214,14 +228,11 @@ bool BookmarkDragData::Read(const OSExchangeData& data) {
} else {
// See if there is a URL on the clipboard.
Element element;
+ GURL url;
std::wstring title;
- if (data.GetURLAndTitle(&element.url, &title) &&
- element.url.is_valid()) {
- element.title = WideToUTF16(title);
- element.is_url = true;
- elements.push_back(element);
- }
- }
+ if (data.GetURLAndTitle(&url, &title))
+ ReadFromTuple(url, WideToUTF16(title));
+ }
return is_valid();
}
« no previous file with comments | « chrome/browser/bookmarks/bookmark_drag_data.h ('k') | chrome/browser/tab_contents/web_drag_dest_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698