Index: chrome/browser/extensions/api/downloads/downloads_api.h |
diff --git a/chrome/browser/extensions/api/downloads/downloads_api.h b/chrome/browser/extensions/api/downloads/downloads_api.h |
index a2533258801deec138ac611f2d4c31c119ee3dfe..279b3be57a47eb207b4a5de607df8b23ac72e435 100644 |
--- a/chrome/browser/extensions/api/downloads/downloads_api.h |
+++ b/chrome/browser/extensions/api/downloads/downloads_api.h |
@@ -8,6 +8,7 @@ |
#include <memory> |
#include <set> |
#include <string> |
+#include <utility> |
#include "base/files/file_path.h" |
#include "base/macros.h" |
@@ -15,6 +16,7 @@ |
#include "base/time/time.h" |
#include "chrome/browser/download/download_danger_prompt.h" |
#include "chrome/browser/download/download_path_reservation_tracker.h" |
+#include "chrome/browser/download/download_query.h" |
#include "chrome/browser/extensions/chrome_extension_function.h" |
#include "chrome/common/extensions/api/downloads.h" |
#include "content/public/browser/all_download_item_notifier.h" |
@@ -404,6 +406,28 @@ class ExtensionDownloadsEventRouter |
DISALLOW_COPY_AND_ASSIGN(ExtensionDownloadsEventRouter); |
}; |
+using DownloadQueryFilterTypePair = |
+ std::pair<const char*, DownloadQuery::FilterType>; |
+using DownloadQuerySortTypePair = |
+ std::pair<const char*, DownloadQuery::SortType>; |
+ |
+// Finds the given filter/sort type pair for the string, or returns nullptr if |
+// the string was not found. |
+const DownloadQueryFilterTypePair* FindDownloadFilterTypeByString( |
+ const char* key); |
+const DownloadQuerySortTypePair* FindDownloadSortTypeByString(const char* key); |
+ |
+#if defined(UNIT_TEST) |
+ |
+// These functions return the beginning and end of the respective filter and |
+// sort type maps for the purposes of unit testing that the lists are sorted. |
+const DownloadQueryFilterTypePair* DownloadQueryFilterTypeBeginForTest(); |
+const DownloadQueryFilterTypePair* DownloadQueryFilterTypeEndForTest(); |
+const DownloadQuerySortTypePair* DownloadQuerySortTypeBeginForTest(); |
+const DownloadQuerySortTypePair* DownloadQuerySortTypeEndForTest(); |
+ |
+#endif // defined(UNIT_TEST); |
+ |
} // namespace extensions |
#endif // CHROME_BROWSER_EXTENSIONS_API_DOWNLOADS_DOWNLOADS_API_H_ |