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.mediaGalleries</code> API to access media files (audio, | 5 // Use the <code>chrome.mediaGalleries</code> API to access media files (audio, |
6 // images, video) from the user's local disks (with the user's consent). | 6 // images, video) from the user's local disks (with the user's consent). |
7 namespace mediaGalleries { | 7 namespace mediaGalleries { |
8 | 8 |
9 [inline_doc] enum GetMediaFileSystemsInteractivity { | 9 [inline_doc] enum GetMediaFileSystemsInteractivity { |
10 // Do not act interactively. | 10 // Do not act interactively. |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
50 GetMetadataType? metadataType; | 50 GetMetadataType? metadataType; |
51 }; | 51 }; |
52 | 52 |
53 callback MediaFileSystemsCallback = | 53 callback MediaFileSystemsCallback = |
54 void ([instanceOf=DOMFileSystem] object[] mediaFileSystems); | 54 void ([instanceOf=DOMFileSystem] object[] mediaFileSystems); |
55 | 55 |
56 callback AddUserFolderCallback = | 56 callback AddUserFolderCallback = |
57 void ([instanceOf=DOMFileSystem] object[] mediaFileSystems, | 57 void ([instanceOf=DOMFileSystem] object[] mediaFileSystems, |
58 DOMString selectedFileSystemName); | 58 DOMString selectedFileSystemName); |
59 | 59 |
60 callback ForgetMediaFileSystemCallback = void (boolean wasForgotten); | |
vandebo (ex-Chrome)
2014/04/07 16:01:01
Is there a usecase for this? If we can't think of
Lei Zhang
2014/04/07 22:32:04
Success is not guaranteed, so there should be some
Lei Zhang
2014/04/08 02:05:11
Also, since the API is asynchronous, the caller ca
| |
61 | |
60 [inline_doc] dictionary MediaFileSystemMetadata { | 62 [inline_doc] dictionary MediaFileSystemMetadata { |
61 // The name of the file system. | 63 // The name of the file system. |
62 DOMString name; | 64 DOMString name; |
63 | 65 |
64 // A unique and persistent id for the media gallery. | 66 // A unique and persistent id for the media gallery. |
65 DOMString galleryId; | 67 DOMString galleryId; |
66 | 68 |
67 // If the media gallery is on a removable device, a unique id for the | 69 // If the media gallery is on a removable device, a unique id for the |
68 // device while the device is online. | 70 // device while the device is online. |
69 DOMString? deviceId; | 71 DOMString? deviceId; |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
134 static void getMediaFileSystems(optional MediaFileSystemsDetails details, | 136 static void getMediaFileSystems(optional MediaFileSystemsDetails details, |
135 MediaFileSystemsCallback callback); | 137 MediaFileSystemsCallback callback); |
136 | 138 |
137 // Present a directory picker to the user and add the selected directory | 139 // Present a directory picker to the user and add the selected directory |
138 // as a gallery. If the user cancels the picker, selectedFileSystemName | 140 // as a gallery. If the user cancels the picker, selectedFileSystemName |
139 // will be empty. | 141 // will be empty. |
140 // A user gesture is required for the dialog to display. Without a user | 142 // A user gesture is required for the dialog to display. Without a user |
141 // gesture, the callback will run as though the user canceled. | 143 // gesture, the callback will run as though the user canceled. |
142 static void addUserSelectedFolder(AddUserFolderCallback callback); | 144 static void addUserSelectedFolder(AddUserFolderCallback callback); |
143 | 145 |
146 // Give up access to a given media gallery. | |
147 static void forgetMediaFileSystem( | |
vandebo (ex-Chrome)
2014/04/07 16:01:01
I think 'cede' or 'drop' would be better than 'for
| |
148 [instanceOf=DOMFileSystem] object mediaFileSystem, | |
vandebo (ex-Chrome)
2014/04/07 16:01:01
Should this take a FS object, or a gallery id? Yo
Lei Zhang
2014/04/07 22:32:04
Done.
| |
149 optional ForgetMediaFileSystemCallback callback); | |
150 | |
144 // Start a scan of the user's hard disks for directories containing media. | 151 // Start a scan of the user's hard disks for directories containing media. |
145 // The scan may take a long time so progress and completion is communicated | 152 // The scan may take a long time so progress and completion is communicated |
146 // by events. No permission is granted as a result of the scan, see | 153 // by events. No permission is granted as a result of the scan, see |
147 // addScanResults. | 154 // addScanResults. |
148 static void startMediaScan(); | 155 static void startMediaScan(); |
149 | 156 |
150 // Cancel any pending media scan. Well behaved apps should provide a way | 157 // Cancel any pending media scan. Well behaved apps should provide a way |
151 // for the user to cancel scans they start. | 158 // for the user to cancel scans they start. |
152 static void cancelMediaScan(); | 159 static void cancelMediaScan(); |
153 | 160 |
(...skipping 17 matching lines...) Expand all Loading... | |
171 optional MediaMetadataOptions options, | 178 optional MediaMetadataOptions options, |
172 MediaMetadataCallback callback); | 179 MediaMetadataCallback callback); |
173 }; | 180 }; |
174 | 181 |
175 interface Events { | 182 interface Events { |
176 // The pending media scan has changed state. See details for more | 183 // The pending media scan has changed state. See details for more |
177 // information. | 184 // information. |
178 static void onScanProgress(ScanProgressDetails details); | 185 static void onScanProgress(ScanProgressDetails details); |
179 }; | 186 }; |
180 }; | 187 }; |
OLD | NEW |