| 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 // MediaFileSystemRegistry implementation. | 5 // MediaFileSystemRegistry implementation. |
| 6 | 6 |
| 7 #include "chrome/browser/media_gallery/media_file_system_registry.h" | 7 #include "chrome/browser/media_gallery/media_file_system_registry.h" |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 continue; | 286 continue; |
| 287 | 287 |
| 288 PrefIdFsInfoMap::const_iterator existing_info = | 288 PrefIdFsInfoMap::const_iterator existing_info = |
| 289 pref_id_map_.find(*pref_id_it); | 289 pref_id_map_.find(*pref_id_it); |
| 290 if (existing_info != pref_id_map_.end()) { | 290 if (existing_info != pref_id_map_.end()) { |
| 291 result.push_back(existing_info->second); | 291 result.push_back(existing_info->second); |
| 292 new_galleries.insert(*pref_id_it); | 292 new_galleries.insert(*pref_id_it); |
| 293 continue; | 293 continue; |
| 294 } | 294 } |
| 295 | 295 |
| 296 FilePath path = MediaStorageUtil::FindDevicePathById(device_id); | 296 FilePath path = gallery_info.AbsolutePath(); |
| 297 if (path.empty()) | 297 if (!path.IsAbsolute()) |
| 298 continue; | 298 continue; |
| 299 path = path.Append(gallery_info.path); | |
| 300 | 299 |
| 301 std::string fsid; | 300 std::string fsid; |
| 302 if (MediaStorageUtil::IsMassStorageDevice(device_id)) { | 301 if (MediaStorageUtil::IsMassStorageDevice(device_id)) { |
| 303 fsid = RegisterFileSystemForMassStorage(device_id, path); | 302 fsid = RegisterFileSystemForMassStorage(device_id, path); |
| 304 } else { | 303 } else { |
| 305 #if defined(SUPPORT_MEDIA_FILESYSTEM) | 304 #if defined(SUPPORT_MEDIA_FILESYSTEM) |
| 306 scoped_refptr<ScopedMediaDeviceMapEntry> mtp_device_host; | 305 scoped_refptr<ScopedMediaDeviceMapEntry> mtp_device_host; |
| 307 fsid = registry_->RegisterFileSystemForMtpDevice( | 306 fsid = registry_->RegisterFileSystemForMtpDevice( |
| 308 device_id, path, &mtp_device_host); | 307 device_id, path, &mtp_device_host); |
| 309 DCHECK(mtp_device_host.get()); | 308 DCHECK(mtp_device_host.get()); |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 630 extension_hosts_map_.find(profile); | 629 extension_hosts_map_.find(profile); |
| 631 DCHECK(extension_hosts != extension_hosts_map_.end()); | 630 DCHECK(extension_hosts != extension_hosts_map_.end()); |
| 632 ExtensionHostMap::size_type erase_count = | 631 ExtensionHostMap::size_type erase_count = |
| 633 extension_hosts->second.erase(extension_id); | 632 extension_hosts->second.erase(extension_id); |
| 634 DCHECK_EQ(1U, erase_count); | 633 DCHECK_EQ(1U, erase_count); |
| 635 if (extension_hosts->second.empty()) | 634 if (extension_hosts->second.empty()) |
| 636 extension_hosts_map_.erase(extension_hosts); | 635 extension_hosts_map_.erase(extension_hosts); |
| 637 } | 636 } |
| 638 | 637 |
| 639 } // namespace chrome | 638 } // namespace chrome |
| OLD | NEW |