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 <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 #if defined(OS_MACOSX) && !defined(OS_IOS) | 54 #if defined(OS_MACOSX) && !defined(OS_IOS) |
55 chrome::DIR_USER_APPLICATIONS, | 55 chrome::DIR_USER_APPLICATIONS, |
56 chrome::DIR_USER_LIBRARY, | 56 chrome::DIR_USER_LIBRARY, |
57 #endif | 57 #endif |
58 #if defined(OS_LINUX) | 58 #if defined(OS_LINUX) |
59 base::DIR_CACHE, | 59 base::DIR_CACHE, |
60 #endif | 60 #endif |
61 #if defined(OS_WIN) || defined(OS_LINUX) | 61 #if defined(OS_WIN) || defined(OS_LINUX) |
62 base::DIR_TEMP, | 62 base::DIR_TEMP, |
63 #endif | 63 #endif |
64 #if defined(OS_ANDROID) | |
65 base::DIR_ANDROID_APP_DATA, | |
66 #endif | |
67 }; | 64 }; |
68 | 65 |
69 bool IsValidScanPath(const base::FilePath& path) { | 66 bool IsValidScanPath(const base::FilePath& path) { |
70 return !path.empty() && path.IsAbsolute(); | 67 return !path.empty() && path.IsAbsolute(); |
71 } | 68 } |
72 | 69 |
73 void CountScanResult(MediaGalleryScanFileType type, | 70 void CountScanResult(MediaGalleryScanFileType type, |
74 MediaGalleryScanResult* scan_result) { | 71 MediaGalleryScanResult* scan_result) { |
75 if (type & MEDIA_GALLERY_SCAN_FILE_TYPE_IMAGE) | 72 if (type & MEDIA_GALLERY_SCAN_FILE_TYPE_IMAGE) |
76 scan_result->image_count += 1; | 73 scan_result->image_count += 1; |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 | 440 |
444 if (!IsEmptyScanResult(reply.scan_result)) | 441 if (!IsEmptyScanResult(reply.scan_result)) |
445 results_[path] = reply.scan_result; | 442 results_[path] = reply.scan_result; |
446 | 443 |
447 // Push new folders to the |folders_to_scan_| in reverse order. | 444 // Push new folders to the |folders_to_scan_| in reverse order. |
448 std::copy(reply.new_folders.rbegin(), reply.new_folders.rend(), | 445 std::copy(reply.new_folders.rbegin(), reply.new_folders.rend(), |
449 std::back_inserter(folders_to_scan_)); | 446 std::back_inserter(folders_to_scan_)); |
450 | 447 |
451 ScanFolder(); | 448 ScanFolder(); |
452 } | 449 } |
OLD | NEW |