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 <string> | 7 #include <string> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 entry_proto.set_download_url(entry.download_url().spec()); | 32 entry_proto.set_download_url(entry.download_url().spec()); |
33 | 33 |
34 const google_apis::Link* edit_link = | 34 const google_apis::Link* edit_link = |
35 entry.GetLinkByType(google_apis::Link::LINK_EDIT); | 35 entry.GetLinkByType(google_apis::Link::LINK_EDIT); |
36 if (edit_link) | 36 if (edit_link) |
37 entry_proto.set_edit_url(edit_link->href().spec()); | 37 entry_proto.set_edit_url(edit_link->href().spec()); |
38 | 38 |
39 const google_apis::Link* parent_link = | 39 const google_apis::Link* parent_link = |
40 entry.GetLinkByType(google_apis::Link::LINK_PARENT); | 40 entry.GetLinkByType(google_apis::Link::LINK_PARENT); |
41 if (parent_link) { | 41 if (parent_link) { |
| 42 // TODO(haruki): Apply mapping from an empty parent to special dummy |
| 43 // directory. See http://crbug.com/174233. Until we implement it, |
| 44 // ChangeListProcessor ignores such "no parent" entries. |
42 entry_proto.set_parent_resource_id( | 45 entry_proto.set_parent_resource_id( |
43 util::ExtractResourceIdFromUrl(parent_link->href())); | 46 util::ExtractResourceIdFromUrl(parent_link->href())); |
44 } | 47 } |
45 | 48 |
46 entry_proto.set_deleted(entry.deleted()); | 49 entry_proto.set_deleted(entry.deleted()); |
47 entry_proto.set_kind(entry.kind()); | 50 entry_proto.set_kind(entry.kind()); |
48 | 51 |
49 PlatformFileInfoProto* file_info = entry_proto.mutable_file_info(); | 52 PlatformFileInfoProto* file_info = entry_proto.mutable_file_info(); |
50 | 53 |
51 file_info->set_last_modified(entry.updated_time().ToInternalValue()); | 54 file_info->set_last_modified(entry.updated_time().ToInternalValue()); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 entry_proto.set_upload_url(upload_link->href().spec()); | 110 entry_proto.set_upload_url(upload_link->href().spec()); |
108 } else { | 111 } else { |
109 // Some resource entries don't map into files (i.e. sites). | 112 // Some resource entries don't map into files (i.e. sites). |
110 return DriveEntryProto(); | 113 return DriveEntryProto(); |
111 } | 114 } |
112 | 115 |
113 return entry_proto; | 116 return entry_proto; |
114 } | 117 } |
115 | 118 |
116 } // namespace drive | 119 } // namespace drive |
OLD | NEW |