| OLD | NEW |
| (Empty) |
| 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. | |
| 4 | |
| 5 #ifndef APP_DOWNLOAD_FILE_INTERFACE_H_ | |
| 6 #define APP_DOWNLOAD_FILE_INTERFACE_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include "build/build_config.h" | |
| 10 | |
| 11 #include "base/basictypes.h" | |
| 12 #include "base/ref_counted.h" | |
| 13 | |
| 14 #if defined(OS_WIN) | |
| 15 #include <objidl.h> | |
| 16 #endif | |
| 17 | |
| 18 class FilePath; | |
| 19 | |
| 20 // Defines the interface to observe the status of file download. | |
| 21 class DownloadFileObserver | |
| 22 : public base::RefCountedThreadSafe<DownloadFileObserver> { | |
| 23 public: | |
| 24 virtual void OnDownloadCompleted(const FilePath& file_path) = 0; | |
| 25 virtual void OnDownloadAborted() = 0; | |
| 26 | |
| 27 protected: | |
| 28 friend class base::RefCountedThreadSafe<DownloadFileObserver>; | |
| 29 virtual ~DownloadFileObserver() {} | |
| 30 }; | |
| 31 | |
| 32 // Defines the interface to control how a file is downloaded. | |
| 33 class DownloadFileProvider | |
| 34 : public base::RefCountedThreadSafe<DownloadFileProvider> { | |
| 35 public: | |
| 36 virtual bool Start(DownloadFileObserver* observer) = 0; | |
| 37 virtual void Stop() = 0; | |
| 38 #if defined(OS_WIN) | |
| 39 virtual IStream* GetStream() = 0; | |
| 40 #endif | |
| 41 | |
| 42 protected: | |
| 43 friend class base::RefCountedThreadSafe<DownloadFileProvider>; | |
| 44 virtual ~DownloadFileProvider() {} | |
| 45 }; | |
| 46 | |
| 47 #endif // APP_DOWNLOAD_FILE_INTERFACE_H_ | |
| OLD | NEW |