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 "chrome/browser/chromeos/drive/drive_file_system_util.h" | 5 #include "chrome/browser/chromeos/drive/drive_file_system_util.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 CR_DEFINE_STATIC_LOCAL(base::FilePath, drive_mount_path, | 153 CR_DEFINE_STATIC_LOCAL(base::FilePath, drive_mount_path, |
154 (base::FilePath::FromUTF8Unsafe(kDriveMountPointPath))); | 154 (base::FilePath::FromUTF8Unsafe(kDriveMountPointPath))); |
155 return drive_mount_path; | 155 return drive_mount_path; |
156 } | 156 } |
157 | 157 |
158 bool IsSpecialResourceId(const std::string& resource_id) { | 158 bool IsSpecialResourceId(const std::string& resource_id) { |
159 return resource_id == kDriveGrandRootSpecialResourceId || | 159 return resource_id == kDriveGrandRootSpecialResourceId || |
160 resource_id == kDriveOtherDirSpecialResourceId; | 160 resource_id == kDriveOtherDirSpecialResourceId; |
161 } | 161 } |
162 | 162 |
| 163 DriveEntryProto CreateMyDriveRootEntry(const std::string& root_resource_id) { |
| 164 DriveEntryProto mydrive_root; |
| 165 mydrive_root.mutable_file_info()->set_is_directory(true); |
| 166 mydrive_root.set_resource_id(root_resource_id); |
| 167 mydrive_root.set_parent_resource_id(util::kDriveGrandRootSpecialResourceId); |
| 168 mydrive_root.set_title(util::kDriveMyDriveRootDirName); |
| 169 return mydrive_root; |
| 170 } |
| 171 |
| 172 DriveEntryProto CreateOtherDirEntry() { |
| 173 DriveEntryProto other_dir; |
| 174 other_dir.mutable_file_info()->set_is_directory(true); |
| 175 other_dir.set_resource_id(util::kDriveOtherDirSpecialResourceId); |
| 176 other_dir.set_parent_resource_id(util::kDriveGrandRootSpecialResourceId); |
| 177 other_dir.set_title(util::kDriveOtherDirName); |
| 178 return other_dir; |
| 179 } |
| 180 |
163 const std::string& GetDriveMountPointPathAsString() { | 181 const std::string& GetDriveMountPointPathAsString() { |
164 CR_DEFINE_STATIC_LOCAL(std::string, drive_mount_path_string, | 182 CR_DEFINE_STATIC_LOCAL(std::string, drive_mount_path_string, |
165 (kDriveMountPointPath)); | 183 (kDriveMountPointPath)); |
166 return drive_mount_path_string; | 184 return drive_mount_path_string; |
167 } | 185 } |
168 | 186 |
169 const base::FilePath& GetSpecialRemoteRootPath() { | 187 const base::FilePath& GetSpecialRemoteRootPath() { |
170 CR_DEFINE_STATIC_LOCAL(base::FilePath, drive_mount_path, | 188 CR_DEFINE_STATIC_LOCAL(base::FilePath, drive_mount_path, |
171 (base::FilePath::FromUTF8Unsafe(kDriveSpecialRootPath))); | 189 (base::FilePath::FromUTF8Unsafe(kDriveSpecialRootPath))); |
172 return drive_mount_path; | 190 return drive_mount_path; |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
444 proto->set_last_modified(file_info.last_modified.ToInternalValue()); | 462 proto->set_last_modified(file_info.last_modified.ToInternalValue()); |
445 proto->set_last_accessed(file_info.last_accessed.ToInternalValue()); | 463 proto->set_last_accessed(file_info.last_accessed.ToInternalValue()); |
446 proto->set_creation_time(file_info.creation_time.ToInternalValue()); | 464 proto->set_creation_time(file_info.creation_time.ToInternalValue()); |
447 } | 465 } |
448 | 466 |
449 void EmptyFileOperationCallback(DriveFileError error) { | 467 void EmptyFileOperationCallback(DriveFileError error) { |
450 } | 468 } |
451 | 469 |
452 } // namespace util | 470 } // namespace util |
453 } // namespace drive | 471 } // namespace drive |
OLD | NEW |