OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "base/files/file_util.h" | 5 #include "base/files/file_util.h" |
6 #include "chrome/browser/extensions/api/image_writer_private/error_messages.h" | 6 #include "chrome/browser/extensions/api/image_writer_private/error_messages.h" |
7 #include "chrome/browser/extensions/api/image_writer_private/write_from_file_ope
ration.h" | 7 #include "chrome/browser/extensions/api/image_writer_private/write_from_file_ope
ration.h" |
8 #include "content/public/browser/browser_thread.h" | 8 #include "content/public/browser/browser_thread.h" |
9 | 9 |
10 namespace extensions { | 10 namespace extensions { |
(...skipping 14 matching lines...) Expand all Loading... |
25 WriteFromFileOperation::~WriteFromFileOperation() {} | 25 WriteFromFileOperation::~WriteFromFileOperation() {} |
26 | 26 |
27 void WriteFromFileOperation::StartImpl() { | 27 void WriteFromFileOperation::StartImpl() { |
28 if (!base::PathExists(image_path_) || base::DirectoryExists(image_path_)) { | 28 if (!base::PathExists(image_path_) || base::DirectoryExists(image_path_)) { |
29 DLOG(ERROR) << "Source must exist and not be a directory."; | 29 DLOG(ERROR) << "Source must exist and not be a directory."; |
30 Error(error::kImageInvalid); | 30 Error(error::kImageInvalid); |
31 return; | 31 return; |
32 } | 32 } |
33 | 33 |
34 BrowserThread::PostTask( | 34 BrowserThread::PostTask( |
35 BrowserThread::FILE, | 35 BrowserThread::FILE, FROM_HERE, |
36 FROM_HERE, | 36 base::BindOnce( |
37 base::Bind( | 37 &WriteFromFileOperation::Unzip, this, |
38 &WriteFromFileOperation::Unzip, | |
39 this, | |
40 base::Bind( | 38 base::Bind( |
41 &WriteFromFileOperation::Write, | 39 &WriteFromFileOperation::Write, this, |
42 this, | 40 base::Bind(&WriteFromFileOperation::VerifyWrite, this, |
43 base::Bind(&WriteFromFileOperation::VerifyWrite, | |
44 this, | |
45 base::Bind(&WriteFromFileOperation::Finish, this))))); | 41 base::Bind(&WriteFromFileOperation::Finish, this))))); |
46 } | 42 } |
47 | 43 |
48 } // namespace image_writer | 44 } // namespace image_writer |
49 } // namespace extensions | 45 } // namespace extensions |
OLD | NEW |