OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/picasa_file_util.h" | 5 #include "chrome/browser/media_galleries/fileapi/picasa_file_util.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 base::Passed(&context), | 96 base::Passed(&context), |
97 url, | 97 url, |
98 callback)); | 98 callback)); |
99 } | 99 } |
100 | 100 |
101 base::PlatformFileError PicasaFileUtil::GetFileInfoSync( | 101 base::PlatformFileError PicasaFileUtil::GetFileInfoSync( |
102 FileSystemOperationContext* context, const FileSystemURL& url, | 102 FileSystemOperationContext* context, const FileSystemURL& url, |
103 base::PlatformFileInfo* file_info, base::FilePath* platform_path) { | 103 base::PlatformFileInfo* file_info, base::FilePath* platform_path) { |
104 DCHECK(context); | 104 DCHECK(context); |
105 DCHECK(file_info); | 105 DCHECK(file_info); |
106 DCHECK(platform_path); | |
107 | 106 |
108 *platform_path = base::FilePath(); | 107 if (platform_path) |
| 108 *platform_path = base::FilePath(); |
109 | 109 |
110 std::vector<std::string> components; | 110 std::vector<std::string> components; |
111 fileapi::VirtualPath::GetComponentsUTF8Unsafe(url.path(), &components); | 111 fileapi::VirtualPath::GetComponentsUTF8Unsafe(url.path(), &components); |
112 | 112 |
113 switch (components.size()) { | 113 switch (components.size()) { |
114 case 0: | 114 case 0: |
115 // Root directory. | 115 // Root directory. |
116 file_info->is_directory = true; | 116 file_info->is_directory = true; |
117 return base::PLATFORM_FILE_OK; | 117 return base::PLATFORM_FILE_OK; |
118 case 1: | 118 case 1: |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 } | 364 } |
365 NativeMediaFileUtil::ReadDirectoryOnTaskRunnerThread( | 365 NativeMediaFileUtil::ReadDirectoryOnTaskRunnerThread( |
366 context.Pass(), url, callback); | 366 context.Pass(), url, callback); |
367 } | 367 } |
368 | 368 |
369 PicasaDataProvider* PicasaFileUtil::GetDataProvider() { | 369 PicasaDataProvider* PicasaFileUtil::GetDataProvider() { |
370 return ImportedMediaGalleryRegistry::PicasaDataProvider(); | 370 return ImportedMediaGalleryRegistry::PicasaDataProvider(); |
371 } | 371 } |
372 | 372 |
373 } // namespace picasa | 373 } // namespace picasa |
OLD | NEW |