OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_BROWSER_DOWNLOAD_DRAG_DOWNLOAD_FILE_H_ | 5 #ifndef CONTENT_BROWSER_DOWNLOAD_DRAG_DOWNLOAD_FILE_H_ |
6 #define CONTENT_BROWSER_DOWNLOAD_DRAG_DOWNLOAD_FILE_H_ | 6 #define CONTENT_BROWSER_DOWNLOAD_DRAG_DOWNLOAD_FILE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "base/files/file.h" | 11 #include "base/files/file.h" |
12 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
16 #include "base/run_loop.h" | 16 #include "base/run_loop.h" |
17 #include "base/single_thread_task_runner.h" | 17 #include "base/single_thread_task_runner.h" |
18 #include "content/browser/download/download_file.h" | 18 #include "content/browser/download/download_file.h" |
19 #include "content/common/content_export.h" | 19 #include "content/common/content_export.h" |
20 #include "content/public/browser/download_item.h" | 20 #include "content/public/browser/download_item.h" |
21 #include "content/public/browser/download_manager.h" | 21 #include "content/public/browser/download_manager.h" |
22 #include "content/public/common/referrer.h" | 22 #include "content/public/common/referrer.h" |
23 #include "ui/base/dragdrop/download_file_interface.h" | 23 #include "ui/base/dragdrop/download_file_interface.h" |
24 #include "url/gurl.h" | 24 #include "url/gurl.h" |
25 | 25 |
26 namespace content { | 26 namespace content { |
27 | 27 |
28 class DownloadManager; | |
29 class WebContents; | 28 class WebContents; |
30 | 29 |
31 // This class implements downloading a file via dragging virtual files out of | 30 // This class implements downloading a file via dragging virtual files out of |
32 // the browser: | 31 // the browser: |
33 // http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2009-August/022118.html | 32 // http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2009-August/022118.html |
34 // http://www.html5rocks.com/en/tutorials/casestudies/box_dnd_download/ | 33 // http://www.html5rocks.com/en/tutorials/casestudies/box_dnd_download/ |
35 class CONTENT_EXPORT DragDownloadFile : public ui::DownloadFileProvider { | 34 class CONTENT_EXPORT DragDownloadFile : public ui::DownloadFileProvider { |
36 public: | 35 public: |
37 // On Windows, we need to download into a temporary file. On posix, we need to | 36 // On Windows, we need to download into a temporary file. On posix, we need to |
38 // download into a file that has already been created, so only the UI | 37 // download into a file that has already been created, so only the UI |
(...skipping 28 matching lines...) Expand all Loading... |
67 base::RunLoop nested_loop_; | 66 base::RunLoop nested_loop_; |
68 DragDownloadFileUI* drag_ui_; | 67 DragDownloadFileUI* drag_ui_; |
69 base::WeakPtrFactory<DragDownloadFile> weak_ptr_factory_; | 68 base::WeakPtrFactory<DragDownloadFile> weak_ptr_factory_; |
70 | 69 |
71 DISALLOW_COPY_AND_ASSIGN(DragDownloadFile); | 70 DISALLOW_COPY_AND_ASSIGN(DragDownloadFile); |
72 }; | 71 }; |
73 | 72 |
74 } // namespace content | 73 } // namespace content |
75 | 74 |
76 #endif // CONTENT_BROWSER_DOWNLOAD_DRAG_DOWNLOAD_FILE_H_ | 75 #endif // CONTENT_BROWSER_DOWNLOAD_DRAG_DOWNLOAD_FILE_H_ |
OLD | NEW |