| OLD | NEW |
| 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/media_galleries/fileapi/native_media_file_util.h" | 5 #include "chrome/browser/media_galleries/fileapi/native_media_file_util.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| 11 #include "base/bind_helpers.h" | 11 #include "base/bind_helpers.h" |
| 12 #include "base/files/file_enumerator.h" | 12 #include "base/files/file_enumerator.h" |
| 13 #include "base/files/file_util.h" | 13 #include "base/files/file_util.h" |
| 14 #include "base/sequenced_task_runner.h" |
| 14 #include "base/strings/string_util.h" | 15 #include "base/strings/string_util.h" |
| 15 #include "base/task_runner_util.h" | 16 #include "base/task_runner_util.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 "content/public/browser/browser_thread.h" | 18 #include "content/public/browser/browser_thread.h" |
| 18 #include "net/base/io_buffer.h" | 19 #include "net/base/io_buffer.h" |
| 19 #include "net/base/mime_sniffer.h" | 20 #include "net/base/mime_sniffer.h" |
| 20 #include "storage/browser/blob/shareable_file_reference.h" | 21 #include "storage/browser/blob/shareable_file_reference.h" |
| 21 #include "storage/browser/fileapi/file_system_context.h" | 22 #include "storage/browser/fileapi/file_system_context.h" |
| 22 #include "storage/browser/fileapi/file_system_operation_context.h" | 23 #include "storage/browser/fileapi/file_system_operation_context.h" |
| 23 #include "storage/browser/fileapi/native_file_util.h" | 24 #include "storage/browser/fileapi/native_file_util.h" |
| (...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 656 return base::File::FILE_ERROR_FAILED; | 657 return base::File::FILE_ERROR_FAILED; |
| 657 | 658 |
| 658 if (!file_info.is_directory && | 659 if (!file_info.is_directory && |
| 659 !media_path_filter_->Match(file_path)) { | 660 !media_path_filter_->Match(file_path)) { |
| 660 return failure_error; | 661 return failure_error; |
| 661 } | 662 } |
| 662 | 663 |
| 663 *local_file_path = file_path; | 664 *local_file_path = file_path; |
| 664 return base::File::FILE_OK; | 665 return base::File::FILE_OK; |
| 665 } | 666 } |
| OLD | NEW |