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