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 // Setting the src of an img to an empty string can crash the browser, so we | 5 // Setting the src of an img to an empty string can crash the browser, so we |
6 // use an empty 1x1 gif instead. | 6 // use an empty 1x1 gif instead. |
7 | 7 |
8 /** | 8 /** |
9 * FileManager constructor. | 9 * FileManager constructor. |
10 * | 10 * |
(...skipping 3760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3771 this.updateCommonActionButtons_(); | 3771 this.updateCommonActionButtons_(); |
3772 this.updateOkButton_(); | 3772 this.updateOkButton_(); |
3773 this.updateBreadcrumbs_(); | 3773 this.updateBreadcrumbs_(); |
3774 this.updateColumnModel_(); | 3774 this.updateColumnModel_(); |
3775 | 3775 |
3776 // Updated when a user clicks on the label of a file, used to detect | 3776 // Updated when a user clicks on the label of a file, used to detect |
3777 // when a click is eligible to trigger a rename. Can be null, or | 3777 // when a click is eligible to trigger a rename. Can be null, or |
3778 // an object with 'path' and 'date' properties. | 3778 // an object with 'path' and 'date' properties. |
3779 this.lastLabelClick_ = null; | 3779 this.lastLabelClick_ = null; |
3780 | 3780 |
3781 var dirEntry = event.newDirEntry; | 3781 // Sometimes we rescan the same directory (when mounting GData lazily first, |
3782 this.updateLocation_(event.initial, dirEntry.fullPath); | 3782 // then for real). Do not update the location then. |
| 3783 if (event.newDirEntry.fullPath != event.previousDirEntry.fullPath) { |
| 3784 this.updateLocation_(event.initial, event.newDirEntry.fullPath); |
| 3785 } |
3783 | 3786 |
3784 this.checkFreeSpace_(this.getCurrentDirectory()); | 3787 this.checkFreeSpace_(this.getCurrentDirectory()); |
3785 | 3788 |
3786 // TODO(dgozman): title may be better than this. | 3789 // TODO(dgozman): title may be better than this. |
3787 this.document_.title = this.getCurrentDirectory().substr(1); | 3790 this.document_.title = this.getCurrentDirectory().substr(1); |
3788 | 3791 |
3789 var self = this; | 3792 var self = this; |
3790 | 3793 |
3791 if (this.watchedDirectoryUrl_) { | 3794 if (this.watchedDirectoryUrl_) { |
3792 if (this.watchedDirectoryUrl_ != event.previousDirEntry.toURL()) { | 3795 if (this.watchedDirectoryUrl_ != event.previousDirEntry.toURL()) { |
(...skipping 904 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4697 | 4700 |
4698 chrome.fileBrowserPrivate.setGDataPreferences(changeInfo); | 4701 chrome.fileBrowserPrivate.setGDataPreferences(changeInfo); |
4699 | 4702 |
4700 if (oldValue) { | 4703 if (oldValue) { |
4701 event.target.removeAttribute('checked'); | 4704 event.target.removeAttribute('checked'); |
4702 } else { | 4705 } else { |
4703 event.target.setAttribute('checked', 'checked'); | 4706 event.target.setAttribute('checked', 'checked'); |
4704 } | 4707 } |
4705 }; | 4708 }; |
4706 })(); | 4709 })(); |
OLD | NEW |