| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/memory/scoped_callback_factory.h" | 8 #include "base/memory/scoped_callback_factory.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 25 matching lines...) Expand all Loading... |
| 36 {"/home/chronos/user/", "Downloads"}, | 36 {"/home/chronos/user/", "Downloads"}, |
| 37 {"/media", "archive"}, | 37 {"/media", "archive"}, |
| 38 {"/media", "removable"}, | 38 {"/media", "removable"}, |
| 39 }; | 39 }; |
| 40 | 40 |
| 41 CrosMountPointProvider::CrosMountPointProvider( | 41 CrosMountPointProvider::CrosMountPointProvider( |
| 42 scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy) | 42 scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy) |
| 43 : special_storage_policy_(special_storage_policy), | 43 : special_storage_policy_(special_storage_policy), |
| 44 file_access_permissions_(new FileAccessPermissions()), | 44 file_access_permissions_(new FileAccessPermissions()), |
| 45 local_file_util_(new fileapi::LocalFileSystemFileUtil( | 45 local_file_util_(new fileapi::LocalFileSystemFileUtil( |
| 46 fileapi::FileSystemFileUtil::GetInstance())) { | 46 new fileapi::FileSystemFileUtil())) { |
| 47 for (size_t i = 0; i < arraysize(fixed_exposed_paths); i++) { | 47 for (size_t i = 0; i < arraysize(fixed_exposed_paths); i++) { |
| 48 mount_point_map_.insert(std::pair<std::string, FilePath>( | 48 mount_point_map_.insert(std::pair<std::string, FilePath>( |
| 49 std::string(fixed_exposed_paths[i].web_root_path), | 49 std::string(fixed_exposed_paths[i].web_root_path), |
| 50 FilePath(std::string(fixed_exposed_paths[i].local_root_path)))); | 50 FilePath(std::string(fixed_exposed_paths[i].local_root_path)))); |
| 51 } | 51 } |
| 52 } | 52 } |
| 53 | 53 |
| 54 CrosMountPointProvider::~CrosMountPointProvider() { | 54 CrosMountPointProvider::~CrosMountPointProvider() { |
| 55 } | 55 } |
| 56 | 56 |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 FilePath mount_prefix = iter->second.Append(iter->first); | 190 FilePath mount_prefix = iter->second.Append(iter->first); |
| 191 *virtual_path = FilePath(iter->first); | 191 *virtual_path = FilePath(iter->first); |
| 192 if (mount_prefix.AppendRelativePath(filesystem_path, virtual_path)) { | 192 if (mount_prefix.AppendRelativePath(filesystem_path, virtual_path)) { |
| 193 return true; | 193 return true; |
| 194 } | 194 } |
| 195 } | 195 } |
| 196 return false; | 196 return false; |
| 197 } | 197 } |
| 198 | 198 |
| 199 } // namespace chromeos | 199 } // namespace chromeos |
| OLD | NEW |