| 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/chromeos/imageburner/burn_manager.h" | 5 #include "chrome/browser/chromeos/imageburner/burn_manager.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "base/threading/worker_pool.h" | 10 #include "base/threading/worker_pool.h" |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 base::Bind(&BurnManager::NotifyDeviceRemoved, weak_ptr)); | 231 base::Bind(&BurnManager::NotifyDeviceRemoved, weak_ptr)); |
| 232 DBusThreadManager::Get()->GetImageBurnerClient()->SetEventHandlers( | 232 DBusThreadManager::Get()->GetImageBurnerClient()->SetEventHandlers( |
| 233 base::Bind(&BurnManager::OnBurnFinished, | 233 base::Bind(&BurnManager::OnBurnFinished, |
| 234 weak_ptr_factory_.GetWeakPtr()), | 234 weak_ptr_factory_.GetWeakPtr()), |
| 235 base::Bind(&BurnManager::OnBurnProgressUpdate, | 235 base::Bind(&BurnManager::OnBurnProgressUpdate, |
| 236 weak_ptr_factory_.GetWeakPtr())); | 236 weak_ptr_factory_.GetWeakPtr())); |
| 237 } | 237 } |
| 238 | 238 |
| 239 BurnManager::~BurnManager() { | 239 BurnManager::~BurnManager() { |
| 240 if (image_dir_created_) { | 240 if (image_dir_created_) { |
| 241 base::Delete(image_dir_, true); | 241 base::DeleteFile(image_dir_, true); |
| 242 } | 242 } |
| 243 if (NetworkHandler::IsInitialized()) { | 243 if (NetworkHandler::IsInitialized()) { |
| 244 NetworkHandler::Get()->network_state_handler()->RemoveObserver( | 244 NetworkHandler::Get()->network_state_handler()->RemoveObserver( |
| 245 this, FROM_HERE); | 245 this, FROM_HERE); |
| 246 } | 246 } |
| 247 DBusThreadManager::Get()->GetImageBurnerClient()->ResetEventHandlers(); | 247 DBusThreadManager::Get()->GetImageBurnerClient()->ResetEventHandlers(); |
| 248 } | 248 } |
| 249 | 249 |
| 250 // static | 250 // static |
| 251 void BurnManager::Initialize( | 251 void BurnManager::Initialize( |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 646 // Note: in theory, this is not a part of notification, but cancelling | 646 // Note: in theory, this is not a part of notification, but cancelling |
| 647 // the running burning task. However, there is no good place to be in the | 647 // the running burning task. However, there is no good place to be in the |
| 648 // current code. | 648 // current code. |
| 649 // TODO(hidehiko): Clean this up after refactoring. | 649 // TODO(hidehiko): Clean this up after refactoring. |
| 650 OnError(IDS_IMAGEBURN_DEVICE_NOT_FOUND_ERROR); | 650 OnError(IDS_IMAGEBURN_DEVICE_NOT_FOUND_ERROR); |
| 651 } | 651 } |
| 652 } | 652 } |
| 653 | 653 |
| 654 } // namespace imageburner | 654 } // namespace imageburner |
| 655 } // namespace chromeos | 655 } // namespace chromeos |
| OLD | NEW |