| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/bookmarks/bookmark_utils.h" | 5 #include "chrome/browser/bookmarks/bookmark_utils.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 return ui::DragDropTypes::DRAG_NONE; | 237 return ui::DragDropTypes::DRAG_NONE; |
| 238 | 238 |
| 239 if (!bookmark_utils::IsValidDropLocation(profile, data, parent, index)) | 239 if (!bookmark_utils::IsValidDropLocation(profile, data, parent, index)) |
| 240 return ui::DragDropTypes::DRAG_NONE; | 240 return ui::DragDropTypes::DRAG_NONE; |
| 241 | 241 |
| 242 if (data.GetFirstNode(profile)) { | 242 if (data.GetFirstNode(profile)) { |
| 243 // User is dragging from this profile: move. | 243 // User is dragging from this profile: move. |
| 244 return ui::DragDropTypes::DRAG_MOVE; | 244 return ui::DragDropTypes::DRAG_MOVE; |
| 245 } | 245 } |
| 246 // User is dragging from another app, copy. | 246 // User is dragging from another app, copy. |
| 247 return PreferredDropOperation(event.GetSourceOperations(), | 247 return PreferredDropOperation(event.source_operations(), |
| 248 ui::DragDropTypes::DRAG_COPY | ui::DragDropTypes::DRAG_LINK); | 248 ui::DragDropTypes::DRAG_COPY | ui::DragDropTypes::DRAG_LINK); |
| 249 } | 249 } |
| 250 | 250 |
| 251 int PerformBookmarkDrop(Profile* profile, | 251 int PerformBookmarkDrop(Profile* profile, |
| 252 const BookmarkNodeData& data, | 252 const BookmarkNodeData& data, |
| 253 const BookmarkNode* parent_node, | 253 const BookmarkNode* parent_node, |
| 254 int index) { | 254 int index) { |
| 255 BookmarkModel* model = profile->GetBookmarkModel(); | 255 BookmarkModel* model = profile->GetBookmarkModel(); |
| 256 if (data.IsFromProfile(profile)) { | 256 if (data.IsFromProfile(profile)) { |
| 257 const std::vector<const BookmarkNode*> dragged_nodes = | 257 const std::vector<const BookmarkNode*> dragged_nodes = |
| (...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 665 return true; | 665 return true; |
| 666 | 666 |
| 667 for (int i = 0; i < node->GetChildCount(); ++i) { | 667 for (int i = 0; i < node->GetChildCount(); ++i) { |
| 668 if (NodeHasURLs(node->GetChild(i))) | 668 if (NodeHasURLs(node->GetChild(i))) |
| 669 return true; | 669 return true; |
| 670 } | 670 } |
| 671 return false; | 671 return false; |
| 672 } | 672 } |
| 673 | 673 |
| 674 } // namespace bookmark_utils | 674 } // namespace bookmark_utils |
| OLD | NEW |