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 #import "chrome/browser/storage_monitor/image_capture_device.h" | 5 #import "chrome/browser/storage_monitor/image_capture_device.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "chrome/browser/storage_monitor/media_storage_util.h" | |
9 #include "content/public/browser/browser_thread.h" | 8 #include "content/public/browser/browser_thread.h" |
10 | 9 |
11 namespace { | 10 namespace { |
12 | 11 |
13 void RenameFile(const base::FilePath& downloaded_filename, | 12 void RenameFile(const base::FilePath& downloaded_filename, |
14 const base::FilePath& desired_filename, | 13 const base::FilePath& desired_filename, |
15 base::PlatformFileError* result) { | 14 base::PlatformFileError* result) { |
16 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::FILE)); | 15 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::FILE)); |
17 bool success = file_util::ReplaceFile(downloaded_filename, desired_filename); | 16 bool success = file_util::ReplaceFile(downloaded_filename, desired_filename); |
18 *result = success ? base::PLATFORM_FILE_OK | 17 *result = success ? base::PLATFORM_FILE_OK |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 // Shared result value from file-copy closure to tell-listener closure. | 212 // Shared result value from file-copy closure to tell-listener closure. |
214 base::PlatformFileError* copyResult = new base::PlatformFileError(); | 213 base::PlatformFileError* copyResult = new base::PlatformFileError(); |
215 content::BrowserThread::PostTaskAndReply( | 214 content::BrowserThread::PostTaskAndReply( |
216 content::BrowserThread::FILE, | 215 content::BrowserThread::FILE, |
217 FROM_HERE, | 216 FROM_HERE, |
218 base::Bind(&RenameFile, savedPath, saveAsPath, copyResult), | 217 base::Bind(&RenameFile, savedPath, saveAsPath, copyResult), |
219 base::Bind(&ReturnRenameResultToListener, listener_, name, copyResult)); | 218 base::Bind(&ReturnRenameResultToListener, listener_, name, copyResult)); |
220 } | 219 } |
221 | 220 |
222 @end // ImageCaptureDevice | 221 @end // ImageCaptureDevice |
OLD | NEW |