| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/string16.h" | 9 #include "base/string16.h" |
| 10 #include "ui/gfx/native_widget_types.h" | 10 #include "ui/gfx/native_widget_types.h" |
| 11 | 11 |
| 12 namespace browser { | 12 namespace chrome { |
| 13 | 13 |
| 14 enum MessageBoxResult { | 14 enum MessageBoxResult { |
| 15 MESSAGE_BOX_RESULT_NO = 0, | 15 MESSAGE_BOX_RESULT_NO = 0, |
| 16 MESSAGE_BOX_RESULT_YES = 1, | 16 MESSAGE_BOX_RESULT_YES = 1, |
| 17 }; | 17 }; |
| 18 | 18 |
| 19 enum MessageBoxType { | 19 enum MessageBoxType { |
| 20 MESSAGE_BOX_TYPE_INFORMATION, | 20 MESSAGE_BOX_TYPE_INFORMATION, |
| 21 MESSAGE_BOX_TYPE_WARNING, | 21 MESSAGE_BOX_TYPE_WARNING, |
| 22 MESSAGE_BOX_TYPE_QUESTION, | 22 MESSAGE_BOX_TYPE_QUESTION, |
| 23 }; | 23 }; |
| 24 | 24 |
| 25 // 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 |
| 26 // 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 |
| 27 // is always app-modal. If |type| is MESSAGE_BOX_TYPE_QUESTION, the box will | 27 // is always app-modal. If |type| is MESSAGE_BOX_TYPE_QUESTION, the box will |
| 28 // have YES and NO buttons; otherwise it will have an OK button. | 28 // have YES and NO buttons; otherwise it will have an OK button. |
| 29 // | 29 // |
| 30 // NOTE: In general, you should avoid this since it's usually poor UI. | 30 // 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 | 31 // We have a variety of other surfaces such as wrench menu notifications and |
| 32 // infobars; consult the UI leads for a recommendation. | 32 // infobars; consult the UI leads for a recommendation. |
| 33 MessageBoxResult ShowMessageBox(gfx::NativeWindow parent, | 33 MessageBoxResult ShowMessageBox(gfx::NativeWindow parent, |
| 34 const string16& title, | 34 const string16& title, |
| 35 const string16& message, | 35 const string16& message, |
| 36 MessageBoxType type); | 36 MessageBoxType type); |
| 37 | 37 |
| 38 } // namespace browser | 38 } // namespace chrome |
| 39 | 39 |
| 40 #endif // CHROME_BROWSER_UI_SIMPLE_MESSAGE_BOX_H_ | 40 #endif // CHROME_BROWSER_UI_SIMPLE_MESSAGE_BOX_H_ |
| OLD | NEW |