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/file_path.h" | 8 #include "base/file_path.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "chrome/browser/chromeos/cros/burn_library.h" | 10 #include "chrome/browser/chromeos/cros/burn_library.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 // Name for hwid in machine statistics. | 31 // Name for hwid in machine statistics. |
32 const char kHwidStatistic[] = "hardware_class"; | 32 const char kHwidStatistic[] = "hardware_class"; |
33 | 33 |
34 const char kImageZipFileName[] = "chromeos_image.bin.zip"; | 34 const char kImageZipFileName[] = "chromeos_image.bin.zip"; |
35 | 35 |
36 // 3.9GB. It is less than 4GB because true device size ussually varies a little. | 36 // 3.9GB. It is less than 4GB because true device size ussually varies a little. |
37 const uint64 kMinDeviceSize = static_cast<uint64>(3.9 * 1000 * 1000 * 1000); | 37 const uint64 kMinDeviceSize = static_cast<uint64>(3.9 * 1000 * 1000 * 1000); |
38 | 38 |
39 // Returns true when |disk| is a device on which we can burn recovery image. | 39 // Returns true when |disk| is a device on which we can burn recovery image. |
40 bool IsBurnableDevice(const disks::DiskMountManager::Disk& disk) { | 40 bool IsBurnableDevice(const disks::DiskMountManager::Disk& disk) { |
41 return disk.is_parent() && !disk.on_boot_device(); | 41 return disk.is_parent() && !disk.on_boot_device() && |
| 42 (disk.device_type() == DEVICE_TYPE_USB || |
| 43 disk.device_type() == DEVICE_TYPE_SD); |
42 } | 44 } |
43 | 45 |
44 //////////////////////////////////////////////////////////////////////////////// | 46 //////////////////////////////////////////////////////////////////////////////// |
45 // | 47 // |
46 // BurnControllerTaskProxy | 48 // BurnControllerTaskProxy |
47 // | 49 // |
48 //////////////////////////////////////////////////////////////////////////////// | 50 //////////////////////////////////////////////////////////////////////////////// |
49 | 51 |
50 class BurnControllerTaskProxy | 52 class BurnControllerTaskProxy |
51 : public base::RefCountedThreadSafe<BurnControllerTaskProxy> { | 53 : public base::RefCountedThreadSafe<BurnControllerTaskProxy> { |
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
526 | 528 |
527 // static | 529 // static |
528 BurnController* BurnController::CreateBurnController( | 530 BurnController* BurnController::CreateBurnController( |
529 content::WebContents* web_contents, | 531 content::WebContents* web_contents, |
530 Delegate* delegate) { | 532 Delegate* delegate) { |
531 return new BurnControllerImpl(web_contents, delegate); | 533 return new BurnControllerImpl(web_contents, delegate); |
532 } | 534 } |
533 | 535 |
534 } // namespace imageburner | 536 } // namespace imageburner |
535 } // namespace chromeos | 537 } // namespace chromeos |
OLD | NEW |