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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/crash/core/browser/crashes_ui_util.cc
diff --git a/components/crash/core/browser/crashes_ui_util.cc b/components/crash/core/browser/crashes_ui_util.cc
new file mode 100644
index 0000000000000000000000000000000000000000..bd74af6056f18b7f797b35010e16912541bb8acc
--- /dev/null
+++ b/components/crash/core/browser/crashes_ui_util.cc
@@ -0,0 +1,53 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/crash/core/browser/crashes_ui_util.h"
+
+#include <vector>
+
+#include "base/i18n/time_formatting.h"
+#include "base/macros.h"
+#include "base/values.h"
+#include "components/upload_list/upload_list.h"
+#include "grit/components_chromium_strings.h"
+#include "grit/components_google_chrome_strings.h"
+#include "grit/components_strings.h"
+
+namespace crash {
+
+const CrashesUILocalizedString kCrashesUILocalizedStrings[] = {
+ {"bugLinkText", IDS_CRASH_BUG_LINK_LABEL},
+ {"crashCountFormat", IDS_CRASH_CRASH_COUNT_BANNER_FORMAT},
+ {"crashHeaderFormat", IDS_CRASH_CRASH_HEADER_FORMAT},
+ {"crashTimeFormat", IDS_CRASH_CRASH_TIME_FORMAT},
+ {"crashesTitle", IDS_CRASH_TITLE},
+ {"disabledHeader", IDS_CRASH_DISABLED_HEADER},
+ {"disabledMessage", IDS_CRASH_DISABLED_MESSAGE},
+ {"noCrashesMessage", IDS_CRASH_NO_CRASHES_MESSAGE},
+ {"uploadCrashesLinkText", IDS_CRASH_UPLOAD_MESSAGE},
+};
+
+const size_t kCrashesUILocalizedStringsCount =
+ arraysize(kCrashesUILocalizedStrings);
+
+const char kCrashesUICrashesJS[] = "crashes.js";
+const char kCrashesUIRequestCrashList[] = "requestCrashList";
+const char kCrashesUIRequestCrashUpload[] = "requestCrashUpload";
+const char kCrashesUIShortProductName[] = "shortProductName";
+const char kCrashesUIUpdateCrashList[] = "updateCrashList";
+
+void UploadListToValue(UploadList* upload_list, base::ListValue* out_value) {
+ std::vector<UploadList::UploadInfo> crashes;
+ upload_list->GetUploads(50, &crashes);
+
+ for (const auto& info : crashes) {
+ base::DictionaryValue* crash = new base::DictionaryValue();
+ crash->SetString("id", info.id);
+ crash->SetString("time", base::TimeFormatFriendlyDateAndTime(info.time));
+ crash->SetString("local_id", info.local_id);
+ out_value->Append(crash);
+ }
+}
+
+} // namespace crash
« 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