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

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

Issue 12225135: [Cleanup] Files.app: add missing periods on comments. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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 /** 5 /**
6 * Type of a root directory. 6 * Type of a root directory.
7 * @enum 7 * @enum
8 */ 8 */
9 var RootType = { 9 var RootType = {
10 DOWNLOADS: 'downloads', 10 DOWNLOADS: 'downloads',
(...skipping 19 matching lines...) Expand all
30 * @param {string} path Path starting with '/'. 30 * @param {string} path Path starting with '/'.
31 * @return {string} Root directory (starting with '/'). 31 * @return {string} Root directory (starting with '/').
32 */ 32 */
33 PathUtil.getRootDirectory = function(path) { 33 PathUtil.getRootDirectory = function(path) {
34 var i = path.indexOf('/', 1); 34 var i = path.indexOf('/', 1);
35 return i === -1 ? path.substring(0) : path.substring(0, i); 35 return i === -1 ? path.substring(0) : path.substring(0, i);
36 }; 36 };
37 37
38 /** 38 /**
39 * @param {string} path Any unix-style path (may start or not start from root). 39 * @param {string} path Any unix-style path (may start or not start from root).
40 * @return {Array.<string>} path components 40 * @return {Array.<string>} path components.
mtomasz 2013/02/12 06:39:23 First letter upper case?
yoshiki 2013/02/12 06:42:45 Good catch! Done. On 2013/02/12 06:39:23, mtomasz
41 */ 41 */
42 PathUtil.split = function(path) { 42 PathUtil.split = function(path) {
43 var fromRoot = false; 43 var fromRoot = false;
44 if (path[0] === '/') { 44 if (path[0] === '/') {
45 fromRoot = true; 45 fromRoot = true;
46 path = path.substring(1); 46 path = path.substring(1);
47 } 47 }
48 48
49 var components = path.split('/'); 49 var components = path.split('/');
50 if (fromRoot) 50 if (fromRoot)
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 if (path === RootDirectory.REMOVABLE) 167 if (path === RootDirectory.REMOVABLE)
168 return str('REMOVABLE_DIRECTORY_LABEL'); 168 return str('REMOVABLE_DIRECTORY_LABEL');
169 if (PathUtil.isParentPath(RootDirectory.REMOVABLE, path)) 169 if (PathUtil.isParentPath(RootDirectory.REMOVABLE, path))
170 return path.substring(RootDirectory.REMOVABLE.length + 1); 170 return path.substring(RootDirectory.REMOVABLE.length + 1);
171 171
172 if (path === RootDirectory.DRIVE) 172 if (path === RootDirectory.DRIVE)
173 return str('DRIVE_DIRECTORY_LABEL'); 173 return str('DRIVE_DIRECTORY_LABEL');
174 174
175 return path; 175 return path;
176 }; 176 };
OLDNEW
« no previous file with comments | « chrome/browser/resources/file_manager/js/file_table.js ('k') | chrome/browser/resources/file_manager/js/util.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698