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 #include "content/browser/download/drag_download_util.h" | 5 #include "content/browser/download/drag_download_util.h" |
6 | 6 |
| 7 #include "base/bind.h" |
7 #include "base/file_path.h" | 8 #include "base/file_path.h" |
8 #include "base/file_util.h" | 9 #include "base/file_util.h" |
9 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
10 #include "base/string_number_conversions.h" | 11 #include "base/string_number_conversions.h" |
11 #include "base/string_util.h" | 12 #include "base/string_util.h" |
12 #include "base/task.h" | |
13 #include "base/utf_string_conversions.h" | 13 #include "base/utf_string_conversions.h" |
14 #include "content/public/browser/browser_thread.h" | 14 #include "content/public/browser/browser_thread.h" |
15 #include "googleurl/src/gurl.h" | 15 #include "googleurl/src/gurl.h" |
16 #include "net/base/file_stream.h" | 16 #include "net/base/file_stream.h" |
17 #include "net/base/net_errors.h" | 17 #include "net/base/net_errors.h" |
18 | 18 |
19 using content::BrowserThread; | 19 using content::BrowserThread; |
20 using net::FileStream; | 20 using net::FileStream; |
21 | 21 |
22 namespace drag_download_util { | 22 namespace drag_download_util { |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 PromiseFileFinalizer::~PromiseFileFinalizer() {} | 95 PromiseFileFinalizer::~PromiseFileFinalizer() {} |
96 | 96 |
97 void PromiseFileFinalizer::Cleanup() { | 97 void PromiseFileFinalizer::Cleanup() { |
98 if (drag_file_downloader_.get()) | 98 if (drag_file_downloader_.get()) |
99 drag_file_downloader_ = NULL; | 99 drag_file_downloader_ = NULL; |
100 } | 100 } |
101 | 101 |
102 void PromiseFileFinalizer::OnDownloadCompleted(const FilePath& file_path) { | 102 void PromiseFileFinalizer::OnDownloadCompleted(const FilePath& file_path) { |
103 BrowserThread::PostTask( | 103 BrowserThread::PostTask( |
104 BrowserThread::UI, FROM_HERE, | 104 BrowserThread::UI, FROM_HERE, |
105 NewRunnableMethod(this, &PromiseFileFinalizer::Cleanup)); | 105 base::Bind(&PromiseFileFinalizer::Cleanup, this)); |
106 } | 106 } |
107 | 107 |
108 void PromiseFileFinalizer::OnDownloadAborted() { | 108 void PromiseFileFinalizer::OnDownloadAborted() { |
109 BrowserThread::PostTask( | 109 BrowserThread::PostTask( |
110 BrowserThread::UI, FROM_HERE, | 110 BrowserThread::UI, FROM_HERE, |
111 NewRunnableMethod(this, &PromiseFileFinalizer::Cleanup)); | 111 base::Bind(&PromiseFileFinalizer::Cleanup, this)); |
112 } | 112 } |
113 | 113 |
114 } // namespace drag_download_util | 114 } // namespace drag_download_util |
OLD | NEW |