Index: tools/dom/src/_chrome/file_system.dart |
diff --git a/tools/dom/src/_chrome/file_system.dart b/tools/dom/src/_chrome/file_system.dart |
index 83212c5448f4557a2204737b80953384da2346a6..f0e62a6145b19076b2da1387b85d14a5435e93e1 100644 |
--- a/tools/dom/src/_chrome/file_system.dart |
+++ b/tools/dom/src/_chrome/file_system.dart |
@@ -14,13 +14,11 @@ class FilesystemAcceptOption extends ChromeObject { |
/* |
* Public constructor |
*/ |
- FilesystemAcceptOption({String description, List<String> mimeTypes, List<String> extensions}) { |
- if (description != null) |
- this.description = description; |
- if (mimeTypes != null) |
- this.mimeTypes = mimeTypes; |
- if (extensions != null) |
- this.extensions = extensions; |
+ FilesystemAcceptOption( |
+ {String description, List<String> mimeTypes, List<String> extensions}) { |
+ if (description != null) this.description = description; |
+ if (mimeTypes != null) this.mimeTypes = mimeTypes; |
+ if (extensions != null) this.extensions = extensions; |
} |
/* |
@@ -43,34 +41,35 @@ class FilesystemAcceptOption extends ChromeObject { |
/// Mime-types to accept, e.g. "image/jpeg" or "audio/*". One of mimeTypes or |
/// extensions must contain at least one valid element. |
- List<String> get mimeTypes => JS('List<String>', '#.mimeTypes', this._jsObject); |
+ List<String> get mimeTypes => |
+ JS('List<String>', '#.mimeTypes', this._jsObject); |
set mimeTypes(List<String> mimeTypes) { |
JS('void', '#.mimeTypes = #', this._jsObject, mimeTypes); |
} |
/// Extensions to accept, e.g. "jpg", "gif", "crx". |
- List<String> get extensions => JS('List<String>', '#.extensions', this._jsObject); |
+ List<String> get extensions => |
+ JS('List<String>', '#.extensions', this._jsObject); |
set extensions(List<String> extensions) { |
JS('void', '#.extensions = #', this._jsObject, extensions); |
} |
- |
} |
class FilesystemChooseEntryOptions extends ChromeObject { |
/* |
* Public constructor |
*/ |
- FilesystemChooseEntryOptions({String type, String suggestedName, List<FilesystemAcceptOption> accepts, bool acceptsAllTypes}) { |
- if (type != null) |
- this.type = type; |
- if (suggestedName != null) |
- this.suggestedName = suggestedName; |
- if (accepts != null) |
- this.accepts = accepts; |
- if (acceptsAllTypes != null) |
- this.acceptsAllTypes = acceptsAllTypes; |
+ FilesystemChooseEntryOptions( |
+ {String type, |
+ String suggestedName, |
+ List<FilesystemAcceptOption> accepts, |
+ bool acceptsAllTypes}) { |
+ if (type != null) this.type = type; |
+ if (suggestedName != null) this.suggestedName = suggestedName; |
+ if (accepts != null) this.accepts = accepts; |
+ if (acceptsAllTypes != null) this.acceptsAllTypes = acceptsAllTypes; |
} |
/* |
@@ -99,7 +98,8 @@ class FilesystemChooseEntryOptions extends ChromeObject { |
/// The optional list of accept options for this file opener. Each option will |
/// be presented as a unique group to the end-user. |
List<FilesystemAcceptOption> get accepts { |
- List<FilesystemAcceptOption> __proxy_accepts = new List<FilesystemAcceptOption>(); |
+ List<FilesystemAcceptOption> __proxy_accepts = |
+ new List<FilesystemAcceptOption>(); |
int count = JS('int', '#.accepts.length', this._jsObject); |
for (int i = 0; i < count; i++) { |
var item = JS('', '#.accepts[#]', this._jsObject, i); |
@@ -120,7 +120,6 @@ class FilesystemChooseEntryOptions extends ChromeObject { |
set acceptsAllTypes(bool acceptsAllTypes) { |
JS('void', '#.acceptsAllTypes = #', this._jsObject, acceptsAllTypes); |
} |
- |
} |
/** |
@@ -139,30 +138,44 @@ class API_file_system { |
/// Get the display path of a FileEntry object. The display path is based on |
/// the full path of the file on the local file system, but may be made more |
/// readable for display purposes. |
- void getDisplayPath(FileEntry fileEntry, void callback(String displayPath)) => JS('void', '#.getDisplayPath(#, #)', this._jsObject, convertArgument(fileEntry), convertDartClosureToJS(callback, 1)); |
+ void getDisplayPath(FileEntry fileEntry, void callback(String displayPath)) => |
+ JS('void', '#.getDisplayPath(#, #)', this._jsObject, |
+ convertArgument(fileEntry), convertDartClosureToJS(callback, 1)); |
/// Get a writable FileEntry from another FileEntry. This call will fail if the |
/// application does not have the 'write' permission under 'fileSystem'. |
- void getWritableEntry(FileEntry fileEntry, void callback(FileEntry fileEntry)) { |
+ void getWritableEntry( |
+ FileEntry fileEntry, void callback(FileEntry fileEntry)) { |
void __proxy_callback(fileEntry) { |
if (callback != null) { |
callback(fileEntry); |
} |
} |
- JS('void', '#.getWritableEntry(#, #)', this._jsObject, convertArgument(fileEntry), convertDartClosureToJS(__proxy_callback, 1)); |
+ |
+ JS( |
+ 'void', |
+ '#.getWritableEntry(#, #)', |
+ this._jsObject, |
+ convertArgument(fileEntry), |
+ convertDartClosureToJS(__proxy_callback, 1)); |
} |
/// Gets whether this FileEntry is writable or not. |
- void isWritableEntry(FileEntry fileEntry, void callback(bool isWritable)) => JS('void', '#.isWritableEntry(#, #)', this._jsObject, convertArgument(fileEntry), convertDartClosureToJS(callback, 1)); |
+ void isWritableEntry(FileEntry fileEntry, void callback(bool isWritable)) => |
+ JS('void', '#.isWritableEntry(#, #)', this._jsObject, |
+ convertArgument(fileEntry), convertDartClosureToJS(callback, 1)); |
/// Ask the user to choose a file. |
- void chooseEntry(void callback(FileEntry fileEntry), [FilesystemChooseEntryOptions options]) { |
+ void chooseEntry(void callback(FileEntry fileEntry), |
+ [FilesystemChooseEntryOptions options]) { |
void __proxy_callback(fileEntry) { |
if (callback != null) { |
callback(fileEntry); |
} |
} |
- JS('void', '#.chooseEntry(#, #)', this._jsObject, convertArgument(options), convertDartClosureToJS(__proxy_callback, 1)); |
+ |
+ JS('void', '#.chooseEntry(#, #)', this._jsObject, convertArgument(options), |
+ convertDartClosureToJS(__proxy_callback, 1)); |
} |
/// Returns the file entry with the given id if it can be restored. This call |
@@ -173,12 +186,19 @@ class API_file_system { |
callback(fileEntry); |
} |
} |
- JS('void', '#.restoreEntry(#, #)', this._jsObject, id, convertDartClosureToJS(__proxy_callback, 1)); |
+ |
+ JS('void', '#.restoreEntry(#, #)', this._jsObject, id, |
+ convertDartClosureToJS(__proxy_callback, 1)); |
} |
/// Returns whether a file entry for the given id can be restored, i.e. whether |
/// restoreEntry would succeed with this id now. |
- void isRestorable(String id, void callback(bool isRestorable)) => JS('void', '#.isRestorable(#, #)', this._jsObject, id, convertDartClosureToJS(callback, 1)); |
+ void isRestorable(String id, void callback(bool isRestorable)) => JS( |
+ 'void', |
+ '#.isRestorable(#, #)', |
+ this._jsObject, |
+ id, |
+ convertDartClosureToJS(callback, 1)); |
/// Returns an id that can be passed to restoreEntry to regain access to a |
/// given file entry. Only the 500 most recently used entries are retained, |
@@ -186,8 +206,8 @@ class API_file_system { |
/// the 'retainEntries' permission under 'fileSystem', entries are retained |
/// indefinitely. Otherwise, entries are retained only while the app is running |
/// and across restarts. |
- String retainEntry(FileEntry fileEntry) => JS('String', '#.retainEntry(#)', this._jsObject, convertArgument(fileEntry)); |
+ String retainEntry(FileEntry fileEntry) => JS( |
+ 'String', '#.retainEntry(#)', this._jsObject, convertArgument(fileEntry)); |
- API_file_system(this._jsObject) { |
- } |
+ API_file_system(this._jsObject) {} |
} |