1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef APP_DOWNLOAD_FILE_INTERFACE_H_
6 #define APP_DOWNLOAD_FILE_INTERFACE_H_
8 #include "build/build_config.h"
10 #include "base/basictypes.h"
11 #include "base/ref_counted.h"
19 // Defines the interface to observe the status of file download.
20 class DownloadFileObserver
21 : public base::RefCountedThreadSafe
<DownloadFileObserver
> {
23 virtual void OnDownloadCompleted(const FilePath
& file_path
) = 0;
24 virtual void OnDownloadAborted() = 0;
27 friend class base::RefCountedThreadSafe
<DownloadFileObserver
>;
28 virtual ~DownloadFileObserver() {}
31 // Defines the interface to control how a file is downloaded.
32 class DownloadFileProvider
33 : public base::RefCountedThreadSafe
<DownloadFileProvider
> {
35 virtual bool Start(DownloadFileObserver
* observer
) = 0;
36 virtual void Stop() = 0;
38 virtual IStream
* GetStream() = 0;
42 friend class base::RefCountedThreadSafe
<DownloadFileProvider
>;
43 virtual ~DownloadFileProvider() {}
46 #endif // APP_DOWNLOAD_FILE_INTERFACE_H_