OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 tasks". | 5 // This file provides utility functions for "file tasks". |
6 // | 6 // |
7 // WHAT ARE FILE TASKS? | 7 // WHAT ARE FILE TASKS? |
8 // | 8 // |
9 // File tasks are representation of actions that can be performed over the | 9 // File tasks are representation of actions that can be performed over the |
10 // currently selected files from Files.app. A task can be either of: | 10 // currently selected files from Files.app. A task can be either of: |
11 // | 11 // |
12 // 1) Chrome extension or app, registered via "file_handlers" or | 12 // 1) Chrome extension or app, registered via "file_handlers" or |
13 // "file_browser_handlers" in manifest.json (ex. Text.app). This information | 13 // "file_browser_handlers" in manifest.json (ex. Text.app). This information |
14 // comes from FileBrowserHandler::GetHandlers() | 14 // comes from FileBrowserHandler::GetHandlers() |
15 // | 15 // |
16 // See also: | 16 // See also: |
17 // https://developer.chrome.com/extensions/manifest.html#file_handlers | 17 // https://developer.chrome.com/extensions/manifest.html#file_handlers |
18 // https://developer.chrome.com/extensions/fileBrowserHandler.html | 18 // https://developer.chrome.com/extensions/fileBrowserHandler.html |
19 // | 19 // |
20 // 2) Built-in handlers provided from Files.app. Files.app provides lots of | 20 // 2) Built-in handlers provided from Files.app. Files.app provides lots of |
21 // file_browser_handlers, such as "play", "mount-archive". These built-in | 21 // file_browser_handlers, such as "play", "mount-archive". These built-in |
22 // handlers are often handled in special manners inside Files.app. | 22 // handlers are often handled in special manners inside Files.app. |
23 // This information also comes from FileBrowserHandler::GetHandlers(). | 23 // This information also comes from FileBrowserHandler::GetHandlers(). |
24 // | 24 // |
25 // See also: | 25 // See also: |
26 // chrome/browser/resources/file_manager/manifest.json | 26 // ui/file_manager/file_manager/manifest.json |
27 // | 27 // |
28 // 3) Drive app, which is a hosted app (i.e. just web site), that can work | 28 // 3) Drive app, which is a hosted app (i.e. just web site), that can work |
29 // with Drive (ex. Pixlr Editor). This information comes from | 29 // with Drive (ex. Pixlr Editor). This information comes from |
30 // drive::DriveAppRegistry. | 30 // drive::DriveAppRegistry. |
31 // | 31 // |
32 // See also: | 32 // See also: |
33 // https://chrome.google.com/webstore/category/collection/drive_apps | 33 // https://chrome.google.com/webstore/category/collection/drive_apps |
34 // | 34 // |
35 // For example, if the user is now selecting a JPEG file, Files.app will | 35 // For example, if the user is now selecting a JPEG file, Files.app will |
36 // receive file tasks represented as a JSON object via | 36 // receive file tasks represented as a JSON object via |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 // without any handler. Browser will take care of handling the file (ex. PDF). | 97 // without any handler. Browser will take care of handling the file (ex. PDF). |
98 // | 98 // |
99 // chrome.fileBrowserPrivate.executeTasks() is used to open a file with a | 99 // chrome.fileBrowserPrivate.executeTasks() is used to open a file with a |
100 // handler (Chrome Extension/App or Drive App). | 100 // handler (Chrome Extension/App or Drive App). |
101 // | 101 // |
102 // Some built-in handlers such as "play" are handled internally in Files.app. | 102 // Some built-in handlers such as "play" are handled internally in Files.app. |
103 // "mount-archive" is handled very differently. The task execution business | 103 // "mount-archive" is handled very differently. The task execution business |
104 // should be simplified: crbug.com/267313 | 104 // should be simplified: crbug.com/267313 |
105 // | 105 // |
106 // See also: | 106 // See also: |
107 // chrome/browser/resources/file_manager/js/file_tasks.js | 107 // ui/file_manager/file_manager/js/file_tasks.js |
108 // | 108 // |
109 | 109 |
110 #ifndef CHROME_BROWSER_CHROMEOS_FILE_MANAGER_FILE_TASKS_H_ | 110 #ifndef CHROME_BROWSER_CHROMEOS_FILE_MANAGER_FILE_TASKS_H_ |
111 #define CHROME_BROWSER_CHROMEOS_FILE_MANAGER_FILE_TASKS_H_ | 111 #define CHROME_BROWSER_CHROMEOS_FILE_MANAGER_FILE_TASKS_H_ |
112 | 112 |
113 #include <set> | 113 #include <set> |
114 #include <string> | 114 #include <string> |
115 #include <vector> | 115 #include <vector> |
116 | 116 |
117 #include "base/basictypes.h" | 117 #include "base/basictypes.h" |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 // task is found (i.e. the default task may not exist in |tasks|). No tasks | 296 // task is found (i.e. the default task may not exist in |tasks|). No tasks |
297 // should be set as default before calling this function. | 297 // should be set as default before calling this function. |
298 void ChooseAndSetDefaultTask(const PrefService& pref_service, | 298 void ChooseAndSetDefaultTask(const PrefService& pref_service, |
299 const PathAndMimeTypeSet& path_mime_set, | 299 const PathAndMimeTypeSet& path_mime_set, |
300 std::vector<FullTaskDescriptor>* tasks); | 300 std::vector<FullTaskDescriptor>* tasks); |
301 | 301 |
302 } // namespace file_tasks | 302 } // namespace file_tasks |
303 } // namespace file_manager | 303 } // namespace file_manager |
304 | 304 |
305 #endif // CHROME_BROWSER_CHROMEOS_FILE_MANAGER_FILE_TASKS_H_ | 305 #endif // CHROME_BROWSER_CHROMEOS_FILE_MANAGER_FILE_TASKS_H_ |
OLD | NEW |