Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(369)

Side by Side Diff: chrome/browser/chromeos/gdata/gdata_file_system.cc

Issue 9570031: This adds some more attributes to the GData files. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Upload after merge Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/chromeos/gdata/gdata_file_system.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/gdata/gdata_file_system.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698