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

Side by Side Diff: webkit/browser/fileapi/external_mount_points.cc

Issue 246293011: Mount MTP devices in Chrome OS Files.app. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase + fix test (handle null StorageMonitor in some tests) Created 6 years, 7 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 #include "webkit/browser/fileapi/external_mount_points.h" 5 #include "webkit/browser/fileapi/external_mount_points.h"
6 6
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 13 matching lines...) Expand all
24 return path; 24 return path;
25 25
26 base::FilePath::StringType path_str = path.StripTrailingSeparators().value(); 26 base::FilePath::StringType path_str = path.StripTrailingSeparators().value();
27 if (!base::FilePath::IsSeparator(path_str[path_str.length() - 1])) 27 if (!base::FilePath::IsSeparator(path_str[path_str.length() - 1]))
28 path_str.append(FILE_PATH_LITERAL("/")); 28 path_str.append(FILE_PATH_LITERAL("/"));
29 29
30 return base::FilePath(path_str).NormalizePathSeparators(); 30 return base::FilePath(path_str).NormalizePathSeparators();
31 } 31 }
32 32
33 bool IsOverlappingMountPathForbidden(fileapi::FileSystemType type) { 33 bool IsOverlappingMountPathForbidden(fileapi::FileSystemType type) {
34 return type != fileapi::kFileSystemTypeNativeMedia; 34 return type != fileapi::kFileSystemTypeNativeMedia &&
35 type != fileapi::kFileSystemTypeDeviceMedia;
35 } 36 }
36 37
37 // Wrapper around ref-counted ExternalMountPoints that will be used to lazily 38 // Wrapper around ref-counted ExternalMountPoints that will be used to lazily
38 // create and initialize LazyInstance system ExternalMountPoints. 39 // create and initialize LazyInstance system ExternalMountPoints.
39 class SystemMountPointsLazyWrapper { 40 class SystemMountPointsLazyWrapper {
40 public: 41 public:
41 SystemMountPointsLazyWrapper() 42 SystemMountPointsLazyWrapper()
42 : system_mount_points_(fileapi::ExternalMountPoints::CreateRefCounted()) { 43 : system_mount_points_(fileapi::ExternalMountPoints::CreateRefCounted()) {
43 } 44 }
44 45
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 path.IsParent(potential_child->first)) { 348 path.IsParent(potential_child->first)) {
348 return false; 349 return false;
349 } 350 }
350 } 351 }
351 } 352 }
352 353
353 return true; 354 return true;
354 } 355 }
355 356
356 } // namespace fileapi 357 } // namespace fileapi
OLDNEW
« no previous file with comments | « components/storage_monitor/storage_info.cc ('k') | webkit/browser/fileapi/file_system_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698