| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef UI_BASE_DRAGDROP_DOWNLOAD_FILE_INTERFACE_H_ | 5 #ifndef UI_BASE_DRAGDROP_DOWNLOAD_FILE_INTERFACE_H_ |
| 6 #define UI_BASE_DRAGDROP_DOWNLOAD_FILE_INTERFACE_H_ | 6 #define UI_BASE_DRAGDROP_DOWNLOAD_FILE_INTERFACE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 | 13 |
| 14 #include "ui/base/ui_export.h" |
| 15 |
| 14 #if defined(OS_WIN) | 16 #if defined(OS_WIN) |
| 15 #include <objidl.h> | 17 #include <objidl.h> |
| 16 #endif | 18 #endif |
| 17 | 19 |
| 18 class FilePath; | 20 class FilePath; |
| 19 | 21 |
| 20 namespace ui { | 22 namespace ui { |
| 21 | 23 |
| 22 // Defines the interface to observe the status of file download. | 24 // Defines the interface to observe the status of file download. |
| 23 class DownloadFileObserver | 25 class UI_EXPORT DownloadFileObserver |
| 24 : public base::RefCountedThreadSafe<DownloadFileObserver> { | 26 : public base::RefCountedThreadSafe<DownloadFileObserver> { |
| 25 public: | 27 public: |
| 26 virtual void OnDownloadCompleted(const FilePath& file_path) = 0; | 28 virtual void OnDownloadCompleted(const FilePath& file_path) = 0; |
| 27 virtual void OnDownloadAborted() = 0; | 29 virtual void OnDownloadAborted() = 0; |
| 28 | 30 |
| 29 protected: | 31 protected: |
| 30 friend class base::RefCountedThreadSafe<DownloadFileObserver>; | 32 friend class base::RefCountedThreadSafe<DownloadFileObserver>; |
| 31 virtual ~DownloadFileObserver() {} | 33 virtual ~DownloadFileObserver() {} |
| 32 }; | 34 }; |
| 33 | 35 |
| 34 // Defines the interface to control how a file is downloaded. | 36 // Defines the interface to control how a file is downloaded. |
| 35 class DownloadFileProvider | 37 class UI_EXPORT DownloadFileProvider |
| 36 : public base::RefCountedThreadSafe<DownloadFileProvider> { | 38 : public base::RefCountedThreadSafe<DownloadFileProvider> { |
| 37 public: | 39 public: |
| 38 virtual bool Start(DownloadFileObserver* observer) = 0; | 40 virtual bool Start(DownloadFileObserver* observer) = 0; |
| 39 virtual void Stop() = 0; | 41 virtual void Stop() = 0; |
| 40 #if defined(OS_WIN) | 42 #if defined(OS_WIN) |
| 41 virtual IStream* GetStream() = 0; | 43 virtual IStream* GetStream() = 0; |
| 42 #endif | 44 #endif |
| 43 | 45 |
| 44 protected: | 46 protected: |
| 45 friend class base::RefCountedThreadSafe<DownloadFileProvider>; | 47 friend class base::RefCountedThreadSafe<DownloadFileProvider>; |
| 46 virtual ~DownloadFileProvider() {} | 48 virtual ~DownloadFileProvider() {} |
| 47 }; | 49 }; |
| 48 | 50 |
| 49 } // namespace ui | 51 } // namespace ui |
| 50 | 52 |
| 51 #endif // UI_BASE_DRAGDROP_DOWNLOAD_FILE_INTERFACE_H_ | 53 #endif // UI_BASE_DRAGDROP_DOWNLOAD_FILE_INTERFACE_H_ |
| OLD | NEW |