| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "chrome/browser/media_gallery/media_device_notifications_utils.h" | |
| 6 | |
| 7 #include "base/file_util.h" | |
| 8 #include "base/string_util.h" | |
| 9 #include "content/public/browser/browser_thread.h" | |
| 10 | |
| 11 namespace { | |
| 12 | |
| 13 #if defined(OS_WIN) | |
| 14 const wchar_t kDCIMDirName[] = L"DCIM"; | |
| 15 #else | |
| 16 const char kDCIMDirName[] = "DCIM"; | |
| 17 #endif | |
| 18 | |
| 19 } // namespace | |
| 20 | |
| 21 namespace chrome { | |
| 22 | |
| 23 bool IsMediaDevice(const FilePath::StringType& mount_point) { | |
| 24 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::FILE)); | |
| 25 | |
| 26 FilePath dcim_path(mount_point); | |
| 27 FilePath::StringType dcim_dir = kDCIMDirName; | |
| 28 if (!file_util::DirectoryExists(dcim_path.Append(dcim_dir))) { | |
| 29 // Check for lowercase 'dcim' as well. | |
| 30 FilePath dcim_path_lower(dcim_path.Append(StringToLowerASCII(dcim_dir))); | |
| 31 if (!file_util::DirectoryExists(dcim_path_lower)) | |
| 32 return false; | |
| 33 } | |
| 34 return true; | |
| 35 } | |
| 36 | |
| 37 } // namespace chrome | |
| OLD | NEW |