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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 if (self_link) | 181 if (self_link) |
182 file->self_url_ = self_link->href(); | 182 file->self_url_ = self_link->href(); |
183 file->content_url_ = doc->content_url(); | 183 file->content_url_ = doc->content_url(); |
184 file->content_mime_type_ = doc->content_mime_type(); | 184 file->content_mime_type_ = doc->content_mime_type(); |
185 file->etag_ = doc->etag(); | 185 file->etag_ = doc->etag(); |
186 file->resource_id_ = doc->resource_id(); | 186 file->resource_id_ = doc->resource_id(); |
187 file->id_ = doc->id(); | 187 file->id_ = doc->id(); |
188 file->file_info_.last_modified = doc->updated_time(); | 188 file->file_info_.last_modified = doc->updated_time(); |
189 file->file_info_.last_accessed = doc->updated_time(); | 189 file->file_info_.last_accessed = doc->updated_time(); |
190 file->file_info_.creation_time = doc->published_time(); | 190 file->file_info_.creation_time = doc->published_time(); |
| 191 |
| 192 const Link* thumbnail_link = doc->GetLinkByType(Link::THUMBNAIL); |
| 193 if (thumbnail_link) |
| 194 file->thumbnail_url_ = thumbnail_link->href(); |
| 195 |
| 196 // TODO(gspencer): Add support for reading pinned state from the cache, |
| 197 // when the cache code is done. |
| 198 |
191 return file; | 199 return file; |
192 } | 200 } |
193 | 201 |
194 // GDataFile class implementation. | 202 // GDataFile class implementation. |
195 | 203 |
196 GDataFile::GDataFile(GDataDirectory* parent) | 204 GDataFile::GDataFile(GDataDirectory* parent) |
197 : GDataFileBase(parent), kind_(gdata::DocumentEntry::UNKNOWN) { | 205 : GDataFileBase(parent), |
| 206 kind_(gdata::DocumentEntry::UNKNOWN), |
| 207 pinned_state_(PINNED_STATE_NONE) { |
198 DCHECK(parent); | 208 DCHECK(parent); |
199 } | 209 } |
200 | 210 |
201 GDataFile::~GDataFile() { | 211 GDataFile::~GDataFile() { |
202 } | 212 } |
203 | 213 |
204 GDataFile* GDataFile::AsGDataFile() { | 214 GDataFile* GDataFile::AsGDataFile() { |
205 return this; | 215 return this; |
206 } | 216 } |
207 | 217 |
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
607 | 617 |
608 GDataFileSystemFactory::~GDataFileSystemFactory() { | 618 GDataFileSystemFactory::~GDataFileSystemFactory() { |
609 } | 619 } |
610 | 620 |
611 ProfileKeyedService* GDataFileSystemFactory::BuildServiceInstanceFor( | 621 ProfileKeyedService* GDataFileSystemFactory::BuildServiceInstanceFor( |
612 Profile* profile) const { | 622 Profile* profile) const { |
613 return new GDataFileSystem(profile); | 623 return new GDataFileSystem(profile); |
614 } | 624 } |
615 | 625 |
616 } // namespace gdata | 626 } // namespace gdata |
OLD | NEW |