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

Side by Side Diff: chrome/browser/extensions/api/file_handlers/app_file_handler_util.h

Issue 23146016: Add support for directory access to the file system API. (Closed) Base URL: http://git.chromium.org/chromium/src.git@simpler-write-permissions
Patch Set: Created 7 years, 3 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 unified diff | Download patch
OLDNEW
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
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,
71 bool is_directory,
68 const base::Closure& on_success, 72 const base::Closure& on_success,
69 const base::Callback<void(const base::FilePath&)>& on_failure); 73 const base::Callback<void(const base::FilePath&)>& on_failure);
70 74
71 // Returns whether |extension| has the fileSystem.write permission. 75 // Returns whether |extension| has the fileSystem.write permission.
72 bool HasFileSystemWritePermission(const Extension* extension); 76 bool HasFileSystemWritePermission(const Extension* extension);
73 77
74 } // namespace app_file_handler_util 78 } // namespace app_file_handler_util
75 79
76 } // namespace extensions 80 } // namespace extensions
77 81
78 #endif // CHROME_BROWSER_EXTENSIONS_API_FILE_HANDLERS_APP_FILE_HANDLER_UTIL_H_ 82 #endif // CHROME_BROWSER_EXTENSIONS_API_FILE_HANDLERS_APP_FILE_HANDLER_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698