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

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

Issue 10178036: File Manager: Fix a JavaScript error with unmounting using eject button. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 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 | « no previous file | no next file » | 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) 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 /** 5 /**
6 * FileManager constructor. 6 * FileManager constructor.
7 * 7 *
8 * FileManager objects encapsulate the functionality of the file selector 8 * FileManager objects encapsulate the functionality of the file selector
9 * dialogs, as well as the full screen file manager application (though the 9 * dialogs, as well as the full screen file manager application (though the
10 * latter is not yet implemented). 10 * latter is not yet implemented).
(...skipping 2603 matching lines...) Expand 10 before | Expand all | Expand 10 after
2614 // This device mount was the reason this File Manager instance was 2614 // This device mount was the reason this File Manager instance was
2615 // created. Now the device is unmounted from another instance 2615 // created. Now the device is unmounted from another instance
2616 // or the user removed the device manually. Close this instance. 2616 // or the user removed the device manually. Close this instance.
2617 // window.close() sometimes doesn't work. 2617 // window.close() sometimes doesn't work.
2618 chrome.tabs.getCurrent(function(tab) { 2618 chrome.tabs.getCurrent(function(tab) {
2619 chrome.tabs.remove(tab.id); 2619 chrome.tabs.remove(tab.id);
2620 }); 2620 });
2621 return; 2621 return;
2622 } 2622 }
2623 // Current directory just unmounted. Move to the 'Downloads'. 2623 // Current directory just unmounted. Move to the 'Downloads'.
2624 changeDirectoryTo = this.directoryModel_.getDefaultDirectory(); 2624 changeDirectoryTo = self.directoryModel_.getDefaultDirectory();
2625 } 2625 }
2626 } 2626 }
2627 2627
2628 // Even if something failed root list should be rescanned. 2628 // Even if something failed root list should be rescanned.
2629 // Failed mounts can "give" us new devices which might be formatted, 2629 // Failed mounts can "give" us new devices which might be formatted,
2630 // so we have to refresh root list then. 2630 // so we have to refresh root list then.
2631 self.directoryModel_.updateRoots(function() { 2631 self.directoryModel_.updateRoots(function() {
2632 if (changeDirectoryTo) { 2632 if (changeDirectoryTo) {
2633 self.directoryModel_.changeDirectory(changeDirectoryTo); 2633 self.directoryModel_.changeDirectory(changeDirectoryTo);
2634 } 2634 }
(...skipping 1727 matching lines...) Expand 10 before | Expand all | Expand 10 after
4362 4362
4363 this.directoryModel_.addEventListener('scan-completed', maybeShowBanner); 4363 this.directoryModel_.addEventListener('scan-completed', maybeShowBanner);
4364 this.directoryModel_.addEventListener('rescan-completed', maybeShowBanner); 4364 this.directoryModel_.addEventListener('rescan-completed', maybeShowBanner);
4365 4365
4366 var style = this.document_.createElement('link'); 4366 var style = this.document_.createElement('link');
4367 style.rel = 'stylesheet'; 4367 style.rel = 'stylesheet';
4368 style.href = 'css/gdrive_welcome.css'; 4368 style.href = 'css/gdrive_welcome.css';
4369 this.document_.head.appendChild(style); 4369 this.document_.head.appendChild(style);
4370 }; 4370 };
4371 })(); 4371 })();
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698