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

Unified Diff: chrome/browser/chromeos/gdata/gdata_operations.h

Issue 10542076: ABANDONED: chromeos: Download contacts (work in progress). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: minor changes Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/gdata/gdata_operations.h
diff --git a/chrome/browser/chromeos/gdata/gdata_operations.h b/chrome/browser/chromeos/gdata/gdata_operations.h
index e0e78042858476b5f6f8c63437333291bcf1b062..298ac31746fdff087ba1a73e94cea0664242ca05 100644
--- a/chrome/browser/chromeos/gdata/gdata_operations.h
+++ b/chrome/browser/chromeos/gdata/gdata_operations.h
@@ -383,6 +383,63 @@ class ResumeUploadOperation : public UrlFetchOperationBase {
DISALLOW_COPY_AND_ASSIGN(ResumeUploadOperation);
};
+//============================ GetContactsOperation ============================
+
+// This class fetches a user's contacts.
+class GetContactsOperation : public GetDataOperation {
+ public:
+ GetContactsOperation(GDataOperationRegistry* registry,
+ Profile* profile,
+ const base::Time& min_update_time,
+ const GetDataCallback& callback);
+ virtual ~GetContactsOperation();
+
+ void set_feed_url_for_testing(const GURL& url) {
+ feed_url_for_testing_ = url;
+ }
+
+ protected:
+ // Overridden from GetDataOperation.
+ virtual GURL GetURL() const OVERRIDE;
+
+ private:
+ // If non-empty, URL of the feed to fetch.
+ GURL feed_url_for_testing_;
+
+ // If is_null() is false, contains a minimum last-updated time that will be
+ // used to filter contacts.
+ base::Time min_update_time_;
+
+ DISALLOW_COPY_AND_ASSIGN(GetContactsOperation);
+};
+
+//========================== GetContactPhotoOperation ==========================
+
+// This class fetches a contact's photo.
+// TODO(derat): Use DownloadFileOperation instead? Not sure whether I want to
+// save images as individual files or not.
+class GetContactPhotoOperation : public UrlFetchOperationBase {
+ public:
+ GetContactPhotoOperation(GDataOperationRegistry* registry,
+ Profile* profile,
+ const GURL& photo_url,
+ const GetDownloadDataCallback& callback);
+ virtual ~GetContactPhotoOperation();
+
+ protected:
+ // Overridden from UrlFetchOperationBase.
+ virtual GURL GetURL() const OVERRIDE;
+ virtual bool ProcessURLFetchResults(const net::URLFetcher* source)
+ OVERRIDE;
+ virtual void RunCallbackOnPrematureFailure(GDataErrorCode code) OVERRIDE;
+
+ private:
+ GURL photo_url_;
+ GetDownloadDataCallback callback_;
+
+ DISALLOW_COPY_AND_ASSIGN(GetContactPhotoOperation);
+};
+
} // namespace gdata
#endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_OPERATIONS_H_
« no previous file with comments | « chrome/browser/chromeos/gdata/gdata_contacts_service_browsertest.cc ('k') | chrome/browser/chromeos/gdata/gdata_operations.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698