OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 // This file provides utility functions for file browser handlers. | 5 // This file provides utility functions for file browser handlers. |
6 // https://developer.chrome.com/extensions/fileBrowserHandler.html | 6 // https://developer.chrome.com/extensions/fileBrowserHandler.html |
7 | 7 |
8 #ifndef CHROME_BROWSER_CHROMEOS_FILE_MANAGER_FILE_BROWSER_HANDLERS_H_ | 8 #ifndef CHROME_BROWSER_CHROMEOS_FILE_MANAGER_FILE_BROWSER_HANDLERS_H_ |
9 #define CHROME_BROWSER_CHROMEOS_FILE_MANAGER_FILE_BROWSER_HANDLERS_H_ | 9 #define CHROME_BROWSER_CHROMEOS_FILE_MANAGER_FILE_BROWSER_HANDLERS_H_ |
10 | 10 |
11 #include <string> | 11 #include <string> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "base/basictypes.h" | 14 #include "base/basictypes.h" |
15 #include "base/callback_forward.h" | 15 #include "base/callback_forward.h" |
16 #include "chrome/browser/chromeos/file_manager/file_tasks.h" | 16 #include "chrome/browser/chromeos/file_manager/file_tasks.h" |
17 | 17 |
18 class FileBrowserHandler; | 18 class FileBrowserHandler; |
19 class GURL; | 19 class GURL; |
20 class Profile; | 20 class Profile; |
21 | 21 |
22 namespace extensions { | 22 namespace extensions { |
23 class Extension; | 23 class Extension; |
24 } | 24 } |
25 | 25 |
26 namespace fileapi { | 26 namespace storage { |
27 class FileSystemURL; | 27 class FileSystemURL; |
28 } | 28 } |
29 | 29 |
30 namespace file_manager { | 30 namespace file_manager { |
31 namespace file_browser_handlers { | 31 namespace file_browser_handlers { |
32 | 32 |
33 // Tasks are stored as a vector in order of priorities. | 33 // Tasks are stored as a vector in order of priorities. |
34 typedef std::vector<const FileBrowserHandler*> FileBrowserHandlerList; | 34 typedef std::vector<const FileBrowserHandler*> FileBrowserHandlerList; |
35 | 35 |
36 // Returns the list of file browser handlers that can open all files in | 36 // Returns the list of file browser handlers that can open all files in |
37 // |file_list|. | 37 // |file_list|. |
38 FileBrowserHandlerList FindFileBrowserHandlers( | 38 FileBrowserHandlerList FindFileBrowserHandlers( |
39 Profile* profile, | 39 Profile* profile, |
40 const std::vector<GURL>& file_list); | 40 const std::vector<GURL>& file_list); |
41 | 41 |
42 // Executes a file browser handler specified by |extension| of the given | 42 // Executes a file browser handler specified by |extension| of the given |
43 // action ID for |file_urls|. Returns false if undeclared handlers are | 43 // action ID for |file_urls|. Returns false if undeclared handlers are |
44 // found. |done| is on completion. See also the comment at ExecuteFileTask() | 44 // found. |done| is on completion. See also the comment at ExecuteFileTask() |
45 // for other parameters. | 45 // for other parameters. |
46 bool ExecuteFileBrowserHandler( | 46 bool ExecuteFileBrowserHandler( |
47 Profile* profile, | 47 Profile* profile, |
48 const extensions::Extension* extension, | 48 const extensions::Extension* extension, |
49 const std::string& action_id, | 49 const std::string& action_id, |
50 const std::vector<fileapi::FileSystemURL>& file_urls, | 50 const std::vector<storage::FileSystemURL>& file_urls, |
51 const file_tasks::FileTaskFinishedCallback& done); | 51 const file_tasks::FileTaskFinishedCallback& done); |
52 | 52 |
53 } // namespace file_browser_handlers | 53 } // namespace file_browser_handlers |
54 } // namespace file_manager | 54 } // namespace file_manager |
55 | 55 |
56 #endif // CHROME_BROWSER_CHROMEOS_FILE_MANAGER_FILE_BROWSER_HANDLERS_H_ | 56 #endif // CHROME_BROWSER_CHROMEOS_FILE_MANAGER_FILE_BROWSER_HANDLERS_H_ |
OLD | NEW |