Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1836)

Side by Side Diff: chrome/browser/chromeos/extensions/file_manager/file_browser_handlers.h

Issue 23857004: file_manager: Unify the file task selection logic (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_EXTENSIONS_FILE_MANAGER_FILE_BROWSER_HANDLERS_H_ 8 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_FILE_BROWSER_HANDLERS_H_
9 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_FILE_BROWSER_HANDLERS_H_ 9 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_FILE_BROWSER_HANDLERS_H_
10 10
(...skipping 25 matching lines...) Expand all
36 namespace file_browser_handlers { 36 namespace file_browser_handlers {
37 37
38 // Tasks are stored as a vector in order of priorities. 38 // Tasks are stored as a vector in order of priorities.
39 typedef std::vector<const FileBrowserHandler*> FileBrowserHandlerList; 39 typedef std::vector<const FileBrowserHandler*> FileBrowserHandlerList;
40 40
41 // Returns true if the given task is a fallback file browser handler. Such 41 // Returns true if the given task is a fallback file browser handler. Such
42 // handlers are Files.app's internal handlers as well as quick office 42 // handlers are Files.app's internal handlers as well as quick office
43 // extensions. 43 // extensions.
44 bool IsFallbackFileBrowserHandler(const file_tasks::TaskDescriptor& task); 44 bool IsFallbackFileBrowserHandler(const file_tasks::TaskDescriptor& task);
45 45
46 // Finds file browser handlers set as default from |common_tasks| for
47 // |file_list|. If no handlers are set as default, choose the the firstly
48 // found fallback handler as default.
49 FileBrowserHandlerList FindDefaultFileBrowserHandlers(
50 const PrefService& pref_service,
51 const std::vector<base::FilePath>& file_list,
52 const FileBrowserHandlerList& common_tasks);
53
54 // Returns the list of file browser handlers that can open all files in 46 // Returns the list of file browser handlers that can open all files in
55 // |file_list|. 47 // |file_list|.
56 FileBrowserHandlerList FindCommonFileBrowserHandlers( 48 FileBrowserHandlerList FindFileBrowserHandlers(
57 Profile* profile, 49 Profile* profile,
58 const std::vector<GURL>& file_list); 50 const std::vector<GURL>& file_list);
59 51
60 // Finds a file browser handler for a file whose URL is |url| and whose path
61 // is |path|. Returns the default handler if one is defined (The default
62 // handler is the one that is assigned to the file manager task button by
63 // default). If the default handler is not found, tries to match the url with
64 // one of the file browser handlers.
65 const FileBrowserHandler* FindFileBrowserHandlerForURLAndPath(
66 Profile* profile,
67 const GURL& url,
68 const base::FilePath& path);
69
70 // Executes a file browser handler specified by |extension| of the given 52 // Executes a file browser handler specified by |extension| of the given
71 // action ID for |file_urls|. Returns false if undeclared handlers are 53 // action ID for |file_urls|. Returns false if undeclared handlers are
72 // found. |done| is on completion. See also the comment at ExecuteFileTask() 54 // found. |done| is on completion. See also the comment at ExecuteFileTask()
73 // for other parameters. 55 // for other parameters.
74 bool ExecuteFileBrowserHandler( 56 bool ExecuteFileBrowserHandler(
75 Profile* profile, 57 Profile* profile,
76 const extensions::Extension* extension, 58 const extensions::Extension* extension,
77 int32 tab_id, 59 int32 tab_id,
78 const std::string& action_id, 60 const std::string& action_id,
79 const std::vector<fileapi::FileSystemURL>& file_urls, 61 const std::vector<fileapi::FileSystemURL>& file_urls,
80 const file_tasks::FileTaskFinishedCallback& done); 62 const file_tasks::FileTaskFinishedCallback& done);
81 63
82 } // namespace file_browser_handlers 64 } // namespace file_browser_handlers
83 } // namespace file_manager 65 } // namespace file_manager
84 66
85 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_FILE_BROWSER_HANDLERS _H_ 67 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_FILE_BROWSER_HANDLERS _H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698