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/gdata/drive_task_executor.h" | 5 #include "chrome/browser/chromeos/gdata/drive_task_executor.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 if (!url.is_valid() || url.type() != fileapi::kFileSystemTypeDrive) | 57 if (!url.is_valid() || url.type() != fileapi::kFileSystemTypeDrive) |
58 return false; | 58 return false; |
59 raw_paths.push_back(url.virtual_path()); | 59 raw_paths.push_back(url.virtual_path()); |
60 } | 60 } |
61 | 61 |
62 GDataSystemService* system_service = | 62 GDataSystemService* system_service = |
63 GDataSystemServiceFactory::GetForProfile(profile()); | 63 GDataSystemServiceFactory::GetForProfile(profile()); |
64 DCHECK(current_index_ == 0); | 64 DCHECK(current_index_ == 0); |
65 if (!system_service || !system_service->file_system()) | 65 if (!system_service || !system_service->file_system()) |
66 return false; | 66 return false; |
67 GDataFileSystemInterface* file_system = system_service->file_system(); | 67 DriveFileSystemInterface* file_system = system_service->file_system(); |
68 | 68 |
69 // Reset the index, so we know when we're done. | 69 // Reset the index, so we know when we're done. |
70 current_index_ = raw_paths.size(); | 70 current_index_ = raw_paths.size(); |
71 | 71 |
72 for (std::vector<FilePath>::const_iterator iter = raw_paths.begin(); | 72 for (std::vector<FilePath>::const_iterator iter = raw_paths.begin(); |
73 iter != raw_paths.end(); ++iter) { | 73 iter != raw_paths.end(); ++iter) { |
74 file_system->GetEntryInfoByPath( | 74 file_system->GetEntryInfoByPath( |
75 *iter, | 75 *iter, |
76 base::Bind(&DriveTaskExecutor::OnFileEntryFetched, this)); | 76 base::Bind(&DriveTaskExecutor::OnFileEntryFetched, this)); |
77 } | 77 } |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 | 167 |
168 void DriveTaskExecutor::Done(bool success) { | 168 void DriveTaskExecutor::Done(bool success) { |
169 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); | 169 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); |
170 current_index_ = 0; | 170 current_index_ = 0; |
171 if (!done_.is_null()) | 171 if (!done_.is_null()) |
172 done_.Run(success); | 172 done_.Run(success); |
173 done_.Reset(); | 173 done_.Reset(); |
174 } | 174 } |
175 | 175 |
176 } // namespace gdata | 176 } // namespace gdata |
OLD | NEW |