Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(80)

Side by Side Diff: chrome/browser/resources/file_manager/common/js/path_util.js

Issue 120533006: Stub for Privet file system (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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.
mtomasz 2014/01/08 09:35:24 Move above fake entries.
Noam Samuel 2014/01/09 01:00:10 Done.
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'
mtomasz 2014/01/08 09:35:24 ditto
Noam Samuel 2014/01/09 01:00:10 Done.
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698