| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/enhanced_bookmarks/enhanced_bookmark_utils.h" | 5 #include "components/enhanced_bookmarks/enhanced_bookmark_utils.h" |
| 6 | 6 |
| 7 #include "base/i18n/string_compare.h" | 7 #include "base/i18n/string_compare.h" |
| 8 #include "components/bookmarks/browser/bookmark_model.h" | 8 #include "components/bookmarks/browser/bookmark_model.h" |
| 9 | 9 |
| 10 using bookmarks::BookmarkModel; | 10 using bookmarks::BookmarkModel; |
| 11 using bookmarks::BookmarkNode; |
| 11 | 12 |
| 12 namespace enhanced_bookmarks { | 13 namespace enhanced_bookmarks { |
| 13 | 14 |
| 14 // Comparator used to sort bookmarks. No folders are allowed. | 15 // Comparator used to sort bookmarks. No folders are allowed. |
| 15 class BookmarkNameComparator : public std::binary_function<const BookmarkNode*, | 16 class BookmarkNameComparator : public std::binary_function<const BookmarkNode*, |
| 16 const BookmarkNode*, | 17 const BookmarkNode*, |
| 17 bool> { | 18 bool> { |
| 18 public: | 19 public: |
| 19 explicit BookmarkNameComparator(icu::Collator* collator) | 20 explicit BookmarkNameComparator(icu::Collator* collator) |
| 20 : collator_(collator) {} | 21 : collator_(collator) {} |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 const BookmarkNode* top = node; | 88 const BookmarkNode* top = node; |
| 88 while (top && | 89 while (top && |
| 89 std::find(root_folders.begin(), root_folders.end(), top) == | 90 std::find(root_folders.begin(), root_folders.end(), top) == |
| 90 root_folders.end()) { | 91 root_folders.end()) { |
| 91 top = top->parent(); | 92 top = top->parent(); |
| 92 } | 93 } |
| 93 return top; | 94 return top; |
| 94 } | 95 } |
| 95 | 96 |
| 96 } // namespace enhanced_bookmarks | 97 } // namespace enhanced_bookmarks |
| OLD | NEW |