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

Side by Side Diff: chrome/browser/bookmarks/bookmark_drag_utils.h

Issue 8115: Refactors some of the bookmark drag and drop code into a separate... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 years, 2 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 unified diff | Download patch | Annotate | Revision Log
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_BOOKMARKS_BOOKMARK_DRAG_UTILS_H_
6 #define CHROME_BROWSER_BOOKMARKS_BOOKMARK_DRAG_UTILS_H_
7
8 #include "chrome/browser/bookmarks/bookmark_drag_data.h"
9
10 class BookmarkNode;
11 class Profile;
12
13 namespace views {
14 class DropTargetEvent;
15 }
16
17 // Functions used in managing bookmark drag and drop. These functions are
18 // used by both the bookmark bar and bookmark manager.
19 namespace bookmark_drag_utils {
20
21 // Calculates the drop operation given the event and supported set of
22 // operations. This prefers the following ordering: COPY, LINK then MOVE.
23 int PreferredDropOperation(const views::DropTargetEvent& event,
24 int operation);
25
26 // Returns true if the bookmark data can be dropped on |drop_parent| at
27 // |index|. A drop from a separate profile is always allowed, where as
28 // a drop from the same profile is only allowed if none of the nodes in
29 // |data| are an ancestor of |drop_parent| and one of the nodes isn't already
30 // a child of |drop_parent| at |index|.
31 bool IsValidDropLocation(Profile* profile,
32 const BookmarkDragData& data,
33 BookmarkNode* drop_parent,
34 int index);
35
36 // Clones drag data, adding newly created nodes to |parent| starting at
37 // |index_to_add_at|.
38 void CloneDragData(BookmarkModel* model,
39 const std::vector<BookmarkDragData::Element>& elements,
40 BookmarkNode* parent,
41 int index_to_add_at);
42
43 }
44
45 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_DRAG_UTILS_H_
OLDNEW
« no previous file with comments | « chrome/browser/bookmarks/bookmark_drag_data.cc ('k') | chrome/browser/bookmarks/bookmark_drag_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698