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 #include "webkit/chromeos/fileapi/cros_mount_point_provider.h" | 5 #include "webkit/chromeos/fileapi/cros_mount_point_provider.h" |
6 | 6 |
7 #include "base/chromeos/chromeos_version.h" | 7 #include "base/chromeos/chromeos_version.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 chromeos::CrosDisksClient::GetRemovableDiskMountPoint()); | 70 chromeos::CrosDisksClient::GetRemovableDiskMountPoint()); |
71 system_mount_points_->RegisterFileSystem( | 71 system_mount_points_->RegisterFileSystem( |
72 "oem", | 72 "oem", |
73 fileapi::kFileSystemTypeRestrictedNativeLocal, | 73 fileapi::kFileSystemTypeRestrictedNativeLocal, |
74 base::FilePath(FILE_PATH_LITERAL("/usr/share/oem"))); | 74 base::FilePath(FILE_PATH_LITERAL("/usr/share/oem"))); |
75 } | 75 } |
76 | 76 |
77 CrosMountPointProvider::~CrosMountPointProvider() { | 77 CrosMountPointProvider::~CrosMountPointProvider() { |
78 } | 78 } |
79 | 79 |
| 80 bool CrosMountPointProvider::CanHandleType(fileapi::FileSystemType type) const { |
| 81 switch (type) { |
| 82 case fileapi::kFileSystemTypeExternal: |
| 83 case fileapi::kFileSystemTypeDrive: |
| 84 case fileapi::kFileSystemTypeRestrictedNativeLocal: |
| 85 case fileapi::kFileSystemTypeNativeLocal: |
| 86 case fileapi::kFileSystemTypeNativeForPlatformApp: |
| 87 return true; |
| 88 default: |
| 89 return false; |
| 90 } |
| 91 } |
| 92 |
80 void CrosMountPointProvider::ValidateFileSystemRoot( | 93 void CrosMountPointProvider::ValidateFileSystemRoot( |
81 const GURL& origin_url, | 94 const GURL& origin_url, |
82 fileapi::FileSystemType type, | 95 fileapi::FileSystemType type, |
83 bool create, | 96 bool create, |
84 const ValidateFileSystemCallback& callback) { | 97 const ValidateFileSystemCallback& callback) { |
85 DCHECK(fileapi::IsolatedContext::IsIsolatedType(type)); | 98 DCHECK(fileapi::IsolatedContext::IsIsolatedType(type)); |
86 // Nothing to validate for external filesystem. | 99 // Nothing to validate for external filesystem. |
87 callback.Run(base::PLATFORM_FILE_OK); | 100 callback.Run(base::PLATFORM_FILE_OK); |
88 } | 101 } |
89 | 102 |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 fileapi::RemoteFileSystemProxyInterface* CrosMountPointProvider::GetRemoteProxy( | 340 fileapi::RemoteFileSystemProxyInterface* CrosMountPointProvider::GetRemoteProxy( |
328 const std::string& mount_name) const { | 341 const std::string& mount_name) const { |
329 fileapi::RemoteFileSystemProxyInterface* proxy = | 342 fileapi::RemoteFileSystemProxyInterface* proxy = |
330 mount_points_->GetRemoteFileSystemProxy(mount_name); | 343 mount_points_->GetRemoteFileSystemProxy(mount_name); |
331 if (proxy) | 344 if (proxy) |
332 return proxy; | 345 return proxy; |
333 return system_mount_points_->GetRemoteFileSystemProxy(mount_name); | 346 return system_mount_points_->GetRemoteFileSystemProxy(mount_name); |
334 } | 347 } |
335 | 348 |
336 } // namespace chromeos | 349 } // namespace chromeos |
OLD | NEW |