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/upload_list.h" | 5 #include "chrome/browser/upload_list.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <iterator> | 8 #include <iterator> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
11 #include "base/file_util.h" | 11 #include "base/files/file_util.h" |
12 #include "base/strings/string_number_conversions.h" | 12 #include "base/strings/string_number_conversions.h" |
13 #include "base/strings/string_split.h" | 13 #include "base/strings/string_split.h" |
14 #include "content/public/browser/browser_thread.h" | 14 #include "content/public/browser/browser_thread.h" |
15 | 15 |
16 using content::BrowserThread; | 16 using content::BrowserThread; |
17 | 17 |
18 UploadList::UploadInfo::UploadInfo(const std::string& id, | 18 UploadList::UploadInfo::UploadInfo(const std::string& id, |
19 const base::Time& t, | 19 const base::Time& t, |
20 const std::string& local_id) | 20 const std::string& local_id) |
21 : id(id), time(t), local_id(local_id) {} | 21 : id(id), time(t), local_id(local_id) {} |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 delegate_->OnUploadListAvailable(); | 101 delegate_->OnUploadListAvailable(); |
102 } | 102 } |
103 | 103 |
104 void UploadList::GetUploads(unsigned int max_count, | 104 void UploadList::GetUploads(unsigned int max_count, |
105 std::vector<UploadInfo>* uploads) { | 105 std::vector<UploadInfo>* uploads) { |
106 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 106 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
107 std::copy(uploads_.begin(), | 107 std::copy(uploads_.begin(), |
108 uploads_.begin() + std::min<size_t>(uploads_.size(), max_count), | 108 uploads_.begin() + std::min<size_t>(uploads_.size(), max_count), |
109 std::back_inserter(*uploads)); | 109 std::back_inserter(*uploads)); |
110 } | 110 } |
OLD | NEW |