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/gdata_operation_registry.h" | 5 #include "chrome/browser/chromeos/gdata/gdata_operation_registry.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 | 8 |
9 #include "content/public/browser/browser_thread.h" | 9 #include "content/public/browser/browser_thread.h" |
10 | 10 |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 OnProgressUpdate(GetProgressStatusList())); | 265 OnProgressUpdate(GetProgressStatusList())); |
266 } | 266 } |
267 } | 267 } |
268 | 268 |
269 bool GDataOperationRegistry::IsFileTransferOperation( | 269 bool GDataOperationRegistry::IsFileTransferOperation( |
270 const Operation* operation) const { | 270 const Operation* operation) const { |
271 OperationType type = operation->progress_status().operation_type; | 271 OperationType type = operation->progress_status().operation_type; |
272 return type == OPERATION_UPLOAD || type == OPERATION_DOWNLOAD; | 272 return type == OPERATION_UPLOAD || type == OPERATION_DOWNLOAD; |
273 } | 273 } |
274 | 274 |
275 std::vector<GDataOperationRegistry::ProgressStatus> | 275 GDataOperationRegistry::ProgressStatusList |
276 GDataOperationRegistry::GetProgressStatusList() { | 276 GDataOperationRegistry::GetProgressStatusList() { |
277 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 277 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
278 | 278 |
279 std::vector<ProgressStatus> status_list; | 279 ProgressStatusList status_list; |
280 for (OperationIDMap::const_iterator iter(&in_flight_operations_); | 280 for (OperationIDMap::const_iterator iter(&in_flight_operations_); |
281 !iter.IsAtEnd(); | 281 !iter.IsAtEnd(); |
282 iter.Advance()) { | 282 iter.Advance()) { |
283 const Operation* operation = iter.GetCurrentValue(); | 283 const Operation* operation = iter.GetCurrentValue(); |
284 if (IsFileTransferOperation(operation)) | 284 if (IsFileTransferOperation(operation)) |
285 status_list.push_back(operation->progress_status()); | 285 status_list.push_back(operation->progress_status()); |
286 } | 286 } |
287 return status_list; | 287 return status_list; |
288 } | 288 } |
289 | 289 |
290 } // namespace gdata | 290 } // namespace gdata |
OLD | NEW |