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

Unified Diff: chrome/browser/ui/profile_error_dialog.cc

Issue 2107493002: Offer user to send feedback from profile error dialog (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Unused variable Created 4 years, 6 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
Index: chrome/browser/ui/profile_error_dialog.cc
diff --git a/chrome/browser/ui/profile_error_dialog.cc b/chrome/browser/ui/profile_error_dialog.cc
index 39eb774268cf3be40c722178e1a84de106e32ffc..d9c5bc0f6cbb6058e4354d85dfed784fe347c57c 100644
--- a/chrome/browser/ui/profile_error_dialog.cc
+++ b/chrome/browser/ui/profile_error_dialog.cc
@@ -7,27 +7,51 @@
#include "base/auto_reset.h"
#include "base/base_switches.h"
#include "base/command_line.h"
+#include "base/files/file_path.h"
#include "base/metrics/histogram.h"
#include "build/build_config.h"
+#include "chrome/browser/ui/chrome_pages.h"
#include "chrome/browser/ui/simple_message_box.h"
#include "chrome/grit/chromium_strings.h"
+#include "chrome/grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h"
-void ShowProfileErrorDialog(ProfileErrorType type, int message_id) {
+namespace {
+
+#if !defined(OS_ANDROID)
+constexpr char kProfileErrorFeedbackCategory[] = "FEEDBACK_PROFILE_ERROR";
+#endif // !defined(OS_ANDROID)
+
+} // namespace
+
+void ShowProfileErrorDialog(const base::FilePath& corrupted_file,
+ ProfileErrorType type,
+ int message_id) {
#if defined(OS_ANDROID)
NOTIMPLEMENTED();
#else
UMA_HISTOGRAM_ENUMERATION("Profile.ProfileError", type, PROFILE_ERROR_END);
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kNoErrorDialogs))
+ switches::kNoErrorDialogs)) {
return;
+ }
static bool is_showing_profile_error_dialog = false;
if (!is_showing_profile_error_dialog) {
base::AutoReset<bool> resetter(&is_showing_profile_error_dialog, true);
- chrome::ShowWarningMessageBox(NULL,
- l10n_util::GetStringUTF16(IDS_PRODUCT_NAME),
- l10n_util::GetStringUTF16(message_id));
+ if (chrome::ShowWarningMessageBoxWithCheckbox(
+ nullptr, l10n_util::GetStringUTF16(IDS_PROFILE_ERROR_DIALOG_TITLE),
+ l10n_util::GetStringUTF16(message_id),
+ l10n_util::GetStringUTF16(IDS_PROFILE_ERROR_DIALOG_CHECKBOX))) {
+ std::string feedback_description =
+ l10n_util::GetStringUTF8(IDS_PROFILE_ERROR_FEEDBACK_DESCRIPTION);
+ feedback_description +=
+ "\nCorrupted file: " + corrupted_file.AsUTF8Unsafe();
Scott Hess - ex-Googler 2016/06/29 05:13:48 May be worth replacing the profile dir with .../ .
afakhry 2016/06/29 18:57:18 We need to distinguish between the default profile
Scott Hess - ex-Googler 2016/06/29 19:17:27 Bit of clarification from offline: My concern is t
+ chrome::ShowFeedbackPage(
+ nullptr,
+ feedback_description,
+ kProfileErrorFeedbackCategory);
+ }
}
#endif
}

Powered by Google App Engine
This is Rietveld 408576698