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