OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 'use strict'; |
| 6 |
| 7 var dialogSettings = {}; |
| 8 |
| 9 chrome.fileSystemProvider.onGetMetadataRequested.addListener( |
| 10 function(options, onSuccess, onError) { |
| 11 onSuccess({ |
| 12 isDirectory: true, |
| 13 name: '', |
| 14 size: 0, |
| 15 modificationTime: new Date() |
| 16 }); |
| 17 }); |
| 18 |
| 19 chrome.fileSystemProvider.onReadDirectoryRequested.addListener( |
| 20 function(options, onSuccess, onError) { |
| 21 onSuccess([], false /* hasMore */); |
| 22 }); |
| 23 |
| 24 chrome.fileSystemProvider.onMountRequested.addListener( |
| 25 function(onSuccess, onError) { |
| 26 chrome.fileSystemProvider.getAll(function(mounted) { |
| 27 var index = mounted.length + 1; |
| 28 chrome.fileSystemProvider.mount({ |
| 29 fileSystemId: 'test-fs-' + index, |
| 30 displayName: 'Test (' + index + ')' |
| 31 }); |
| 32 }); |
| 33 }); |
| 34 |
| 35 chrome.fileSystemProvider.onUnmountRequested.addListener( |
| 36 function(options, onSuccess, onError) { |
| 37 chrome.fileSystemProvider.unmount( |
| 38 { |
| 39 fileSystemId: options.fileSystemId |
| 40 }, |
| 41 function() { |
| 42 if (chrome.runtime.lastError) |
| 43 onError(chrome.runtime.lastError.message); |
| 44 else |
| 45 onSuccess(); |
| 46 }); |
| 47 }); |
OLD | NEW |