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/chromeos/extensions/file_browser_private_api.h" | 5 #include "chrome/browser/chromeos/extensions/file_browser_private_api.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/base64.h" | 9 #include "base/base64.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 2041 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2052 | 2052 |
2053 gdata::GDataSystemService* system_service = | 2053 gdata::GDataSystemService* system_service = |
2054 gdata::GDataSystemServiceFactory::GetForProfile(profile_); | 2054 gdata::GDataSystemServiceFactory::GetForProfile(profile_); |
2055 DCHECK(system_service); | 2055 DCHECK(system_service); |
2056 | 2056 |
2057 // Get the file on the top of the queue. | 2057 // Get the file on the top of the queue. |
2058 FilePath gdata_path = remaining_gdata_paths_.front(); | 2058 FilePath gdata_path = remaining_gdata_paths_.front(); |
2059 system_service->file_system()->GetFileByPath( | 2059 system_service->file_system()->GetFileByPath( |
2060 gdata_path, | 2060 gdata_path, |
2061 base::Bind(&GetGDataFilesFunction::OnFileReady, this), | 2061 base::Bind(&GetGDataFilesFunction::OnFileReady, this), |
2062 gdata::GetDownloadDataCallback()); | 2062 gdata::GetContentCallback()); |
2063 } | 2063 } |
2064 | 2064 |
2065 | 2065 |
2066 void GetGDataFilesFunction::OnFileReady( | 2066 void GetGDataFilesFunction::OnFileReady( |
2067 gdata::GDataFileError error, | 2067 gdata::GDataFileError error, |
2068 const FilePath& local_path, | 2068 const FilePath& local_path, |
2069 const std::string& unused_mime_type, | 2069 const std::string& unused_mime_type, |
2070 gdata::GDataFileType file_type) { | 2070 gdata::GDataFileType file_type) { |
2071 FilePath gdata_path = remaining_gdata_paths_.front(); | 2071 FilePath gdata_path = remaining_gdata_paths_.front(); |
2072 | 2072 |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2427 gdata::GDataSystemService* system_service = | 2427 gdata::GDataSystemService* system_service = |
2428 gdata::GDataSystemServiceFactory::GetForProfile(profile_); | 2428 gdata::GDataSystemServiceFactory::GetForProfile(profile_); |
2429 if (!system_service || !system_service->file_system()) | 2429 if (!system_service || !system_service->file_system()) |
2430 return false; | 2430 return false; |
2431 | 2431 |
2432 FilePath directory_path = GetVirtualPathFromURL(GURL(file_url_as_string)); | 2432 FilePath directory_path = GetVirtualPathFromURL(GURL(file_url_as_string)); |
2433 system_service->file_system()->RequestDirectoryRefresh(directory_path); | 2433 system_service->file_system()->RequestDirectoryRefresh(directory_path); |
2434 | 2434 |
2435 return true; | 2435 return true; |
2436 } | 2436 } |
OLD | NEW |