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 // File-level comment to appease parser. Eventually this will not be necessary. | 5 // File-level comment to appease parser. Eventually this will not be necessary. |
6 | 6 |
7 namespace experimental.mediaGalleries { | 7 namespace experimental.mediaGalleries { |
8 | 8 |
9 [inline_doc] enum GetMediaFileSystemsInteractivity { | |
10 // Do not act interactively. | |
11 no, | |
12 // Ask the user to manage permitted media galleries. | |
13 yes, | |
14 // Ask the user to manage permitted galleries only if the return set would | |
15 // otherwise be empty. | |
16 if_needed | |
17 }; | |
18 | |
19 [inline_doc] dictionary MediaFileSystemsDetails { | |
20 // Whether to prompt the user for additional media galleries before | |
21 // returning the permitted set. Default is silent. | |
22 GetMediaFileSystemsInteractivity? interactive; | |
23 }; | |
24 | |
25 callback MediaFileSystemsCallback = | |
26 void ([instanceOf=LocalFileSystem] optional object[] mediaFileSystems); | |
27 callback AssembleMediaFileCallback = | 9 callback AssembleMediaFileCallback = |
28 void ([instanceOf=Blob] optional object mediaFile); | 10 void ([instanceOf=Blob] optional object mediaFile); |
29 | 11 |
30 interface Functions { | 12 interface Functions { |
31 // Get the media galleries configured in this user agent. If none are | |
32 // configured or available, the callback will receive an empty array. | |
33 static void getMediaFileSystems(optional MediaFileSystemsDetails details, | |
34 MediaFileSystemsCallback callback); | |
35 | |
36 // Create a new MediaFile setting the metadata in the Blob to the supplied | 13 // Create a new MediaFile setting the metadata in the Blob to the supplied |
37 // values, overriding any existing metadata in the media file. If user agent | 14 // values, overriding any existing metadata in the media file. If user agent |
38 // does not recognize the Blob as a supported file format, it will fail. | 15 // does not recognize the Blob as a supported file format, it will fail. |
39 // |mediaFileContents| : the media bytes. | 16 // |mediaFileContents| : the media bytes. |
40 // |metadata| : the metadata. TODO(estade): this should be | 17 // |metadata| : the metadata. TODO(estade): this should be |
41 // [instanceOf=Metafile]. | 18 // [instanceOf=Metafile]. |
42 static void assembleMediaFile( | 19 static void assembleMediaFile( |
43 [instanceOf=Blob] object mediaFileContents, | 20 [instanceOf=Blob] object mediaFileContents, |
44 object metadata, | 21 object metadata, |
45 AssembleMediaFileCallback callback); | 22 AssembleMediaFileCallback callback); |
46 | 23 |
47 // Get any thumbnails contained in the passed media file. The resulting | 24 // Get any thumbnails contained in the passed media file. The resulting |
48 // directory reader refers to a virtual directory that can not be navigated | 25 // directory reader refers to a virtual directory that can not be navigated |
49 // to. If there are no thumbnails in the passed file entry, the virtual | 26 // to. If there are no thumbnails in the passed file entry, the virtual |
50 // directory will have no entries. | 27 // directory will have no entries. |
51 // TODO(estade): The return type should be Directory. The argument type | 28 // TODO(estade): The return type should be Directory. The argument type |
52 // should be [instanceOf=FileEntry]. | 29 // should be [instanceOf=FileEntry]. |
53 [nocompile] static object extractEmbeddedThumbnails(object mediaFile); | 30 [nocompile] static object extractEmbeddedThumbnails(object mediaFile); |
54 }; | 31 }; |
55 | 32 |
56 }; | 33 }; |
OLD | NEW |