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.
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_
14 #include "base/basictypes.h"
15 #include "base/callback_forward.h"
16 #include "chrome/browser/chromeos/file_manager/file_tasks.h"
18 class FileBrowserHandler
;
22 namespace extensions
{
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
38 FileBrowserHandlerList
FindFileBrowserHandlers(
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(
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_