| 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 'use strict'; | 5 'use strict'; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * Type of a root directory. | 8 * Type of a root directory. |
| 9 * @enum {string} | 9 * @enum {string} |
| 10 * @const | 10 * @const |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 // files. | 26 // files. |
| 27 DRIVE_OTHER: 'drive_other', | 27 DRIVE_OTHER: 'drive_other', |
| 28 | 28 |
| 29 // Fake root for offline available files on the drive. | 29 // Fake root for offline available files on the drive. |
| 30 DRIVE_OFFLINE: 'drive_offline', | 30 DRIVE_OFFLINE: 'drive_offline', |
| 31 | 31 |
| 32 // Fake root for shared files on the drive. | 32 // Fake root for shared files on the drive. |
| 33 DRIVE_SHARED_WITH_ME: 'drive_shared_with_me', | 33 DRIVE_SHARED_WITH_ME: 'drive_shared_with_me', |
| 34 | 34 |
| 35 // Fake root for recent files on the drive. | 35 // Fake root for recent files on the drive. |
| 36 DRIVE_RECENT: 'drive_recent' | 36 DRIVE_RECENT: 'drive_recent', |
| 37 |
| 38 // Root for privet storage volume. |
| 39 PRIVET: 'privet' |
| 37 }); | 40 }); |
| 38 | 41 |
| 39 /** | 42 /** |
| 40 * Top directory for each root type. | 43 * Top directory for each root type. |
| 41 * TODO(mtomasz): Deprecated. Remove this. | 44 * TODO(mtomasz): Deprecated. Remove this. |
| 42 * @enum {string} | 45 * @enum {string} |
| 43 * @const | 46 * @const |
| 44 */ | 47 */ |
| 45 var RootDirectory = Object.freeze({ | 48 var RootDirectory = Object.freeze({ |
| 46 DOWNLOADS: '/Downloads', | 49 DOWNLOADS: '/Downloads', |
| 47 ARCHIVE: '/archive', | 50 ARCHIVE: '/archive', |
| 48 REMOVABLE: '/removable', | 51 REMOVABLE: '/removable', |
| 49 DRIVE: '/drive', | 52 DRIVE: '/drive', |
| 50 DRIVE_OFFLINE: '/drive_offline', // A fake root. Not the actual filesystem. | 53 DRIVE_OFFLINE: '/drive_offline', // A fake root. Not the actual filesystem. |
| 51 DRIVE_SHARED_WITH_ME: '/drive_shared_with_me', // A fake root. | 54 DRIVE_SHARED_WITH_ME: '/drive_shared_with_me', // A fake root. |
| 52 DRIVE_RECENT: '/drive_recent' // A fake root. | 55 DRIVE_RECENT: '/drive_recent', // A fake root. |
| 56 PRIVET: '/privet' |
| 53 }); | 57 }); |
| 54 | 58 |
| 55 /** | 59 /** |
| 56 * Sub root directory for Drive. "root" and "other". This is not used now. | 60 * Sub root directory for Drive. "root" and "other". This is not used now. |
| 57 * TODO(haruki): Add namespaces support. http://crbug.com/174233. | 61 * TODO(haruki): Add namespaces support. http://crbug.com/174233. |
| 58 * @enum {string} | 62 * @enum {string} |
| 59 * @const | 63 * @const |
| 60 */ | 64 */ |
| 61 var DriveSubRootDirectory = Object.freeze({ | 65 var DriveSubRootDirectory = Object.freeze({ |
| 62 ROOT: 'root', | 66 ROOT: 'root', |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 */ | 398 */ |
| 395 PathUtil.splitExtension = function(path) { | 399 PathUtil.splitExtension = function(path) { |
| 396 var dotPosition = path.lastIndexOf('.'); | 400 var dotPosition = path.lastIndexOf('.'); |
| 397 if (dotPosition <= path.lastIndexOf('/')) | 401 if (dotPosition <= path.lastIndexOf('/')) |
| 398 dotPosition = -1; | 402 dotPosition = -1; |
| 399 | 403 |
| 400 var filename = dotPosition != -1 ? path.substr(0, dotPosition) : path; | 404 var filename = dotPosition != -1 ? path.substr(0, dotPosition) : path; |
| 401 var extension = dotPosition != -1 ? path.substr(dotPosition) : ''; | 405 var extension = dotPosition != -1 ? path.substr(dotPosition) : ''; |
| 402 return [filename, extension]; | 406 return [filename, extension]; |
| 403 }; | 407 }; |
| 404 | |
| OLD | NEW |