| Index: chrome/browser/chromeos/drive/drive_scheduler.h
|
| diff --git a/chrome/browser/chromeos/drive/drive_scheduler.h b/chrome/browser/chromeos/drive/drive_scheduler.h
|
| index 59092fb9098199f40e7acb4450d9bee939251ed7..2d187a811990513f469c2908ad8977b0c903f97b 100644
|
| --- a/chrome/browser/chromeos/drive/drive_scheduler.h
|
| +++ b/chrome/browser/chromeos/drive/drive_scheduler.h
|
| @@ -8,6 +8,7 @@
|
| #include "base/memory/linked_ptr.h"
|
| #include "base/memory/scoped_ptr.h"
|
| #include "chrome/browser/chromeos/drive/drive_file_system_interface.h"
|
| +#include "chrome/browser/google_apis/drive_service_interface.h"
|
| #include "net/base/network_change_notifier.h"
|
|
|
| #include <deque>
|
| @@ -33,6 +34,7 @@ class DriveScheduler
|
| // Enum representing the type of job.
|
| enum JobType {
|
| TYPE_COPY,
|
| + TYPE_GET_DOCUMENTS,
|
| TYPE_MOVE,
|
| TYPE_REMOVE,
|
| TYPE_TRANSFER_LOCAL_TO_REMOTE,
|
| @@ -76,6 +78,7 @@ class DriveScheduler
|
| };
|
|
|
| DriveScheduler(Profile* profile,
|
| + google_apis::DriveServiceInterface* drive_service,
|
| file_system::DriveOperations* drive_operations);
|
| virtual ~DriveScheduler();
|
|
|
| @@ -88,6 +91,14 @@ class DriveScheduler
|
| const FilePath& dest_file_path,
|
| const FileOperationCallback& callback);
|
|
|
| + // Adds a GetDocuments operation to the queue.
|
| + void GetDocuments(const GURL& feed_url,
|
| + int64 start_changestamp,
|
| + const std::string& search_query,
|
| + bool shared_with_me,
|
| + const std::string& directory_resource_id,
|
| + const google_apis::GetDataCallback& callback);
|
| +
|
| // Adds a transfer operation to the queue.
|
| void TransferFileFromRemoteToLocal(const FilePath& remote_src_file_path,
|
| const FilePath& local_dest_file_path,
|
| @@ -119,8 +130,7 @@ class DriveScheduler
|
| // Represents a single entry in the job queue.
|
| struct QueueEntry {
|
| QueueEntry(JobType in_job_type,
|
| - FilePath in_file_path,
|
| - FileOperationCallback in_callback);
|
| + FilePath in_file_path);
|
| ~QueueEntry();
|
|
|
| JobInfo job_info;
|
| @@ -133,7 +143,7 @@ class DriveScheduler
|
| // TYPE_TRANSFER_LOCAL_TO_REMOTE,
|
| // TYPE_TRANSFER_REGULAR_FILE,
|
| // TYPE_TRANSFER_REMOTE_TO_LOCAL
|
| - FileOperationCallback callback;
|
| + FileOperationCallback file_operation_callback;
|
|
|
| // Destination of the operation.
|
| // Used by:
|
| @@ -144,8 +154,18 @@ class DriveScheduler
|
| // TYPE_TRANSFER_REMOTE_TO_LOCAL
|
| FilePath dest_file_path;
|
|
|
| - // Whether the operation is recursive. Used by: TYPE_REMOVE
|
| + // Whether the operation is recursive. Used by:
|
| + // TYPE_REMOVE
|
| bool is_recursive;
|
| +
|
| + // Parameters for GetDocuments(). Used by:
|
| + // TYPE_GET_DOCUMENTS
|
| + GURL feed_url;
|
| + int64 start_changestamp;
|
| + std::string search_query;
|
| + bool shared_with_me;
|
| + std::string directory_resource_id;
|
| + google_apis::GetDataCallback get_data_callback;
|
| };
|
|
|
| // Adds the specified job to the queue. Takes ownership of |job|
|
| @@ -172,7 +192,14 @@ class DriveScheduler
|
|
|
| // Callback for job finishing. Retries the job if needed, otherwise cleans up
|
| // the job, invokes the callback, and continues the job loop.
|
| - void OnJobDone(int job_id, DriveFileError error);
|
| + void OnFileOperationJobDone(int job_id, DriveFileError error);
|
| +
|
| + // Callback for job finishing with a GetDataCallback. Retries the job if
|
| + // needed, otherwise cleans up the job, invokes the callback, and continues
|
| + // the job loop.
|
| + void OnGetDataJobDone(int job_id,
|
| + google_apis::GDataErrorCode error,
|
| + scoped_ptr<base::Value> feed_data);
|
|
|
| // net::NetworkChangeNotifier::ConnectionTypeObserver override.
|
| virtual void OnConnectionTypeChanged(
|
| @@ -206,6 +233,8 @@ class DriveScheduler
|
| // Drive operations.
|
| file_system::DriveOperations* drive_operations_;
|
|
|
| + google_apis::DriveServiceInterface* drive_service_;
|
| +
|
| Profile* profile_;
|
|
|
| // Note: This should remain the last member so it'll be destroyed and
|
|
|