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 2603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 Loading... |
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 })(); |
OLD | NEW |