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

Side by Side Diff: chrome/browser/storage_monitor/media_storage_util.cc

Issue 18286004: Move PathExists to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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/storage_monitor/media_storage_util.h" 5 #include "chrome/browser/storage_monitor/media_storage_util.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 26 matching lines...) Expand all
37 37
38 #if !defined(OS_WIN) 38 #if !defined(OS_WIN)
39 const char kRootPath[] = "/"; 39 const char kRootPath[] = "/";
40 #endif 40 #endif
41 41
42 void ValidatePathOnFileThread( 42 void ValidatePathOnFileThread(
43 const base::FilePath& path, 43 const base::FilePath& path,
44 const base::Callback<void(bool)>& callback) { 44 const base::Callback<void(bool)>& callback) {
45 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); 45 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
46 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, 46 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
47 base::Bind(callback, file_util::PathExists(path))); 47 base::Bind(callback, base::PathExists(path)));
48 } 48 }
49 49
50 typedef std::vector<StorageInfo> StorageInfoList; 50 typedef std::vector<StorageInfo> StorageInfoList;
51 51
52 base::FilePath::StringType FindRemovableStorageLocationById( 52 base::FilePath::StringType FindRemovableStorageLocationById(
53 const std::string& device_id) { 53 const std::string& device_id) {
54 StorageInfoList devices = 54 StorageInfoList devices =
55 StorageMonitor::GetInstance()->GetAllAvailableStorages(); 55 StorageMonitor::GetInstance()->GetAllAvailableStorages();
56 for (StorageInfoList::const_iterator it = devices.begin(); 56 for (StorageInfoList::const_iterator it = devices.begin();
57 it != devices.end(); ++it) { 57 it != devices.end(); ++it) {
(...skipping 14 matching lines...) Expand all
72 StorageInfo::Type type; 72 StorageInfo::Type type;
73 std::string unique_id; 73 std::string unique_id;
74 if (!StorageInfo::CrackDeviceId(*it, &type, &unique_id)) { 74 if (!StorageInfo::CrackDeviceId(*it, &type, &unique_id)) {
75 missing_devices.insert(*it); 75 missing_devices.insert(*it);
76 continue; 76 continue;
77 } 77 }
78 78
79 if (type == StorageInfo::FIXED_MASS_STORAGE || 79 if (type == StorageInfo::FIXED_MASS_STORAGE ||
80 type == StorageInfo::ITUNES || 80 type == StorageInfo::ITUNES ||
81 type == StorageInfo::PICASA) { 81 type == StorageInfo::PICASA) {
82 if (!file_util::PathExists(base::FilePath::FromUTF8Unsafe(unique_id))) 82 if (!base::PathExists(base::FilePath::FromUTF8Unsafe(unique_id)))
83 missing_devices.insert(*it); 83 missing_devices.insert(*it);
84 continue; 84 continue;
85 } 85 }
86 86
87 if (!MediaStorageUtil::IsRemovableStorageAttached(*it)) 87 if (!MediaStorageUtil::IsRemovableStorageAttached(*it))
88 missing_devices.insert(*it); 88 missing_devices.insert(*it);
89 } 89 }
90 90
91 for (MediaStorageUtil::DeviceIdSet::const_iterator it = 91 for (MediaStorageUtil::DeviceIdSet::const_iterator it =
92 missing_devices.begin(); 92 missing_devices.begin();
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 StorageMonitor::GetInstance()->GetAllAvailableStorages(); 246 StorageMonitor::GetInstance()->GetAllAvailableStorages();
247 for (StorageInfoList::const_iterator it = devices.begin(); 247 for (StorageInfoList::const_iterator it = devices.begin();
248 it != devices.end(); ++it) { 248 it != devices.end(); ++it) {
249 if (StorageInfo::IsRemovableDevice(id) && it->device_id() == id) 249 if (StorageInfo::IsRemovableDevice(id) && it->device_id() == id)
250 return true; 250 return true;
251 } 251 }
252 return false; 252 return false;
253 } 253 }
254 254
255 } // namespace chrome 255 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/spellchecker/spellcheck_service_browsertest.cc ('k') | chrome/browser/sync/profile_sync_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698