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 (images, | 5 // Use the <code>chrome.mediaGalleries</code> API to access media files (images, |
6 // video, audio) from the user's local disks (with the user's consent). | 6 // video, audio) 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 23 matching lines...) Expand all Loading... |
34 | 34 |
35 dictionary MediaMetadataOptions { | 35 dictionary MediaMetadataOptions { |
36 // Specifies which subset of the metadata to retrieve. Defaults to 'all' | 36 // Specifies which subset of the metadata to retrieve. Defaults to 'all' |
37 // if the option is omitted. | 37 // if the option is omitted. |
38 GetMetadataType? metadataType; | 38 GetMetadataType? metadataType; |
39 }; | 39 }; |
40 | 40 |
41 callback MediaFileSystemsCallback = | 41 callback MediaFileSystemsCallback = |
42 void ([instanceOf=DOMFileSystem] optional object[] mediaFileSystems); | 42 void ([instanceOf=DOMFileSystem] optional object[] mediaFileSystems); |
43 | 43 |
| 44 callback AddUserFolderCallback = |
| 45 void ([instanceOf=DOMFileSystem] object[] mediaFileSystems, |
| 46 DOMString selectedFileSystemName); |
| 47 |
44 [inline_doc] dictionary MediaFileSystemMetadata { | 48 [inline_doc] dictionary MediaFileSystemMetadata { |
45 // The name of the file system. | 49 // The name of the file system. |
46 DOMString name; | 50 DOMString name; |
47 | 51 |
48 // A unique and persistent id for the media gallery. | 52 // A unique and persistent id for the media gallery. |
49 DOMString galleryId; | 53 DOMString galleryId; |
50 | 54 |
51 // If the media gallery is on a removable device, a unique id for the | 55 // If the media gallery is on a removable device, a unique id for the |
52 // device while the device is online. | 56 // device while the device is online. |
53 DOMString? deviceId; | 57 DOMString? deviceId; |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 }; | 94 }; |
91 | 95 |
92 callback MediaMetadataCallback = void (MediaMetadata metadata); | 96 callback MediaMetadataCallback = void (MediaMetadata metadata); |
93 | 97 |
94 interface Functions { | 98 interface Functions { |
95 // Get the media galleries configured in this user agent. If none are | 99 // Get the media galleries configured in this user agent. If none are |
96 // configured or available, the callback will receive an empty array. | 100 // configured or available, the callback will receive an empty array. |
97 static void getMediaFileSystems(optional MediaFileSystemsDetails details, | 101 static void getMediaFileSystems(optional MediaFileSystemsDetails details, |
98 MediaFileSystemsCallback callback); | 102 MediaFileSystemsCallback callback); |
99 | 103 |
| 104 // Present a directory picker to the user and add the selected directory |
| 105 // as a gallery. If the user cancels the picker, selectedFileSystemName |
| 106 // will be empty. |
| 107 static void addUserSelectedFolder(AddUserFolderCallback callback); |
| 108 |
100 // Get metadata about a specific media file system. | 109 // Get metadata about a specific media file system. |
101 [nocompile] static MediaFileSystemMetadata getMediaFileSystemMetadata( | 110 [nocompile] static MediaFileSystemMetadata getMediaFileSystemMetadata( |
102 [instanceOf=DOMFileSystem] object mediaFileSystem); | 111 [instanceOf=DOMFileSystem] object mediaFileSystem); |
103 | 112 |
104 // Get metadata for all available media galleries. | 113 // Get metadata for all available media galleries. |
105 static void getAllMediaFileSystemMetadata( | 114 static void getAllMediaFileSystemMetadata( |
106 MediaFileSystemsMetadataCallback callback); | 115 MediaFileSystemsMetadataCallback callback); |
107 | 116 |
108 // Gets the media-specific metadata for a media file. This should work | 117 // Gets the media-specific metadata for a media file. This should work |
109 // for files in media galleries as well as other DOM filesystems. | 118 // for files in media galleries as well as other DOM filesystems. |
110 static void getMetadata([instanceOf=Blob] object mediaFile, | 119 static void getMetadata([instanceOf=Blob] object mediaFile, |
111 optional MediaMetadataOptions options, | 120 optional MediaMetadataOptions options, |
112 MediaMetadataCallback callback); | 121 MediaMetadataCallback callback); |
113 }; | 122 }; |
114 | 123 |
115 }; | 124 }; |
OLD | NEW |