Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(90)

Side by Side Diff: chrome/browser/chromeos/imageburner/burn_controller.cc

Issue 9019002: [CrosDisksClient] Determine device type from DeviceMediaType property sent by cros-disks. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698