OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 /** | 5 /** |
6 * Global fileManager reference useful for poking at from the console. | 6 * Global fileManager reference useful for poking at from the console. |
7 */ | 7 */ |
8 var fileManager; | 8 var fileManager; |
9 | 9 |
10 /** | 10 /** |
11 * Kick off the file manager dialog. | 11 * Kick off the file manager dialog. |
12 * | 12 * |
13 * Called by main.html after the dom has been parsed. | 13 * Called by main.html after the dom has been parsed. |
14 */ | 14 */ |
15 function init() { | 15 function init() { |
16 var params; | 16 var params; |
Vladislav Kaznacheev
2011/08/05 13:01:36
Duplicate var declaration. Also, you are keeping t
SeRya
2011/08/05 13:45:42
I just lost a bit of changes while moved the patch
| |
17 | 17 |
18 var rootPaths = ['Downloads', 'removable', 'archive', 'tmp']; | 18 var rootPaths = ['Downloads', 'removable', 'archive', 'tmp']; |
19 | 19 |
20 if (document.location.search) { | 20 if (document.location.search) { |
21 var json = decodeURIComponent(document.location.search.substr(1)); | 21 var json = decodeURIComponent(document.location.search.substr(1)); |
22 var params = JSON.parse(json); | 22 var params = JSON.parse(json); |
23 console.log('params: ' + JSON.stringify(params)); | 23 console.log('params: ' + JSON.stringify(params)); |
24 } | 24 } |
25 | 25 |
26 function onEntriesFound(filesystem, entries) { | 26 function onEntriesFound(filesystem, entries) { |
27 FileManager.initStrings(function () { | 27 FileManager.initStrings(function () { |
28 fileManager = new FileManager(document.body, filesystem, entries, params); | 28 fileManager = new FileManager(document.body, filesystem, entries); |
29 // We're ready to run. Tests can monitor for this state with | 29 // We're ready to run. Tests can monitor for this state with |
30 // ExtensionTestMessageListener listener("ready"); | 30 // ExtensionTestMessageListener listener("ready"); |
31 // ASSERT_TRUE(listener.WaitUntilSatisfied()); | 31 // ASSERT_TRUE(listener.WaitUntilSatisfied()); |
32 chrome.test.sendMessage('ready'); | 32 chrome.test.sendMessage('ready'); |
33 }); | 33 }); |
34 } | 34 } |
35 | 35 |
36 function onFileSystemFound(filesystem) { | 36 function onFileSystemFound(filesystem) { |
37 console.log('Found filesystem: ' + filesystem.name, filesystem); | 37 console.log('Found filesystem: ' + filesystem.name, filesystem); |
38 | 38 |
(...skipping 19 matching lines...) Expand all Loading... | |
58 } else { | 58 } else { |
59 util.forEachDirEntry(filesystem.root, onEntryFound); | 59 util.forEachDirEntry(filesystem.root, onEntryFound); |
60 } | 60 } |
61 }; | 61 }; |
62 | 62 |
63 util.installFileErrorToString(); | 63 util.installFileErrorToString(); |
64 | 64 |
65 console.log('Requesting filesystem.'); | 65 console.log('Requesting filesystem.'); |
66 chrome.fileBrowserPrivate.requestLocalFileSystem(onFileSystemFound); | 66 chrome.fileBrowserPrivate.requestLocalFileSystem(onFileSystemFound); |
67 } | 67 } |
OLD | NEW |