| 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::BookmarkNodeData; |
| 19 |
| 18 namespace chrome { | 20 namespace chrome { |
| 19 | 21 |
| 20 int DropBookmarks(Profile* profile, | 22 int DropBookmarks(Profile* profile, |
| 21 const BookmarkNodeData& data, | 23 const BookmarkNodeData& data, |
| 22 const BookmarkNode* parent_node, | 24 const BookmarkNode* parent_node, |
| 23 int index, | 25 int index, |
| 24 bool copy) { | 26 bool copy) { |
| 25 BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile); | 27 BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile); |
| 26 #if !defined(OS_ANDROID) | 28 #if !defined(OS_ANDROID) |
| 27 bookmarks::ScopedGroupBookmarkActions group_drops(model); | 29 bookmarks::ScopedGroupBookmarkActions group_drops(model); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 45 return copy ? ui::DragDropTypes::DRAG_COPY : ui::DragDropTypes::DRAG_MOVE; | 47 return copy ? ui::DragDropTypes::DRAG_COPY : ui::DragDropTypes::DRAG_MOVE; |
| 46 } | 48 } |
| 47 return ui::DragDropTypes::DRAG_NONE; | 49 return ui::DragDropTypes::DRAG_NONE; |
| 48 } | 50 } |
| 49 // Dropping a folder from different profile. Always accept. | 51 // Dropping a folder from different profile. Always accept. |
| 50 bookmarks::CloneBookmarkNode(model, data.elements, parent_node, index, true); | 52 bookmarks::CloneBookmarkNode(model, data.elements, parent_node, index, true); |
| 51 return ui::DragDropTypes::DRAG_COPY; | 53 return ui::DragDropTypes::DRAG_COPY; |
| 52 } | 54 } |
| 53 | 55 |
| 54 } // namespace chrome | 56 } // namespace chrome |
| OLD | NEW |