Index: chrome/browser/extensions/api/file_handlers/app_file_handler_util.h |
diff --git a/chrome/browser/extensions/api/file_handlers/app_file_handler_util.h b/chrome/browser/extensions/api/file_handlers/app_file_handler_util.h |
index ad7d4b7465a63ef23193ff354995a99efdd58d06..504d8ed3de4f18ac6167d5b22d066bd0d91d6b7b 100644 |
--- a/chrome/browser/extensions/api/file_handlers/app_file_handler_util.h |
+++ b/chrome/browser/extensions/api/file_handlers/app_file_handler_util.h |
@@ -7,6 +7,7 @@ |
#include <set> |
#include <string> |
+#include <utility> |
#include <vector> |
#include "chrome/common/extensions/api/file_handlers/file_handlers_parser.h" |
@@ -19,6 +20,9 @@ namespace extensions { |
// TODO(benwells): move this to platform_apps namespace. |
namespace app_file_handler_util { |
+// A set of pairs of path and its corresponding MIME type. |
+typedef std::set<std::pair<base::FilePath, std::string> > PathAndMimeTypeSet; |
+ |
// Returns the file handler with the specified |handler_id|, or NULL if there |
// is no such handler. |
const FileHandlerInfo* FileHandlerForId(const Extension& app, |
@@ -31,17 +35,16 @@ const FileHandlerInfo* FirstFileHandlerForFile( |
const std::string& mime_type, |
const base::FilePath& path); |
+// Returns the handlers that can handle all files in |files|. The paths in |
+// |files| must be populated, but the MIME types are optional. |
std::vector<const FileHandlerInfo*> |
-FindFileHandlersForMimeTypes(const Extension& extension, |
- const std::set<std::string>& mime_types); |
+FindFileHandlersForFiles(const Extension& extension, |
+ const PathAndMimeTypeSet& files); |
bool FileHandlerCanHandleFile( |
const FileHandlerInfo& handler, |
const std::string& mime_type, |
const base::FilePath& path); |
-bool FileHandlerCanHandleFileWithMimeType( |
- const FileHandlerInfo& handler, |
- const std::string& mime_type); |
// Represents a file entry that a user has given an extension permission to |
// access. Intended to be persisted to disk (in the Preferences file), so should |