| 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 <algorithm> | 7 #include <algorithm> | 
| 8 #include <string> | 8 #include <string> | 
| 9 #include <vector> | 9 #include <vector> | 
| 10 | 10 | 
| 11 #include "base/bind.h" | 11 #include "base/bind.h" | 
| 12 #include "base/callback.h" | 12 #include "base/callback.h" | 
| 13 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" | 
| 14 #include "base/i18n/case_conversion.h" | 14 #include "base/i18n/case_conversion.h" | 
| 15 #include "base/i18n/string_search.h" | 15 #include "base/i18n/string_search.h" | 
| 16 #include "base/logging.h" | 16 #include "base/logging.h" | 
| 17 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" | 
| 18 #include "base/stl_util.h" | 18 #include "base/stl_util.h" | 
| 19 #include "base/string16.h" | 19 #include "base/string16.h" | 
| 20 #include "base/string_split.h" |  | 
| 21 #include "base/stringprintf.h" | 20 #include "base/stringprintf.h" | 
|  | 21 #include "base/strings/string_split.h" | 
| 22 #include "base/time.h" | 22 #include "base/time.h" | 
| 23 #include "base/utf_string_conversions.h" | 23 #include "base/utf_string_conversions.h" | 
| 24 #include "base/values.h" | 24 #include "base/values.h" | 
| 25 #include "content/public/browser/content_browser_client.h" | 25 #include "content/public/browser/content_browser_client.h" | 
| 26 #include "content/public/browser/download_item.h" | 26 #include "content/public/browser/download_item.h" | 
| 27 #include "googleurl/src/gurl.h" | 27 #include "googleurl/src/gurl.h" | 
| 28 #include "net/base/net_util.h" | 28 #include "net/base/net_util.h" | 
| 29 #include "third_party/icu/public/i18n/unicode/regex.h" | 29 #include "third_party/icu/public/i18n/unicode/regex.h" | 
| 30 | 30 | 
| 31 using content::DownloadDangerType; | 31 using content::DownloadDangerType; | 
| (...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 419 | 419 | 
| 420 void DownloadQuery::FinishSearch(DownloadQuery::DownloadVector* results) const { | 420 void DownloadQuery::FinishSearch(DownloadQuery::DownloadVector* results) const { | 
| 421   if (!sorters_.empty()) | 421   if (!sorters_.empty()) | 
| 422     std::partial_sort(results->begin(), | 422     std::partial_sort(results->begin(), | 
| 423                       results->begin() + std::min(limit_, results->size()), | 423                       results->begin() + std::min(limit_, results->size()), | 
| 424                       results->end(), | 424                       results->end(), | 
| 425                       DownloadComparator(sorters_)); | 425                       DownloadComparator(sorters_)); | 
| 426   if (results->size() > limit_) | 426   if (results->size() > limit_) | 
| 427     results->resize(limit_); | 427     results->resize(limit_); | 
| 428 } | 428 } | 
| OLD | NEW | 
|---|