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

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

Issue 1389913002: Move crashes_ui resources and utils to //components/crash (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comments Created 5 years, 2 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 | « components/crash/core/browser/crashes_ui_util.h ('k') | components/resources/OWNERS » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "components/crash/core/browser/crashes_ui_util.h"
6
7 #include <vector>
8
9 #include "base/i18n/time_formatting.h"
10 #include "base/macros.h"
11 #include "base/values.h"
12 #include "components/upload_list/upload_list.h"
13 #include "grit/components_chromium_strings.h"
14 #include "grit/components_google_chrome_strings.h"
15 #include "grit/components_strings.h"
16
17 namespace crash {
18
19 const CrashesUILocalizedString kCrashesUILocalizedStrings[] = {
20 {"bugLinkText", IDS_CRASH_BUG_LINK_LABEL},
21 {"crashCountFormat", IDS_CRASH_CRASH_COUNT_BANNER_FORMAT},
22 {"crashHeaderFormat", IDS_CRASH_CRASH_HEADER_FORMAT},
23 {"crashTimeFormat", IDS_CRASH_CRASH_TIME_FORMAT},
24 {"crashesTitle", IDS_CRASH_TITLE},
25 {"disabledHeader", IDS_CRASH_DISABLED_HEADER},
26 {"disabledMessage", IDS_CRASH_DISABLED_MESSAGE},
27 {"noCrashesMessage", IDS_CRASH_NO_CRASHES_MESSAGE},
28 {"uploadCrashesLinkText", IDS_CRASH_UPLOAD_MESSAGE},
29 };
30
31 const size_t kCrashesUILocalizedStringsCount =
32 arraysize(kCrashesUILocalizedStrings);
33
34 const char kCrashesUICrashesJS[] = "crashes.js";
35 const char kCrashesUIRequestCrashList[] = "requestCrashList";
36 const char kCrashesUIRequestCrashUpload[] = "requestCrashUpload";
37 const char kCrashesUIShortProductName[] = "shortProductName";
38 const char kCrashesUIUpdateCrashList[] = "updateCrashList";
39
40 void UploadListToValue(UploadList* upload_list, base::ListValue* out_value) {
41 std::vector<UploadList::UploadInfo> crashes;
42 upload_list->GetUploads(50, &crashes);
43
44 for (const auto& info : crashes) {
45 base::DictionaryValue* crash = new base::DictionaryValue();
46 crash->SetString("id", info.id);
47 crash->SetString("time", base::TimeFormatFriendlyDateAndTime(info.time));
48 crash->SetString("local_id", info.local_id);
49 out_value->Append(crash);
50 }
51 }
52
53 } // namespace crash
OLDNEW
« no previous file with comments | « components/crash/core/browser/crashes_ui_util.h ('k') | components/resources/OWNERS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698