Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(129)

Side by Side Diff: components/crash/core/browser/crashes_ui_util.cc

Issue 2622363006: Revert of Fix Incorrect date/time info under chrome://crashes. (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | components/crash/core/browser/resources/crashes.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
11 #include "base/i18n/time_formatting.h" 11 #include "base/i18n/time_formatting.h"
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "base/values.h" 13 #include "base/values.h"
14 #include "components/upload_list/upload_list.h" 14 #include "components/upload_list/upload_list.h"
15 #include "grit/components_chromium_strings.h" 15 #include "grit/components_chromium_strings.h"
16 #include "grit/components_strings.h" 16 #include "grit/components_strings.h"
17 17
18 namespace crash { 18 namespace crash {
19 19
20 const CrashesUILocalizedString kCrashesUILocalizedStrings[] = { 20 const CrashesUILocalizedString kCrashesUILocalizedStrings[] = {
21 {"bugLinkText", IDS_CRASH_BUG_LINK_LABEL}, 21 {"bugLinkText", IDS_CRASH_BUG_LINK_LABEL},
22 {"crashCountFormat", IDS_CRASH_CRASH_COUNT_BANNER_FORMAT}, 22 {"crashCountFormat", IDS_CRASH_CRASH_COUNT_BANNER_FORMAT},
23 {"crashHeaderFormat", IDS_CRASH_CRASH_HEADER_FORMAT}, 23 {"crashHeaderFormat", IDS_CRASH_CRASH_HEADER_FORMAT},
24 {"crashHeaderFormatLocalOnly", IDS_CRASH_CRASH_HEADER_FORMAT_LOCAL_ONLY}, 24 {"crashHeaderFormatLocalOnly", IDS_CRASH_CRASH_HEADER_FORMAT_LOCAL_ONLY},
25 {"crashTimeFormat", IDS_CRASH_CRASH_TIME_FORMAT}, 25 {"crashTimeFormat", IDS_CRASH_CRASH_TIME_FORMAT},
26 {"crashAndUploadTimeFormat", IDS_CRASH_CRASH_AND_UPLOAD_TIME_FORMAT},
27 {"crashNotUploaded", IDS_CRASH_CRASH_NOT_UPLOADED}, 26 {"crashNotUploaded", IDS_CRASH_CRASH_NOT_UPLOADED},
28 {"crashUserRequested", IDS_CRASH_CRASH_USER_REQUESTED}, 27 {"crashUserRequested", IDS_CRASH_CRASH_USER_REQUESTED},
29 {"crashPending", IDS_CRASH_CRASH_PENDING}, 28 {"crashPending", IDS_CRASH_CRASH_PENDING},
30 {"crashesTitle", IDS_CRASH_TITLE}, 29 {"crashesTitle", IDS_CRASH_TITLE},
31 {"disabledHeader", IDS_CRASH_DISABLED_HEADER}, 30 {"disabledHeader", IDS_CRASH_DISABLED_HEADER},
32 {"disabledMessage", IDS_CRASH_DISABLED_MESSAGE}, 31 {"disabledMessage", IDS_CRASH_DISABLED_MESSAGE},
33 {"noCrashesMessage", IDS_CRASH_NO_CRASHES_MESSAGE}, 32 {"noCrashesMessage", IDS_CRASH_NO_CRASHES_MESSAGE},
34 {"uploadCrashesLinkText", IDS_CRASH_UPLOAD_MESSAGE}, 33 {"uploadCrashesLinkText", IDS_CRASH_UPLOAD_MESSAGE},
35 {"uploadNowLinkText", IDS_CRASH_UPLOAD_NOW_LINK_TEXT}, 34 {"uploadNowLinkText", IDS_CRASH_UPLOAD_NOW_LINK_TEXT},
36 {"crashSizeMessage", IDS_CRASH_SIZE_MESSAGE}, 35 {"crashSizeMessage", IDS_CRASH_SIZE_MESSAGE},
(...skipping 29 matching lines...) Expand all
66 std::vector<UploadList::UploadInfo> crashes; 65 std::vector<UploadList::UploadInfo> crashes;
67 upload_list->GetUploads(50, &crashes); 66 upload_list->GetUploads(50, &crashes);
68 67
69 for (const auto& info : crashes) { 68 for (const auto& info : crashes) {
70 std::unique_ptr<base::DictionaryValue> crash(new base::DictionaryValue()); 69 std::unique_ptr<base::DictionaryValue> crash(new base::DictionaryValue());
71 crash->SetString("id", info.upload_id); 70 crash->SetString("id", info.upload_id);
72 if (info.state == UploadList::UploadInfo::State::Uploaded) { 71 if (info.state == UploadList::UploadInfo::State::Uploaded) {
73 crash->SetString("upload_time", 72 crash->SetString("upload_time",
74 base::TimeFormatFriendlyDateAndTime(info.upload_time)); 73 base::TimeFormatFriendlyDateAndTime(info.upload_time));
75 } 74 }
76 if (!info.capture_time.is_null()) { 75 crash->SetString("time",
77 crash->SetString("time", 76 base::TimeFormatFriendlyDateAndTime(info.capture_time));
78 base::TimeFormatFriendlyDateAndTime(info.capture_time));
79 }
80 crash->SetString("local_id", info.local_id); 77 crash->SetString("local_id", info.local_id);
81 crash->SetString("state", UploadInfoStateAsString(info.state)); 78 crash->SetString("state", UploadInfoStateAsString(info.state));
82 crash->SetString("file_size", info.file_size); 79 crash->SetString("file_size", info.file_size);
83 out_value->Append(std::move(crash)); 80 out_value->Append(std::move(crash));
84 } 81 }
85 } 82 }
86 83
87 } // namespace crash 84 } // namespace crash
OLDNEW
« no previous file with comments | « no previous file | components/crash/core/browser/resources/crashes.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698