Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2579)

Unified Diff: chrome/browser/extensions/api/file_handlers/app_file_handler_util.h

Issue 14790018: ChromeOS: Use file extensions in Files app to decide which apps to use. (Closed) Base URL: http://git.chromium.org/chromium/src.git@file-handler-extensions2
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..1dbf56f53b9501e983a22af9e1feadde5af26463 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,
@@ -32,16 +36,13 @@ const FileHandlerInfo* FirstFileHandlerForFile(
const base::FilePath& path);
std::vector<const FileHandlerInfo*>
-FindFileHandlersForMimeTypes(const Extension& extension,
- const std::set<std::string>& mime_types);
+FindFileHandlers(const Extension& extension,
benwells 2013/05/07 08:05:17 Nit: please rename to just FileHandlersForFiles an
Sam McNally 2013/05/07 08:25:54 Done.
+ 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

Powered by Google App Engine
This is Rietveld 408576698