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