summaryrefslogtreecommitdiffstats
path: root/chrome/browser/bookmarks/bookmark_drag_data.cc
diff options
context:
space:
mode:
authorsky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-24 01:54:26 +0000
committersky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-24 01:54:26 +0000
commit9eb381798e60beac696ba13855b85691e9d22fb7 (patch)
tree9b1c83fcd7f442f06c5279b6730492d5d3fdef0d /chrome/browser/bookmarks/bookmark_drag_data.cc
parent4e8d907dd01011dd67fdf7661d98c7cbc663b0ff (diff)
downloadchromium_src-9eb381798e60beac696ba13855b85691e9d22fb7.zip
chromium_src-9eb381798e60beac696ba13855b85691e9d22fb7.tar.gz
chromium_src-9eb381798e60beac696ba13855b85691e9d22fb7.tar.bz2
Refactors some of the bookmark drag and drop code into a separate
class that I can use in the bookmark manager. BUG=674 TEST=make sure drag and drop on the bookmark bar still works, especially when moving folders around. Review URL: http://codereview.chromium.org/8115 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3896 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/bookmarks/bookmark_drag_data.cc')
-rw-r--r--chrome/browser/bookmarks/bookmark_drag_data.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/chrome/browser/bookmarks/bookmark_drag_data.cc b/chrome/browser/bookmarks/bookmark_drag_data.cc
index 65d3445..85911a7 100644
--- a/chrome/browser/bookmarks/bookmark_drag_data.cc
+++ b/chrome/browser/bookmarks/bookmark_drag_data.cc
@@ -135,7 +135,7 @@ bool BookmarkDragData::Read(const OSExchangeData& data) {
std::vector<BookmarkNode*> BookmarkDragData::GetNodes(Profile* profile) const {
std::vector<BookmarkNode*> nodes;
- if (profile->GetPath() != profile_path_)
+ if (!IsFromProfile(profile))
return nodes;
for (size_t i = 0; i < elements.size(); ++i) {
@@ -154,3 +154,7 @@ BookmarkNode* BookmarkDragData::GetFirstNode(Profile* profile) const {
std::vector<BookmarkNode*> nodes = GetNodes(profile);
return nodes.size() == 1 ? nodes[0] : NULL;
}
+
+bool BookmarkDragData::IsFromProfile(Profile* profile) const {
+ return (profile->GetPath() == profile_path_);
+}