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
;
26 namespace extensions
{
34 namespace file_manager
{
35 namespace file_browser_handlers
{
37 // Tasks are stored as a vector in order of priorities.
38 typedef std::vector
<const FileBrowserHandler
*> FileBrowserHandlerList
;
40 // Returns true if the given task is a fallback file browser handler. Such
41 // handlers are Files.app's internal handlers as well as quick office
43 bool IsFallbackFileBrowserHandler(const file_tasks::TaskDescriptor
& task
);
45 // Returns the list of file browser handlers that can open all files in
47 FileBrowserHandlerList
FindFileBrowserHandlers(
49 const std::vector
<GURL
>& file_list
);
51 // Executes a file browser handler specified by |extension| of the given
52 // action ID for |file_urls|. Returns false if undeclared handlers are
53 // found. |done| is on completion. See also the comment at ExecuteFileTask()
54 // for other parameters.
55 bool ExecuteFileBrowserHandler(
57 const extensions::Extension
* extension
,
58 const std::string
& action_id
,
59 const std::vector
<fileapi::FileSystemURL
>& file_urls
,
60 const file_tasks::FileTaskFinishedCallback
& done
);
62 } // namespace file_browser_handlers
63 } // namespace file_manager
65 #endif // CHROME_BROWSER_CHROMEOS_FILE_MANAGER_FILE_BROWSER_HANDLERS_H_