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/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
15 #include "base/run_loop.h" | 16 #include "base/run_loop.h" |
| 17 #include "base/single_thread_task_runner.h" |
16 #include "content/browser/download/download_file.h" | 18 #include "content/browser/download/download_file.h" |
17 #include "content/common/content_export.h" | 19 #include "content/common/content_export.h" |
18 #include "content/public/browser/download_item.h" | 20 #include "content/public/browser/download_item.h" |
19 #include "content/public/browser/download_manager.h" | 21 #include "content/public/browser/download_manager.h" |
20 #include "content/public/common/referrer.h" | 22 #include "content/public/common/referrer.h" |
21 #include "ui/base/dragdrop/download_file_interface.h" | 23 #include "ui/base/dragdrop/download_file_interface.h" |
22 #include "url/gurl.h" | 24 #include "url/gurl.h" |
23 | 25 |
24 namespace content { | 26 namespace content { |
25 | 27 |
(...skipping 26 matching lines...) Expand all Loading... |
52 class DragDownloadFileUI; | 54 class DragDownloadFileUI; |
53 enum State {INITIALIZED, STARTED, SUCCESS, FAILURE}; | 55 enum State {INITIALIZED, STARTED, SUCCESS, FAILURE}; |
54 | 56 |
55 ~DragDownloadFile() override; | 57 ~DragDownloadFile() override; |
56 | 58 |
57 void DownloadCompleted(bool is_successful); | 59 void DownloadCompleted(bool is_successful); |
58 void CheckThread(); | 60 void CheckThread(); |
59 | 61 |
60 base::FilePath file_path_; | 62 base::FilePath file_path_; |
61 base::File file_; | 63 base::File file_; |
62 base::MessageLoop* drag_message_loop_; | 64 const scoped_refptr<base::SingleThreadTaskRunner> drag_task_runner_; |
63 State state_; | 65 State state_; |
64 scoped_refptr<ui::DownloadFileObserver> observer_; | 66 scoped_refptr<ui::DownloadFileObserver> observer_; |
65 base::RunLoop nested_loop_; | 67 base::RunLoop nested_loop_; |
66 DragDownloadFileUI* drag_ui_; | 68 DragDownloadFileUI* drag_ui_; |
67 base::WeakPtrFactory<DragDownloadFile> weak_ptr_factory_; | 69 base::WeakPtrFactory<DragDownloadFile> weak_ptr_factory_; |
68 | 70 |
69 DISALLOW_COPY_AND_ASSIGN(DragDownloadFile); | 71 DISALLOW_COPY_AND_ASSIGN(DragDownloadFile); |
70 }; | 72 }; |
71 | 73 |
72 } // namespace content | 74 } // namespace content |
73 | 75 |
74 #endif // CONTENT_BROWSER_DOWNLOAD_DRAG_DOWNLOAD_FILE_H_ | 76 #endif // CONTENT_BROWSER_DOWNLOAD_DRAG_DOWNLOAD_FILE_H_ |
OLD | NEW |