| 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 #include "chrome/browser/ui/simple_message_box.h" | 5 #include "chrome/browser/ui/simple_message_box.h" |
| 6 | 6 |
| 7 #include "ui/base/win/message_box_win.h" | 7 #include "ui/base/win/message_box_win.h" |
| 8 | 8 |
| 9 namespace browser { | 9 namespace chrome { |
| 10 | 10 |
| 11 MessageBoxResult ShowMessageBox(gfx::NativeWindow parent, | 11 MessageBoxResult ShowMessageBox(gfx::NativeWindow parent, |
| 12 const string16& title, | 12 const string16& title, |
| 13 const string16& message, | 13 const string16& message, |
| 14 MessageBoxType type) { | 14 MessageBoxType type) { |
| 15 UINT flags = MB_SETFOREGROUND; | 15 UINT flags = MB_SETFOREGROUND; |
| 16 flags |= ((type == MESSAGE_BOX_TYPE_QUESTION) ? MB_YESNO : MB_OK); | 16 flags |= ((type == MESSAGE_BOX_TYPE_QUESTION) ? MB_YESNO : MB_OK); |
| 17 flags |= ((type == MESSAGE_BOX_TYPE_INFORMATION) ? | 17 flags |= ((type == MESSAGE_BOX_TYPE_INFORMATION) ? |
| 18 MB_ICONINFORMATION : MB_ICONWARNING); | 18 MB_ICONINFORMATION : MB_ICONWARNING); |
| 19 return (ui::MessageBox(parent, message, title, flags) == IDNO) ? | 19 return (ui::MessageBox(parent, message, title, flags) == IDNO) ? |
| 20 MESSAGE_BOX_RESULT_NO : MESSAGE_BOX_RESULT_YES; | 20 MESSAGE_BOX_RESULT_NO : MESSAGE_BOX_RESULT_YES; |
| 21 } | 21 } |
| 22 | 22 |
| 23 } // namespace browser | 23 } // namespace chrome |
| OLD | NEW |