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 #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 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 int64 current, int64 total) OVERRIDE; | 366 int64 current, int64 total) OVERRIDE; |
367 | 367 |
368 private: | 368 private: |
369 ResumeUploadCallback callback_; | 369 ResumeUploadCallback callback_; |
370 ResumeUploadParams params_; | 370 ResumeUploadParams params_; |
371 bool last_chunk_completed_; | 371 bool last_chunk_completed_; |
372 | 372 |
373 DISALLOW_COPY_AND_ASSIGN(ResumeUploadOperation); | 373 DISALLOW_COPY_AND_ASSIGN(ResumeUploadOperation); |
374 }; | 374 }; |
375 | 375 |
| 376 //========================== GetContactGroupsOperation ========================= |
| 377 |
| 378 // This class fetches a JSON feed containing a user's contact groups. |
| 379 class GetContactGroupsOperation : public GetDataOperation { |
| 380 public: |
| 381 GetContactGroupsOperation(GDataOperationRegistry* registry, |
| 382 const GetDataCallback& callback); |
| 383 virtual ~GetContactGroupsOperation(); |
| 384 |
| 385 void set_feed_url_for_testing(const GURL& url) { |
| 386 feed_url_for_testing_ = url; |
| 387 } |
| 388 |
| 389 protected: |
| 390 // Overridden from GetDataOperation. |
| 391 virtual GURL GetURL() const OVERRIDE; |
| 392 |
| 393 private: |
| 394 // If non-empty, URL of the feed to fetch. |
| 395 GURL feed_url_for_testing_; |
| 396 |
| 397 DISALLOW_COPY_AND_ASSIGN(GetContactGroupsOperation); |
| 398 }; |
| 399 |
376 //============================ GetContactsOperation ============================ | 400 //============================ GetContactsOperation ============================ |
377 | 401 |
378 // This class fetches a user's contacts. | 402 // This class fetches a JSON feed containing a user's contacts. |
379 class GetContactsOperation : public GetDataOperation { | 403 class GetContactsOperation : public GetDataOperation { |
380 public: | 404 public: |
381 GetContactsOperation(GDataOperationRegistry* registry, | 405 GetContactsOperation(GDataOperationRegistry* registry, |
| 406 const std::string& group_id, |
382 const base::Time& min_update_time, | 407 const base::Time& min_update_time, |
383 const GetDataCallback& callback); | 408 const GetDataCallback& callback); |
384 virtual ~GetContactsOperation(); | 409 virtual ~GetContactsOperation(); |
385 | 410 |
386 void set_feed_url_for_testing(const GURL& url) { | 411 void set_feed_url_for_testing(const GURL& url) { |
387 feed_url_for_testing_ = url; | 412 feed_url_for_testing_ = url; |
388 } | 413 } |
389 | 414 |
390 protected: | 415 protected: |
391 // Overridden from GetDataOperation. | 416 // Overridden from GetDataOperation. |
392 virtual GURL GetURL() const OVERRIDE; | 417 virtual GURL GetURL() const OVERRIDE; |
393 | 418 |
394 private: | 419 private: |
395 // If non-empty, URL of the feed to fetch. | 420 // If non-empty, URL of the feed to fetch. |
396 GURL feed_url_for_testing_; | 421 GURL feed_url_for_testing_; |
397 | 422 |
| 423 // If non-empty, contains the ID of the group whose contacts should be |
| 424 // returned. Group IDs generally look like this: |
| 425 // http://www.google.com/m8/feeds/groups/user%40gmail.com/base/6 |
| 426 std::string group_id_; |
| 427 |
398 // If is_null() is false, contains a minimum last-updated time that will be | 428 // If is_null() is false, contains a minimum last-updated time that will be |
399 // used to filter contacts. | 429 // used to filter contacts. |
400 base::Time min_update_time_; | 430 base::Time min_update_time_; |
401 | 431 |
402 DISALLOW_COPY_AND_ASSIGN(GetContactsOperation); | 432 DISALLOW_COPY_AND_ASSIGN(GetContactsOperation); |
403 }; | 433 }; |
404 | 434 |
405 //========================== GetContactPhotoOperation ========================== | 435 //========================== GetContactPhotoOperation ========================== |
406 | 436 |
407 // This class fetches a contact's photo. | 437 // This class fetches a contact's photo. |
(...skipping 16 matching lines...) Expand all Loading... |
424 | 454 |
425 // Callback to which the photo data is passed. | 455 // Callback to which the photo data is passed. |
426 GetDownloadDataCallback callback_; | 456 GetDownloadDataCallback callback_; |
427 | 457 |
428 DISALLOW_COPY_AND_ASSIGN(GetContactPhotoOperation); | 458 DISALLOW_COPY_AND_ASSIGN(GetContactPhotoOperation); |
429 }; | 459 }; |
430 | 460 |
431 } // namespace gdata | 461 } // namespace gdata |
432 | 462 |
433 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_OPERATIONS_H_ | 463 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_OPERATIONS_H_ |
OLD | NEW |