| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/media_galleries/media_folder_finder.h" | 5 #include "chrome/browser/media_galleries/media_folder_finder.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/files/file_enumerator.h" | 10 #include "base/files/file_enumerator.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 #if defined(OS_MACOSX) && !defined(OS_IOS) | 49 #if defined(OS_MACOSX) && !defined(OS_IOS) |
| 50 chrome::DIR_USER_APPLICATIONS, | 50 chrome::DIR_USER_APPLICATIONS, |
| 51 chrome::DIR_USER_LIBRARY, | 51 chrome::DIR_USER_LIBRARY, |
| 52 #endif | 52 #endif |
| 53 #if defined(OS_LINUX) | 53 #if defined(OS_LINUX) |
| 54 base::DIR_CACHE, | 54 base::DIR_CACHE, |
| 55 #endif | 55 #endif |
| 56 #if defined(OS_WIN) || defined(OS_LINUX) | 56 #if defined(OS_WIN) || defined(OS_LINUX) |
| 57 base::DIR_TEMP, | 57 base::DIR_TEMP, |
| 58 #endif | 58 #endif |
| 59 #if defined(OS_ANDROID) |
| 60 base::DIR_ANDROID_APP_DATA, |
| 61 #endif |
| 59 }; | 62 }; |
| 60 | 63 |
| 61 bool IsValidScanPath(const base::FilePath& path) { | 64 bool IsValidScanPath(const base::FilePath& path) { |
| 62 return !path.empty() && path.IsAbsolute(); | 65 return !path.empty() && path.IsAbsolute(); |
| 63 } | 66 } |
| 64 | 67 |
| 65 void CountScanResult(MediaGalleryScanFileType type, | 68 void CountScanResult(MediaGalleryScanFileType type, |
| 66 MediaGalleryScanResult* scan_result) { | 69 MediaGalleryScanResult* scan_result) { |
| 67 if (type & MEDIA_GALLERY_SCAN_FILE_TYPE_IMAGE) | 70 if (type & MEDIA_GALLERY_SCAN_FILE_TYPE_IMAGE) |
| 68 scan_result->image_count += 1; | 71 scan_result->image_count += 1; |
| (...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 435 | 438 |
| 436 if (!IsEmptyScanResult(reply.scan_result)) | 439 if (!IsEmptyScanResult(reply.scan_result)) |
| 437 results_[path] = reply.scan_result; | 440 results_[path] = reply.scan_result; |
| 438 | 441 |
| 439 // Push new folders to the |folders_to_scan_| in reverse order. | 442 // Push new folders to the |folders_to_scan_| in reverse order. |
| 440 std::copy(reply.new_folders.rbegin(), reply.new_folders.rend(), | 443 std::copy(reply.new_folders.rbegin(), reply.new_folders.rend(), |
| 441 std::back_inserter(folders_to_scan_)); | 444 std::back_inserter(folders_to_scan_)); |
| 442 | 445 |
| 443 ScanFolder(); | 446 ScanFolder(); |
| 444 } | 447 } |
| OLD | NEW |