| 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/picasa_file_util.h" | 5 #include "chrome/browser/media_galleries/fileapi/picasa/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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 : weak_factory_(this) { | 57 : weak_factory_(this) { |
| 58 } | 58 } |
| 59 | 59 |
| 60 PicasaFileUtil::~PicasaFileUtil() {} | 60 PicasaFileUtil::~PicasaFileUtil() {} |
| 61 | 61 |
| 62 void PicasaFileUtil::GetFileInfoOnTaskRunnerThread( | 62 void PicasaFileUtil::GetFileInfoOnTaskRunnerThread( |
| 63 scoped_ptr<fileapi::FileSystemOperationContext> context, | 63 scoped_ptr<fileapi::FileSystemOperationContext> context, |
| 64 const fileapi::FileSystemURL& url, | 64 const fileapi::FileSystemURL& url, |
| 65 const GetFileInfoCallback& callback) { | 65 const GetFileInfoCallback& callback) { |
| 66 GetDataProvider()->RefreshData( | 66 GetDataProvider()->RefreshData( |
| 67 false, |
| 67 base::Bind(&PicasaFileUtil::GetFileInfoWithFreshDataProvider, | 68 base::Bind(&PicasaFileUtil::GetFileInfoWithFreshDataProvider, |
| 68 weak_factory_.GetWeakPtr(), base::Passed(&context), url, | 69 weak_factory_.GetWeakPtr(), base::Passed(&context), url, |
| 69 callback)); | 70 callback)); |
| 70 } | 71 } |
| 71 | 72 |
| 72 void PicasaFileUtil::ReadDirectoryOnTaskRunnerThread( | 73 void PicasaFileUtil::ReadDirectoryOnTaskRunnerThread( |
| 73 scoped_ptr<fileapi::FileSystemOperationContext> context, | 74 scoped_ptr<fileapi::FileSystemOperationContext> context, |
| 74 const fileapi::FileSystemURL& url, | 75 const fileapi::FileSystemURL& url, |
| 75 const ReadDirectoryCallback& callback) { | 76 const ReadDirectoryCallback& callback) { |
| 76 GetDataProvider()->RefreshData( | 77 GetDataProvider()->RefreshData( |
| 78 false, |
| 77 base::Bind(&PicasaFileUtil::ReadDirectoryWithFreshDataProvider, | 79 base::Bind(&PicasaFileUtil::ReadDirectoryWithFreshDataProvider, |
| 78 weak_factory_.GetWeakPtr(), base::Passed(&context), url, | 80 weak_factory_.GetWeakPtr(), base::Passed(&context), url, |
| 79 callback)); | 81 callback)); |
| 80 } | 82 } |
| 81 | 83 |
| 82 base::PlatformFileError PicasaFileUtil::GetFileInfoSync( | 84 base::PlatformFileError PicasaFileUtil::GetFileInfoSync( |
| 83 FileSystemOperationContext* context, const FileSystemURL& url, | 85 FileSystemOperationContext* context, const FileSystemURL& url, |
| 84 base::PlatformFileInfo* file_info, base::FilePath* platform_path) { | 86 base::PlatformFileInfo* file_info, base::FilePath* platform_path) { |
| 85 DCHECK(context); | 87 DCHECK(context); |
| 86 DCHECK(file_info); | 88 DCHECK(file_info); |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 const ReadDirectoryCallback& callback) { | 294 const ReadDirectoryCallback& callback) { |
| 293 NativeMediaFileUtil::ReadDirectoryOnTaskRunnerThread(context.Pass(), url, | 295 NativeMediaFileUtil::ReadDirectoryOnTaskRunnerThread(context.Pass(), url, |
| 294 callback); | 296 callback); |
| 295 } | 297 } |
| 296 | 298 |
| 297 PicasaDataProvider* PicasaFileUtil::GetDataProvider() { | 299 PicasaDataProvider* PicasaFileUtil::GetDataProvider() { |
| 298 return chrome::ImportedMediaGalleryRegistry::PicasaDataProvider(); | 300 return chrome::ImportedMediaGalleryRegistry::PicasaDataProvider(); |
| 299 } | 301 } |
| 300 | 302 |
| 301 } // namespace picasa | 303 } // namespace picasa |
| OLD | NEW |