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(); |
} |