Home | History | Annotate | Download | only in api
      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.
      4 
      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, cloud_device, provided,
     12                   mtp, testing };
     13 
     14 // Device type. Available if this is removable volume.
     15 enum DeviceType { usb, sd, optical, mobile, unknown };
     16 
     17 // Additional data about mount, for example, that the filesystem is not
     18 // supported.
     19 enum MountCondition { unknown, unsupported };
     20 
     21 // Is the event raised for mounting or unmounting.
     22 enum MountCompletedEventType { mount, unmount };
     23 
     24 // Event type that tells listeners if mount was successful or an error
     25 // occurred. It also specifies the error.
     26 enum MountCompletedStatus {
     27   success,
     28   error_unknown,
     29   error_internal,
     30   error_invalid_argument,
     31   error_invalid_path,
     32   error_path_already_mounted,
     33   error_path_not_mounted,
     34   error_directory_creation_failed,
     35   error_invalid_mount_options,
     36   error_invalid_unmount_options,
     37   error_insufficient_permissions,
     38   error_mount_program_not_found,
     39   error_mount_program_failed,
     40   error_invalid_device_path,
     41   error_unknown_filesystem,
     42   error_unsupported_filesystem,
     43   error_invalid_archive,
     44   error_authentication,
     45   error_path_unmounted
     46 };
     47 
     48 // File transfer progress state.
     49 enum TransferState { added, started, in_progress, completed, failed };
     50 
     51 // Defines file transfer direction.
     52 enum TransferType { upload, download };
     53 
     54 // The type of the progress event.
     55 enum CopyProgressStatusType {
     56   // "begin_copy_entry" is fired for each entry (file or directory) before
     57   // starting the copy operation.
     58   begin_copy_entry,
     59 
     60   // "end_copy_entry" is fired for each entry (file or directory) after ending
     61   // the copy operation.
     62   end_copy_entry,
     63 
     64   // "progress" is fired periodically to report progress of a file copy (not
     65   // directory).
     66   progress,
     67 
     68   // "success" is fired after all entries are copied.
     69   success,
     70 
     71   // "error" is fired when an error occurs.
     72   error
     73 };
     74 
     75 // Specifies type of event that is raised.
     76 enum FileWatchEventType { changed, error };
     77 
     78 // Specifies type of change in file watch event.
     79 enum ChangeType { add_or_update, delete };
     80 
     81 // The type of entry that is needed. Default to ALL.
     82 enum SearchType { EXCLUDE_DIRECTORIES, SHARED_WITH_ME, OFFLINE, ALL };
     83 
     84 // Zooming mode.
     85 enum ZoomOperationType { in, out, reset };
     86 
     87 // Specifies how to open inspector.
     88 enum InspectionType {
     89   // Open inspector for foreground page.
     90   normal,
     91   // Open inspector for foreground page and bring focus to the console.
     92   console,
     93   // Open inspector for foreground page in inspect element mode.
     94   element,
     95   // Open inspector for background page.
     96   background
     97 };
     98 
     99 // Device event type.
    100 enum DeviceEventType {
    101   // If the device is disabled by preference.
    102   disabled,
    103   // Device is removed.
    104   removed,
    105   // Device is hard unplugged.
    106   hard_unplugged,
    107   // Format started.
    108   format_start,
    109   // Format succeeded.
    110   format_success,
    111   // Format failed.
    112   format_fail
    113 };
    114 
    115 // Drive sync error type.
    116 // Keep it synced with DriveSyncErrorType in operation_observer.h.
    117 enum DriveSyncErrorType {
    118   // Request to delete a file without permission.
    119   delete_without_permission,
    120   // Google Drive is temporarily unavailable.
    121   service_unavailable,
    122   // Miscellaneous errors other than listed above.
    123   misc
    124 };
    125 
    126 // Result of task execution.
    127 enum TaskResult {
    128   // The task execution succeeded and a new window/tab was opened.
    129   opened,
    130   // The task execution succeeded and the message was sent to the proper
    131   // extension.
    132   message_sent,
    133   // The task execution failed.
    134   failed,
    135   // No URL is specified.
    136   empty
    137 };
    138 
    139 // Drive share type.
    140 enum DriveShareType {
    141   can_edit,
    142   can_comment,
    143   can_view
    144 };
    145 
    146 // ImageSet that represents multi-scale images.
    147 dictionary ImageSet {
    148   // 1x scale URL.
    149   DOMString scale1xUrl;
    150   // 2x scale URL.
    151   DOMString scale2xUrl;
    152 };
    153 
    154 // A file task represents an action that the file manager can perform over the
    155 // currently selected files. See
    156 // chrome/browser/chromeos/extensions/file_manager/file_tasks.h for details
    157 // about how file tasks are handled.
    158 dictionary FileTask {
    159   // The unique identifier of the task.
    160   DOMString taskId;
    161 
    162   // Task title (ex. App name).
    163   DOMString title;
    164 
    165   // Task icon url (from chrome://extension-icon/...)
    166   DOMString iconUrl;
    167 
    168   // True if this task is a default task for the selected files.
    169   boolean isDefault;
    170 };
    171 
    172 // Additional entry properties.
    173 dictionary EntryProperties {
    174   // Size of this file.
    175   double? fileSize;
    176 
    177   // Timestamp of entry update time, in milliseconds past the epoch.
    178   double? lastModifiedTime;
    179 
    180   // URL to the Drive thumbnail image for this file.
    181   DOMString? thumbnailUrl;
    182 
    183   // Width, if the entry is an image.
    184   long? imageWidth;
    185 
    186   // Height, if the entry is an image.
    187   long? imageHeight;
    188 
    189   // Rotation in clockwise degrees, if the entry is an image.
    190   long? imageRotation;
    191 
    192   // True if the file is pinned in cache.
    193   boolean? isPinned;
    194 
    195   // True if the file is present in cache.
    196   boolean? isPresent;
    197 
    198   // True if the file is hosted on a server instead of local.
    199   boolean? isHosted;
    200 
    201   // True if the file is available offline.
    202   boolean? isAvailableOffline;
    203 
    204   // True if the file is available on metered connection.
    205   boolean? isAvailableWhenMetered;
    206 
    207   // URL to the custom icon for this file.
    208   DOMString? customIconUrl;
    209 
    210   // Drive MIME type for this file.
    211   DOMString? contentMimeType;
    212 
    213   // True if the entry is labeled as shared-with-me.
    214   boolean? sharedWithMe;
    215 
    216   // True if the entry is labeled as shared (either from me to others or to me
    217   // by others.)
    218   boolean? shared;
    219 };
    220 
    221 // Information about total and remaining size on the mount point.
    222 dictionary MountPointSizeStats {
    223   // Approximate total available size on the mount point.
    224   double totalSize;
    225 
    226   // Approximate remaining available size on the mount point.
    227   double remainingSize;
    228 };
    229 
    230 // Information about a profile.
    231 dictionary ProfileInfo {
    232   // Profile ID. This is currently e-mail address of the profile.
    233   DOMString profileId;
    234 
    235   // The name of the profile for display purpose.
    236   DOMString displayName;
    237 
    238   // True if the profile is the one running the current file manager instance.
    239   // TODO(hirono): Remove the property because of the design change of
    240   // multi-profile suuport.
    241   boolean isCurrentProfile;
    242 };
    243 
    244 // Mounted disk volume metadata.
    245 dictionary VolumeMetadata {
    246   // ID of the disk volume.
    247   DOMString volumeId;
    248 
    249   // Id the provided file system (for proviided file systems).
    250   DOMString? fileSystemId;
    251 
    252   // Extension providing this volume (for provided file systems).
    253   DOMString? extensionId;
    254 
    255   // Label of the volume (if available).
    256   DOMString? volumeLabel;
    257 
    258   // Description of the profile where the volume belongs.
    259   // TODO(hirono): Remove the property because of the design change of
    260   // multi-profile support.
    261   ProfileInfo profile;
    262 
    263   // The path to the mounted device, archive file or network resource.
    264   DOMString? sourcePath;
    265 
    266   // Type of the mounted volume.
    267   VolumeType volumeType;
    268 
    269   // Device type. Available if this is removable volume.
    270   DeviceType? deviceType;
    271 
    272   // Path to identify the device. This is consistent with DeviceEvent's
    273   // devicePath.
    274   DOMString? devicePath;
    275 
    276   // Whether the device is parent or not (i.e. sdb rather than sdb1).
    277   boolean? isParentDevice;
    278 
    279   // Flag that specifies if volume is mounted in read-only mode.
    280   boolean isReadOnly;
    281 
    282   // Additional data about mount, for example, that the filesystem is not
    283   // supported.
    284   MountCondition? mountCondition;
    285 };
    286 
    287 // Payload data for mount event.
    288 dictionary MountCompletedEvent {
    289   // Is the event raised for mounting or unmounting.
    290   MountCompletedEventType eventType;
    291 
    292   // Event type that tells listeners if mount was successful or an error
    293   // occurred. It also specifies the error.
    294   MountCompletedStatus status;
    295 
    296   // Metadata of the mounted volume.
    297   VolumeMetadata volumeMetadata;
    298 
    299   // Whether the volume event should be notified or not.
    300   boolean shouldNotify;
    301 };
    302 
    303 // Payload data for file transfer status updates.
    304 dictionary FileTransferStatus {
    305   // URL of file that is being transfered.
    306   DOMString fileUrl;
    307 
    308   // File transfer progress state.
    309   TransferState transferState;
    310 
    311   // Defines file transfer direction.
    312   TransferType transferType;
    313 
    314   // Approximated completed portion of the transfer operation.
    315   double? processed;
    316 
    317   // Approximated total size of transfer operation.
    318   double? total;
    319 
    320   // Total number of jobs.
    321   long num_total_jobs;
    322 };
    323 
    324 // Error during the drive sync.
    325 dictionary DriveSyncErrorEvent {
    326   // Error type.
    327   DriveSyncErrorType type;
    328 
    329   // File URL of the entry that the error happens to.
    330   DOMString fileUrl;
    331 };
    332 
    333 // Payload data for copy status progress updates.
    334 dictionary CopyProgressStatus {
    335   // The type of the progress event.
    336   CopyProgressStatusType type;
    337 
    338   // URL for the entry currently being copied. This field is particularly useful
    339   // when a directory copy is initiated with startCopy(). The field tells what
    340   // file/directory in that directory is now being copied.
    341   DOMString? sourceUrl;
    342 
    343   // URL for the entry currently being created. This field is particularly
    344   // useful when a directory copy is initiated with startCopy(). The field tells
    345   // what file/directory in that directory is being created. Available only for
    346   // end_copy_entry and success.
    347   DOMString? destinationUrl;
    348 
    349   // Number of processed bytes for the file currently being copied. Available
    350   // only for "progress" event. To show the progress bar, a caller needs to
    351   // pre-compute the size of files being copied for the file (not directory).
    352   double? size;
    353 
    354   // DOMError's name. Available only for ERROR event.
    355   DOMString? error;
    356 };
    357 
    358 // Payload data for file transfer cancel response.
    359 dictionary FileTransferCancelStatus {
    360   // URL of file that is being transfered.
    361   DOMString fileUrl;
    362 
    363   // True if ongoing transfer operation was found and canceled.
    364   boolean canceled;
    365 };
    366 
    367 // Detailed information of change.
    368 dictionary FileChange {
    369   // URL of changed file (or directory).
    370   DOMString url;
    371 
    372   // Type of change, which may be multiple.
    373   ChangeType[] changes;
    374 };
    375 
    376 // Directory change notification details.
    377 dictionary FileWatchEvent {
    378   // Specifies type of event that is raised.
    379   FileWatchEventType eventType;
    380 
    381   // An Entry object which represents a changed directory. The conversion into a
    382   // kind of FileEntry object is done in
    383   // file_browser_handler_custom_bindings.cc. For filesystem API's Entry
    384   // interface, see <a
    385   // href='http://www.w3.org/TR/file-system-api/#the-entry-interface'>The Entry
    386   // interface</a>.
    387   [instanceOf=Entry] object entry;
    388 
    389   // Detailed change information of change. It would be null if the detailed
    390   // information is not available.
    391   FileChange[]? changedFiles;
    392 };
    393 
    394 dictionary Preferences {
    395   boolean driveEnabled;
    396   boolean cellularDisabled;
    397   boolean hostedFilesDisabled;
    398   boolean use24hourClock;
    399   boolean allowRedeemOffers;
    400 };
    401 
    402 dictionary PreferencesChange {
    403   boolean? cellularDisabled;
    404   boolean? hostedFilesDisabled;
    405 };
    406 
    407 dictionary SearchParams {
    408   // Search query.
    409   DOMString query;
    410 
    411   // ID of the search feed that should be fetched next. Value passed here should
    412   // be gotten from previous searchDrive call. It can be empty for the initial
    413   // search request.
    414   DOMString nextFeed;
    415 };
    416 
    417 dictionary SearchMetadataParams {
    418   // Search query. It can be empty. Any filename matches to an empty query.
    419   DOMString query;
    420 
    421   // The type of entry that is needed. Default to ALL.
    422   SearchType types;
    423 
    424   // Maximum number of results.
    425   long maxResults;
    426 };
    427 
    428 // Entry and Drive-related properties representing a search result.
    429 dictionary SearchResult {
    430   // A dictionary object which represents a Drive file. This will be converted
    431   // into a kind of FileEntry object. See
    432   // file_browser_handler_custom_bindings.cc for details. For filesystem API's
    433   // Entry interface, see <a
    434   // href='http://www.w3.org/TR/file-system-api/#the-entry-interface'>The Entry
    435   // interface</a>.
    436   [instanceOf=Entry] object entry;
    437 
    438   // The base name of a Drive file that matched the search query. The matched
    439   // sub strings are highlighted with <b> element. Meta characters are escaped
    440   // like &lt;.
    441   DOMString highlightedBaseName;
    442 };
    443 
    444 dictionary DriveConnectionState {
    445   DOMString type;
    446 
    447   // Reasons of offline.
    448   DOMString? reason;
    449 };
    450 
    451 // Device event dispatched to listeners of onDeviceChaged.  See also
    452 // DeviceEventType to know when the event dispatched.
    453 dictionary DeviceEvent {
    454   // Event type of the device event.
    455   DeviceEventType type;
    456   // Device path to identify the device.
    457   DOMString devicePath;
    458 };
    459 
    460 // Callback that does not take arguments.
    461 callback SimpleCallback = void();
    462 
    463 // |result| Result of the task execution.
    464 callback ExecuteTaskCallback = void(TaskResult result);
    465 
    466 // |tasks| The list of matched file URL patterns for this task.
    467 callback GetFileTasksCallback = void(FileTask[] tasks);
    468 
    469 // |result| Hash containing the string assets.
    470 callback GetStringsCallback = void(object result);
    471 
    472 // |success| True when file watch is successfully added.
    473 callback AddFileWatchCallback = void(optional boolean success);
    474 
    475 // |success| True when file watch is successfully removed.
    476 callback RemoveFileWatchCallback = void(optional boolean success);
    477 
    478 // |fileSystem| A DOMFileSystem instance for local file system access. null if
    479 // the caller has no appropriate permissions.
    480 callback RequestFileSystemCallback = void(optional object fileSystem);
    481 
    482 // |entryProperties| A dictionary containing properties of the requested
    483 // entries.
    484 callback GetEntryPropertiesCallback =
    485     void(EntryProperties[] entryProperties);
    486 
    487 // |sourcePath| Source path of the mount.
    488 callback AddMountCallback = void(DOMString sourcePath);
    489 
    490 // |volumeMetadataList| The list of VolumeMetadata representing mounted volumes.
    491 callback GetVolumeMetadataListCallback =
    492     void(VolumeMetadata[] volumeMetadataList);
    493 
    494 // |fileTransferCancelStatuses| The list of FileTransferCancelStatus.
    495 callback CancelFileTransfersCallback =
    496     void(FileTransferCancelStatus[] fileTransferCancelStatuses);
    497 
    498 // |copyId| ID of the copy task. Can be used to identify the progress, and to
    499 // cancel the task.
    500 callback StartCopyCallback = void(long copyId);
    501 
    502 // |sizeStats| Name/value pairs of size stats. Will be undefined if stats could
    503 // not be determined.
    504 callback GetSizeStatsCallback = void(optional MountPointSizeStats sizeStats);
    505 
    506 callback GetPreferencesCallback = void(Preferences result);
    507 
    508 // |entries|
    509 // |nextFeed| ID of the feed that contains next chunk of the search result.
    510 //     Should be sent to the next searchDrive request to perform
    511 //     incremental search.
    512 callback SearchDriveCallback =
    513     void([instanceOf=Entry] object[] entries, DOMString nextFeed);
    514 
    515 callback SearchDriveMetadataCallback = void(SearchResult[] results);
    516 
    517 callback ZipSelectionCallback = void(optional boolean success);
    518 
    519 callback GetDriveConnectionStateCallback = void(DriveConnectionState result);
    520 
    521 // |result| true if the length is in the valid range, false otherwise.
    522 callback ValidatePathNameLengthCallback = void(boolean result);
    523 
    524 // |accessToken| OAuth2 access token, or an empty string if failed to fetch.
    525 callback RequestAccessTokenCallback = void(DOMString accessToken);
    526 
    527 // |accessToken| OAuth2 access token, or an empty string if failed to fetch.
    528 callback RequestWebStoreAccessTokenCallback = void(DOMString accessToken);
    529 
    530 // |url| Result url.
    531 callback GetUrlCallback = void(DOMString url);
    532 
    533 // |profiles| List of profile information.
    534 // |runningProfile| ID of the profile that runs the application instance.
    535 // |showingProfile| ID of the profile that shows the application window.
    536 callback GetProfilesCallback = void(ProfileInfo[] profiles,
    537                                     DOMString runningProfile,
    538                                     DOMString displayProfile);
    539 
    540 // |entryUrl| URL of an entry in a normal file system.
    541 callback ResolveEntriesCallback =
    542     void([instanceOf=FileEntry] object[] entries);
    543 
    544 interface Functions {
    545   // Logout the current user for navigating to the re-authentication screen for
    546   // the Google account.
    547   static void logoutUserForReauthentication();
    548 
    549   // Cancels file selection.
    550   static void cancelDialog();
    551 
    552   // Executes file browser task over selected files.
    553   // |taskId| The unique identifier of task to execute.
    554   // |fileUrls| Array of file URLs
    555   // |callback|
    556   static void executeTask(DOMString taskId,
    557                           DOMString[] fileUrls,
    558                           optional ExecuteTaskCallback callback);
    559 
    560   // Sets the default task for the supplied MIME types and suffixes of the
    561   // supplied file URLs. Lists of MIME types and URLs may contain duplicates.
    562   // |taskId| The unique identifier of task to mark as default.
    563   // |fileUrls| Array of selected file URLs to extract suffixes from.
    564   // |mimeTypes| Array of selected file MIME types.
    565   // |callback|
    566   static void setDefaultTask(DOMString taskId,
    567                              DOMString[] fileUrls,
    568                              optional DOMString[] mimeTypes,
    569                              optional SimpleCallback callback);
    570 
    571   // Gets the list of tasks that can be performed over selected files.
    572   // |fileUrls| Array of selected file URLs
    573   // |callback|
    574   static void getFileTasks(DOMString[] fileUrls,
    575                            GetFileTasksCallback callback);
    576 
    577   // Gets localized strings and initialization data.
    578   // |callback|
    579   static void getStrings(GetStringsCallback callback);
    580 
    581   // Adds file watch.
    582   // |fileUrl| URL of file to watch
    583   // |callback|
    584   static void addFileWatch(DOMString fileUrl, AddFileWatchCallback callback);
    585 
    586   // Removes file watch.
    587   // |fileUrl| URL of watched file to remove
    588   // |callback|
    589   static void removeFileWatch(DOMString fileUrl,
    590                               RemoveFileWatchCallback callback);
    591 
    592   // Requests access to a file system volume.
    593   // |volumeId| The ID of the file system volume to request. The volume ID is
    594   //     delivered to JavaScript as part of VolumeMetadata. By specifying
    595   //     "compatible", this function behaves in the compatible mode, where the
    596   //     returned FileSystem object gives access to all file system volumes such
    597   //     as Downloads folder and removal media like SD cards (i.e. all volumes
    598   //     are provided inside the single FileSystem object). In the new
    599   //     "per-volume FileSystem object model" crbug.com/322305, a separate
    600   //     FileSystem object is created for each volume. "compatible" parameter
    601   //     will be removed once Files.app is switched to the per-volume FileSystem
    602   //     object model.
    603   // |callback|
    604   static void requestFileSystem(DOMString volumeId,
    605                                 RequestFileSystemCallback callback);
    606 
    607   // Selects multiple files.
    608   // |selectedPaths| Array of selected paths
    609   // |shouldReturnLocalPath| true if paths need to be resolved to local paths.
    610   // |callback|
    611   static void selectFiles(DOMString[] selectedPaths,
    612                           boolean shouldReturnLocalPath,
    613                           SimpleCallback callback);
    614 
    615   // Selects a file.
    616   // |selectedPath| A selected path
    617   // |index| Index of Filter
    618   // |forOpening| true if paths are selected for opening. false if for saving.
    619   // |shouldReturnLocalPath| true if paths need to be resolved to local paths.
    620   // |callback|
    621   static void selectFile(DOMString selectedPath,
    622                          long index,
    623                          boolean forOpening,
    624                          boolean shouldReturnLocalPath,
    625                          SimpleCallback callback);
    626 
    627   // Requests additional properties for files.
    628   // |fileUrls| list of URLs of files
    629   // |callback|
    630   static void getEntryProperties(
    631       DOMString[] fileUrls,
    632       GetEntryPropertiesCallback callback);
    633 
    634   // Pins/unpins a Drive file in the cache.
    635   // |fileUrl| URL of a file to pin/unpin.
    636   // |pin| Pass true to pin the file.
    637   // |callback| Completion callback. $(ref:runtime.lastError) will be set if
    638   //     there was an error.
    639   static void pinDriveFile(DOMString fileUrl,
    640                            boolean pin,
    641                            optional SimpleCallback callback);
    642 
    643   // Resolves file entries in the isolated file system and returns corresponding
    644   // entries in the external file system mounted to Chrome OS file manager
    645   // backend. If resolving entry fails, the entry will be just ignored and the
    646   // corresponding entry does not appear in the result.
    647   [nocompile]
    648   static void resolveIsolatedEntries(
    649       [instanceOf=FileEntry] object[] entries,
    650       ResolveEntriesCallback callback);
    651 
    652   // Mount a resource or a file.
    653   // |source| Mount point source. For compressed files it is relative file path
    654   //     within external file system
    655   // |callback|
    656   static void addMount(DOMString source, AddMountCallback callback);
    657 
    658   // Unmounts a mounted resource.
    659   // |volumeId| An ID of the volume.
    660   static void removeMount(DOMString volumeId);
    661 
    662   // Get the list of mounted volumes.
    663   // |callback|
    664   static void getVolumeMetadataList(GetVolumeMetadataListCallback callback);
    665 
    666   // Cancels ongoing file transfers for selected files.
    667   // |fileUrls| Array of files for which ongoing transfer should be canceled.
    668   //     If this is absent, all jobs are canceled. 
    669   // |callback|
    670   static void cancelFileTransfers(optional DOMString[] fileUrls,
    671                                   CancelFileTransfersCallback callback);
    672 
    673   // Starts to copy an entry. If the source is a directory, the copy is done
    674   // recursively.
    675   // |sourceUrl| URL of the source entry to be copied.
    676   // |parent| URL of the destination directory.
    677   // |newName| Name of the new entry. It shouldn't contain '/'.
    678   // |callback| Completion callback.
    679   static void startCopy(DOMString sourceUrl,
    680                         DOMString parent,
    681                         DOMString newName,
    682                         StartCopyCallback callback);
    683 
    684   // Cancels the running copy task.
    685   // |copyId| ID of the copy task to be cancelled.
    686   // |callback| Completion callback of the cancel.
    687   static void cancelCopy(long copyId, optional SimpleCallback callback);
    688 
    689   // Retrieves total and remaining size of a mount point.
    690   // |volumeId| ID of the volume to be checked.
    691   // |callback|
    692   static void getSizeStats(DOMString volumeId, GetSizeStatsCallback callback);
    693 
    694   // Formats a mounted volume.
    695   // |volumeId| ID of the volume to be formatted.
    696   static void formatVolume(DOMString volumeId);
    697 
    698   // Retrieves file manager preferences.
    699   // |callback|
    700   static void getPreferences(GetPreferencesCallback callback);
    701 
    702   // Sets file manager preferences.
    703   // |changeInfo|
    704   static void setPreferences(PreferencesChange changeInfo);
    705 
    706   // Performs drive content search.
    707   // |searchParams|
    708   // |callback|
    709   static void searchDrive(SearchParams searchParams,
    710                           SearchDriveCallback callback);
    711 
    712   // Performs drive metadata search.
    713   // |searchParams|
    714   // |callback|
    715   static void searchDriveMetadata(SearchMetadataParams searchParams,
    716                                   SearchDriveMetadataCallback callback);
    717 
    718   // Create a zip file for the selected files.
    719   // |dirURL| URL of the directory containing the selected files.
    720   // |selectionUrls| URLs of the selected files. The files must be under the
    721   //     directory specified by dirURL.
    722   // |destName| Name of the destination zip file. The zip file will be created
    723   //     under the directory specified by dirURL.
    724   // |callback|
    725   static void zipSelection(DOMString dirURL,
    726                            DOMString[] selectionUrls,
    727                            DOMString destName,
    728                            optional ZipSelectionCallback callback);
    729 
    730   // Retrieves the state of the current drive connection.
    731   // |callback|
    732   static void getDriveConnectionState(GetDriveConnectionStateCallback callback);
    733 
    734   // Checks whether the path name length fits in the limit of the filesystem.
    735   // |parent_directory_url| The URL of the parent directory entry.
    736   // |name| The name of the file.
    737   // |callback| Called back when the check is finished.
    738   static void validatePathNameLength(DOMString parent_directory_url,
    739                                      DOMString name,
    740                                      ValidatePathNameLengthCallback callback);
    741 
    742   // Changes the zoom factor of the Files.app.
    743   // |operation| Zooming mode.
    744   static void zoom(ZoomOperationType operation);
    745 
    746   // Requests a Drive API OAuth2 access token.
    747   // |refresh| Whether the token should be refetched instead of using the cached
    748   //     one.
    749   // |callback|
    750   static void requestAccessToken(boolean refresh,
    751                                  RequestAccessTokenCallback callback);
    752 
    753   // Requests a Webstore API OAuth2 access token.
    754   // |callback|
    755   static void requestWebStoreAccessToken(
    756       RequestWebStoreAccessTokenCallback callback);
    757 
    758   // Requests a share dialog url for the specified file.
    759   // |url| Url for the file.
    760   // |callback|
    761   static void getShareUrl(DOMString url, GetUrlCallback callback);
    762 
    763   // Requests a download url to download the file contents.
    764   // |url| Url for the file.
    765   // |callback|
    766   static void getDownloadUrl(DOMString url, GetUrlCallback callback);
    767 
    768   // Requests to share drive files.
    769   // |url| URL of a file to be shared.
    770   // |shareType| Type of access that is getting granted.
    771   static void requestDriveShare(DOMString url,
    772                                 DriveShareType shareType,
    773                                 SimpleCallback callback);
    774 
    775   // Requests to install a webstore item.
    776   // |item_id| The id of the item to install.
    777   // |silentInstallation| False to show installation prompt. True not to show.
    778   // |callback|
    779   static void installWebstoreItem(DOMString itemId,
    780                                   boolean silentInstallation,
    781                                   SimpleCallback callback);
    782 
    783   // Obtains a list of profiles that are logged-in.
    784   static void getProfiles(GetProfilesCallback callback);
    785 
    786   // Moves the window to other user's desktop.
    787   static void visitDesktop(DOMString profileId,
    788                            optional SimpleCallback callback);
    789 
    790   // Opens inspector window.
    791   // |type| InspectionType which specifies how to open inspector.
    792   static void openInspector(InspectionType type);
    793 };
    794 
    795 interface Events {
    796   static void onMountCompleted(MountCompletedEvent event);
    797 
    798   static void onFileTransfersUpdated(FileTransferStatus event);
    799 
    800   static void onCopyProgress(long copyId, CopyProgressStatus status);
    801 
    802   static void onDirectoryChanged(FileWatchEvent event);
    803 
    804   static void onPreferencesChanged();
    805 
    806   static void onDriveConnectionStatusChanged();
    807 
    808   static void onDeviceChanged(DeviceEvent event);
    809 
    810   static void onDriveSyncError(DriveSyncErrorEvent event);
    811 };
    812 };
    813