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/compiler_specific.h" |
8 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
9 #include "ui/gfx/native_widget_types.h" | 10 #include "ui/gfx/native_widget_types.h" |
10 | 11 |
11 namespace chrome { | 12 namespace chrome { |
12 | 13 |
13 enum MessageBoxResult { | 14 enum MessageBoxResult { |
14 // User chose NO or CANCEL. If there's a checkbox, then the checkbox was | 15 // User chose NO or CANCEL. If there's a checkbox, then the checkbox was |
15 // unchecked. | 16 // unchecked. |
16 MESSAGE_BOX_RESULT_NO = 0, | 17 MESSAGE_BOX_RESULT_NO = 0, |
17 | 18 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 // | 55 // |
55 // NOTE: In general, you should avoid this since it's usually poor UI. | 56 // NOTE: In general, you should avoid this since it's usually poor UI. |
56 // We have a variety of other surfaces such as app menu notifications and | 57 // We have a variety of other surfaces such as app menu notifications and |
57 // infobars; consult the UI leads for a recommendation. | 58 // infobars; consult the UI leads for a recommendation. |
58 MessageBoxResult ShowMessageBoxWithButtonText(gfx::NativeWindow parent, | 59 MessageBoxResult ShowMessageBoxWithButtonText(gfx::NativeWindow parent, |
59 const base::string16& title, | 60 const base::string16& title, |
60 const base::string16& message, | 61 const base::string16& message, |
61 const base::string16& yes_text, | 62 const base::string16& yes_text, |
62 const base::string16& no_text); | 63 const base::string16& no_text); |
63 | 64 |
| 65 // Closes the current message box, if any, accepting or declining based on |
| 66 // |accept|. Returns whether there was a message box showing. |
| 67 bool CloseMessageBoxForTest(bool accept) WARN_UNUSED_RESULT; |
| 68 |
64 } // namespace chrome | 69 } // namespace chrome |
65 | 70 |
66 #endif // CHROME_BROWSER_UI_SIMPLE_MESSAGE_BOX_H_ | 71 #endif // CHROME_BROWSER_UI_SIMPLE_MESSAGE_BOX_H_ |
OLD | NEW |