| 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 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_QUERY_H_ | 5 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_QUERY_H_ |
| 6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_QUERY_H_ | 6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_QUERY_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 public: | 45 public: |
| 46 typedef std::vector<content::DownloadItem*> DownloadVector; | 46 typedef std::vector<content::DownloadItem*> DownloadVector; |
| 47 | 47 |
| 48 // FilterCallback is a Callback that takes a DownloadItem and returns true if | 48 // FilterCallback is a Callback that takes a DownloadItem and returns true if |
| 49 // the item matches the filter and false otherwise. | 49 // the item matches the filter and false otherwise. |
| 50 // query.AddFilter(base::Bind(&YourFilterFunction)); | 50 // query.AddFilter(base::Bind(&YourFilterFunction)); |
| 51 typedef base::Callback<bool(const content::DownloadItem&)> FilterCallback; | 51 typedef base::Callback<bool(const content::DownloadItem&)> FilterCallback; |
| 52 | 52 |
| 53 // All times are ISO 8601 strings. | 53 // All times are ISO 8601 strings. |
| 54 enum FilterType { | 54 enum FilterType { |
| 55 FILTER_BYTES_RECEIVED, // int | 55 FILTER_BYTES_RECEIVED, // double |
| 56 FILTER_DANGER_ACCEPTED, // bool | 56 FILTER_DANGER_ACCEPTED, // bool |
| 57 FILTER_ENDED_AFTER, // string | 57 FILTER_ENDED_AFTER, // string |
| 58 FILTER_ENDED_BEFORE, // string | 58 FILTER_ENDED_BEFORE, // string |
| 59 FILTER_END_TIME, // string | 59 FILTER_END_TIME, // string |
| 60 FILTER_EXISTS, // bool | 60 FILTER_EXISTS, // bool |
| 61 FILTER_FILENAME, // string | 61 FILTER_FILENAME, // string |
| 62 FILTER_FILENAME_REGEX, // string | 62 FILTER_FILENAME_REGEX, // string |
| 63 FILTER_MIME, // string | 63 FILTER_MIME, // string |
| 64 FILTER_PAUSED, // bool | 64 FILTER_PAUSED, // bool |
| 65 FILTER_QUERY, // vector<base::string16> | 65 FILTER_QUERY, // vector<base::string16> |
| 66 FILTER_STARTED_AFTER, // string | 66 FILTER_STARTED_AFTER, // string |
| 67 FILTER_STARTED_BEFORE, // string | 67 FILTER_STARTED_BEFORE, // string |
| 68 FILTER_START_TIME, // string | 68 FILTER_START_TIME, // string |
| 69 FILTER_TOTAL_BYTES, // int | 69 FILTER_TOTAL_BYTES, // double |
| 70 FILTER_TOTAL_BYTES_GREATER, // int | 70 FILTER_TOTAL_BYTES_GREATER, // double |
| 71 FILTER_TOTAL_BYTES_LESS, // int | 71 FILTER_TOTAL_BYTES_LESS, // double |
| 72 FILTER_URL, // string | 72 FILTER_URL, // string |
| 73 FILTER_URL_REGEX, // string | 73 FILTER_URL_REGEX, // string |
| 74 }; | 74 }; |
| 75 | 75 |
| 76 enum SortType { | 76 enum SortType { |
| 77 SORT_BYTES_RECEIVED, | 77 SORT_BYTES_RECEIVED, |
| 78 SORT_DANGER, | 78 SORT_DANGER, |
| 79 SORT_DANGER_ACCEPTED, | 79 SORT_DANGER_ACCEPTED, |
| 80 SORT_END_TIME, | 80 SORT_END_TIME, |
| 81 SORT_EXISTS, | 81 SORT_EXISTS, |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 void FinishSearch(DownloadVector* results) const; | 152 void FinishSearch(DownloadVector* results) const; |
| 153 | 153 |
| 154 FilterCallbackVector filters_; | 154 FilterCallbackVector filters_; |
| 155 SorterVector sorters_; | 155 SorterVector sorters_; |
| 156 size_t limit_; | 156 size_t limit_; |
| 157 | 157 |
| 158 DISALLOW_COPY_AND_ASSIGN(DownloadQuery); | 158 DISALLOW_COPY_AND_ASSIGN(DownloadQuery); |
| 159 }; | 159 }; |
| 160 | 160 |
| 161 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_QUERY_H_ | 161 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_QUERY_H_ |
| OLD | NEW |