OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/crash/core/browser/crashes_ui_util.h" | 5 #include "components/crash/core/browser/crashes_ui_util.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 } | 62 } |
63 | 63 |
64 void UploadListToValue(UploadList* upload_list, base::ListValue* out_value) { | 64 void UploadListToValue(UploadList* upload_list, base::ListValue* out_value) { |
65 std::vector<UploadList::UploadInfo> crashes; | 65 std::vector<UploadList::UploadInfo> crashes; |
66 upload_list->GetUploads(50, &crashes); | 66 upload_list->GetUploads(50, &crashes); |
67 | 67 |
68 for (const auto& info : crashes) { | 68 for (const auto& info : crashes) { |
69 std::unique_ptr<base::DictionaryValue> crash(new base::DictionaryValue()); | 69 std::unique_ptr<base::DictionaryValue> crash(new base::DictionaryValue()); |
70 crash->SetString("id", info.upload_id); | 70 crash->SetString("id", info.upload_id); |
71 if (info.state == UploadList::UploadInfo::State::Uploaded) { | 71 if (info.state == UploadList::UploadInfo::State::Uploaded) { |
72 crash->SetString("time", | 72 crash->SetString("upload_time", |
73 base::TimeFormatFriendlyDateAndTime(info.upload_time)); | 73 base::TimeFormatFriendlyDateAndTime(info.upload_time)); |
74 } else { | |
75 crash->SetString("time", | |
76 base::TimeFormatFriendlyDateAndTime(info.capture_time)); | |
77 } | 74 } |
| 75 crash->SetString("time", |
| 76 base::TimeFormatFriendlyDateAndTime(info.capture_time)); |
78 crash->SetString("local_id", info.local_id); | 77 crash->SetString("local_id", info.local_id); |
79 crash->SetString("state", UploadInfoStateAsString(info.state)); | 78 crash->SetString("state", UploadInfoStateAsString(info.state)); |
80 crash->SetString("file_size", info.file_size); | 79 crash->SetString("file_size", info.file_size); |
81 out_value->Append(std::move(crash)); | 80 out_value->Append(std::move(crash)); |
82 } | 81 } |
83 } | 82 } |
84 | 83 |
85 } // namespace crash | 84 } // namespace crash |
OLD | NEW |