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/disks/disk_mount_manager.h" | 5 #include "chrome/browser/chromeos/disks/disk_mount_manager.h" |
6 | 6 |
7 #include <sys/statvfs.h> | 7 #include <sys/statvfs.h> |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 delete iter->second; | 369 delete iter->second; |
370 disks_.erase(iter); | 370 disks_.erase(iter); |
371 is_new = false; | 371 is_new = false; |
372 } | 372 } |
373 Disk* disk = new Disk(disk_info.device_path(), | 373 Disk* disk = new Disk(disk_info.device_path(), |
374 disk_info.mount_path(), | 374 disk_info.mount_path(), |
375 disk_info.system_path(), | 375 disk_info.system_path(), |
376 disk_info.file_path(), | 376 disk_info.file_path(), |
377 disk_info.label(), | 377 disk_info.label(), |
378 disk_info.drive_label(), | 378 disk_info.drive_label(), |
| 379 disk_info.uuid(), |
379 FindSystemPathPrefix(disk_info.system_path()), | 380 FindSystemPathPrefix(disk_info.system_path()), |
380 disk_info.device_type(), | 381 disk_info.device_type(), |
381 disk_info.total_size_in_bytes(), | 382 disk_info.total_size_in_bytes(), |
382 disk_info.is_drive(), | 383 disk_info.is_drive(), |
383 disk_info.is_read_only(), | 384 disk_info.is_read_only(), |
384 disk_info.has_media(), | 385 disk_info.has_media(), |
385 disk_info.on_boot_device(), | 386 disk_info.on_boot_device(), |
386 disk_info.is_hidden()); | 387 disk_info.is_hidden()); |
387 disks_.insert(std::make_pair(disk_info.device_path(), disk)); | 388 disks_.insert(std::make_pair(disk_info.device_path(), disk)); |
388 NotifyDiskStatusUpdate(is_new ? MOUNT_DISK_ADDED : MOUNT_DISK_CHANGED, | 389 NotifyDiskStatusUpdate(is_new ? MOUNT_DISK_ADDED : MOUNT_DISK_CHANGED, |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
559 }; | 560 }; |
560 | 561 |
561 } // namespace | 562 } // namespace |
562 | 563 |
563 DiskMountManager::Disk::Disk(const std::string& device_path, | 564 DiskMountManager::Disk::Disk(const std::string& device_path, |
564 const std::string& mount_path, | 565 const std::string& mount_path, |
565 const std::string& system_path, | 566 const std::string& system_path, |
566 const std::string& file_path, | 567 const std::string& file_path, |
567 const std::string& device_label, | 568 const std::string& device_label, |
568 const std::string& drive_label, | 569 const std::string& drive_label, |
| 570 const std::string& fs_uuid, |
569 const std::string& system_path_prefix, | 571 const std::string& system_path_prefix, |
570 DeviceType device_type, | 572 DeviceType device_type, |
571 uint64 total_size_in_bytes, | 573 uint64 total_size_in_bytes, |
572 bool is_parent, | 574 bool is_parent, |
573 bool is_read_only, | 575 bool is_read_only, |
574 bool has_media, | 576 bool has_media, |
575 bool on_boot_device, | 577 bool on_boot_device, |
576 bool is_hidden) | 578 bool is_hidden) |
577 : device_path_(device_path), | 579 : device_path_(device_path), |
578 mount_path_(mount_path), | 580 mount_path_(mount_path), |
579 system_path_(system_path), | 581 system_path_(system_path), |
580 file_path_(file_path), | 582 file_path_(file_path), |
581 device_label_(device_label), | 583 device_label_(device_label), |
582 drive_label_(drive_label), | 584 drive_label_(drive_label), |
| 585 fs_uuid_(fs_uuid), |
583 system_path_prefix_(system_path_prefix), | 586 system_path_prefix_(system_path_prefix), |
584 device_type_(device_type), | 587 device_type_(device_type), |
585 total_size_in_bytes_(total_size_in_bytes), | 588 total_size_in_bytes_(total_size_in_bytes), |
586 is_parent_(is_parent), | 589 is_parent_(is_parent), |
587 is_read_only_(is_read_only), | 590 is_read_only_(is_read_only), |
588 has_media_(has_media), | 591 has_media_(has_media), |
589 on_boot_device_(on_boot_device), | 592 on_boot_device_(on_boot_device), |
590 is_hidden_(is_hidden) { | 593 is_hidden_(is_hidden) { |
591 } | 594 } |
592 | 595 |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
688 VLOG(1) << "DiskMountManager Shutdown completed"; | 691 VLOG(1) << "DiskMountManager Shutdown completed"; |
689 } | 692 } |
690 | 693 |
691 // static | 694 // static |
692 DiskMountManager* DiskMountManager::GetInstance() { | 695 DiskMountManager* DiskMountManager::GetInstance() { |
693 return g_disk_mount_manager; | 696 return g_disk_mount_manager; |
694 } | 697 } |
695 | 698 |
696 } // namespace disks | 699 } // namespace disks |
697 } // namespace chromeos | 700 } // namespace chromeos |
OLD | NEW |