| 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 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 473 // Add the bookmark bar and other nodes if there is space. | 473 // Add the bookmark bar and other nodes if there is space. |
| 474 if (find(nodes.begin(), nodes.end(), model->GetBookmarkBarNode()) == | 474 if (find(nodes.begin(), nodes.end(), model->GetBookmarkBarNode()) == |
| 475 nodes.end()) { | 475 nodes.end()) { |
| 476 nodes.push_back(model->GetBookmarkBarNode()); | 476 nodes.push_back(model->GetBookmarkBarNode()); |
| 477 } | 477 } |
| 478 | 478 |
| 479 if (nodes.size() < max_count && | 479 if (nodes.size() < max_count && |
| 480 find(nodes.begin(), nodes.end(), model->other_node()) == nodes.end()) { | 480 find(nodes.begin(), nodes.end(), model->other_node()) == nodes.end()) { |
| 481 nodes.push_back(model->other_node()); | 481 nodes.push_back(model->other_node()); |
| 482 } | 482 } |
| 483 |
| 484 if (nodes.size() < max_count && model->synced_node()->IsVisible() && |
| 485 find(nodes.begin(), nodes.end(), |
| 486 model->synced_node()) == nodes.end()) { |
| 487 nodes.push_back(model->synced_node()); |
| 488 } |
| 483 } | 489 } |
| 484 return nodes; | 490 return nodes; |
| 485 } | 491 } |
| 486 | 492 |
| 487 void GetMostRecentlyAddedEntries(BookmarkModel* model, | 493 void GetMostRecentlyAddedEntries(BookmarkModel* model, |
| 488 size_t count, | 494 size_t count, |
| 489 std::vector<const BookmarkNode*>* nodes) { | 495 std::vector<const BookmarkNode*>* nodes) { |
| 490 ui::TreeNodeIterator<const BookmarkNode> iterator(model->root_node()); | 496 ui::TreeNodeIterator<const BookmarkNode> iterator(model->root_node()); |
| 491 while (iterator.has_next()) { | 497 while (iterator.has_next()) { |
| 492 const BookmarkNode* node = iterator.Next(); | 498 const BookmarkNode* node = iterator.Next(); |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 681 return true; | 687 return true; |
| 682 | 688 |
| 683 for (int i = 0; i < node->child_count(); ++i) { | 689 for (int i = 0; i < node->child_count(); ++i) { |
| 684 if (NodeHasURLs(node->GetChild(i))) | 690 if (NodeHasURLs(node->GetChild(i))) |
| 685 return true; | 691 return true; |
| 686 } | 692 } |
| 687 return false; | 693 return false; |
| 688 } | 694 } |
| 689 | 695 |
| 690 } // namespace bookmark_utils | 696 } // namespace bookmark_utils |
| OLD | NEW |