| OLD | NEW | 
|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be | 
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. | 
| 4 | 4 | 
| 5 // Use the <code>chrome.fileSystem</code> API to create, read, navigate, | 5 // Use the <code>chrome.fileSystem</code> API to create, read, navigate, | 
| 6 // and write to the user's local file system. With this API, Chrome Apps can | 6 // and write to the user's local file system. With this API, Chrome Apps can | 
| 7 // read and write to a user-selected location. For example, a text editor app | 7 // read and write to a user-selected location. For example, a text editor app | 
| 8 // can use the API to read and write local documents. All failures are notified | 8 // can use the API to read and write local documents. All failures are notified | 
| 9 // via chrome.runtime.lastError. | 9 // via chrome.runtime.lastError. | 
| 10 namespace fileSystem { | 10 namespace fileSystem { | 
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 76     // unset or contains no valid entries, this will always be reset to true. | 76     // unset or contains no valid entries, this will always be reset to true. | 
| 77     boolean? acceptsAllTypes; | 77     boolean? acceptsAllTypes; | 
| 78 | 78 | 
| 79     // Whether to accept multiple files. This is only supported for openFile and | 79     // Whether to accept multiple files. This is only supported for openFile and | 
| 80     // openWritableFile. The callback to chooseEntry will be called with a list | 80     // openWritableFile. The callback to chooseEntry will be called with a list | 
| 81     // of entries if this is set to true. Otherwise it will be called with a | 81     // of entries if this is set to true. Otherwise it will be called with a | 
| 82     // single Entry. | 82     // single Entry. | 
| 83     boolean? acceptsMultiple; | 83     boolean? acceptsMultiple; | 
| 84   }; | 84   }; | 
| 85 | 85 | 
| 86   // Change to an entry within a tracked directory. | 86   dictionary RequestFileSystemOptions { | 
|  | 87     // The ID of the requested volume. | 
|  | 88     DOMString volumeId; | 
|  | 89 | 
|  | 90     // Whether the requested file system should be writeable, or read-only. | 
|  | 91     // By default read-only. | 
|  | 92     boolean? writable; | 
|  | 93   }; | 
|  | 94 | 
|  | 95 // Change to an entry within a tracked directory. | 
| 87   [nodoc] dictionary ChildChange { | 96   [nodoc] dictionary ChildChange { | 
| 88     [instanceOf=Entry] object entry; | 97     [instanceOf=Entry] object entry; | 
| 89     ChildChangeType type; | 98     ChildChangeType type; | 
| 90   }; | 99   }; | 
| 91 | 100 | 
| 92   // Event notifying about a change in a file or a directory, including its | 101   // Event notifying about a change in a file or a directory, including its | 
| 93   // contents. | 102   // contents. | 
| 94   [nodoc] dictionary EntryChangedEvent { | 103   [nodoc] dictionary EntryChangedEvent { | 
| 95     // Tracked entry. | 104     // Tracked entry. | 
| 96     [instanceOf=Entry] object target; | 105     [instanceOf=Entry] object target; | 
| 97 | 106 | 
| 98     // List of changed entries within the tracked directory in order they | 107     // List of changed entries within the tracked directory in order they | 
| 99     // happened. May not be available for some types of file systems. | 108     // happened. May not be available for some types of file systems. | 
| 100     ChildChange[]? childChanges; | 109     ChildChange[]? childChanges; | 
| 101   }; | 110   }; | 
| 102 | 111 | 
| 103   // Event notifying about a tracked file or a directory being removed. | 112   // Event notifying about a tracked file or a directory being removed. | 
| 104   [nodoc] dictionary EntryRemovedEvent { | 113   [nodoc] dictionary EntryRemovedEvent { | 
| 105     [instanceOf=Entry] object target; | 114     [instanceOf=Entry] object target; | 
| 106   }; | 115   }; | 
| 107 | 116 | 
|  | 117   // Represents a volume available in the system. | 
|  | 118   [nodoc] dictionary Volume { | 
|  | 119    DOMString volumeId; | 
|  | 120   }; | 
|  | 121 | 
| 108   callback GetDisplayPathCallback = void (DOMString displayPath); | 122   callback GetDisplayPathCallback = void (DOMString displayPath); | 
| 109   callback EntryCallback = void ([instanceOf=Entry] object entry); | 123   callback EntryCallback = void ([instanceOf=Entry] object entry); | 
| 110   callback EntriesCallback = void ( | 124   callback EntriesCallback = void ( | 
| 111       [instanceOf=Entry] optional object entry, | 125       [instanceOf=Entry] optional object entry, | 
| 112       [instanceOf=FileEntry] optional object[] fileEntries); | 126       [instanceOf=FileEntry] optional object[] fileEntries); | 
| 113   callback IsWritableCallback = void (boolean isWritable); | 127   callback IsWritableCallback = void (boolean isWritable); | 
| 114   callback IsRestorableCallback = void (boolean isRestorable); | 128   callback IsRestorableCallback = void (boolean isRestorable); | 
| 115   [nodoc] callback GetObservedEntriesCallback = void ( | 129   [nodoc] callback GetObservedEntriesCallback = void ( | 
| 116       [instanceOf=Entry] object[] entries); | 130       [instanceOf=Entry] object[] entries); | 
|  | 131   [nodoc] callback RequestFileSystemCallback = void( | 
|  | 132       [instanceOf=FileSystem] optional object fileSystem); | 
|  | 133   [nodoc] callback GetVolumeListCallback = void(Volume[] volumes); | 
| 117 | 134 | 
| 118   interface Functions { | 135   interface Functions { | 
| 119     // Get the display path of an Entry object. The display path is based on | 136     // Get the display path of an Entry object. The display path is based on | 
| 120     // the full path of the file or directory on the local file system, but may | 137     // the full path of the file or directory on the local file system, but may | 
| 121     // be made more readable for display purposes. | 138     // be made more readable for display purposes. | 
| 122     static void getDisplayPath([instanceOf=Entry] object entry, | 139     static void getDisplayPath([instanceOf=Entry] object entry, | 
| 123                                GetDisplayPathCallback callback); | 140                                GetDisplayPathCallback callback); | 
| 124 | 141 | 
| 125     // Get a writable Entry from another Entry. This call will fail with a | 142     // Get a writable Entry from another Entry. This call will fail with a | 
| 126     // runtime error if the application does not have the 'write' permission | 143     // runtime error if the application does not have the 'write' permission | 
| (...skipping 20 matching lines...) Expand all  Loading... | 
| 147     static void isRestorable(DOMString id, IsRestorableCallback callback); | 164     static void isRestorable(DOMString id, IsRestorableCallback callback); | 
| 148 | 165 | 
| 149     // Returns an id that can be passed to restoreEntry to regain access to a | 166     // Returns an id that can be passed to restoreEntry to regain access to a | 
| 150     // given file entry. Only the 500 most recently used entries are retained, | 167     // given file entry. Only the 500 most recently used entries are retained, | 
| 151     // where calls to retainEntry and restoreEntry count as use. If the app has | 168     // where calls to retainEntry and restoreEntry count as use. If the app has | 
| 152     // the 'retainEntries' permission under 'fileSystem', entries are retained | 169     // the 'retainEntries' permission under 'fileSystem', entries are retained | 
| 153     // indefinitely. Otherwise, entries are retained only while the app is | 170     // indefinitely. Otherwise, entries are retained only while the app is | 
| 154     // running and across restarts. | 171     // running and across restarts. | 
| 155     static DOMString retainEntry([instanceOf=Entry] object entry); | 172     static DOMString retainEntry([instanceOf=Entry] object entry); | 
| 156 | 173 | 
|  | 174     // Requests access to a file system for a volume represented by <code> | 
|  | 175     // options.volumeId</code>. If <code>options.writable</code> is set to true, | 
|  | 176     // then the file system will be writable. Otherwise, it will be read-only. | 
|  | 177     // The <code>writable</code> option requires the <code> | 
|  | 178     // "fileSystem": {"write"}</code> permission in the manifest. Available to | 
|  | 179     // kiosk apps running in kiosk session only. | 
|  | 180     [nodoc] static void requestFileSystem(RequestFileSystemOptions options, | 
|  | 181                                           RequestFileSystemCallback callback); | 
|  | 182 | 
|  | 183     // Fetches a list of available volumes to be mounted. Available to kiosk | 
|  | 184     // apps running in kiosk session only. | 
|  | 185     // [nodoc] static void getVolumeList(GetVolumeListCallback callback); | 
|  | 186 | 
| 157     // Observes a directory entry. Emits an event if the tracked directory is | 187     // Observes a directory entry. Emits an event if the tracked directory is | 
| 158     // changed (including the list of files on it), or removed. If <code> | 188     // changed (including the list of files on it), or removed. If <code> | 
| 159     // recursive</code> is set to true, then also all accessible subdirectories | 189     // recursive</code> is set to true, then also all accessible subdirectories | 
| 160     // will be tracked. Observers are automatically removed once the extension | 190     // will be tracked. Observers are automatically removed once the extension | 
| 161     // is closed or suspended, unless <code>entry</code> is retained using | 191     // is closed or suspended, unless <code>entry</code> is retained using | 
| 162     // <code>chrome.fileSystem.retainEntry</code>. | 192     // <code>chrome.fileSystem.retainEntry</code>. | 
| 163     // | 193     // | 
| 164     // In such case of retained entries, the observer stays active across | 194     // In such case of retained entries, the observer stays active across | 
| 165     // restarts until <code>unobserveEntry</code> is explicitly called. Note, | 195     // restarts until <code>unobserveEntry</code> is explicitly called. Note, | 
| 166     // that once the <code>entry</code> is not retained anymore, the observer | 196     // that once the <code>entry</code> is not retained anymore, the observer | 
| (...skipping 10 matching lines...) Expand all  Loading... | 
| 177     // Lists all observed entries. | 207     // Lists all observed entries. | 
| 178     [nodoc] static void getObservedEntries(GetObservedEntriesCallback callback); | 208     [nodoc] static void getObservedEntries(GetObservedEntriesCallback callback); | 
| 179   }; | 209   }; | 
| 180 | 210 | 
| 181   interface Events { | 211   interface Events { | 
| 182     // Called when an observed entry is changed. | 212     // Called when an observed entry is changed. | 
| 183     [nodoc] static void onEntryChanged(EntryChangedEvent event); | 213     [nodoc] static void onEntryChanged(EntryChangedEvent event); | 
| 184 | 214 | 
| 185     // Called when an observed entry is removed. | 215     // Called when an observed entry is removed. | 
| 186     [nodoc] static void onEntryRemoved(EntryRemovedEvent event); | 216     [nodoc] static void onEntryRemoved(EntryRemovedEvent event); | 
|  | 217 | 
|  | 218     // Called when the list of volumes available in the system is changed. | 
|  | 219     // Available to kiosk apps running in kiosk session only. | 
|  | 220     [nodoc] static void onVolumeListChanged(); | 
| 187   }; | 221   }; | 
| 188 }; | 222 }; | 
| OLD | NEW | 
|---|