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

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

Issue 10818017: contacts: Add GDataContactsService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: s/struct/class/ in forward declaration (caught by clang) 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..8c1f096493faef542c18021f42b1ffb830a6d416 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.
+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:
+ // Location of the photo to fetch.
+ GURL photo_url_;
+
+ // Callback to which the photo data is passed.
+ 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