| 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/bookmarks/browser/bookmark_utils.h" | 5 #include "components/bookmarks/browser/bookmark_utils.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 520 } | 520 } |
| 521 | 521 |
| 522 base::string16 CleanUpUrlForMatching( | 522 base::string16 CleanUpUrlForMatching( |
| 523 const GURL& gurl, | 523 const GURL& gurl, |
| 524 const std::string& languages, | 524 const std::string& languages, |
| 525 base::OffsetAdjuster::Adjustments* adjustments) { | 525 base::OffsetAdjuster::Adjustments* adjustments) { |
| 526 base::OffsetAdjuster::Adjustments tmp_adjustments; | 526 base::OffsetAdjuster::Adjustments tmp_adjustments; |
| 527 return base::i18n::ToLower(url_formatter::FormatUrlWithAdjustments( | 527 return base::i18n::ToLower(url_formatter::FormatUrlWithAdjustments( |
| 528 GURL(TruncateUrl(gurl.spec())), languages, | 528 GURL(TruncateUrl(gurl.spec())), languages, |
| 529 url_formatter::kFormatUrlOmitUsernamePassword, | 529 url_formatter::kFormatUrlOmitUsernamePassword, |
| 530 net::UnescapeRule::SPACES | net::UnescapeRule::URL_SPECIAL_CHARS, NULL, | 530 net::UnescapeRule::SPACES | net::UnescapeRule::PATH_SEPARATORS | |
| 531 NULL, adjustments ? adjustments : &tmp_adjustments)); | 531 net::UnescapeRule::URL_SPECIAL_CHARS_EXCEPT_PATH_SEPARATORS, |
| 532 nullptr, nullptr, adjustments ? adjustments : &tmp_adjustments)); |
| 532 } | 533 } |
| 533 | 534 |
| 534 base::string16 CleanUpTitleForMatching(const base::string16& title) { | 535 base::string16 CleanUpTitleForMatching(const base::string16& title) { |
| 535 return base::i18n::ToLower(title.substr(0u, kCleanedUpTitleMaxLength)); | 536 return base::i18n::ToLower(title.substr(0u, kCleanedUpTitleMaxLength)); |
| 536 } | 537 } |
| 537 | 538 |
| 538 bool CanAllBeEditedByUser(BookmarkClient* client, | 539 bool CanAllBeEditedByUser(BookmarkClient* client, |
| 539 const std::vector<const BookmarkNode*>& nodes) { | 540 const std::vector<const BookmarkNode*>& nodes) { |
| 540 for (size_t i = 0; i < nodes.size(); ++i) { | 541 for (size_t i = 0; i < nodes.size(); ++i) { |
| 541 if (!client->CanBeEditedByUser(nodes[i])) | 542 if (!client->CanBeEditedByUser(nodes[i])) |
| (...skipping 25 matching lines...) Expand all Loading... |
| 567 bool HasDescendantsOf(const std::vector<const BookmarkNode*>& list, | 568 bool HasDescendantsOf(const std::vector<const BookmarkNode*>& list, |
| 568 const BookmarkNode* root) { | 569 const BookmarkNode* root) { |
| 569 for (const BookmarkNode* node : list) { | 570 for (const BookmarkNode* node : list) { |
| 570 if (IsDescendantOf(node, root)) | 571 if (IsDescendantOf(node, root)) |
| 571 return true; | 572 return true; |
| 572 } | 573 } |
| 573 return false; | 574 return false; |
| 574 } | 575 } |
| 575 | 576 |
| 576 } // namespace bookmarks | 577 } // namespace bookmarks |
| OLD | NEW |