OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/bookmarks/bookmark_drag_drop.h" | 5 #include "chrome/browser/ui/bookmarks/bookmark_drag_drop.h" |
6 | 6 |
7 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 7 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
9 #include "chrome/browser/undo/bookmark_undo_service.h" | 9 #include "chrome/browser/undo/bookmark_undo_service.h" |
10 #include "chrome/browser/undo/bookmark_undo_service_factory.h" | 10 #include "chrome/browser/undo/bookmark_undo_service_factory.h" |
11 #include "components/bookmarks/browser/bookmark_client.h" | 11 #include "components/bookmarks/browser/bookmark_client.h" |
12 #include "components/bookmarks/browser/bookmark_model.h" | 12 #include "components/bookmarks/browser/bookmark_model.h" |
13 #include "components/bookmarks/browser/bookmark_node_data.h" | 13 #include "components/bookmarks/browser/bookmark_node_data.h" |
14 #include "components/bookmarks/browser/bookmark_utils.h" | 14 #include "components/bookmarks/browser/bookmark_utils.h" |
15 #include "components/bookmarks/browser/scoped_group_bookmark_actions.h" | 15 #include "components/bookmarks/browser/scoped_group_bookmark_actions.h" |
16 #include "ui/base/dragdrop/drag_drop_types.h" | 16 #include "ui/base/dragdrop/drag_drop_types.h" |
17 | 17 |
18 using bookmarks::BookmarkModel; | 18 using bookmarks::BookmarkModel; |
| 19 using bookmarks::BookmarkNode; |
19 using bookmarks::BookmarkNodeData; | 20 using bookmarks::BookmarkNodeData; |
20 | 21 |
21 namespace chrome { | 22 namespace chrome { |
22 | 23 |
23 int DropBookmarks(Profile* profile, | 24 int DropBookmarks(Profile* profile, |
24 const BookmarkNodeData& data, | 25 const BookmarkNodeData& data, |
25 const BookmarkNode* parent_node, | 26 const BookmarkNode* parent_node, |
26 int index, | 27 int index, |
27 bool copy) { | 28 bool copy) { |
28 BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile); | 29 BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile); |
(...skipping 19 matching lines...) Expand all Loading... |
48 return copy ? ui::DragDropTypes::DRAG_COPY : ui::DragDropTypes::DRAG_MOVE; | 49 return copy ? ui::DragDropTypes::DRAG_COPY : ui::DragDropTypes::DRAG_MOVE; |
49 } | 50 } |
50 return ui::DragDropTypes::DRAG_NONE; | 51 return ui::DragDropTypes::DRAG_NONE; |
51 } | 52 } |
52 // Dropping a folder from different profile. Always accept. | 53 // Dropping a folder from different profile. Always accept. |
53 bookmarks::CloneBookmarkNode(model, data.elements, parent_node, index, true); | 54 bookmarks::CloneBookmarkNode(model, data.elements, parent_node, index, true); |
54 return ui::DragDropTypes::DRAG_COPY; | 55 return ui::DragDropTypes::DRAG_COPY; |
55 } | 56 } |
56 | 57 |
57 } // namespace chrome | 58 } // namespace chrome |
OLD | NEW |