| 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_EXTENSIONS_API_FILE_HANDLERS_APP_FILE_HANDLER_UTIL_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_FILE_HANDLERS_APP_FILE_HANDLER_UTIL_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_FILE_HANDLERS_APP_FILE_HANDLER_UTIL_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_FILE_HANDLERS_APP_FILE_HANDLER_UTIL_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 namespace app_file_handler_util { | 26 namespace app_file_handler_util { |
| 27 | 27 |
| 28 extern const char kInvalidParameters[]; | 28 extern const char kInvalidParameters[]; |
| 29 extern const char kSecurityError[]; | 29 extern const char kSecurityError[]; |
| 30 | 30 |
| 31 // Returns the file handler with the specified |handler_id|, or NULL if there | 31 // Returns the file handler with the specified |handler_id|, or NULL if there |
| 32 // is no such handler. | 32 // is no such handler. |
| 33 const FileHandlerInfo* FileHandlerForId(const Extension& app, | 33 const FileHandlerInfo* FileHandlerForId(const Extension& app, |
| 34 const std::string& handler_id); | 34 const std::string& handler_id); |
| 35 | 35 |
| 36 // Returns the first file handler that can handle the given entry, | |
| 37 // or NULL if is no such handler. | |
| 38 const FileHandlerInfo* FirstFileHandlerForEntry(const Extension& app, | |
| 39 const EntryInfo* entry); | |
| 40 | |
| 41 // Returns the handlers that can handle all files in |entries|. | 36 // Returns the handlers that can handle all files in |entries|. |
| 42 std::vector<const FileHandlerInfo*> FindFileHandlersForEntries( | 37 std::vector<const FileHandlerInfo*> FindFileHandlersForEntries( |
| 43 const Extension& extension, | 38 const Extension& extension, |
| 44 const std::vector<EntryInfo> entries); | 39 const std::vector<EntryInfo> entries); |
| 45 | 40 |
| 46 bool FileHandlerCanHandleEntry(const FileHandlerInfo& handler, | 41 bool FileHandlerCanHandleEntry(const FileHandlerInfo& handler, |
| 47 const EntryInfo& entry); | 42 const EntryInfo& entry); |
| 48 | 43 |
| 49 // Creates a new file entry and allows |renderer_id| to access |path|. This | 44 // Creates a new file entry and allows |renderer_id| to access |path|. This |
| 50 // registers a new file system for |path|. | 45 // registers a new file system for |path|. |
| (...skipping 24 matching lines...) Expand all Loading... |
| 75 const std::string& filesystem_path, | 70 const std::string& filesystem_path, |
| 76 int render_process_id, | 71 int render_process_id, |
| 77 base::FilePath* file_path, | 72 base::FilePath* file_path, |
| 78 std::string* error); | 73 std::string* error); |
| 79 | 74 |
| 80 } // namespace app_file_handler_util | 75 } // namespace app_file_handler_util |
| 81 | 76 |
| 82 } // namespace extensions | 77 } // namespace extensions |
| 83 | 78 |
| 84 #endif // CHROME_BROWSER_EXTENSIONS_API_FILE_HANDLERS_APP_FILE_HANDLER_UTIL_H_ | 79 #endif // CHROME_BROWSER_EXTENSIONS_API_FILE_HANDLERS_APP_FILE_HANDLER_UTIL_H_ |
| OLD | NEW |