| 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 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 487 &MoreRecentlyAdded); | 487 &MoreRecentlyAdded); |
| 488 if (nodes->size() < count || insert_position != nodes->end()) { | 488 if (nodes->size() < count || insert_position != nodes->end()) { |
| 489 nodes->insert(insert_position, node); | 489 nodes->insert(insert_position, node); |
| 490 while (nodes->size() > count) | 490 while (nodes->size() > count) |
| 491 nodes->pop_back(); | 491 nodes->pop_back(); |
| 492 } | 492 } |
| 493 } | 493 } |
| 494 } | 494 } |
| 495 } | 495 } |
| 496 | 496 |
| 497 TitleMatch::TitleMatch() {} | 497 TitleMatch::TitleMatch() |
| 498 : node(NULL) { |
| 499 } |
| 498 | 500 |
| 499 TitleMatch::~TitleMatch() {} | 501 TitleMatch::~TitleMatch() {} |
| 500 | 502 |
| 501 bool MoreRecentlyAdded(const BookmarkNode* n1, const BookmarkNode* n2) { | 503 bool MoreRecentlyAdded(const BookmarkNode* n1, const BookmarkNode* n2) { |
| 502 return n1->date_added() > n2->date_added(); | 504 return n1->date_added() > n2->date_added(); |
| 503 } | 505 } |
| 504 | 506 |
| 505 void GetBookmarksContainingText(BookmarkModel* model, | 507 void GetBookmarksContainingText(BookmarkModel* model, |
| 506 const string16& text, | 508 const string16& text, |
| 507 size_t max_count, | 509 size_t max_count, |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 665 return true; | 667 return true; |
| 666 | 668 |
| 667 for (int i = 0; i < node->GetChildCount(); ++i) { | 669 for (int i = 0; i < node->GetChildCount(); ++i) { |
| 668 if (NodeHasURLs(node->GetChild(i))) | 670 if (NodeHasURLs(node->GetChild(i))) |
| 669 return true; | 671 return true; |
| 670 } | 672 } |
| 671 return false; | 673 return false; |
| 672 } | 674 } |
| 673 | 675 |
| 674 } // namespace bookmark_utils | 676 } // namespace bookmark_utils |
| OLD | NEW |