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/component_updater/pnacl/pnacl_component_installer.h" | 5 #include "chrome/browser/component_updater/pnacl/pnacl_component_installer.h" |
6 | 6 |
7 #include "base/base_paths.h" | 7 #include "base/base_paths.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 } | 263 } |
264 | 264 |
265 // Passed the basic tests. Time to install it. | 265 // Passed the basic tests. Time to install it. |
266 base::FilePath path = GetPnaclBaseDirectory().AppendASCII( | 266 base::FilePath path = GetPnaclBaseDirectory().AppendASCII( |
267 version.GetString()); | 267 version.GetString()); |
268 if (file_util::PathExists(path)) { | 268 if (file_util::PathExists(path)) { |
269 LOG(WARNING) << "Target path already exists, not installing."; | 269 LOG(WARNING) << "Target path already exists, not installing."; |
270 NotifyInstallError(); | 270 NotifyInstallError(); |
271 return false; | 271 return false; |
272 } | 272 } |
273 if (!file_util::Move(unpack_path, path)) { | 273 if (!base::Move(unpack_path, path)) { |
274 LOG(WARNING) << "Move failed, not installing."; | 274 LOG(WARNING) << "Move failed, not installing."; |
275 NotifyInstallError(); | 275 NotifyInstallError(); |
276 return false; | 276 return false; |
277 } | 277 } |
278 | 278 |
279 // Installation is done. Now tell the rest of chrome. | 279 // Installation is done. Now tell the rest of chrome. |
280 // - The path service. | 280 // - The path service. |
281 // - Callbacks that requested an update. | 281 // - Callbacks that requested an update. |
282 set_current_version(version); | 282 set_current_version(version); |
283 NotifyInstallSuccess(); | 283 NotifyInstallSuccess(); |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 pnacl_component.installer = pci; | 476 pnacl_component.installer = pci; |
477 SetPnaclHash(&pnacl_component); | 477 SetPnaclHash(&pnacl_component); |
478 ComponentUpdateService::Status status = cus->CheckForUpdateSoon( | 478 ComponentUpdateService::Status status = cus->CheckForUpdateSoon( |
479 pnacl_component); | 479 pnacl_component); |
480 if (status != ComponentUpdateService::kOk) { | 480 if (status != ComponentUpdateService::kOk) { |
481 installed.Run(false); | 481 installed.Run(false); |
482 return; | 482 return; |
483 } | 483 } |
484 pci->AddInstallCallback(installed); | 484 pci->AddInstallCallback(installed); |
485 } | 485 } |
OLD | NEW |