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

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: 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..a987efca7eac99f9ee0bd9348bb0757e7cc523db 100644
--- a/chrome/browser/ui/profile_error_dialog.cc
+++ b/chrome/browser/ui/profile_error_dialog.cc
@@ -4,19 +4,32 @@
#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"
#include "ui/base/l10n/l10n_util.h"
+namespace {
+bool is_showing_profile_error_dialog = false;
Peter Kasting 2015/01/26 19:52:46 Nit: A static bool inside the method would be clea
robwu 2015/01/26 23:26:21 Done.
+} // namespace
+
void ShowProfileErrorDialog(ProfileErrorType type, int message_id) {
#if defined(OS_ANDROID) || defined(OS_IOS)
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))
Peter Kasting 2015/01/26 19:52:46 I wonder if this should be in ShowMessageBox() ins
robwu 2015/01/26 23:26:21 At least ShowWarningMessageBox in chrome/browser/c
Peter Kasting 2015/01/27 00:20:32 Are you sure that should be shown when --noerrdial
robwu 2015/01/27 22:03:47 I'm not sure about that, but I'm definitely to not
+ return;
+ if (!is_showing_profile_error_dialog) {
+ base::AutoReset<bool> resetter(&is_showing_profile_error_dialog, true);
Peter Kasting 2015/01/26 19:52:46 If this actually works to eliminate duplicate dial
robwu 2015/01/26 23:26:21 If you follow the calls, then you'll indeed see a
Peter Kasting 2015/01/27 00:20:32 That seems very, very bad. I would imagine this c
robwu 2015/01/27 22:03:47 Can you follow up with the right people? As a memb
+ 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