| 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/simple_message_box.h" | 5 #include "chrome/browser/simple_message_box.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 // SimpleMessageBoxViews, private: | 129 // SimpleMessageBoxViews, private: |
| 130 | 130 |
| 131 SimpleMessageBoxViews::SimpleMessageBoxViews(gfx::NativeWindow parent_window, | 131 SimpleMessageBoxViews::SimpleMessageBoxViews(gfx::NativeWindow parent_window, |
| 132 const string16& title, | 132 const string16& title, |
| 133 const string16& message, | 133 const string16& message, |
| 134 DialogType dialog_type) | 134 DialogType dialog_type) |
| 135 : window_title_(title), | 135 : window_title_(title), |
| 136 dialog_type_(dialog_type), | 136 dialog_type_(dialog_type), |
| 137 disposition_(DISPOSITION_UNKNOWN), | 137 disposition_(DISPOSITION_UNKNOWN), |
| 138 message_box_view_(new views::MessageBoxView( | 138 message_box_view_(new views::MessageBoxView( |
| 139 views::MessageBoxView::NO_OPTIONS, message, string16())) { | 139 views::MessageBoxView::InitParams(message))) { |
| 140 views::Widget::CreateWindowWithParent(this, parent_window)->Show(); | 140 views::Widget::CreateWindowWithParent(this, parent_window)->Show(); |
| 141 | 141 |
| 142 // Add reference to be released in DeleteDelegate(). | 142 // Add reference to be released in DeleteDelegate(). |
| 143 AddRef(); | 143 AddRef(); |
| 144 } | 144 } |
| 145 | 145 |
| 146 SimpleMessageBoxViews::~SimpleMessageBoxViews() { | 146 SimpleMessageBoxViews::~SimpleMessageBoxViews() { |
| 147 } | 147 } |
| 148 | 148 |
| 149 int SimpleMessageBoxViews::GetDialogButtons() const { | 149 int SimpleMessageBoxViews::GetDialogButtons() const { |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 SimpleMessageBoxViews::ShowWarningMessageBox(parent, title, message); | 212 SimpleMessageBoxViews::ShowWarningMessageBox(parent, title, message); |
| 213 } | 213 } |
| 214 | 214 |
| 215 bool ShowQuestionMessageBox(gfx::NativeWindow parent, | 215 bool ShowQuestionMessageBox(gfx::NativeWindow parent, |
| 216 const string16& title, | 216 const string16& title, |
| 217 const string16& message) { | 217 const string16& message) { |
| 218 return SimpleMessageBoxViews::ShowQuestionMessageBox(parent, title, message); | 218 return SimpleMessageBoxViews::ShowQuestionMessageBox(parent, title, message); |
| 219 } | 219 } |
| 220 | 220 |
| 221 } // namespace browser | 221 } // namespace browser |
| OLD | NEW |