| 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 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 } | 449 } |
| 450 | 450 |
| 451 bool CanPasteFromClipboard(const BookmarkNode* node) { | 451 bool CanPasteFromClipboard(const BookmarkNode* node) { |
| 452 if (!node) | 452 if (!node) |
| 453 return false; | 453 return false; |
| 454 return BookmarkNodeData::ClipboardContainsBookmarks(); | 454 return BookmarkNodeData::ClipboardContainsBookmarks(); |
| 455 } | 455 } |
| 456 | 456 |
| 457 string16 GetNameForURL(const GURL& url) { | 457 string16 GetNameForURL(const GURL& url) { |
| 458 if (url.is_valid()) { | 458 if (url.is_valid()) { |
| 459 return net::GetSuggestedFilename(url, "", "", "", string16()); | 459 return net::GetSuggestedFilename(url, "", "", "", "", string16()); |
| 460 } else { | 460 } else { |
| 461 return l10n_util::GetStringUTF16(IDS_APP_UNTITLED_SHORTCUT_FILE_NAME); | 461 return l10n_util::GetStringUTF16(IDS_APP_UNTITLED_SHORTCUT_FILE_NAME); |
| 462 } | 462 } |
| 463 } | 463 } |
| 464 | 464 |
| 465 std::vector<const BookmarkNode*> GetMostRecentlyModifiedFolders( | 465 std::vector<const BookmarkNode*> GetMostRecentlyModifiedFolders( |
| 466 BookmarkModel* model, | 466 BookmarkModel* model, |
| 467 size_t max_count) { | 467 size_t max_count) { |
| 468 std::vector<const BookmarkNode*> nodes; | 468 std::vector<const BookmarkNode*> nodes; |
| 469 ui::TreeNodeIterator<const BookmarkNode> iterator(model->root_node()); | 469 ui::TreeNodeIterator<const BookmarkNode> iterator(model->root_node()); |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 738 ++iter) { | 738 ++iter) { |
| 739 const BookmarkNode* node = model->GetNodeByID(*iter); | 739 const BookmarkNode* node = model->GetNodeByID(*iter); |
| 740 if (!node) | 740 if (!node) |
| 741 continue; | 741 continue; |
| 742 const BookmarkNode* parent = node->parent(); | 742 const BookmarkNode* parent = node->parent(); |
| 743 model->Remove(parent, parent->GetIndexOf(node)); | 743 model->Remove(parent, parent->GetIndexOf(node)); |
| 744 } | 744 } |
| 745 } | 745 } |
| 746 | 746 |
| 747 } // namespace bookmark_utils | 747 } // namespace bookmark_utils |
| OLD | NEW |