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 // If directory files changes too often, don't rescan directory more than once | 5 // If directory files changes too often, don't rescan directory more than once |
6 // per specified interval | 6 // per specified interval |
7 var SIMULTANEOUS_RESCAN_INTERVAL = 1000; | 7 var SIMULTANEOUS_RESCAN_INTERVAL = 1000; |
8 // Used for operations that require almost instant rescan. | 8 // Used for operations that require almost instant rescan. |
9 var SHORT_RESCAN_INTERVAL = 100; | 9 var SHORT_RESCAN_INTERVAL = 100; |
10 | 10 |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 */ | 146 */ |
147 DirectoryModel.prototype.isPathReadOnly = function(path) { | 147 DirectoryModel.prototype.isPathReadOnly = function(path) { |
148 switch (DirectoryModel.getRootType(path)) { | 148 switch (DirectoryModel.getRootType(path)) { |
149 case DirectoryModel.RootType.REMOVABLE: | 149 case DirectoryModel.RootType.REMOVABLE: |
150 return !!this.volumeReadOnlyStatus_[DirectoryModel.getRootPath(path)]; | 150 return !!this.volumeReadOnlyStatus_[DirectoryModel.getRootPath(path)]; |
151 case DirectoryModel.RootType.ARCHIVE: | 151 case DirectoryModel.RootType.ARCHIVE: |
152 return true; | 152 return true; |
153 case DirectoryModel.RootType.DOWNLOADS: | 153 case DirectoryModel.RootType.DOWNLOADS: |
154 return false; | 154 return false; |
155 case DirectoryModel.RootType.GDATA: | 155 case DirectoryModel.RootType.GDATA: |
156 return !navigator.onLine; | 156 return util.isOffline(); |
157 default: | 157 default: |
158 return true; | 158 return true; |
159 } | 159 } |
160 }; | 160 }; |
161 | 161 |
162 /** | 162 /** |
163 * @return {boolean} If current directory is system. | 163 * @return {boolean} If current directory is system. |
164 */ | 164 */ |
165 DirectoryModel.prototype.isSystemDirectory = function() { | 165 DirectoryModel.prototype.isSystemDirectory = function() { |
166 var path = this.currentDirEntry_.fullPath; | 166 var path = this.currentDirEntry_.fullPath; |
(...skipping 1070 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1237 /** | 1237 /** |
1238 * @private | 1238 * @private |
1239 */ | 1239 */ |
1240 DirectoryModel.Scanner.prototype.recordMetrics_ = function() { | 1240 DirectoryModel.Scanner.prototype.recordMetrics_ = function() { |
1241 metrics.recordInterval('DirectoryScan'); | 1241 metrics.recordInterval('DirectoryScan'); |
1242 if (this.dir_.fullPath == | 1242 if (this.dir_.fullPath == |
1243 '/' + DirectoryModel.DOWNLOADS_DIRECTORY) { | 1243 '/' + DirectoryModel.DOWNLOADS_DIRECTORY) { |
1244 metrics.recordMediumCount('DownloadsCount', this.list_.length); | 1244 metrics.recordMediumCount('DownloadsCount', this.list_.length); |
1245 } | 1245 } |
1246 }; | 1246 }; |
OLD | NEW |