summaryrefslogtreecommitdiffstats
path: root/chrome/browser/bookmarks/bookmark_drag_data.h
diff options
context:
space:
mode:
authorsky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-19 18:33:48 +0000
committersky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-19 18:33:48 +0000
commit848cd05ed947f5939df4cd6028aad4e068484c23 (patch)
treefda36e250d3d83fbcb58e57b950aba56f090c575 /chrome/browser/bookmarks/bookmark_drag_data.h
parentb988fe4ded9067b2e5cb7e3a3937036ce2cb09c8 (diff)
downloadchromium_src-848cd05ed947f5939df4cd6028aad4e068484c23.zip
chromium_src-848cd05ed947f5939df4cd6028aad4e068484c23.tar.gz
chromium_src-848cd05ed947f5939df4cd6028aad4e068484c23.tar.bz2
Changes the bookmark model to allow more than one bookmark to
reference the same url. Clicking the star button edits the most recently added bookmark for the URL. Dragging a button/star always does a move, otherwise drops on the bookmark bar create a new bookmark. Also changed the add page context menu for the bookmark bar to remember where you invoked it from. BUG=1173228 1678 Review URL: http://codereview.chromium.org/3203 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2413 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/bookmarks/bookmark_drag_data.h')
-rw-r--r--chrome/browser/bookmarks/bookmark_drag_data.h20
1 files changed, 11 insertions, 9 deletions
diff --git a/chrome/browser/bookmarks/bookmark_drag_data.h b/chrome/browser/bookmarks/bookmark_drag_data.h
index c7e1fed..564393a 100644
--- a/chrome/browser/bookmarks/bookmark_drag_data.h
+++ b/chrome/browser/bookmarks/bookmark_drag_data.h
@@ -14,6 +14,7 @@ class BookmarkModel;
class BookmarkNode;
class OSExchangeData;
class Pickle;
+class Profile;
// BookmarkDragData is used by the bookmark bar to represent a dragged
// URL or starred group on the clipboard during drag and drop.
@@ -36,23 +37,19 @@ struct BookmarkDragData {
// Writes this BookmarkDragData to data. If BookmarkDragData is a URL,
// this writes out the URL and URL title clipboard data as well.
- void Write(OSExchangeData* data) const;
+ void Write(Profile* profile, OSExchangeData* data) const;
// Restores this data from the clipboard, returning true on success.
bool Read(const OSExchangeData& data);
- // Returns the node represented by this drag data from root. If the
- // path can not be found, NULL is returned.
- //
- // This is only valid for groups.
- BookmarkNode* BookmarkDragData::GetNode(BookmarkModel* model) const;
+ // Returns the node represented by this DragData. If this DragData was created
+ // from the same profile then the node from the model is returned. If the
+ // node can't be found (may have been deleted), NULL is returned.
+ BookmarkNode* BookmarkDragData::GetNode(Profile* profile) const;
// If true, this entry represents a StarredEntry of type URL.
bool is_url;
- // ID of the profile we originated from.
- std::wstring profile_id;
-
// The URL, only valid if is_url is true.
GURL url;
@@ -74,7 +71,12 @@ struct BookmarkDragData {
// Adds to children an entry for each child of node.
void AddChildren(BookmarkNode* node);
+ // Path of the profile we originated from.
+ // This is only saved for the root node.
+ std::wstring profile_path_;
+
// ID (node->id()) of the node this BookmarkDragData was created from.
+ // This is only saved for the root node.
int id_;
};