| 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 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 456 } | 456 } |
| 457 | 457 |
| 458 bool CanPasteFromClipboard(const BookmarkNode* node) { | 458 bool CanPasteFromClipboard(const BookmarkNode* node) { |
| 459 if (!node) | 459 if (!node) |
| 460 return false; | 460 return false; |
| 461 return BookmarkNodeData::ClipboardContainsBookmarks(); | 461 return BookmarkNodeData::ClipboardContainsBookmarks(); |
| 462 } | 462 } |
| 463 | 463 |
| 464 string16 GetNameForURL(const GURL& url) { | 464 string16 GetNameForURL(const GURL& url) { |
| 465 if (url.is_valid()) { | 465 if (url.is_valid()) { |
| 466 return net::GetSuggestedFilename(url, "", "", "", string16()); | 466 return net::GetSuggestedFilename(url, "", "", "", "", string16()); |
| 467 } else { | 467 } else { |
| 468 return l10n_util::GetStringUTF16(IDS_APP_UNTITLED_SHORTCUT_FILE_NAME); | 468 return l10n_util::GetStringUTF16(IDS_APP_UNTITLED_SHORTCUT_FILE_NAME); |
| 469 } | 469 } |
| 470 } | 470 } |
| 471 | 471 |
| 472 std::vector<const BookmarkNode*> GetMostRecentlyModifiedFolders( | 472 std::vector<const BookmarkNode*> GetMostRecentlyModifiedFolders( |
| 473 BookmarkModel* model, | 473 BookmarkModel* model, |
| 474 size_t max_count) { | 474 size_t max_count) { |
| 475 std::vector<const BookmarkNode*> nodes; | 475 std::vector<const BookmarkNode*> nodes; |
| 476 ui::TreeNodeIterator<const BookmarkNode> iterator(model->root_node()); | 476 ui::TreeNodeIterator<const BookmarkNode> iterator(model->root_node()); |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 746 ++iter) { | 746 ++iter) { |
| 747 const BookmarkNode* node = model->GetNodeByID(*iter); | 747 const BookmarkNode* node = model->GetNodeByID(*iter); |
| 748 if (!node) | 748 if (!node) |
| 749 continue; | 749 continue; |
| 750 const BookmarkNode* parent = node->parent(); | 750 const BookmarkNode* parent = node->parent(); |
| 751 model->Remove(parent, parent->GetIndexOf(node)); | 751 model->Remove(parent, parent->GetIndexOf(node)); |
| 752 } | 752 } |
| 753 } | 753 } |
| 754 | 754 |
| 755 } // namespace bookmark_utils | 755 } // namespace bookmark_utils |
| OLD | NEW |