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

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

Issue 873253002: Show only one profile corrupted dialog, support --noerrdialogs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments #2 Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 0dae4bfd5cb01b50f59d388387a3c658d99edfed..40423cbe18ff2104485513c7b642a57d8b95aca0 100644
--- a/chrome/browser/ui/profile_error_dialog.cc
+++ b/chrome/browser/ui/profile_error_dialog.cc
@@ -4,6 +4,9 @@
#include "chrome/browser/ui/profile_error_dialog.h"
+#include "base/auto_reset.h"
+#include "base/base_switches.h"
+#include "base/command_line.h"
#include "base/metrics/histogram.h"
#include "chrome/browser/ui/simple_message_box.h"
#include "chrome/grit/chromium_strings.h"
@@ -14,9 +17,17 @@ void ShowProfileErrorDialog(ProfileErrorType type, int message_id) {
NOTIMPLEMENTED();
#else
UMA_HISTOGRAM_ENUMERATION("Profile.ProfileError", type, PROFILE_ERROR_END);
- chrome::ShowMessageBox(NULL,
- l10n_util::GetStringUTF16(IDS_PRODUCT_NAME),
- l10n_util::GetStringUTF16(message_id),
- chrome::MESSAGE_BOX_TYPE_WARNING);
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+ 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::ShowMessageBox(NULL,
+ l10n_util::GetStringUTF16(IDS_PRODUCT_NAME),
+ l10n_util::GetStringUTF16(message_id),
+ chrome::MESSAGE_BOX_TYPE_WARNING);
+ }
#endif
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698