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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 if (self_link) | 182 if (self_link) |
183 file->self_url_ = self_link->href(); | 183 file->self_url_ = self_link->href(); |
184 file->content_url_ = doc->content_url(); | 184 file->content_url_ = doc->content_url(); |
185 file->content_mime_type_ = doc->content_mime_type(); | 185 file->content_mime_type_ = doc->content_mime_type(); |
186 file->etag_ = doc->etag(); | 186 file->etag_ = doc->etag(); |
187 file->resource_id_ = doc->resource_id(); | 187 file->resource_id_ = doc->resource_id(); |
188 file->id_ = doc->id(); | 188 file->id_ = doc->id(); |
189 file->file_info_.last_modified = doc->updated_time(); | 189 file->file_info_.last_modified = doc->updated_time(); |
190 file->file_info_.last_accessed = doc->updated_time(); | 190 file->file_info_.last_accessed = doc->updated_time(); |
191 file->file_info_.creation_time = doc->published_time(); | 191 file->file_info_.creation_time = doc->published_time(); |
| 192 |
| 193 const Link* thumbnail_link = doc->GetLinkByType(Link::THUMBNAIL); |
| 194 if (thumbnail_link) |
| 195 file->thumbnail_url_ = thumbnail_link->href(); |
| 196 |
| 197 const Link* edit_link = doc->GetLinkByType(Link::EDIT); |
| 198 if (edit_link) |
| 199 file->edit_url_ = edit_link->href(); |
| 200 |
| 201 // TODO(gspencer): Add support for fetching cache state from the cache, |
| 202 // when the cache code is done. |
| 203 |
192 return file; | 204 return file; |
193 } | 205 } |
194 | 206 |
195 // GDataFile class implementation. | 207 // GDataFile class implementation. |
196 | 208 |
197 GDataFile::GDataFile(GDataDirectory* parent) | 209 GDataFile::GDataFile(GDataDirectory* parent) |
198 : GDataFileBase(parent), kind_(gdata::DocumentEntry::UNKNOWN) { | 210 : GDataFileBase(parent), |
| 211 kind_(gdata::DocumentEntry::UNKNOWN), |
| 212 cache_state_(CACHE_STATE_NONE) { |
199 DCHECK(parent); | 213 DCHECK(parent); |
200 } | 214 } |
201 | 215 |
202 GDataFile::~GDataFile() { | 216 GDataFile::~GDataFile() { |
203 } | 217 } |
204 | 218 |
205 GDataFile* GDataFile::AsGDataFile() { | 219 GDataFile* GDataFile::AsGDataFile() { |
206 return this; | 220 return this; |
207 } | 221 } |
208 | 222 |
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
612 | 626 |
613 GDataFileSystemFactory::~GDataFileSystemFactory() { | 627 GDataFileSystemFactory::~GDataFileSystemFactory() { |
614 } | 628 } |
615 | 629 |
616 ProfileKeyedService* GDataFileSystemFactory::BuildServiceInstanceFor( | 630 ProfileKeyedService* GDataFileSystemFactory::BuildServiceInstanceFor( |
617 Profile* profile) const { | 631 Profile* profile) const { |
618 return new GDataFileSystem(profile); | 632 return new GDataFileSystem(profile); |
619 } | 633 } |
620 | 634 |
621 } // namespace gdata | 635 } // namespace gdata |
OLD | NEW |