OLD | NEW |
1 // Copyright (c) 2011 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/disks/disk_mount_manager.h" | 5 #include "chrome/browser/chromeos/disks/disk_mount_manager.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include <sys/statvfs.h> | 10 #include <sys/statvfs.h> |
11 | 11 |
(...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
625 return MOUNT_TYPE_DEVICE; | 625 return MOUNT_TYPE_DEVICE; |
626 else if (type_str == "network") | 626 else if (type_str == "network") |
627 return MOUNT_TYPE_NETWORK_STORAGE; | 627 return MOUNT_TYPE_NETWORK_STORAGE; |
628 else if (type_str == "file") | 628 else if (type_str == "file") |
629 return MOUNT_TYPE_ARCHIVE; | 629 return MOUNT_TYPE_ARCHIVE; |
630 else | 630 else |
631 return MOUNT_TYPE_INVALID; | 631 return MOUNT_TYPE_INVALID; |
632 } | 632 } |
633 | 633 |
634 // static | 634 // static |
| 635 std::string DiskMountManager::DeviceTypeToString(DeviceType type) { |
| 636 switch (type) { |
| 637 case DEVICE_TYPE_USB: |
| 638 return "usb"; |
| 639 case DEVICE_TYPE_SD: |
| 640 return "sd"; |
| 641 case DEVICE_TYPE_OPTICAL_DISC: |
| 642 return "optical"; |
| 643 case DEVICE_TYPE_MOBILE: |
| 644 return "mobile"; |
| 645 default: |
| 646 return "unknown"; |
| 647 } |
| 648 } |
| 649 |
| 650 // static |
635 void DiskMountManager::Initialize() { | 651 void DiskMountManager::Initialize() { |
636 if (g_disk_mount_manager) { | 652 if (g_disk_mount_manager) { |
637 LOG(WARNING) << "DiskMountManager was already initialized"; | 653 LOG(WARNING) << "DiskMountManager was already initialized"; |
638 return; | 654 return; |
639 } | 655 } |
640 g_disk_mount_manager = new DiskMountManagerImpl(); | 656 g_disk_mount_manager = new DiskMountManagerImpl(); |
641 VLOG(1) << "DiskMountManager initialized"; | 657 VLOG(1) << "DiskMountManager initialized"; |
642 } | 658 } |
643 | 659 |
644 // static | 660 // static |
(...skipping 18 matching lines...) Expand all Loading... |
663 VLOG(1) << "DiskMountManager Shutdown completed"; | 679 VLOG(1) << "DiskMountManager Shutdown completed"; |
664 } | 680 } |
665 | 681 |
666 // static | 682 // static |
667 DiskMountManager* DiskMountManager::GetInstance() { | 683 DiskMountManager* DiskMountManager::GetInstance() { |
668 return g_disk_mount_manager; | 684 return g_disk_mount_manager; |
669 } | 685 } |
670 | 686 |
671 } // namespace disks | 687 } // namespace disks |
672 } // namespace chromeos | 688 } // namespace chromeos |
OLD | NEW |