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

Side by Side 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: apply review feedback 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 unified diff | Download patch | Annotate | Revision Log
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 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_GDATA_OPERATIONS_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_GDATA_OPERATIONS_H_
6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_OPERATIONS_H_ 6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_OPERATIONS_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 int64 current, int64 total) OVERRIDE; 376 int64 current, int64 total) OVERRIDE;
377 377
378 private: 378 private:
379 ResumeUploadCallback callback_; 379 ResumeUploadCallback callback_;
380 ResumeUploadParams params_; 380 ResumeUploadParams params_;
381 bool last_chunk_completed_; 381 bool last_chunk_completed_;
382 382
383 DISALLOW_COPY_AND_ASSIGN(ResumeUploadOperation); 383 DISALLOW_COPY_AND_ASSIGN(ResumeUploadOperation);
384 }; 384 };
385 385
386 //============================ GetContactsOperation ============================
387
388 // This class fetches a user's contacts.
389 class GetContactsOperation : public GetDataOperation {
390 public:
391 GetContactsOperation(GDataOperationRegistry* registry,
392 Profile* profile,
393 const base::Time& min_update_time,
394 const GetDataCallback& callback);
395 virtual ~GetContactsOperation();
396
397 void set_feed_url_for_testing(const GURL& url) {
398 feed_url_for_testing_ = url;
399 }
400
401 protected:
402 // Overridden from GetDataOperation.
403 virtual GURL GetURL() const OVERRIDE;
404
405 private:
406 // If non-empty, URL of the feed to fetch.
407 GURL feed_url_for_testing_;
408
409 // If is_null() is false, contains a minimum last-updated time that will be
410 // used to filter contacts.
411 base::Time min_update_time_;
412
413 DISALLOW_COPY_AND_ASSIGN(GetContactsOperation);
414 };
415
416 //========================== GetContactPhotoOperation ==========================
417
418 // This class fetches a contact's photo.
419 class GetContactPhotoOperation : public UrlFetchOperationBase {
420 public:
421 GetContactPhotoOperation(GDataOperationRegistry* registry,
422 Profile* profile,
423 const GURL& photo_url,
424 const GetDownloadDataCallback& callback);
425 virtual ~GetContactPhotoOperation();
426
427 protected:
428 // Overridden from UrlFetchOperationBase.
429 virtual GURL GetURL() const OVERRIDE;
430 virtual bool ProcessURLFetchResults(const net::URLFetcher* source) OVERRIDE;
431 virtual void RunCallbackOnPrematureFailure(GDataErrorCode code) OVERRIDE;
432
433 private:
434 // Location of the photo to fetch.
435 GURL photo_url_;
436
437 // Callback to which the photo data is passed.
438 GetDownloadDataCallback callback_;
439
440 DISALLOW_COPY_AND_ASSIGN(GetContactPhotoOperation);
441 };
442
386 } // namespace gdata 443 } // namespace gdata
387 444
388 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_OPERATIONS_H_ 445 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_OPERATIONS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698