Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(81)

Side by Side Diff: chrome/browser/resources/file_manager/js/main.js

Issue 7584004: Keeping the current directory in URL. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Conflicts resolved. Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/resources/file_manager/js/file_manager.js ('k') | chrome/browser/ui/browser.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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;
17
18 var rootPaths = ['Downloads', 'removable', 'archive', 'tmp']; 16 var rootPaths = ['Downloads', 'removable', 'archive', 'tmp'];
19 17
20 if (document.location.search) {
21 var json = decodeURIComponent(document.location.search.substr(1));
22 var params = JSON.parse(json);
23 console.log('params: ' + JSON.stringify(params));
24 }
25
26 function onEntriesFound(filesystem, entries) { 18 function onEntriesFound(filesystem, entries) {
27 FileManager.initStrings(function () { 19 FileManager.initStrings(function () {
28 fileManager = new FileManager(document.body, filesystem, entries, params); 20 fileManager = new FileManager(document.body, filesystem, entries);
21 // We're ready to run. Tests can monitor for this state with
22 // ExtensionTestMessageListener listener("ready");
23 // ASSERT_TRUE(listener.WaitUntilSatisfied());
24 chrome.test.sendMessage('ready');
29 }); 25 });
30 } 26 }
31 27
32 function onFileSystemFound(filesystem) { 28 function onFileSystemFound(filesystem) {
33 console.log('Found filesystem: ' + filesystem.name, filesystem); 29 console.log('Found filesystem: ' + filesystem.name, filesystem);
34 30
35 var entries = []; 31 var entries = [];
36 32
37 function onPathError(path, err) { 33 function onPathError(path, err) {
38 console.error('Error locating root path: ' + path + ': ' + err); 34 console.error('Error locating root path: ' + path + ': ' + err);
(...skipping 15 matching lines...) Expand all
54 } else { 50 } else {
55 util.forEachDirEntry(filesystem.root, onEntryFound); 51 util.forEachDirEntry(filesystem.root, onEntryFound);
56 } 52 }
57 }; 53 };
58 54
59 util.installFileErrorToString(); 55 util.installFileErrorToString();
60 56
61 console.log('Requesting filesystem.'); 57 console.log('Requesting filesystem.');
62 chrome.fileBrowserPrivate.requestLocalFileSystem(onFileSystemFound); 58 chrome.fileBrowserPrivate.requestLocalFileSystem(onFileSystemFound);
63 } 59 }
OLDNEW
« no previous file with comments | « chrome/browser/resources/file_manager/js/file_manager.js ('k') | chrome/browser/ui/browser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698