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 715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
726 return true; | 726 return true; |
727 } | 727 } |
728 return false; | 728 return false; |
729 } | 729 } |
730 | 730 |
731 bool ConfirmDeleteBookmarkNode(const BookmarkNode* node, | 731 bool ConfirmDeleteBookmarkNode(const BookmarkNode* node, |
732 gfx::NativeWindow window) { | 732 gfx::NativeWindow window) { |
733 DCHECK(node && node->is_folder() && !node->empty()); | 733 DCHECK(node && node->is_folder() && !node->empty()); |
734 return browser::ShowYesNoBox(window, | 734 return browser::ShowYesNoBox(window, |
735 l10n_util::GetStringUTF16(IDS_DELETE), | 735 l10n_util::GetStringUTF16(IDS_DELETE), |
736 l10n_util::GetStringFUTF16Int(IDS_BOOMARK_EDITOR_CONFIRM_DELETE, | 736 l10n_util::GetStringFUTF16Int(IDS_BOOKMARK_EDITOR_CONFIRM_DELETE, |
737 ChildURLCountTotal(node))); | 737 ChildURLCountTotal(node))); |
738 } | 738 } |
739 | 739 |
740 void DeleteBookmarkFolders(BookmarkModel* model, | 740 void DeleteBookmarkFolders(BookmarkModel* model, |
741 const std::vector<int64>& ids) { | 741 const std::vector<int64>& ids) { |
742 // Remove the folders that were removed. This has to be done after all the | 742 // Remove the folders that were removed. This has to be done after all the |
743 // other changes have been committed. | 743 // other changes have been committed. |
744 for (std::vector<int64>::const_iterator iter = ids.begin(); | 744 for (std::vector<int64>::const_iterator iter = ids.begin(); |
745 iter != ids.end(); | 745 iter != ids.end(); |
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 |