Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(967)

Side by Side Diff: chrome/browser/bookmarks/bookmark_utils.cc

Issue 7012005: Revert "Revert 84829 - Initial implementation of "Synced Bookmarks" folder." (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Trying to set .json eol-style Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/bookmarks/bookmark_storage.cc ('k') | chrome/browser/bookmarks/recently_used_folders_combo_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698