| 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 <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/i18n/time_formatting.h" | 9 #include "base/i18n/time_formatting.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 const char kCrashesUIRequestCrashUpload[] = "requestCrashUpload"; | 36 const char kCrashesUIRequestCrashUpload[] = "requestCrashUpload"; |
| 37 const char kCrashesUIShortProductName[] = "shortProductName"; | 37 const char kCrashesUIShortProductName[] = "shortProductName"; |
| 38 const char kCrashesUIUpdateCrashList[] = "updateCrashList"; | 38 const char kCrashesUIUpdateCrashList[] = "updateCrashList"; |
| 39 | 39 |
| 40 void UploadListToValue(UploadList* upload_list, base::ListValue* out_value) { | 40 void UploadListToValue(UploadList* upload_list, base::ListValue* out_value) { |
| 41 std::vector<UploadList::UploadInfo> crashes; | 41 std::vector<UploadList::UploadInfo> crashes; |
| 42 upload_list->GetUploads(50, &crashes); | 42 upload_list->GetUploads(50, &crashes); |
| 43 | 43 |
| 44 for (const auto& info : crashes) { | 44 for (const auto& info : crashes) { |
| 45 base::DictionaryValue* crash = new base::DictionaryValue(); | 45 base::DictionaryValue* crash = new base::DictionaryValue(); |
| 46 crash->SetString("id", info.id); | 46 crash->SetString("id", info.upload_id); |
| 47 crash->SetString("time", base::TimeFormatFriendlyDateAndTime(info.time)); | 47 crash->SetString("time", |
| 48 base::TimeFormatFriendlyDateAndTime(info.upload_time)); |
| 48 crash->SetString("local_id", info.local_id); | 49 crash->SetString("local_id", info.local_id); |
| 49 out_value->Append(crash); | 50 out_value->Append(crash); |
| 50 } | 51 } |
| 51 } | 52 } |
| 52 | 53 |
| 53 } // namespace crash | 54 } // namespace crash |
| OLD | NEW |