Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / browser / chromeos / file_manager / file_browser_handlers.h
blob07ad9be5808902003b7f9687a86a728d20278b6b
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
8 #ifndef CHROME_BROWSER_CHROMEOS_FILE_MANAGER_FILE_BROWSER_HANDLERS_H_
9 #define CHROME_BROWSER_CHROMEOS_FILE_MANAGER_FILE_BROWSER_HANDLERS_H_
11 #include <string>
12 #include <vector>
14 #include "base/basictypes.h"
15 #include "base/callback_forward.h"
16 #include "chrome/browser/chromeos/file_manager/file_tasks.h"
18 class FileBrowserHandler;
19 class GURL;
20 class Profile;
22 namespace extensions {
23 class Extension;
26 namespace storage {
27 class FileSystemURL;
30 namespace file_manager {
31 namespace file_browser_handlers {
33 // Tasks are stored as a vector in order of priorities.
34 typedef std::vector<const FileBrowserHandler*> FileBrowserHandlerList;
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);
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<storage::FileSystemURL>& file_urls,
51 const file_tasks::FileTaskFinishedCallback& done);
53 } // namespace file_browser_handlers
54 } // namespace file_manager
56 #endif // CHROME_BROWSER_CHROMEOS_FILE_MANAGER_FILE_BROWSER_HANDLERS_H_