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_CHROMEOS_EXTENSIONS_FILE_MANAGER_FILE_HANDLER_UTIL_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_FILE_HANDLER_UTIL_H_ |
6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_FILE_HANDLER_UTIL_H_ | 6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_FILE_HANDLER_UTIL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 const std::set<std::string>& mime_types); | 46 const std::set<std::string>& mime_types); |
47 | 47 |
48 // Returns the task ID of the default task for the given |mime_type|/|suffix| | 48 // Returns the task ID of the default task for the given |mime_type|/|suffix| |
49 // combination. If it finds a MIME type match, then it prefers that over a | 49 // combination. If it finds a MIME type match, then it prefers that over a |
50 // suffix match. If it a default can't be found, then it returns the empty | 50 // suffix match. If it a default can't be found, then it returns the empty |
51 // string. | 51 // string. |
52 std::string GetDefaultTaskIdFromPrefs(Profile* profile, | 52 std::string GetDefaultTaskIdFromPrefs(Profile* profile, |
53 const std::string& mime_type, | 53 const std::string& mime_type, |
54 const std::string& suffix); | 54 const std::string& suffix); |
55 | 55 |
56 // Gets read-write file access permission flags. | |
57 int GetReadWritePermissions(); | |
58 // Gets read-only file access permission flags. | |
59 int GetReadOnlyPermissions(); | |
60 | |
61 // Generates task id for the action specified by the extension. The |task_type| | 56 // Generates task id for the action specified by the extension. The |task_type| |
62 // must be one of kTaskFile, kTaskDrive or kTaskApp. | 57 // must be one of kTaskFile, kTaskDrive or kTaskApp. |
63 std::string MakeTaskID(const std::string& extension_id, | 58 std::string MakeTaskID(const std::string& extension_id, |
64 const std::string& task_type, | 59 const std::string& task_type, |
65 const std::string& action_id); | 60 const std::string& action_id); |
66 | 61 |
67 // Extracts action, type and extension id bound to the file task. Either | 62 // Extracts action, type and extension id bound to the file task. Either |
68 // |target_extension_id| or |action_id| are allowed to be NULL if caller isn't | 63 // |target_extension_id| or |action_id| are allowed to be NULL if caller isn't |
69 // interested in those values. Returns false on failure to parse. | 64 // interested in those values. Returns false on failure to parse. |
70 bool CrackTaskID(const std::string& task_id, | 65 bool CrackTaskID(const std::string& task_id, |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 int32 tab_id, | 101 int32 tab_id, |
107 const std::string& extension_id, | 102 const std::string& extension_id, |
108 const std::string& task_type, | 103 const std::string& task_type, |
109 const std::string& action_id, | 104 const std::string& action_id, |
110 const std::vector<fileapi::FileSystemURL>& file_urls, | 105 const std::vector<fileapi::FileSystemURL>& file_urls, |
111 const FileTaskFinishedCallback& done); | 106 const FileTaskFinishedCallback& done); |
112 | 107 |
113 } // namespace file_handler_util | 108 } // namespace file_handler_util |
114 | 109 |
115 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_FILE_HANDLER_UTIL_H_ | 110 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_FILE_HANDLER_UTIL_H_ |
OLD | NEW |