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/gdata/gdata_wapi_parser.h" | 5 #include "chrome/browser/chromeos/gdata/gdata_wapi_parser.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
(...skipping 807 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
818 entry->content_.url_ = file.web_content_link(); | 818 entry->content_.url_ = file.web_content_link(); |
819 entry->content_.mime_type_ = file.mime_type(); | 819 entry->content_.mime_type_ = file.mime_type(); |
820 // TODO(kochi): entry->feed_links_ | 820 // TODO(kochi): entry->feed_links_ |
821 | 821 |
822 // For file entries | 822 // For file entries |
823 entry->filename_ = UTF8ToUTF16(file.title()); | 823 entry->filename_ = UTF8ToUTF16(file.title()); |
824 entry->suggested_filename_ = UTF8ToUTF16(file.title()); | 824 entry->suggested_filename_ = UTF8ToUTF16(file.title()); |
825 entry->file_md5_ = file.md5_checksum(); | 825 entry->file_md5_ = file.md5_checksum(); |
826 entry->file_size_ = file.file_size(); | 826 entry->file_size_ = file.file_size(); |
827 | 827 |
828 entry->deleted_ = false; // later filled by CreateFromChangeResource. | 828 entry->deleted_ = file.labels().is_trashed(); |
hashimoto
2012/08/14 10:21:52
Could you add a brief comment about:
1. What is th
kochi
2012/08/14 10:32:11
Updated comments.
And I noticed that |removed_| fi
| |
829 entry->removed_ = false; // later filled by CreateFromChangeResource. | 829 entry->removed_ = false; // later filled by CreateFromChangeResource. |
830 | 830 |
831 // FeedEntry | 831 // FeedEntry |
832 entry->etag_ = file.etag(); | 832 entry->etag_ = file.etag(); |
833 // entry->authors_ | 833 // entry->authors_ |
834 // entry->links_. | 834 // entry->links_. |
835 if (!file.parents().empty()) { | 835 if (!file.parents().empty()) { |
836 Link* link = new Link(); | 836 Link* link = new Link(); |
837 link->type_ = Link::PARENT; | 837 link->type_ = Link::PARENT; |
838 link->href_ = file.parents()[0]->parent_link(); | 838 link->href_ = file.parents()[0]->parent_link(); |
(...skipping 29 matching lines...) Expand all Loading... | |
868 // TODO: Do we need this? | 868 // TODO: Do we need this? |
869 entry->FillRemainingFields(); | 869 entry->FillRemainingFields(); |
870 return entry.release(); | 870 return entry.release(); |
871 } | 871 } |
872 | 872 |
873 // static | 873 // static |
874 DocumentEntry* | 874 DocumentEntry* |
875 DocumentEntry::CreateFromChangeResource(const ChangeResource& change) { | 875 DocumentEntry::CreateFromChangeResource(const ChangeResource& change) { |
876 DocumentEntry* entry = CreateFromFileResource(change.file()); | 876 DocumentEntry* entry = CreateFromFileResource(change.file()); |
877 | 877 |
878 entry->deleted_ = change.is_deleted(); | |
879 entry->removed_ = change.is_deleted(); | 878 entry->removed_ = change.is_deleted(); |
880 | 879 |
881 return entry; | 880 return entry; |
882 } | 881 } |
883 | 882 |
884 // static | 883 // static |
885 std::string DocumentEntry::GetEntryNodeName() { | 884 std::string DocumentEntry::GetEntryNodeName() { |
886 return kEntryNode; | 885 return kEntryNode; |
887 } | 886 } |
888 | 887 |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1116 bool AccountMetadataFeed::Parse(const base::Value& value) { | 1115 bool AccountMetadataFeed::Parse(const base::Value& value) { |
1117 base::JSONValueConverter<AccountMetadataFeed> converter; | 1116 base::JSONValueConverter<AccountMetadataFeed> converter; |
1118 if (!converter.Convert(value, this)) { | 1117 if (!converter.Convert(value, this)) { |
1119 LOG(ERROR) << "Unable to parse: Invalid account metadata feed!"; | 1118 LOG(ERROR) << "Unable to parse: Invalid account metadata feed!"; |
1120 return false; | 1119 return false; |
1121 } | 1120 } |
1122 return true; | 1121 return true; |
1123 } | 1122 } |
1124 | 1123 |
1125 } // namespace gdata | 1124 } // namespace gdata |
OLD | NEW |