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" |
11 #include "base/path_service.h" | 11 #include "base/path_service.h" |
12 #include "base/sequence_checker.h" | 12 #include "base/sequence_checker.h" |
13 #include "base/stl_util.h" | 13 #include "base/stl_util.h" |
14 #include "base/strings/string_util.h" | 14 #include "base/strings/string_util.h" |
15 #include "base/task_runner_util.h" | 15 #include "base/task_runner_util.h" |
| 16 #include "base/threading/sequenced_worker_pool.h" |
16 #include "chrome/browser/media_galleries/fileapi/media_path_filter.h" | 17 #include "chrome/browser/media_galleries/fileapi/media_path_filter.h" |
17 #include "chrome/browser/storage_monitor/storage_monitor.h" | 18 #include "chrome/browser/storage_monitor/storage_monitor.h" |
18 #include "content/public/browser/browser_thread.h" | 19 #include "content/public/browser/browser_thread.h" |
19 | 20 |
20 #if defined(OS_CHROMEOS) | 21 #if defined(OS_CHROMEOS) |
21 #include "chrome/common/chrome_paths.h" | 22 #include "chrome/common/chrome_paths.h" |
22 #include "chromeos/dbus/cros_disks_client.h" | 23 #include "chromeos/dbus/cros_disks_client.h" |
23 #endif | 24 #endif |
24 | 25 |
25 typedef base::Callback<void(const std::vector<base::FilePath>& /*roots*/)> | 26 typedef base::Callback<void(const std::vector<base::FilePath>& /*roots*/)> |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 | 329 |
329 if (!IsEmptyScanResult(reply.scan_result)) | 330 if (!IsEmptyScanResult(reply.scan_result)) |
330 results_[path] = reply.scan_result; | 331 results_[path] = reply.scan_result; |
331 | 332 |
332 // Push new folders to the |folders_to_scan_| in reverse order. | 333 // Push new folders to the |folders_to_scan_| in reverse order. |
333 std::copy(reply.new_folders.rbegin(), reply.new_folders.rend(), | 334 std::copy(reply.new_folders.rbegin(), reply.new_folders.rend(), |
334 std::back_inserter(folders_to_scan_)); | 335 std::back_inserter(folders_to_scan_)); |
335 | 336 |
336 ScanFolder(); | 337 ScanFolder(); |
337 } | 338 } |
OLD | NEW |