blob: e4a155bd2561bd6dc6f9c847fce6475d55eada75 [file] [log] [blame]
[email protected]5c61cc92012-04-23 02:00:391// Copyright (c) 2012 The Chromium Authors. All rights reserved.
[email protected]80772ed2011-08-09 21:11:382// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
[email protected]b50892c5f2012-05-13 07:34:145#ifndef CHROME_BROWSER_UI_SIMPLE_MESSAGE_BOX_H_
6#define CHROME_BROWSER_UI_SIMPLE_MESSAGE_BOX_H_
[email protected]80772ed2011-08-09 21:11:387
[email protected]f92d65882013-06-10 22:02:368#include "base/strings/string16.h"
[email protected]80772ed2011-08-09 21:11:389#include "ui/gfx/native_widget_types.h"
10
[email protected]d33220292012-07-04 01:41:2711namespace chrome {
[email protected]80772ed2011-08-09 21:11:3812
[email protected]5da155e2012-05-26 16:31:1613enum MessageBoxResult {
[email protected]24ced7dc02013-04-04 08:32:3914 MESSAGE_BOX_RESULT_NO = 0, // User chose NO or CANCEL.
15 MESSAGE_BOX_RESULT_YES = 1, // User chose YES or OK.
[email protected]5da155e2012-05-26 16:31:1616};
17
[email protected]d1f48ef52012-05-13 19:34:2118enum MessageBoxType {
[email protected]f8ef7162013-11-22 01:56:4119 MESSAGE_BOX_TYPE_INFORMATION, // Shows an OK button.
20 MESSAGE_BOX_TYPE_WARNING, // Shows an OK button.
21 MESSAGE_BOX_TYPE_QUESTION, // Shows YES and NO buttons.
[email protected]a6539cd2014-02-20 12:50:3622 MESSAGE_BOX_TYPE_OK_CANCEL, // Shows OK and CANCEL buttons (Aura only).
[email protected]d1f48ef52012-05-13 19:34:2123};
24
[email protected]5da155e2012-05-26 16:31:1625// Shows a dialog box with the given |title| and |message|. If |parent| is
26// non-NULL, the box will be made modal to the |parent|, except on Mac, where it
[email protected]24ced7dc02013-04-04 08:32:3927// is always app-modal.
[email protected]5da155e2012-05-26 16:31:1628//
29// NOTE: In general, you should avoid this since it's usually poor UI.
30// We have a variety of other surfaces such as wrench menu notifications and
31// infobars; consult the UI leads for a recommendation.
32MessageBoxResult ShowMessageBox(gfx::NativeWindow parent,
[email protected]dcd0249872013-12-06 23:58:4533 const base::string16& title,
34 const base::string16& message,
[email protected]5da155e2012-05-26 16:31:1635 MessageBoxType type);
[email protected]80772ed2011-08-09 21:11:3836
[email protected]f8ef7162013-11-22 01:56:4137// Shows a dialog box with the given |title| and |message|, and with two buttons
38// labeled with |yes_text| and |no_text|. If |parent| is non-NULL, the box will
39// be made modal to the |parent|. (Aura only.)
40//
41// NOTE: In general, you should avoid this since it's usually poor UI.
42// We have a variety of other surfaces such as wrench menu notifications and
43// infobars; consult the UI leads for a recommendation.
44MessageBoxResult ShowMessageBoxWithButtonText(gfx::NativeWindow parent,
[email protected]dcd0249872013-12-06 23:58:4545 const base::string16& title,
46 const base::string16& message,
47 const base::string16& yes_text,
48 const base::string16& no_text);
[email protected]f8ef7162013-11-22 01:56:4149
[email protected]d33220292012-07-04 01:41:2750} // namespace chrome
[email protected]80772ed2011-08-09 21:11:3851
[email protected]b50892c5f2012-05-13 07:34:1452#endif // CHROME_BROWSER_UI_SIMPLE_MESSAGE_BOX_H_