Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / common / extensions / api / file_manager_private.idl
blob1ef1b22bdf5214d94747765ecdca3d0223e76681
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 // fileManagerPrivate API.
6 // This is a private API used by the file browser of ChromeOS.
7 [platforms=("chromeos"),
8 implemented_in="chrome/browser/chromeos/extensions/file_manager/file_manager_private_api_functions.h"]
9 namespace fileManagerPrivate {
10 // Type of the mounted volume.
11 enum VolumeType { drive, downloads, removable, archive, provided, mtp,
12 testing };
14 // Device type. Available if this is removable volume.
15 enum DeviceType { usb, sd, optical, mobile, unknown };
17 // Additional data about mount, for example, that the filesystem is not
18 // supported.
19 enum MountCondition { unknown, unsupported };
21 // Additional information of the context the volume was mounted.
22 enum MountContext { user, auto };
24 // Is the event raised for mounting or unmounting.
25 enum MountCompletedEventType { mount, unmount };
27 // Event type that tells listeners if mount was successful or an error
28 // occurred. It also specifies the error.
29 enum MountCompletedStatus {
30 success,
31 error_unknown,
32 error_internal,
33 error_invalid_argument,
34 error_invalid_path,
35 error_path_already_mounted,
36 error_path_not_mounted,
37 error_directory_creation_failed,
38 error_invalid_mount_options,
39 error_invalid_unmount_options,
40 error_insufficient_permissions,
41 error_mount_program_not_found,
42 error_mount_program_failed,
43 error_invalid_device_path,
44 error_unknown_filesystem,
45 error_unsupported_filesystem,
46 error_invalid_archive,
47 error_authentication,
48 error_path_unmounted
51 // File transfer progress state.
52 enum TransferState { in_progress, completed, failed };
54 // Defines file transfer direction.
55 enum TransferType { upload, download };
57 // The type of the progress event.
58 enum CopyProgressStatusType {
59 // "begin_copy_entry" is fired for each entry (file or directory) before
60 // starting the copy operation.
61 begin_copy_entry,
63 // "end_copy_entry" is fired for each entry (file or directory) after ending
64 // the copy operation.
65 end_copy_entry,
67 // "progress" is fired periodically to report progress of a file copy (not
68 // directory).
69 progress,
71 // "success" is fired after all entries are copied.
72 success,
74 // "error" is fired when an error occurs.
75 error
78 // Specifies type of event that is raised.
79 enum FileWatchEventType { changed, error };
81 // Specifies type of change in file watch event.
82 enum ChangeType { add_or_update, delete };
84 // The type of entry that is needed. Default to ALL.
85 enum SearchType { EXCLUDE_DIRECTORIES, SHARED_WITH_ME, OFFLINE, ALL };
87 // Zooming mode.
88 enum ZoomOperationType { in, out, reset };
90 // Specifies how to open inspector.
91 enum InspectionType {
92 // Open inspector for foreground page.
93 normal,
94 // Open inspector for foreground page and bring focus to the console.
95 console,
96 // Open inspector for foreground page in inspect element mode.
97 element,
98 // Open inspector for background page.
99 background
102 // Device event type.
103 enum DeviceEventType {
104 // If the device is disabled by preference.
105 disabled,
106 // Device is removed.
107 removed,
108 // Device is hard unplugged.
109 hard_unplugged,
110 // Format started.
111 format_start,
112 // Format succeeded.
113 format_success,
114 // Format failed.
115 format_fail
118 // Drive sync error type.
119 // Keep it synced with DriveSyncErrorType in operation_observer.h.
120 enum DriveSyncErrorType {
121 // Request to delete a file without permission.
122 delete_without_permission,
123 // Google Drive is temporarily unavailable.
124 service_unavailable,
125 // There is no server space to sync a file.
126 no_server_space,
127 // Miscellaneous errors other than listed above.
128 misc
131 // Result of task execution.
132 enum TaskResult {
133 // The task execution succeeded and a new window/tab was opened.
134 opened,
135 // The task execution succeeded and the message was sent to the proper
136 // extension.
137 message_sent,
138 // The task execution failed.
139 failed,
140 // No URL is specified.
141 empty
144 // Drive share type.
145 enum DriveShareType {
146 can_edit,
147 can_comment,
148 can_view
151 // Names of properies for getEntryProperties().
152 enum EntryPropertyName {
153 size,
154 modificationTime,
155 thumbnailUrl,
156 croppedThumbnailUrl,
157 imageWidth,
158 imageHeight,
159 imageRotation,
160 pinned,
161 present,
162 hosted,
163 availableOffline,
164 availableWhenMetered,
165 dirty,
166 customIconUrl,
167 contentMimeType,
168 sharedWithMe,
169 shared,
170 externalFileUrl
173 // Entry property visibility for setEntryTag();
174 enum EntryTagVisibility {
175 private,
176 public
179 // Source of the volume data.
180 enum Source {
181 file,
182 device,
183 network,
184 system
187 // A file task represents an action that the file manager can perform over the
188 // currently selected files. See
189 // chrome/browser/chromeos/extensions/file_manager/file_tasks.h for details
190 // about how file tasks are handled.
191 dictionary FileTask {
192 // The unique identifier of the task.
193 DOMString taskId;
195 // Task title (ex. App name).
196 DOMString title;
198 // Task icon url (from chrome://extension-icon/...)
199 DOMString iconUrl;
201 // True if this task is a default task for the selected files.
202 boolean isDefault;
204 // True if this task is from generic file handler. Generic file handler is a
205 // file handler which handles any type of files (e.g. extensions: ["*"],
206 // types: ["*/*"]). Partial wild card (e.g. types: ["image/*"]) is not
207 // generic file handler.
208 boolean isGenericFileHandler;
211 // Additional entry properties.
212 dictionary EntryProperties {
213 // Size of this file.
214 double? size;
216 // Timestamp of entry update time, in milliseconds past the epoch.
217 double? modificationTime;
219 // URL to the Drive thumbnail image for this file.
220 DOMString? thumbnailUrl;
222 // URL to the Drive cropped thumbnail image for this file.
223 DOMString? croppedThumbnailUrl;
225 // Width, if the entry is an image.
226 long? imageWidth;
228 // Height, if the entry is an image.
229 long? imageHeight;
231 // Rotation in clockwise degrees, if the entry is an image.
232 long? imageRotation;
234 // True if the file is pinned in cache.
235 boolean? pinned;
237 // True if the file is present in cache.
238 boolean? present;
240 // True if the file is hosted on a server instead of local.
241 boolean? hosted;
243 // True if the file is available offline.
244 boolean? availableOffline;
246 // True if the file is available on metered connection.
247 boolean? availableWhenMetered;
249 // True if the file has local change (has not been fully synced to the cloud).
250 boolean? dirty;
252 // URL to the custom icon for this file.
253 DOMString? customIconUrl;
255 // Drive MIME type for this file.
256 DOMString? contentMimeType;
258 // True if the entry is labeled as shared-with-me.
259 boolean? sharedWithMe;
261 // True if the entry is labeled as shared (either from me to others or to me
262 // by others.)
263 boolean? shared;
265 // External file URL to open the file in browser.
266 DOMString? externalFileUrl;
269 // Information about total and remaining size on the mount point.
270 dictionary MountPointSizeStats {
271 // Approximate total available size on the mount point.
272 double totalSize;
274 // Approximate remaining available size on the mount point.
275 double remainingSize;
278 // Information about a profile.
279 dictionary ProfileInfo {
280 // Profile ID. This is currently e-mail address of the profile.
281 DOMString profileId;
283 // The name of the profile for display purpose.
284 DOMString displayName;
286 // True if the profile is the one running the current file manager instance.
287 // TODO(hirono): Remove the property because of the design change of
288 // multi-profile suuport.
289 boolean isCurrentProfile;
292 // Mounted disk volume metadata.
293 dictionary VolumeMetadata {
294 // ID of the disk volume.
295 DOMString volumeId;
297 // Id the provided file system (for provided file systems).
298 DOMString? fileSystemId;
300 // Extension providing this volume (for provided file systems).
301 DOMString? extensionId;
303 // Source of the volume's data.
304 Source source;
306 // Label of the volume (if available).
307 DOMString? volumeLabel;
309 // Description of the profile where the volume belongs.
310 // TODO(hirono): Remove the property because of the design change of
311 // multi-profile support.
312 ProfileInfo profile;
314 // The path to the mounted device, archive file or network resource.
315 DOMString? sourcePath;
317 // Type of the mounted volume.
318 VolumeType volumeType;
320 // Device type. Available if this is removable volume.
321 DeviceType? deviceType;
323 // Path to identify the device. This is consistent with DeviceEvent's
324 // devicePath.
325 DOMString? devicePath;
327 // Whether the device is parent or not (i.e. sdb rather than sdb1).
328 boolean? isParentDevice;
330 // Flag that specifies if volume is mounted in read-only mode.
331 boolean isReadOnly;
333 // Flag that specifies whether the volume contains media.
334 boolean hasMedia;
336 // Flag that specifies whether the volume is configurable.
337 boolean configurable;
339 // Flag that specifies whether the volume is watchable.
340 boolean watchable;
342 // Additional data about mount, for example, that the filesystem is not
343 // supported.
344 MountCondition? mountCondition;
346 // Context in which the volume has been mounted.
347 MountContext? mountContext;
350 // Payload data for mount event.
351 dictionary MountCompletedEvent {
352 // Is the event raised for mounting or unmounting.
353 MountCompletedEventType eventType;
355 // Event type that tells listeners if mount was successful or an error
356 // occurred. It also specifies the error.
357 MountCompletedStatus status;
359 // Metadata of the mounted volume.
360 VolumeMetadata volumeMetadata;
362 // Whether the volume event should be notified or not.
363 boolean shouldNotify;
366 // Payload data for file transfer status updates.
367 dictionary FileTransferStatus {
368 // URL of file that is being transfered.
369 DOMString fileUrl;
371 // File transfer progress state.
372 TransferState transferState;
374 // Defines file transfer direction.
375 TransferType transferType;
377 // Approximated completed portion of the transfer operation.
378 double processed;
380 // Approximated total size of transfer operation.
381 double total;
383 // Total number of jobs.
384 long num_total_jobs;
387 // Error during the drive sync.
388 dictionary DriveSyncErrorEvent {
389 // Error type.
390 DriveSyncErrorType type;
392 // File URL of the entry that the error happens to.
393 DOMString fileUrl;
396 // Payload data for copy status progress updates.
397 dictionary CopyProgressStatus {
398 // The type of the progress event.
399 CopyProgressStatusType type;
401 // URL for the entry currently being copied. This field is particularly useful
402 // when a directory copy is initiated with startCopy(). The field tells what
403 // file/directory in that directory is now being copied.
404 DOMString? sourceUrl;
406 // URL for the entry currently being created. This field is particularly
407 // useful when a directory copy is initiated with startCopy(). The field tells
408 // what file/directory in that directory is being created. Available only for
409 // end_copy_entry and success.
410 DOMString? destinationUrl;
412 // Number of processed bytes for the file currently being copied. Available
413 // only for "progress" event. To show the progress bar, a caller needs to
414 // pre-compute the size of files being copied for the file (not directory).
415 double? size;
417 // DOMError's name. Available only for ERROR event.
418 DOMString? error;
421 // Detailed information of change.
422 dictionary FileChange {
423 // URL of changed file (or directory).
424 DOMString url;
426 // Type of change, which may be multiple.
427 ChangeType[] changes;
430 // Directory change notification details.
431 dictionary FileWatchEvent {
432 // Specifies type of event that is raised.
433 FileWatchEventType eventType;
435 // An Entry object which represents a changed directory. The conversion into a
436 // kind of FileEntry object is done in
437 // file_browser_handler_custom_bindings.cc. For filesystem API's Entry
438 // interface, see <a
439 // href='http://www.w3.org/TR/file-system-api/#the-entry-interface'>The Entry
440 // interface</a>.
441 [instanceOf=Entry] object entry;
443 // Detailed change information of change. It would be null if the detailed
444 // information is not available.
445 FileChange[]? changedFiles;
448 dictionary Preferences {
449 boolean driveEnabled;
450 boolean cellularDisabled;
451 boolean hostedFilesDisabled;
452 boolean searchSuggestEnabled;
453 boolean use24hourClock;
454 boolean allowRedeemOffers;
455 DOMString timezone;
458 dictionary PreferencesChange {
459 boolean? cellularDisabled;
460 boolean? hostedFilesDisabled;
463 dictionary SearchParams {
464 // Search query.
465 DOMString query;
467 // ID of the search feed that should be fetched next. Value passed here should
468 // be gotten from previous searchDrive call. It can be empty for the initial
469 // search request.
470 DOMString nextFeed;
473 dictionary SearchMetadataParams {
474 // Search query. It can be empty. Any filename matches to an empty query.
475 DOMString query;
477 // The type of entry that is needed. Default to ALL.
478 SearchType types;
480 // Maximum number of results.
481 long maxResults;
484 // Entry and Drive-related properties representing a search result.
485 dictionary SearchResult {
486 // A dictionary object which represents a Drive file. This will be converted
487 // into a kind of FileEntry object. See
488 // file_browser_handler_custom_bindings.cc for details. For filesystem API's
489 // Entry interface, see <a
490 // href='http://www.w3.org/TR/file-system-api/#the-entry-interface'>The Entry
491 // interface</a>.
492 [instanceOf=Entry] object entry;
494 // The base name of a Drive file that matched the search query. The matched
495 // sub strings are highlighted with <b> element. Meta characters are escaped
496 // like &lt;.
497 DOMString highlightedBaseName;
500 dictionary DriveConnectionState {
501 DOMString type;
503 // Reasons of offline.
504 DOMString? reason;
506 // Whether the device has a cellular network access or not. i.e. the |type|
507 // can be 'metered' or not.
508 boolean hasCellularNetworkAccess;
511 // Device event dispatched to listeners of onDeviceChaged. See also
512 // DeviceEventType to know when the event dispatched.
513 dictionary DeviceEvent {
514 // Event type of the device event.
515 DeviceEventType type;
516 // Device path to identify the device.
517 DOMString devicePath;
520 // Describes an installed providing extension.
521 dictionary ProvidingExtension {
522 // ID of the providing extension.
523 DOMString extensionId;
525 // Name of the providing extension.
526 DOMString name;
528 // Whether supports configuration dialog.
529 boolean configurable;
531 // Whether supports watching entries.
532 boolean watchable;
534 // Whether supports mounting multiple instances.
535 boolean multipleMounts;
537 // Source of file systems' data.
538 manifestTypes.FileSystemProviderSource source;
541 // Callback that does not take arguments.
542 callback SimpleCallback = void();
544 // |result| Boolean result returned by the invoked function.
545 callback BooleanCallback = void(boolean result);
547 // |result| Result of the task execution.
548 callback ExecuteTaskCallback = void(TaskResult result);
550 // |tasks| The list of matched file entries for this task.
551 callback GetFileTasksCallback = void(FileTask[] tasks);
553 // |result| Mime type of the file.
554 callback GetMimeTypeCallback = void(DOMString result);
556 // |result| Hash containing the string assets.
557 callback GetStringsCallback = void(object result);
559 // |success| True when file watch is successfully added.
560 callback AddFileWatchCallback = void(optional boolean success);
562 // |success| True when file watch is successfully removed.
563 callback RemoveFileWatchCallback = void(optional boolean success);
565 // |entryProperties| A dictionary containing properties of the requested
566 // entries.
567 callback GetEntryPropertiesCallback =
568 void(EntryProperties[] entryProperties);
570 // |sourcePath| Source path of the mount.
571 callback AddMountCallback = void(DOMString sourcePath);
573 // |volumeMetadataList| The list of VolumeMetadata representing mounted volumes.
574 callback GetVolumeMetadataListCallback =
575 void(VolumeMetadata[] volumeMetadataList);
577 // |fileTransferCancelStatuses| The list of FileTransferCancelStatus.
578 callback CancelFileTransfersCallback =
579 void(FileTransferCancelStatus[] fileTransferCancelStatuses);
581 // |copyId| ID of the copy task. Can be used to identify the progress, and to
582 // cancel the task.
583 callback StartCopyCallback = void(long copyId);
585 // |sizeStats| Name/value pairs of size stats. Will be undefined if stats could
586 // not be determined.
587 callback GetSizeStatsCallback = void(optional MountPointSizeStats sizeStats);
589 callback GetPreferencesCallback = void(Preferences result);
591 // |entries|
592 // |nextFeed| ID of the feed that contains next chunk of the search result.
593 // Should be sent to the next searchDrive request to perform
594 // incremental search.
595 callback SearchDriveCallback =
596 void([instanceOf=Entry] object[] entries, DOMString nextFeed);
598 callback SearchDriveMetadataCallback = void(SearchResult[] results);
600 // |urls| The map of hash and array of FileEntry's URL. The array can be empty
601 // if the corresponding file is not found.
602 callback SearchFilesByHashesCallback = void(object urls);
604 callback ZipSelectionCallback = void(optional boolean success);
606 callback GetDriveConnectionStateCallback = void(DriveConnectionState result);
608 // |result| true if the length is in the valid range, false otherwise.
609 callback ValidatePathNameLengthCallback = void(boolean result);
611 // |accessToken| OAuth2 access token, or an empty string if failed to fetch.
612 callback RequestAccessTokenCallback = void(DOMString accessToken);
614 // |accessToken| OAuth2 access token, or an empty string if failed to fetch.
615 callback RequestWebStoreAccessTokenCallback = void(DOMString accessToken);
617 // |url| Result url.
618 callback GetUrlCallback = void(DOMString url);
620 // |profiles| List of profile information.
621 // |runningProfile| ID of the profile that runs the application instance.
622 // |showingProfile| ID of the profile that shows the application window.
623 callback GetProfilesCallback = void(ProfileInfo[] profiles,
624 DOMString runningProfile,
625 DOMString displayProfile);
627 // |entries| External entries.
628 callback ResolveEntriesCallback =
629 void([instanceOf=Entry] object[] entries);
631 // |checksum| Result checksum.
632 callback ComputeChecksumCallback = void(DOMString checksum);
634 // |extensions| List of providing extensions.
635 callback GetProvidingExtensionsCallback = void(ProvidingExtension[] extensions);
637 // |actions| List of actions.
638 callback GetEntryActionsCallback = void(fileSystemProvider.Action[] actions);
640 interface Functions {
641 // Logout the current user for navigating to the re-authentication screen for
642 // the Google account.
643 static void logoutUserForReauthentication();
645 // Cancels file selection.
646 static void cancelDialog();
648 // Executes file browser task over selected files.
649 // |taskId| The unique identifier of task to execute.
650 // |entries| Array of entries
651 // |callback|
652 [nocompile]
653 static void executeTask(DOMString taskId,
654 [instanceof=Entry] object[] entries,
655 ExecuteTaskCallback callback);
657 // Sets the default task for the supplied MIME types and path extensions.
658 // Lists of MIME types and URLs may contain duplicates. Additionally, the
659 // list of MIME types can be empty.
660 // |taskId| The unique identifier of task to mark as default.
661 // |entries| Array of selected entries to extract path extensions from.
662 // |mimeTypes| Array of selected file MIME types.
663 // |callback|
664 [nocompile]
665 static void setDefaultTask(DOMString taskId,
666 [instanceof=Entry] object[] entries,
667 DOMString[] mimeTypes,
668 SimpleCallback callback);
670 // Gets the list of tasks that can be performed over selected files.
671 // |entries| Array of selected entries
672 // |callback|
673 [nocompile]
674 static void getFileTasks([instanceof=Entry] object[] entries,
675 GetFileTasksCallback callback);
677 // Gets the MIME type of a file.
678 // |entry| Entry to be checked.
679 // |callback|
680 [nocompile]
681 static void getMimeType([instanceof=Entry] object entry,
682 GetMimeTypeCallback callback);
684 // Gets localized strings and initialization data.
685 // |callback|
686 static void getStrings(GetStringsCallback callback);
688 // Adds file watch.
689 // |entry| Entry to watch
690 // |callback|
691 [nocompile]
692 static void addFileWatch([instanceof=Entry] object entry,
693 AddFileWatchCallback callback);
695 // Removes file watch.
696 // |entry| Watched entry
697 // |callback|
698 [nocompile]
699 static void removeFileWatch([instanceof=Entry] object entry,
700 RemoveFileWatchCallback callback);
702 // Enables the extenal file scheme necessary to initiate drags to the browser
703 // window for files on the external backend.
704 static void enableExternalFileScheme();
706 // Requests granting R/W permissions for the passed entries. It's a best
707 // effort operation. Some files may not be granted access if the url is
708 // invalid or not backed by the external file system.
709 // |entryUrls| Urls for the entries to be accessed.
710 // |callback|
711 static void grantAccess(DOMString[] entryUrls, SimpleCallback callback);
713 // Selects multiple files.
714 // |selectedPaths| Array of selected paths
715 // |shouldReturnLocalPath| true if paths need to be resolved to local paths.
716 // |callback|
717 static void selectFiles(DOMString[] selectedPaths,
718 boolean shouldReturnLocalPath,
719 SimpleCallback callback);
721 // Selects a file.
722 // |selectedPath| A selected path
723 // |index| Index of Filter
724 // |forOpening| true if paths are selected for opening. false if for saving.
725 // |shouldReturnLocalPath| true if paths need to be resolved to local paths.
726 // |callback|
727 static void selectFile(DOMString selectedPath,
728 long index,
729 boolean forOpening,
730 boolean shouldReturnLocalPath,
731 SimpleCallback callback);
733 // Requests additional properties for files.
734 // |entries| list of entries
735 // |names| list of requested properties by their names.
736 // |callback| Completion callback. May return less than requested properties
737 // if some are not available. In the same time, it can return properties
738 // which were not requested (if it's cheap to compute them).
739 [nocompile]
740 static void getEntryProperties(
741 [instanceOf=Entry] object[] entries,
742 EntryPropertyName[] names,
743 GetEntryPropertiesCallback callback);
745 // Pins/unpins a Drive file in the cache.
746 // |entry| Entry to pin/unpin.
747 // |pin| Pass true to pin the file.
748 // |callback| Completion callback. $(ref:runtime.lastError) will be set if
749 // there was an error.
750 [nocompile]
751 static void pinDriveFile([instanceof=Entry] object entry,
752 boolean pin,
753 SimpleCallback callback);
755 // Resolves entries in the isolated file system and returns corresponding
756 // entries in the external file system mounted to Chrome OS file manager
757 // backend. If resolving entry fails, the entry will be just ignored and the
758 // corresponding entry does not appear in the result.
759 [nocompile]
760 static void resolveIsolatedEntries(
761 [instanceOf=Entry] object[] entries,
762 ResolveEntriesCallback callback);
764 // Mount a resource or a file.
765 // |source| Mount point source. For compressed files it is relative file path
766 // within external file system
767 // |callback|
768 static void addMount(DOMString source, AddMountCallback callback);
770 // Unmounts a mounted resource.
771 // |volumeId| An ID of the volume.
772 static void removeMount(DOMString volumeId);
774 // Get the list of mounted volumes.
775 // |callback|
776 static void getVolumeMetadataList(GetVolumeMetadataListCallback callback);
778 // Cancels ongoing file transfers for selected files.
779 // |entries| Array of files for which ongoing transfer should be canceled.
780 // |callback| Completion callback of the cancel.
781 [nocompile]
782 static void cancelFileTransfers([instanceof=Entry] object[] entries,
783 SimpleCallback callback);
785 // Cancels all ongoing file transfers.
786 // |callback| Completion callback of the cancel.
787 static void cancelAllFileTransfers(SimpleCallback callback);
789 // Starts to copy an entry. If the source is a directory, the copy is done
790 // recursively.
791 // |entry| Entry of the source entry to be copied.
792 // |parentEntry| Entry for the destination (parent) directory.
793 // |newName| Name of the new entry. It must not contain '/'.
794 // |callback| Completion callback.
795 [nocompile]
796 static void startCopy([instanceof=Entry] object entry,
797 [instanceof=DirectoryEntry] object parentEntry,
798 DOMString newName,
799 StartCopyCallback callback);
801 // Cancels the running copy task.
802 // |copyId| ID of the copy task to be cancelled.
803 // |callback| Completion callback of the cancel.
804 static void cancelCopy(long copyId, SimpleCallback callback);
806 // Retrieves total and remaining size of a mount point.
807 // |volumeId| ID of the volume to be checked.
808 // |callback|
809 static void getSizeStats(DOMString volumeId, GetSizeStatsCallback callback);
811 // Formats a mounted volume.
812 // |volumeId| ID of the volume to be formatted.
813 static void formatVolume(DOMString volumeId);
815 // Retrieves file manager preferences.
816 // |callback|
817 static void getPreferences(GetPreferencesCallback callback);
819 // Sets file manager preferences.
820 // |changeInfo|
821 static void setPreferences(PreferencesChange changeInfo);
823 // Performs drive content search.
824 // |searchParams|
825 // |callback|
826 static void searchDrive(SearchParams searchParams,
827 SearchDriveCallback callback);
829 // Performs drive metadata search.
830 // |searchParams|
831 // |callback|
832 static void searchDriveMetadata(SearchMetadataParams searchParams,
833 SearchDriveMetadataCallback callback);
835 // Search files in the volume having |volumeId| by using |hashList|.
836 // sub-directories) the given |targetDirectoryUrl|.
837 static void searchFilesByHashes(DOMString volumeId,
838 DOMString[] hashList,
839 SearchFilesByHashesCallback callback);
841 // Create a zip file for the selected files.
842 // |parentEntry| Entry of the directory containing the selected files.
843 // |entries| Entries of the selected files. The files must be under the
844 // directory specified by |parentEntry|.
845 // |destName| Name of the destination zip file. The zip file will be created
846 // under the directory specified by |parentEntry|.
847 // |callback|
848 // TODO(mtomasz): Swap order of |entries| and |parentEntry|.
849 [nocompile]
850 static void zipSelection([instanceof=DirectoryEntry] object parentEntry,
851 [instanceof=Entry] object[] entries,
852 DOMString destName,
853 ZipSelectionCallback callback);
855 // Retrieves the state of the current drive connection.
856 // |callback|
857 static void getDriveConnectionState(GetDriveConnectionStateCallback callback);
859 // Checks whether the path name length fits in the limit of the filesystem.
860 // |parentEntry| The entry of the parent directory entry.
861 // |name| The name of the file.
862 // |callback| Called back when the check is finished.
863 [nocompile]
864 static void validatePathNameLength(
865 [instanceof=DirectoryEntry] object parentEntry,
866 DOMString name,
867 ValidatePathNameLengthCallback callback);
869 // Changes the zoom factor of the Files.app.
870 // |operation| Zooming mode.
871 static void zoom(ZoomOperationType operation);
873 // Requests a Drive API OAuth2 access token.
874 // |refresh| Whether the token should be refetched instead of using the cached
875 // one.
876 // |callback|
877 static void requestAccessToken(boolean refresh,
878 RequestAccessTokenCallback callback);
880 // Requests a Webstore API OAuth2 access token.
881 // |callback|
882 static void requestWebStoreAccessToken(
883 RequestWebStoreAccessTokenCallback callback);
885 // Requests a share dialog url for the specified file.
886 // |entry| The entry to share.
887 // |callback|
888 [nocompile]
889 static void getShareUrl([instanceof=Entry] object entry,
890 GetUrlCallback callback);
892 // Requests a download url to download the file contents.
893 // |entry| The entry to download.
894 // |callback|
895 [nocompile]
896 static void getDownloadUrl([instanceof=Entry] object entry,
897 GetUrlCallback callback);
899 // Requests to share drive files.
900 // |entry| Entry to be shared.
901 // |shareType| Type of access that is getting granted.
902 [nocompile]
903 static void requestDriveShare([instanceof=Entry] object entry,
904 DriveShareType shareType,
905 SimpleCallback callback);
907 // Obtains a list of profiles that are logged-in.
908 static void getProfiles(GetProfilesCallback callback);
910 // Opens inspector window.
911 // |type| InspectionType which specifies how to open inspector.
912 static void openInspector(InspectionType type);
914 // Computes an MD5 checksum for the given file.
915 // |entry| The entry of the file to checksum.
916 // |callback|
917 [nocompile]
918 static void computeChecksum([instanceof=Entry] object entry,
919 ComputeChecksumCallback callback);
921 // Is UMA enabled?
922 static void isUMAEnabled(BooleanCallback callback);
924 // Sets a tag on a file or a directory. Only Drive files are supported.
925 [nocompile]
926 static void setEntryTag([instanceof=Entry] object entry,
927 EntryTagVisibility visibility,
928 DOMString key,
929 DOMString value,
930 SimpleCallback callback);
932 // Returns if Piex loader is enabled.
933 static void isPiexLoaderEnabled(BooleanCallback callback);
935 // Returns list of available providing extensions.
936 static void getProvidingExtensions(GetProvidingExtensionsCallback callback);
938 // Requests adding a new provided file system. If not possible, then an error
939 // via chrome.runtime.lastError is returned.
940 static void addProvidedFileSystem(DOMString extension_id,
941 SimpleCallback callback);
943 // Requests configuring an existing volume. If not possible, then returns
944 // an error via chrome.runtime.lastError.
945 static void configureVolume(DOMString volumeId, SimpleCallback callback);
947 // Requests list of actions for the specified file. If not possible, then an
948 // error via chrome.runtime.lastError is returned.
949 [nocompile]
950 static void getEntryActions([instanceof=Entry] object entry,
951 GetEntryActionsCallback callback);
953 // Executes the entry action. If not possible, then an error via
954 // chrome.runtime.lastError is returned.
955 [nocompile]
956 static void executeEntryAction([instanceof=Entry] object entry,
957 DOMString actionId,
958 SimpleCallback callback);
961 interface Events {
962 static void onMountCompleted(MountCompletedEvent event);
964 static void onFileTransfersUpdated(FileTransferStatus event);
966 static void onCopyProgress(long copyId, CopyProgressStatus status);
968 static void onDirectoryChanged(FileWatchEvent event);
970 static void onPreferencesChanged();
972 static void onDriveConnectionStatusChanged();
974 static void onDeviceChanged(DeviceEvent event);
976 static void onDriveSyncError(DriveSyncErrorEvent event);