| Index: chrome/browser/net/file_downloader.h
|
| diff --git a/chrome/browser/net/file_downloader.h b/chrome/browser/net/file_downloader.h
|
| index d6383188464f3af04f6a66d801c3785c61c02636..4db2b6b7e2582492f42e9eb37f2813ca11855f92 100644
|
| --- a/chrome/browser/net/file_downloader.h
|
| +++ b/chrome/browser/net/file_downloader.h
|
| @@ -25,7 +25,15 @@ class GURL;
|
| // downloading anything.
|
| class FileDownloader : public net::URLFetcherDelegate {
|
| public:
|
| - typedef base::Callback<void(bool /* success */)> DownloadFinishedCallback;
|
| + enum Result {
|
| + // The file was successfully downloaded.
|
| + DOWNLOADED,
|
| + // A local file at the given path already existed and was kept.
|
| + EXISTS,
|
| + // Downloading failed.
|
| + FAILED
|
| + };
|
| + using DownloadFinishedCallback = base::Callback<void(Result)>;
|
|
|
| // Directly starts the download (if necessary) and runs |callback| when done.
|
| // If the instance is destroyed before it is finished, |callback| is not run.
|
| @@ -36,6 +44,8 @@ class FileDownloader : public net::URLFetcherDelegate {
|
| const DownloadFinishedCallback& callback);
|
| ~FileDownloader() override;
|
|
|
| + static bool IsSuccess(Result result) { return result != FAILED; }
|
| +
|
| private:
|
| // net::URLFetcherDelegate implementation.
|
| void OnURLFetchComplete(const net::URLFetcher* source) override;
|
|
|