OLD | NEW |
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 2694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2705 // This device mount was the reason this File Manager instance was | 2705 // This device mount was the reason this File Manager instance was |
2706 // created. Now the device is unmounted from another instance | 2706 // created. Now the device is unmounted from another instance |
2707 // or the user removed the device manually. Close this instance. | 2707 // or the user removed the device manually. Close this instance. |
2708 // window.close() sometimes doesn't work. | 2708 // window.close() sometimes doesn't work. |
2709 chrome.tabs.getCurrent(function(tab) { | 2709 chrome.tabs.getCurrent(function(tab) { |
2710 chrome.tabs.remove(tab.id); | 2710 chrome.tabs.remove(tab.id); |
2711 }); | 2711 }); |
2712 return; | 2712 return; |
2713 } | 2713 } |
2714 // Current directory just unmounted. Move to the 'Downloads'. | 2714 // Current directory just unmounted. Move to the 'Downloads'. |
2715 changeDirectoryTo = '/' + DirectoryModel.DOWNLOADS_DIRECTORY; | 2715 changeDirectoryTo = this.directoryModel_.getDefaultDirectory(); |
2716 } | 2716 } |
2717 } | 2717 } |
2718 | 2718 |
2719 // Even if something failed root list should be rescanned. | 2719 // Even if something failed root list should be rescanned. |
2720 // Failed mounts can "give" us new devices which might be formatted, | 2720 // Failed mounts can "give" us new devices which might be formatted, |
2721 // so we have to refresh root list then. | 2721 // so we have to refresh root list then. |
2722 self.directoryModel_.updateRoots(function() { | 2722 self.directoryModel_.updateRoots(function() { |
2723 if (changeDirectoryTo) { | 2723 if (changeDirectoryTo) { |
2724 self.directoryModel_.changeDirectory(changeDirectoryTo); | 2724 self.directoryModel_.changeDirectory(changeDirectoryTo); |
2725 } | 2725 } |
(...skipping 1606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4332 | 4332 |
4333 handleSplitterDragEnd: function(e) { | 4333 handleSplitterDragEnd: function(e) { |
4334 Splitter.prototype.handleSplitterDragEnd.apply(this, arguments); | 4334 Splitter.prototype.handleSplitterDragEnd.apply(this, arguments); |
4335 this.ownerDocument.documentElement.classList.remove('col-resize'); | 4335 this.ownerDocument.documentElement.classList.remove('col-resize'); |
4336 } | 4336 } |
4337 }; | 4337 }; |
4338 | 4338 |
4339 customSplitter.decorate(splitterElement); | 4339 customSplitter.decorate(splitterElement); |
4340 }; | 4340 }; |
4341 })(); | 4341 })(); |
OLD | NEW |