| 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 21 matching lines...) Expand all Loading... |
| 32 typedef std::vector<const FileBrowserHandler*> FileBrowserHandlerList; | 32 typedef std::vector<const FileBrowserHandler*> FileBrowserHandlerList; |
| 33 | 33 |
| 34 // Specifies the task type for a task id that represents some file action, Drive | 34 // Specifies the task type for a task id that represents some file action, Drive |
| 35 // action, or Web Intent action. | 35 // action, or Web Intent action. |
| 36 extern const char kTaskFile[]; | 36 extern const char kTaskFile[]; |
| 37 extern const char kTaskDrive[]; | 37 extern const char kTaskDrive[]; |
| 38 extern const char kTaskApp[]; | 38 extern const char kTaskApp[]; |
| 39 | 39 |
| 40 void UpdateFileHandlerUsageStats(Profile* profile, const std::string& task_id); | 40 void UpdateFileHandlerUsageStats(Profile* profile, const std::string& task_id); |
| 41 | 41 |
| 42 // Returns true if the task should be used as a fallback. Such tasks are |
| 43 // Files.app's internal handlers as well as quick office extensions. |
| 44 bool IsFallbackTask(const FileBrowserHandler* task); |
| 45 |
| 42 // Update the default file handler for the given sets of suffixes and MIME | 46 // Update the default file handler for the given sets of suffixes and MIME |
| 43 // types. | 47 // types. |
| 44 void UpdateDefaultTask(Profile* profile, | 48 void UpdateDefaultTask(Profile* profile, |
| 45 const std::string& task_id, | 49 const std::string& task_id, |
| 46 const std::set<std::string>& suffixes, | 50 const std::set<std::string>& suffixes, |
| 47 const std::set<std::string>& mime_types); | 51 const std::set<std::string>& mime_types); |
| 48 | 52 |
| 49 // Returns the task ID of the default task for the given |mime_type|/|suffix| | 53 // Returns the task ID of the default task for the given |mime_type|/|suffix| |
| 50 // combination. If it finds a MIME type match, then it prefers that over a | 54 // combination. If it finds a MIME type match, then it prefers that over a |
| 51 // suffix match. If it a default can't be found, then it returns the empty | 55 // suffix match. If it a default can't be found, then it returns the empty |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 | 155 |
| 152 Profile* profile_; | 156 Profile* profile_; |
| 153 const GURL source_url_; | 157 const GURL source_url_; |
| 154 const std::string file_browser_id_; | 158 const std::string file_browser_id_; |
| 155 const std::string extension_id_; | 159 const std::string extension_id_; |
| 156 }; | 160 }; |
| 157 | 161 |
| 158 } // namespace file_handler_util | 162 } // namespace file_handler_util |
| 159 | 163 |
| 160 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_FILE_HANDLER_UTIL_H_ | 164 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_FILE_HANDLER_UTIL_H_ |
| OLD | NEW |