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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
8 #include "base/base_switches.h"
9 #include "base/command_line.h"
7 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
8 #include "chrome/browser/ui/simple_message_box.h" 11 #include "chrome/browser/ui/simple_message_box.h"
9 #include "chrome/grit/chromium_strings.h" 12 #include "chrome/grit/chromium_strings.h"
10 #include "ui/base/l10n/l10n_util.h" 13 #include "ui/base/l10n/l10n_util.h"
11 14
12 void ShowProfileErrorDialog(ProfileErrorType type, int message_id) { 15 void ShowProfileErrorDialog(ProfileErrorType type, int message_id) {
13 #if defined(OS_ANDROID) || defined(OS_IOS) 16 #if defined(OS_ANDROID) || defined(OS_IOS)
14 NOTIMPLEMENTED(); 17 NOTIMPLEMENTED();
15 #else 18 #else
16 UMA_HISTOGRAM_ENUMERATION("Profile.ProfileError", type, PROFILE_ERROR_END); 19 UMA_HISTOGRAM_ENUMERATION("Profile.ProfileError", type, PROFILE_ERROR_END);
17 chrome::ShowMessageBox(NULL, 20 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
18 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME), 21 switches::kNoErrorDialogs))
19 l10n_util::GetStringUTF16(message_id), 22 return;
20 chrome::MESSAGE_BOX_TYPE_WARNING); 23
24 static bool is_showing_profile_error_dialog = false;
25 if (!is_showing_profile_error_dialog) {
26 base::AutoReset<bool> resetter(&is_showing_profile_error_dialog, true);
27 chrome::ShowMessageBox(NULL,
28 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME),
29 l10n_util::GetStringUTF16(message_id),
30 chrome::MESSAGE_BOX_TYPE_WARNING);
31 }
21 #endif 32 #endif
22 } 33 }
OLDNEW
« 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