OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/ui/profile_error_dialog.h" | 5 #include "chrome/browser/ui/profile_error_dialog.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/base_switches.h" | 8 #include "base/base_switches.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 if (is_showing_profile_error_dialog) | 39 if (is_showing_profile_error_dialog) |
40 return; | 40 return; |
41 | 41 |
42 base::AutoReset<bool> resetter(&is_showing_profile_error_dialog, true); | 42 base::AutoReset<bool> resetter(&is_showing_profile_error_dialog, true); |
43 if (chrome::ShowWarningMessageBoxWithCheckbox( | 43 if (chrome::ShowWarningMessageBoxWithCheckbox( |
44 nullptr, l10n_util::GetStringUTF16(IDS_PROFILE_ERROR_DIALOG_TITLE), | 44 nullptr, l10n_util::GetStringUTF16(IDS_PROFILE_ERROR_DIALOG_TITLE), |
45 l10n_util::GetStringUTF16(message_id), | 45 l10n_util::GetStringUTF16(message_id), |
46 l10n_util::GetStringUTF16(IDS_PROFILE_ERROR_DIALOG_CHECKBOX))) { | 46 l10n_util::GetStringUTF16(IDS_PROFILE_ERROR_DIALOG_CHECKBOX))) { |
47 std::string feedback_description = | 47 std::string feedback_description = |
48 l10n_util::GetStringUTF8(IDS_PROFILE_ERROR_FEEDBACK_DESCRIPTION); | 48 l10n_util::GetStringUTF8(IDS_PROFILE_ERROR_FEEDBACK_DESCRIPTION); |
49 feedback_description += "\n" + diagnostics; | 49 if (!diagnostics.empty()) { |
| 50 // TODO(afakhry): Add support to inject diagnostics to the feedback |
| 51 // reports without adding them to the description. crbug.com/708511. |
| 52 feedback_description += "\n\n" + |
| 53 l10n_util::GetStringUTF8( |
| 54 IDS_PROFILE_ERROR_FEEDBACK_DIAGNOSTICS_LINE) + |
| 55 diagnostics; |
| 56 } |
50 | 57 |
51 chrome::ShowFeedbackPage(nullptr, chrome::kFeedbackSourceProfileErrorDialog, | 58 chrome::ShowFeedbackPage(nullptr, chrome::kFeedbackSourceProfileErrorDialog, |
52 feedback_description, | 59 feedback_description, |
53 kProfileErrorFeedbackCategory); | 60 kProfileErrorFeedbackCategory); |
54 } | 61 } |
55 #endif | 62 #endif |
56 } | 63 } |
OLD | NEW |