| Index: chrome/browser/net/file_downloader.h
|
| diff --git a/chrome/browser/supervised_user/experimental/supervised_user_blacklist_downloader.h b/chrome/browser/net/file_downloader.h
|
| similarity index 48%
|
| rename from chrome/browser/supervised_user/experimental/supervised_user_blacklist_downloader.h
|
| rename to chrome/browser/net/file_downloader.h
|
| index 871d4e0e42383d8a9dd25d3ae5a2b0c108a9c3d6..2f1c6399162b19bca22517de2569003afe530a12 100644
|
| --- a/chrome/browser/supervised_user/experimental/supervised_user_blacklist_downloader.h
|
| +++ b/chrome/browser/net/file_downloader.h
|
| @@ -1,9 +1,9 @@
|
| -// Copyright 2014 The Chromium Authors. All rights reserved.
|
| +// Copyright 2015 The Chromium Authors. All rights reserved.
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#ifndef CHROME_BROWSER_SUPERVISED_USER_EXPERIMENTAL_SUPERVISED_USER_BLACKLIST_DOWNLOADER_H_
|
| -#define CHROME_BROWSER_SUPERVISED_USER_EXPERIMENTAL_SUPERVISED_USER_BLACKLIST_DOWNLOADER_H_
|
| +#ifndef CHROME_BROWSER_NET_FILE_DOWNLOADER_H_
|
| +#define CHROME_BROWSER_NET_FILE_DOWNLOADER_H_
|
|
|
| #include "base/callback.h"
|
| #include "base/memory/scoped_ptr.h"
|
| @@ -21,21 +21,21 @@ class URLRequestContextGetter;
|
|
|
| class GURL;
|
|
|
| -// Helper class to download a blacklist file from a given URL and store it in a
|
| -// local file. If the local file already exists, reports success without
|
| -// downloading anything.
|
| -class SupervisedUserBlacklistDownloader : public net::URLFetcherDelegate {
|
| +// Helper class to download a file from a given URL and store it in a local
|
| +// file. If the local file already exists, reports success without downloading
|
| +// anything.
|
| +// TODO(treib): Add a "bool overwrite" param?
|
| +class FileDownloader : public net::URLFetcherDelegate {
|
| public:
|
| typedef base::Callback<void(bool /* success */)> DownloadFinishedCallback;
|
|
|
| // Directly starts the download (if necessary) and runs |callback| when done.
|
| // If the instance is destroyed before it is finished, |callback| is not run.
|
| - SupervisedUserBlacklistDownloader(
|
| - const GURL& url,
|
| - const base::FilePath& path,
|
| - net::URLRequestContextGetter* request_context,
|
| - const DownloadFinishedCallback& callback);
|
| - ~SupervisedUserBlacklistDownloader() override;
|
| + FileDownloader(const GURL& url,
|
| + const base::FilePath& path,
|
| + net::URLRequestContextGetter* request_context,
|
| + const DownloadFinishedCallback& callback);
|
| + ~FileDownloader() override;
|
|
|
| private:
|
| // net::URLFetcherDelegate implementation.
|
| @@ -47,9 +47,9 @@ class SupervisedUserBlacklistDownloader : public net::URLFetcherDelegate {
|
|
|
| scoped_ptr<net::URLFetcher> fetcher_;
|
|
|
| - base::WeakPtrFactory<SupervisedUserBlacklistDownloader> weak_ptr_factory_;
|
| + base::WeakPtrFactory<FileDownloader> weak_ptr_factory_;
|
|
|
| - DISALLOW_COPY_AND_ASSIGN(SupervisedUserBlacklistDownloader);
|
| + DISALLOW_COPY_AND_ASSIGN(FileDownloader);
|
| };
|
|
|
| -#endif // CHROME_BROWSER_SUPERVISED_USER_EXPERIMENTAL_SUPERVISED_USER_BLACKLIST_DOWNLOADER_H_
|
| +#endif // CHROME_BROWSER_NET_FILE_DOWNLOADER_H_
|
|
|