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 "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/files/file.h" | 9 #include "base/files/file.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 // thread is involved. |file| must be null on windows but non-null on | 35 // thread is involved. |file| must be null on windows but non-null on |
36 // posix systems. |file_path| is an absolute path on all systems. | 36 // posix systems. |file_path| is an absolute path on all systems. |
37 DragDownloadFile(const base::FilePath& file_path, | 37 DragDownloadFile(const base::FilePath& file_path, |
38 base::File file, | 38 base::File file, |
39 const GURL& url, | 39 const GURL& url, |
40 const Referrer& referrer, | 40 const Referrer& referrer, |
41 const std::string& referrer_encoding, | 41 const std::string& referrer_encoding, |
42 WebContents* web_contents); | 42 WebContents* web_contents); |
43 | 43 |
44 // DownloadFileProvider methods. | 44 // DownloadFileProvider methods. |
45 virtual void Start(ui::DownloadFileObserver* observer) OVERRIDE; | 45 virtual void Start(ui::DownloadFileObserver* observer) override; |
46 virtual bool Wait() OVERRIDE; | 46 virtual bool Wait() override; |
47 virtual void Stop() OVERRIDE; | 47 virtual void Stop() override; |
48 | 48 |
49 private: | 49 private: |
50 class DragDownloadFileUI; | 50 class DragDownloadFileUI; |
51 enum State {INITIALIZED, STARTED, SUCCESS, FAILURE}; | 51 enum State {INITIALIZED, STARTED, SUCCESS, FAILURE}; |
52 | 52 |
53 virtual ~DragDownloadFile(); | 53 virtual ~DragDownloadFile(); |
54 | 54 |
55 void DownloadCompleted(bool is_successful); | 55 void DownloadCompleted(bool is_successful); |
56 void CheckThread(); | 56 void CheckThread(); |
57 | 57 |
58 base::FilePath file_path_; | 58 base::FilePath file_path_; |
59 base::File file_; | 59 base::File file_; |
60 base::MessageLoop* drag_message_loop_; | 60 base::MessageLoop* drag_message_loop_; |
61 State state_; | 61 State state_; |
62 scoped_refptr<ui::DownloadFileObserver> observer_; | 62 scoped_refptr<ui::DownloadFileObserver> observer_; |
63 base::RunLoop nested_loop_; | 63 base::RunLoop nested_loop_; |
64 DragDownloadFileUI* drag_ui_; | 64 DragDownloadFileUI* drag_ui_; |
65 base::WeakPtrFactory<DragDownloadFile> weak_ptr_factory_; | 65 base::WeakPtrFactory<DragDownloadFile> weak_ptr_factory_; |
66 | 66 |
67 DISALLOW_COPY_AND_ASSIGN(DragDownloadFile); | 67 DISALLOW_COPY_AND_ASSIGN(DragDownloadFile); |
68 }; | 68 }; |
69 | 69 |
70 } // namespace content | 70 } // namespace content |
71 | 71 |
72 #endif // CONTENT_BROWSER_DOWNLOAD_DRAG_DOWNLOAD_FILE_H_ | 72 #endif // CONTENT_BROWSER_DOWNLOAD_DRAG_DOWNLOAD_FILE_H_ |
OLD | NEW |