| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/download/download_query.h" | 5 #include "chrome/browser/download/download_query.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <limits> | 10 #include <limits> |
| 11 #include <memory> | 11 #include <memory> |
| 12 #include <string> | 12 #include <string> |
| 13 #include <vector> | 13 #include <vector> |
| 14 | 14 |
| 15 #include "base/bind.h" | 15 #include "base/bind.h" |
| 16 #include "base/callback.h" | 16 #include "base/callback.h" |
| 17 #include "base/files/file_path.h" | 17 #include "base/files/file_path.h" |
| 18 #include "base/i18n/case_conversion.h" | 18 #include "base/i18n/case_conversion.h" |
| 19 #include "base/i18n/string_search.h" | 19 #include "base/i18n/string_search.h" |
| 20 #include "base/logging.h" | 20 #include "base/logging.h" |
| 21 #include "base/stl_util.h" | |
| 22 #include "base/strings/string16.h" | 21 #include "base/strings/string16.h" |
| 23 #include "base/strings/string_split.h" | 22 #include "base/strings/string_split.h" |
| 24 #include "base/strings/stringprintf.h" | 23 #include "base/strings/stringprintf.h" |
| 25 #include "base/strings/utf_string_conversions.h" | 24 #include "base/strings/utf_string_conversions.h" |
| 26 #include "base/time/time.h" | 25 #include "base/time/time.h" |
| 27 #include "base/values.h" | 26 #include "base/values.h" |
| 28 #include "components/url_formatter/url_formatter.h" | 27 #include "components/url_formatter/url_formatter.h" |
| 29 #include "content/public/browser/content_browser_client.h" | 28 #include "content/public/browser/content_browser_client.h" |
| 30 #include "content/public/browser/download_item.h" | 29 #include "content/public/browser/download_item.h" |
| 31 #include "third_party/re2/src/re2/re2.h" | 30 #include "third_party/re2/src/re2/re2.h" |
| (...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 454 if (!sorters_.empty()) { | 453 if (!sorters_.empty()) { |
| 455 std::partial_sort(results->begin(), | 454 std::partial_sort(results->begin(), |
| 456 results->begin() + std::min(limit_, results->size()), | 455 results->begin() + std::min(limit_, results->size()), |
| 457 results->end(), | 456 results->end(), |
| 458 DownloadComparator(sorters_)); | 457 DownloadComparator(sorters_)); |
| 459 } | 458 } |
| 460 | 459 |
| 461 if (results->size() > limit_) | 460 if (results->size() > limit_) |
| 462 results->resize(limit_); | 461 results->resize(limit_); |
| 463 } | 462 } |
| OLD | NEW |