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

Unified 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/bookmarks/bookmark_drag_utils.h
===================================================================
--- chrome/browser/bookmarks/bookmark_drag_utils.h (revision 0)
+++ chrome/browser/bookmarks/bookmark_drag_utils.h (revision 0)
@@ -0,0 +1,45 @@
+// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_BOOKMARKS_BOOKMARK_DRAG_UTILS_H_
+#define CHROME_BROWSER_BOOKMARKS_BOOKMARK_DRAG_UTILS_H_
+
+#include "chrome/browser/bookmarks/bookmark_drag_data.h"
+
+class BookmarkNode;
+class Profile;
+
+namespace views {
+class DropTargetEvent;
+}
+
+// Functions used in managing bookmark drag and drop. These functions are
+// used by both the bookmark bar and bookmark manager.
+namespace bookmark_drag_utils {
+
+// Calculates the drop operation given the event and supported set of
+// operations. This prefers the following ordering: COPY, LINK then MOVE.
+int PreferredDropOperation(const views::DropTargetEvent& event,
+ int operation);
+
+// Returns true if the bookmark data can be dropped on |drop_parent| at
+// |index|. A drop from a separate profile is always allowed, where as
+// a drop from the same profile is only allowed if none of the nodes in
+// |data| are an ancestor of |drop_parent| and one of the nodes isn't already
+// a child of |drop_parent| at |index|.
+bool IsValidDropLocation(Profile* profile,
+ const BookmarkDragData& data,
+ BookmarkNode* drop_parent,
+ int index);
+
+// Clones drag data, adding newly created nodes to |parent| starting at
+// |index_to_add_at|.
+void CloneDragData(BookmarkModel* model,
+ const std::vector<BookmarkDragData::Element>& elements,
+ BookmarkNode* parent,
+ int index_to_add_at);
+
+}
+
+#endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_DRAG_UTILS_H_
Property changes on: chrome\browser\bookmarks\bookmark_drag_utils.h
___________________________________________________________________
Added: svn:eol-style
+ LF
« 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