| 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_file_system.h" | 5 #include "chrome/browser/chromeos/gdata/gdata_file_system.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 if (self_link) | 183 if (self_link) |
| 184 file->self_url_ = self_link->href(); | 184 file->self_url_ = self_link->href(); |
| 185 file->content_url_ = doc->content_url(); | 185 file->content_url_ = doc->content_url(); |
| 186 file->content_mime_type_ = doc->content_mime_type(); | 186 file->content_mime_type_ = doc->content_mime_type(); |
| 187 file->etag_ = doc->etag(); | 187 file->etag_ = doc->etag(); |
| 188 file->resource_id_ = doc->resource_id(); | 188 file->resource_id_ = doc->resource_id(); |
| 189 file->id_ = doc->id(); | 189 file->id_ = doc->id(); |
| 190 file->file_info_.last_modified = doc->updated_time(); | 190 file->file_info_.last_modified = doc->updated_time(); |
| 191 file->file_info_.last_accessed = doc->updated_time(); | 191 file->file_info_.last_accessed = doc->updated_time(); |
| 192 file->file_info_.creation_time = doc->published_time(); | 192 file->file_info_.creation_time = doc->published_time(); |
| 193 |
| 194 const Link* thumbnail_link = doc->GetLinkByType(Link::THUMBNAIL); |
| 195 if (thumbnail_link) |
| 196 file->thumbnail_url_ = thumbnail_link->href(); |
| 197 |
| 198 const Link* edit_link = doc->GetLinkByType(Link::EDIT); |
| 199 if (edit_link) |
| 200 file->edit_url_ = edit_link->href(); |
| 201 |
| 202 // TODO(gspencer): Add support for fetching cache state from the cache, |
| 203 // when the cache code is done. |
| 204 |
| 193 return file; | 205 return file; |
| 194 } | 206 } |
| 195 | 207 |
| 196 // GDataFile class implementation. | 208 // GDataFile class implementation. |
| 197 | 209 |
| 198 GDataFile::GDataFile(GDataDirectory* parent) | 210 GDataFile::GDataFile(GDataDirectory* parent) |
| 199 : GDataFileBase(parent), kind_(gdata::DocumentEntry::UNKNOWN) { | 211 : GDataFileBase(parent), |
| 212 kind_(gdata::DocumentEntry::UNKNOWN), |
| 213 cache_state_(CACHE_STATE_NONE) { |
| 200 DCHECK(parent); | 214 DCHECK(parent); |
| 201 } | 215 } |
| 202 | 216 |
| 203 GDataFile::~GDataFile() { | 217 GDataFile::~GDataFile() { |
| 204 } | 218 } |
| 205 | 219 |
| 206 GDataFile* GDataFile::AsGDataFile() { | 220 GDataFile* GDataFile::AsGDataFile() { |
| 207 return this; | 221 return this; |
| 208 } | 222 } |
| 209 | 223 |
| (...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 833 | 847 |
| 834 GDataFileSystemFactory::~GDataFileSystemFactory() { | 848 GDataFileSystemFactory::~GDataFileSystemFactory() { |
| 835 } | 849 } |
| 836 | 850 |
| 837 ProfileKeyedService* GDataFileSystemFactory::BuildServiceInstanceFor( | 851 ProfileKeyedService* GDataFileSystemFactory::BuildServiceInstanceFor( |
| 838 Profile* profile) const { | 852 Profile* profile) const { |
| 839 return new GDataFileSystem(profile); | 853 return new GDataFileSystem(profile); |
| 840 } | 854 } |
| 841 | 855 |
| 842 } // namespace gdata | 856 } // namespace gdata |
| OLD | NEW |