| 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 #include "chrome/browser/extensions/startup_helper.h" | 5 #include "chrome/browser/extensions/startup_helper.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 base::ScopedTempDir temp_dir; | 172 base::ScopedTempDir temp_dir; |
| 173 | 173 |
| 174 if (!temp_dir.CreateUniqueTempDir()) { | 174 if (!temp_dir.CreateUniqueTempDir()) { |
| 175 *error = std::string("Failed to create temp dir"); | 175 *error = std::string("Failed to create temp dir"); |
| 176 return false; | 176 return false; |
| 177 } | 177 } |
| 178 | 178 |
| 179 base::RunLoop run_loop; | 179 base::RunLoop run_loop; |
| 180 CRXFileInfo file(path); | 180 CRXFileInfo file(path); |
| 181 scoped_refptr<ValidateCrxHelper> helper( | 181 scoped_refptr<ValidateCrxHelper> helper( |
| 182 new ValidateCrxHelper(file, temp_dir.path(), &run_loop)); | 182 new ValidateCrxHelper(file, temp_dir.GetPath(), &run_loop)); |
| 183 helper->Start(); | 183 helper->Start(); |
| 184 run_loop.Run(); | 184 run_loop.Run(); |
| 185 | 185 |
| 186 bool success = helper->success(); | 186 bool success = helper->success(); |
| 187 if (!success) | 187 if (!success) |
| 188 *error = base::UTF16ToUTF8(helper->error()); | 188 *error = base::UTF16ToUTF8(helper->error()); |
| 189 return success; | 189 return success; |
| 190 } | 190 } |
| 191 | 191 |
| 192 StartupHelper::~StartupHelper() { | 192 StartupHelper::~StartupHelper() { |
| 193 if (pack_job_.get()) | 193 if (pack_job_.get()) |
| 194 pack_job_->ClearClient(); | 194 pack_job_->ClearClient(); |
| 195 } | 195 } |
| 196 | 196 |
| 197 } // namespace extensions | 197 } // namespace extensions |
| OLD | NEW |