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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 FindFileHandlersForFiles(const Extension& extension, | 42 FindFileHandlersForFiles(const Extension& extension, |
43 const PathAndMimeTypeSet& files); | 43 const PathAndMimeTypeSet& files); |
44 | 44 |
45 bool FileHandlerCanHandleFile( | 45 bool FileHandlerCanHandleFile( |
46 const FileHandlerInfo& handler, | 46 const FileHandlerInfo& handler, |
47 const std::string& mime_type, | 47 const std::string& mime_type, |
48 const base::FilePath& path); | 48 const base::FilePath& path); |
49 | 49 |
50 // Refers to a file entry that a renderer has been given access to. | 50 // Refers to a file entry that a renderer has been given access to. |
51 struct GrantedFileEntry { | 51 struct GrantedFileEntry { |
| 52 GrantedFileEntry(); |
| 53 |
52 std::string id; | 54 std::string id; |
53 std::string filesystem_id; | 55 std::string filesystem_id; |
54 std::string registered_name; | 56 std::string registered_name; |
55 }; | 57 }; |
56 | 58 |
57 // Creates a new file entry and allows |renderer_id| to access |path|. This | 59 // Creates a new file entry and allows |renderer_id| to access |path|. This |
58 // registers a new file system for |path|. | 60 // registers a new file system for |path|. |
59 GrantedFileEntry CreateFileEntry( | 61 GrantedFileEntry CreateFileEntry( |
60 Profile* profile, | 62 Profile* profile, |
61 const Extension* extension, | 63 const Extension* extension, |
62 int renderer_id, | 64 int renderer_id, |
63 const base::FilePath& path); | 65 const base::FilePath& path, |
| 66 bool is_directory); |
64 | 67 |
65 void CheckWritableFiles( | 68 void CheckWritableFiles( |
66 const std::vector<base::FilePath>& paths, | 69 const std::vector<base::FilePath>& paths, |
67 Profile* profile, | 70 Profile* profile, |
68 const base::Closure& on_success, | 71 const base::Closure& on_success, |
69 const base::Callback<void(const base::FilePath&)>& on_failure); | 72 const base::Callback<void(const base::FilePath&)>& on_failure); |
70 | 73 |
71 // Returns whether |extension| has the fileSystem.write permission. | 74 // Returns whether |extension| has the fileSystem.write permission. |
72 bool HasFileSystemWritePermission(const Extension* extension); | 75 bool HasFileSystemWritePermission(const Extension* extension); |
73 | 76 |
74 } // namespace app_file_handler_util | 77 } // namespace app_file_handler_util |
75 | 78 |
76 } // namespace extensions | 79 } // namespace extensions |
77 | 80 |
78 #endif // CHROME_BROWSER_EXTENSIONS_API_FILE_HANDLERS_APP_FILE_HANDLER_UTIL_H_ | 81 #endif // CHROME_BROWSER_EXTENSIONS_API_FILE_HANDLERS_APP_FILE_HANDLER_UTIL_H_ |
OLD | NEW |