| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 // Namespace | 5 // Namespace |
| 6 var importer = importer || {}; | 6 var importer = importer || {}; |
| 7 | 7 |
| 8 /** | 8 /** |
| 9 * Interface providing access to information about active import processes. | 9 * Interface providing access to information about active import processes. |
| 10 * | 10 * |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 * @param {Object=} updateInfo | 153 * @param {Object=} updateInfo |
| 154 */ | 154 */ |
| 155 importer.MediaImportHandler.prototype.onFileImported_ = | 155 importer.MediaImportHandler.prototype.onFileImported_ = |
| 156 function(task, updateType, updateInfo) { | 156 function(task, updateType, updateInfo) { |
| 157 if (updateType !== | 157 if (updateType !== |
| 158 importer.MediaImportHandler.ImportTask.UpdateType.ENTRY_CHANGED) { | 158 importer.MediaImportHandler.ImportTask.UpdateType.ENTRY_CHANGED) { |
| 159 return; | 159 return; |
| 160 } | 160 } |
| 161 // Update info must exist for ENTRY_CHANGED notifications. | 161 // Update info must exist for ENTRY_CHANGED notifications. |
| 162 console.assert(updateInfo && updateInfo.destination); | 162 console.assert(updateInfo && updateInfo.destination); |
| 163 /** @type {!importer.MediaImportHandler.ImportTask.EntryChangedInfo} */ | 163 var info = |
| 164 var info = updateInfo; | 164 /** @type {!importer.MediaImportHandler.ImportTask.EntryChangedInfo} */ ( |
| 165 updateInfo); |
| 165 | 166 |
| 166 // Tag the import with a private drive property. | 167 // Tag the import with a private drive property. |
| 167 chrome.fileManagerPrivate.setEntryTag( | 168 chrome.fileManagerPrivate.setEntryTag( |
| 168 info.destination.toURL(), | 169 info.destination.toURL(), |
| 169 'private', // Scoped to just this app. | 170 'private', // Scoped to just this app. |
| 170 importer.MediaImportHandler.IMPORTS_TAG_KEY, | 171 importer.MediaImportHandler.IMPORTS_TAG_KEY, |
| 171 importer.MediaImportHandler.IMPORTS_TAG_VALUE, | 172 importer.MediaImportHandler.IMPORTS_TAG_VALUE, |
| 172 function() { | 173 function() { |
| 173 if (chrome.runtime.lastError) { | 174 if (chrome.runtime.lastError) { |
| 174 console.error('Unable to tag imported media: ' + | 175 console.error('Unable to tag imported media: ' + |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 527 metrics.ImportEvents.FILES_DEDUPLICATED | 528 metrics.ImportEvents.FILES_DEDUPLICATED |
| 528 .label(disposition) | 529 .label(disposition) |
| 529 .value(count)); | 530 .value(count)); |
| 530 }.bind(this)); | 531 }.bind(this)); |
| 531 | 532 |
| 532 this.tracker_.send( | 533 this.tracker_.send( |
| 533 metrics.ImportEvents.FILES_DEDUPLICATED | 534 metrics.ImportEvents.FILES_DEDUPLICATED |
| 534 .label('all-duplicates') | 535 .label('all-duplicates') |
| 535 .value(totalDeduped)); | 536 .value(totalDeduped)); |
| 536 }; | 537 }; |
| OLD | NEW |