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 "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/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 SimpleMessageBoxViews::~SimpleMessageBoxViews() { | 190 SimpleMessageBoxViews::~SimpleMessageBoxViews() { |
191 } | 191 } |
192 | 192 |
193 MessageBoxResult ShowMessageBoxImpl(gfx::NativeWindow parent, | 193 MessageBoxResult ShowMessageBoxImpl(gfx::NativeWindow parent, |
194 const base::string16& title, | 194 const base::string16& title, |
195 const base::string16& message, | 195 const base::string16& message, |
196 MessageBoxType type, | 196 MessageBoxType type, |
197 const base::string16& yes_text, | 197 const base::string16& yes_text, |
198 const base::string16& no_text) { | 198 const base::string16& no_text) { |
199 | 199 |
200 #if defined(USE_AURA) && defined(OS_WIN) | 200 #if defined(OS_WIN) |
201 // If we're very early, we can't show a GPU-based dialog, so fallback to | 201 // If we're very early, we can't show a GPU-based dialog, so fallback to |
202 // plain Windows MessageBox. | 202 // plain Windows MessageBox. |
203 if (!ui::ContextFactory::GetInstance()) | 203 if (!ui::ContextFactory::GetInstance()) |
204 return NativeShowMessageBox(NULL, title, message, type); | 204 return NativeShowMessageBox(NULL, title, message, type); |
205 #endif | 205 #endif |
206 | 206 |
207 scoped_refptr<SimpleMessageBoxViews> dialog( | 207 scoped_refptr<SimpleMessageBoxViews> dialog( |
208 new SimpleMessageBoxViews(title, message, type, yes_text, no_text)); | 208 new SimpleMessageBoxViews(title, message, type, yes_text, no_text)); |
209 CreateBrowserModalDialogViews(dialog.get(), parent)->Show(); | 209 CreateBrowserModalDialogViews(dialog.get(), parent)->Show(); |
210 | 210 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 const base::string16& title, | 246 const base::string16& title, |
247 const base::string16& message, | 247 const base::string16& message, |
248 const base::string16& yes_text, | 248 const base::string16& yes_text, |
249 const base::string16& no_text) { | 249 const base::string16& no_text) { |
250 return ShowMessageBoxImpl( | 250 return ShowMessageBoxImpl( |
251 parent, title, message, MESSAGE_BOX_TYPE_QUESTION, yes_text, no_text); | 251 parent, title, message, MESSAGE_BOX_TYPE_QUESTION, yes_text, no_text); |
252 } | 252 } |
253 #endif | 253 #endif |
254 | 254 |
255 } // namespace chrome | 255 } // namespace chrome |
OLD | NEW |