Adding instrumentation to locate the source of jankiness
[chromium-blink-merge.git] / chrome / browser / ui / views / bookmarks / bookmark_drag_drop_views.h
blob1dcf68f203407d40578757d1c147ae6527a88ca6
1 // Copyright 2013 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.
5 #ifndef CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_DRAG_DROP_VIEWS_H_
6 #define CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_DRAG_DROP_VIEWS_H_
8 class BookmarkNode;
9 class Profile;
11 namespace bookmarks {
12 struct BookmarkNodeData;
15 namespace content {
16 class BrowserContext;
19 namespace ui {
20 class DropTargetEvent;
23 namespace chrome {
25 // Returns the drag operations for the specified node.
26 int GetBookmarkDragOperation(content::BrowserContext* browser_context,
27 const BookmarkNode* node);
29 // Calculates the drop operation given |source_operations| and the ideal
30 // set of drop operations (|operations|). This prefers the following ordering:
31 // COPY, LINK then MOVE.
32 int GetPreferredBookmarkDropOperation(int source_operations, int operations);
34 // Returns the preferred drop operation on a bookmark menu/bar.
35 // |parent| is the parent node the drop is to occur on and |index| the index the
36 // drop is over.
37 int GetBookmarkDropOperation(Profile* profile,
38 const ui::DropTargetEvent& event,
39 const bookmarks::BookmarkNodeData& data,
40 const BookmarkNode* parent,
41 int index);
43 // Returns true if the bookmark data can be dropped on |drop_parent| at
44 // |index|. A drop from a separate profile is always allowed, where as
45 // a drop from the same profile is only allowed if none of the nodes in
46 // |data| are an ancestor of |drop_parent| and one of the nodes isn't already
47 // a child of |drop_parent| at |index|.
48 bool IsValidBookmarkDropLocation(Profile* profile,
49 const bookmarks::BookmarkNodeData& data,
50 const BookmarkNode* drop_parent,
51 int index);
53 } // namespace chrome
55 #endif // CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_DRAG_DROP_VIEWS_H_