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/resource_entry_conversion.h" | 5 #include "chrome/browser/chromeos/drive/resource_entry_conversion.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 file_info->is_directory = entry.file_info().is_directory(); | 139 file_info->is_directory = entry.file_info().is_directory(); |
140 file_info->is_symbolic_link = entry.file_info().is_symbolic_link(); | 140 file_info->is_symbolic_link = entry.file_info().is_symbolic_link(); |
141 file_info->last_modified = base::Time::FromInternalValue( | 141 file_info->last_modified = base::Time::FromInternalValue( |
142 entry.file_info().last_modified()); | 142 entry.file_info().last_modified()); |
143 file_info->last_accessed = base::Time::FromInternalValue( | 143 file_info->last_accessed = base::Time::FromInternalValue( |
144 entry.file_info().last_accessed()); | 144 entry.file_info().last_accessed()); |
145 file_info->creation_time = base::Time::FromInternalValue( | 145 file_info->creation_time = base::Time::FromInternalValue( |
146 entry.file_info().creation_time()); | 146 entry.file_info().creation_time()); |
147 } | 147 } |
148 | 148 |
149 void SetPlatformFileInfoToResourceEntry(const base::File::Info& file_info, | |
150 ResourceEntry* entry) { | |
151 PlatformFileInfoProto* entry_file_info = entry->mutable_file_info(); | |
152 entry_file_info->set_size(file_info.size); | |
153 entry_file_info->set_is_directory(file_info.is_directory); | |
154 entry_file_info->set_is_symbolic_link(file_info.is_symbolic_link); | |
155 entry_file_info->set_last_modified(file_info.last_modified.ToInternalValue()); | |
156 entry_file_info->set_last_accessed(file_info.last_accessed.ToInternalValue()); | |
157 entry_file_info->set_creation_time(file_info.creation_time.ToInternalValue()); | |
158 } | |
159 | |
160 } // namespace drive | 149 } // namespace drive |
OLD | NEW |