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