| 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_controller.h" | 5 #include "chrome/browser/chromeos/imageburner/burn_controller.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "chrome/browser/chromeos/cros/cros_library.h" | 10 #include "chrome/browser/chromeos/cros/cros_library.h" |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 burn_manager_->Cancel(); | 120 burn_manager_->Cancel(); |
| 121 } | 121 } |
| 122 | 122 |
| 123 // BurnController override. | 123 // BurnController override. |
| 124 // May be called with empty values if there is a handler that has started | 124 // May be called with empty values if there is a handler that has started |
| 125 // burning, and thus set the target paths. | 125 // burning, and thus set the target paths. |
| 126 virtual void StartBurnImage(const base::FilePath& target_device_path, | 126 virtual void StartBurnImage(const base::FilePath& target_device_path, |
| 127 const base::FilePath& target_file_path) OVERRIDE { | 127 const base::FilePath& target_file_path) OVERRIDE { |
| 128 if (!target_device_path.empty() && !target_file_path.empty() && | 128 if (!target_device_path.empty() && !target_file_path.empty() && |
| 129 state_machine_->new_burn_posible()) { | 129 state_machine_->new_burn_posible()) { |
| 130 if (!NetworkStateHandler::Get()->DefaultNetwork()) { | 130 if (!NetworkHandler::Get()->network_state_handler()->DefaultNetwork()) { |
| 131 delegate_->OnNoNetwork(); | 131 delegate_->OnNoNetwork(); |
| 132 return; | 132 return; |
| 133 } | 133 } |
| 134 burn_manager_->set_target_device_path(target_device_path); | 134 burn_manager_->set_target_device_path(target_device_path); |
| 135 burn_manager_->set_target_file_path(target_file_path); | 135 burn_manager_->set_target_file_path(target_file_path); |
| 136 uint64 device_size = GetDeviceSize( | 136 uint64 device_size = GetDeviceSize( |
| 137 burn_manager_->target_device_path().value()); | 137 burn_manager_->target_device_path().value()); |
| 138 if (device_size < kMinDeviceSize) { | 138 if (device_size < kMinDeviceSize) { |
| 139 delegate_->OnDeviceTooSmall(device_size); | 139 delegate_->OnDeviceTooSmall(device_size); |
| 140 return; | 140 return; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 | 174 |
| 175 // static | 175 // static |
| 176 BurnController* BurnController::CreateBurnController( | 176 BurnController* BurnController::CreateBurnController( |
| 177 content::WebContents* web_contents, | 177 content::WebContents* web_contents, |
| 178 Delegate* delegate) { | 178 Delegate* delegate) { |
| 179 return new BurnControllerImpl(delegate); | 179 return new BurnControllerImpl(delegate); |
| 180 } | 180 } |
| 181 | 181 |
| 182 } // namespace imageburner | 182 } // namespace imageburner |
| 183 } // namespace chromeos | 183 } // namespace chromeos |
| OLD | NEW |