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 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 CR_DEFINE_STATIC_LOCAL(base::FilePath, drive_mount_path, | 86 CR_DEFINE_STATIC_LOCAL(base::FilePath, drive_mount_path, |
87 (base::FilePath::FromUTF8Unsafe(kDriveMountPointPath))); | 87 (base::FilePath::FromUTF8Unsafe(kDriveMountPointPath))); |
88 return drive_mount_path; | 88 return drive_mount_path; |
89 } | 89 } |
90 | 90 |
91 bool IsSpecialResourceId(const std::string& resource_id) { | 91 bool IsSpecialResourceId(const std::string& resource_id) { |
92 return resource_id == kDriveGrandRootSpecialResourceId || | 92 return resource_id == kDriveGrandRootSpecialResourceId || |
93 resource_id == kDriveOtherDirSpecialResourceId; | 93 resource_id == kDriveOtherDirSpecialResourceId; |
94 } | 94 } |
95 | 95 |
| 96 DriveEntryProto CreateMyDriveRootEntry(const std::string& root_resource_id) { |
| 97 DriveEntryProto mydrive_root; |
| 98 mydrive_root.mutable_file_info()->set_is_directory(true); |
| 99 mydrive_root.set_resource_id(root_resource_id); |
| 100 mydrive_root.set_parent_resource_id(util::kDriveGrandRootSpecialResourceId); |
| 101 mydrive_root.set_title(util::kDriveMyDriveRootDirName); |
| 102 return mydrive_root; |
| 103 } |
| 104 |
| 105 DriveEntryProto CreateOtherDirEntry() { |
| 106 DriveEntryProto other_dir; |
| 107 other_dir.mutable_file_info()->set_is_directory(true); |
| 108 other_dir.set_resource_id(util::kDriveOtherDirSpecialResourceId); |
| 109 other_dir.set_parent_resource_id(util::kDriveGrandRootSpecialResourceId); |
| 110 other_dir.set_title(util::kDriveOtherDirName); |
| 111 return other_dir; |
| 112 } |
| 113 |
96 const std::string& GetDriveMountPointPathAsString() { | 114 const std::string& GetDriveMountPointPathAsString() { |
97 CR_DEFINE_STATIC_LOCAL(std::string, drive_mount_path_string, | 115 CR_DEFINE_STATIC_LOCAL(std::string, drive_mount_path_string, |
98 (kDriveMountPointPath)); | 116 (kDriveMountPointPath)); |
99 return drive_mount_path_string; | 117 return drive_mount_path_string; |
100 } | 118 } |
101 | 119 |
102 const base::FilePath& GetSpecialRemoteRootPath() { | 120 const base::FilePath& GetSpecialRemoteRootPath() { |
103 CR_DEFINE_STATIC_LOCAL(base::FilePath, drive_mount_path, | 121 CR_DEFINE_STATIC_LOCAL(base::FilePath, drive_mount_path, |
104 (base::FilePath::FromUTF8Unsafe(kDriveSpecialRootPath))); | 122 (base::FilePath::FromUTF8Unsafe(kDriveSpecialRootPath))); |
105 return drive_mount_path; | 123 return drive_mount_path; |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 proto->set_last_modified(file_info.last_modified.ToInternalValue()); | 370 proto->set_last_modified(file_info.last_modified.ToInternalValue()); |
353 proto->set_last_accessed(file_info.last_accessed.ToInternalValue()); | 371 proto->set_last_accessed(file_info.last_accessed.ToInternalValue()); |
354 proto->set_creation_time(file_info.creation_time.ToInternalValue()); | 372 proto->set_creation_time(file_info.creation_time.ToInternalValue()); |
355 } | 373 } |
356 | 374 |
357 void EmptyFileOperationCallback(DriveFileError error) { | 375 void EmptyFileOperationCallback(DriveFileError error) { |
358 } | 376 } |
359 | 377 |
360 } // namespace util | 378 } // namespace util |
361 } // namespace drive | 379 } // namespace drive |
OLD | NEW |