OLD | NEW |
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 #ifndef CHROME_BROWSER_UI_SIMPLE_MESSAGE_BOX_H_ | 5 #ifndef CHROME_BROWSER_UI_SIMPLE_MESSAGE_BOX_H_ |
6 #define CHROME_BROWSER_UI_SIMPLE_MESSAGE_BOX_H_ | 6 #define CHROME_BROWSER_UI_SIMPLE_MESSAGE_BOX_H_ |
7 | 7 |
8 #include "base/strings/string16.h" | 8 #include "base/strings/string16.h" |
9 #include "ui/gfx/native_widget_types.h" | 9 #include "ui/gfx/native_widget_types.h" |
10 | 10 |
11 namespace chrome { | 11 namespace chrome { |
12 | 12 |
13 enum MessageBoxResult { | 13 enum MessageBoxResult { |
14 MESSAGE_BOX_RESULT_NO = 0, // User chose NO or CANCEL. | 14 MESSAGE_BOX_RESULT_NO = 0, // User chose NO or CANCEL. |
15 MESSAGE_BOX_RESULT_YES = 1, // User chose YES or OK. | 15 MESSAGE_BOX_RESULT_YES = 1, // User chose YES or OK. |
16 }; | 16 }; |
17 | 17 |
18 enum MessageBoxType { | 18 enum MessageBoxType { |
19 MESSAGE_BOX_TYPE_INFORMATION, // Shows an OK button. | 19 MESSAGE_BOX_TYPE_INFORMATION, // Shows an OK button. |
20 MESSAGE_BOX_TYPE_WARNING, // Shows an OK button. | 20 MESSAGE_BOX_TYPE_WARNING, // Shows an OK button. |
21 MESSAGE_BOX_TYPE_QUESTION, // Shows YES and NO buttons. | 21 MESSAGE_BOX_TYPE_QUESTION, // Shows YES and NO buttons. |
22 MESSAGE_BOX_TYPE_OK_CANCEL, // Shows OK and CANCEL buttons (Windows or aura | 22 MESSAGE_BOX_TYPE_OK_CANCEL, // Shows OK and CANCEL buttons (Aura only). |
23 // only). | |
24 }; | 23 }; |
25 | 24 |
26 // Shows a dialog box with the given |title| and |message|. If |parent| is | 25 // Shows a dialog box with the given |title| and |message|. If |parent| is |
27 // non-NULL, the box will be made modal to the |parent|, except on Mac, where it | 26 // non-NULL, the box will be made modal to the |parent|, except on Mac, where it |
28 // is always app-modal. | 27 // is always app-modal. |
29 // | 28 // |
30 // NOTE: In general, you should avoid this since it's usually poor UI. | 29 // NOTE: In general, you should avoid this since it's usually poor UI. |
31 // We have a variety of other surfaces such as wrench menu notifications and | 30 // We have a variety of other surfaces such as wrench menu notifications and |
32 // infobars; consult the UI leads for a recommendation. | 31 // infobars; consult the UI leads for a recommendation. |
33 MessageBoxResult ShowMessageBox(gfx::NativeWindow parent, | 32 MessageBoxResult ShowMessageBox(gfx::NativeWindow parent, |
(...skipping 10 matching lines...) Expand all Loading... |
44 // infobars; consult the UI leads for a recommendation. | 43 // infobars; consult the UI leads for a recommendation. |
45 MessageBoxResult ShowMessageBoxWithButtonText(gfx::NativeWindow parent, | 44 MessageBoxResult ShowMessageBoxWithButtonText(gfx::NativeWindow parent, |
46 const base::string16& title, | 45 const base::string16& title, |
47 const base::string16& message, | 46 const base::string16& message, |
48 const base::string16& yes_text, | 47 const base::string16& yes_text, |
49 const base::string16& no_text); | 48 const base::string16& no_text); |
50 | 49 |
51 } // namespace chrome | 50 } // namespace chrome |
52 | 51 |
53 #endif // CHROME_BROWSER_UI_SIMPLE_MESSAGE_BOX_H_ | 52 #endif // CHROME_BROWSER_UI_SIMPLE_MESSAGE_BOX_H_ |
OLD | NEW |