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

Unified Diff: chrome/browser/google_apis/gdata_wapi_operations.h

Issue 12088104: Move DownloadFileOperation to base_operations. (Closed) Base URL: http://git.chromium.org/chromium/src.git@b148627_download_file_3_test_util
Patch Set: Rebase Created 7 years, 10 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/google_apis/gdata_wapi_operations.h
diff --git a/chrome/browser/google_apis/gdata_wapi_operations.h b/chrome/browser/google_apis/gdata_wapi_operations.h
index ef1c544c830561e0888af391937a7d56d5d2b2d7..edb36b61481b328a6353836395c19949c4b5d082 100644
--- a/chrome/browser/google_apis/gdata_wapi_operations.h
+++ b/chrome/browser/google_apis/gdata_wapi_operations.h
@@ -124,65 +124,6 @@ class GetAccountMetadataOperation : public GetDataOperation {
DISALLOW_COPY_AND_ASSIGN(GetAccountMetadataOperation);
};
-//============================ DownloadFileOperation ===========================
-
-// Callback type for DownloadHostedDocument/DownloadFile
-// DocumentServiceInterface calls.
-typedef base::Callback<void(GDataErrorCode error,
- const FilePath& temp_file)> DownloadActionCallback;
-
-// This class performs the operation for downloading of a given document/file.
-class DownloadFileOperation : public UrlFetchOperationBase {
- public:
- // download_action_callback:
- // This callback is called when the download is complete. Must not be null.
- //
- // get_content_callback:
- // This callback is called when some part of the content is
- // read. Used to read the download content progressively. May be null.
- //
- // content_url:
- // Specifies the target file to download.
- //
- // drive_file_path:
- // Specifies the drive path of the target file. Shown in UI.
- // TODO(satorux): Remove the drive file path hack. crbug.com/163296
- //
- // output_file_path:
- // Specifies the file path to save the downloaded file.
- //
- DownloadFileOperation(
- OperationRegistry* registry,
- net::URLRequestContextGetter* url_request_context_getter,
- const DownloadActionCallback& download_action_callback,
- const GetContentCallback& get_content_callback,
- const GURL& content_url,
- const FilePath& drive_file_path,
- const FilePath& output_file_path);
- virtual ~DownloadFileOperation();
-
- protected:
- // UrlFetchOperationBase overrides.
- virtual GURL GetURL() const OVERRIDE;
- virtual void ProcessURLFetchResults(const net::URLFetcher* source) OVERRIDE;
- virtual void RunCallbackOnPrematureFailure(GDataErrorCode code) OVERRIDE;
-
- // net::URLFetcherDelegate overrides.
- virtual void OnURLFetchDownloadProgress(const net::URLFetcher* source,
- int64 current, int64 total) OVERRIDE;
- virtual bool ShouldSendDownloadData() OVERRIDE;
- virtual void OnURLFetchDownloadData(
- const net::URLFetcher* source,
- scoped_ptr<std::string> download_data) OVERRIDE;
-
- private:
- const DownloadActionCallback download_action_callback_;
- const GetContentCallback get_content_callback_;
- const GURL content_url_;
-
- DISALLOW_COPY_AND_ASSIGN(DownloadFileOperation);
-};
-
//=========================== DeleteResourceOperation ==========================
// This class performs the operation for deleting a resource.
« no previous file with comments | « chrome/browser/google_apis/base_operations_server_unittest.cc ('k') | chrome/browser/google_apis/gdata_wapi_operations.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698