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 const SIMULTANEOUS_RESCAN_INTERVAL = 1000; | 7 const SIMULTANEOUS_RESCAN_INTERVAL = 1000; |
8 | 8 |
9 /** | 9 /** |
10 * Data model of the file manager. | 10 * Data model of the file manager. |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 * @type {boolean} | 129 * @type {boolean} |
130 */ | 130 */ |
131 get readonly() { | 131 get readonly() { |
132 switch (this.rootType) { | 132 switch (this.rootType) { |
133 case DirectoryModel.RootType.REMOVABLE: | 133 case DirectoryModel.RootType.REMOVABLE: |
134 return this.readonly_; | 134 return this.readonly_; |
135 case DirectoryModel.RootType.ARCHIVE: | 135 case DirectoryModel.RootType.ARCHIVE: |
136 return true; | 136 return true; |
137 case DirectoryModel.RootType.DOWNLOADS: | 137 case DirectoryModel.RootType.DOWNLOADS: |
138 return false; | 138 return false; |
| 139 case DirectoryModel.RootType.GDATA: |
| 140 return false; |
139 default: | 141 default: |
140 return true; | 142 return true; |
141 } | 143 } |
142 }, | 144 }, |
143 | 145 |
144 set readonly(value) { | 146 set readonly(value) { |
145 if (this.rootType == DirectoryModel.RootType.REMOVABLE) { | 147 if (this.rootType == DirectoryModel.RootType.REMOVABLE) { |
146 this.readonly_ = !!value; | 148 this.readonly_ = !!value; |
147 } | 149 } |
148 }, | 150 }, |
(...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
907 | 909 |
908 recordMetrics_: function() { | 910 recordMetrics_: function() { |
909 metrics.recordInterval('DirectoryScan'); | 911 metrics.recordInterval('DirectoryScan'); |
910 if (this.dir_.fullPath == | 912 if (this.dir_.fullPath == |
911 '/' + DirectoryModel.DOWNLOADS_DIRECTORY) { | 913 '/' + DirectoryModel.DOWNLOADS_DIRECTORY) { |
912 metrics.recordMediumCount("DownloadsCount", this.list_.length); | 914 metrics.recordMediumCount("DownloadsCount", this.list_.length); |
913 } | 915 } |
914 } | 916 } |
915 }; | 917 }; |
916 | 918 |
OLD | NEW |