summaryrefslogtreecommitdiffstats
path: root/app/win_util.cc
diff options
context:
space:
mode:
authorabarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-17 06:11:56 +0000
committerabarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-17 06:11:56 +0000
commit5e6e939f429310fb37d00421f728ecba11bc030e (patch)
treeb901d98ca174aadc338a728914c1603c5d277f45 /app/win_util.cc
parent912c64520e0e9f22bd49e43c7ee102e3b9de66a7 (diff)
downloadchromium_src-5e6e939f429310fb37d00421f728ecba11bc030e.zip
chromium_src-5e6e939f429310fb37d00421f728ecba11bc030e.tar.gz
chromium_src-5e6e939f429310fb37d00421f728ecba11bc030e.tar.bz2
Add a command line argument to disable message boxes. This is useful to
extension developers who want to package extensions as part of a build script and aren't there to click the message box. R=aa,jackson BUG=14732 TEST=Pack an extension with the --no-message-box flag and notice that there is no message box. Review URL: http://codereview.chromium.org/149795 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20937 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app/win_util.cc')
-rw-r--r--app/win_util.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/win_util.cc b/app/win_util.cc
index 70e6ecc..9e54f5c 100644
--- a/app/win_util.cc
+++ b/app/win_util.cc
@@ -13,6 +13,8 @@
#include "app/l10n_util.h"
#include "app/l10n_util_win.h"
+#include "base/base_switches.h"
+#include "base/command_line.h"
#include "base/file_util.h"
#include "base/gfx/gdi_util.h"
#include "base/gfx/png_encoder.h"
@@ -795,6 +797,9 @@ int MessageBox(HWND hwnd,
const std::wstring& text,
const std::wstring& caption,
UINT flags) {
+ if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kNoMessageBox))
+ return IDOK;
+
UINT actual_flags = flags;
if (l10n_util::GetTextDirection() == l10n_util::RIGHT_TO_LEFT)
actual_flags |= MB_RIGHT | MB_RTLREADING;