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 // Use the <code>chrome.fileSystemProvider</code> API to create file systems,
      6 // that can be accessible from the file manager on Chrome OS.
      7 [platforms=("chromeos"),
      8  implemented_in="chrome/browser/chromeos/extensions/file_system_provider/file_system_provider_api.h"]
      9 namespace fileSystemProvider {
     10   // Callback to receive the result of mount() function.
     11   // <code>fileSystemID</code> will be a unique ID for the file system just
     12   // mounted. The ID is used to distinguish multiple file systems mounted
     13   // from a single File System Provider.
     14   callback MountCallback = void(DOMString fileSystemId,
     15                                 [nodoc, instanceOf=DOMError] object error);
     16 
     17   // Callback to handle an error raised from the browser.
     18   [nocompile] callback ErrorCallback = void([instanceOf=DOMError] object error);
     19 
     20   interface Functions {
     21     // Mounts a file system with the given <code>displayName</code>.
     22     // <code>displayName</code> will be shown in the left panel of
     23     // Files.app. <code>displayName</code> can contain any characters
     24     // including '/', but cannot be an empty string. <code>displayName</code>
     25     // should be descritive but doesn't have to be unique. Duplicate display
     26     // names are uniquified by adding suffix like "(1)" in the Files.app UI.
     27     static void mount(DOMString displayName,
     28                       MountCallback successCallback,
     29                       [nocompile] ErrorCallback errorCallback);
     30   };
     31 };
     32