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 "chromeos/disks/disk_mount_manager.h" | 5 #include "chromeos/disks/disk_mount_manager.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <set> | 10 #include <set> |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 if (type == MOUNT_TYPE_DEVICE) { | 73 if (type == MOUNT_TYPE_DEVICE) { |
74 DiskMap::const_iterator it = disks_.find(source_path); | 74 DiskMap::const_iterator it = disks_.find(source_path); |
75 if (it == disks_.end() || it->second->is_hidden()) { | 75 if (it == disks_.end() || it->second->is_hidden()) { |
76 OnMountCompleted(MountEntry(MOUNT_ERROR_INTERNAL, source_path, type, | 76 OnMountCompleted(MountEntry(MOUNT_ERROR_INTERNAL, source_path, type, |
77 "")); | 77 "")); |
78 return; | 78 return; |
79 } | 79 } |
80 } | 80 } |
81 cros_disks_client_->Mount( | 81 cros_disks_client_->Mount( |
82 source_path, source_format, mount_label, access_mode, | 82 source_path, source_format, mount_label, access_mode, |
| 83 REMOUNT_OPTION_MOUNT_NEW_DEVICE, |
83 // When succeeds, OnMountCompleted will be called by | 84 // When succeeds, OnMountCompleted will be called by |
84 // "MountCompleted" signal instead. | 85 // "MountCompleted" signal instead. |
85 base::Bind(&base::DoNothing), | 86 base::Bind(&base::DoNothing), |
86 base::Bind(&DiskMountManagerImpl::OnMountCompleted, | 87 base::Bind(&DiskMountManagerImpl::OnMountCompleted, |
87 weak_ptr_factory_.GetWeakPtr(), | 88 weak_ptr_factory_.GetWeakPtr(), |
88 MountEntry(MOUNT_ERROR_INTERNAL, source_path, type, ""))); | 89 MountEntry(MOUNT_ERROR_INTERNAL, source_path, type, ""))); |
89 | 90 |
90 // Record the access mode option passed to CrosDisks. | 91 // Record the access mode option passed to CrosDisks. |
91 // This is needed because CrosDisks service methods doesn't return the info | 92 // This is needed because CrosDisks service methods doesn't return the info |
92 // via DBus. | 93 // via DBus. |
(...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
794 VLOG(1) << "DiskMountManager Shutdown completed"; | 795 VLOG(1) << "DiskMountManager Shutdown completed"; |
795 } | 796 } |
796 | 797 |
797 // static | 798 // static |
798 DiskMountManager* DiskMountManager::GetInstance() { | 799 DiskMountManager* DiskMountManager::GetInstance() { |
799 return g_disk_mount_manager; | 800 return g_disk_mount_manager; |
800 } | 801 } |
801 | 802 |
802 } // namespace disks | 803 } // namespace disks |
803 } // namespace chromeos | 804 } // namespace chromeos |
OLD | NEW |