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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 aura::Window* anchor = parent; | 206 aura::Window* anchor = parent; |
207 aura::client::DispatcherClient* client = anchor ? | 207 aura::client::DispatcherClient* client = anchor ? |
208 aura::client::GetDispatcherClient(anchor->GetRootWindow()) : NULL; | 208 aura::client::GetDispatcherClient(anchor->GetRootWindow()) : NULL; |
209 if (!client) { | 209 if (!client) { |
210 // Use the widget's window itself so that the message loop | 210 // Use the widget's window itself so that the message loop |
211 // exists when the dialog is closed by some other means than | 211 // exists when the dialog is closed by some other means than |
212 // |Cancel| or |Accept|. | 212 // |Cancel| or |Accept|. |
213 anchor = dialog->GetWidget()->GetNativeWindow(); | 213 anchor = dialog->GetWidget()->GetNativeWindow(); |
214 client = aura::client::GetDispatcherClient(anchor->GetRootWindow()); | 214 client = aura::client::GetDispatcherClient(anchor->GetRootWindow()); |
215 } | 215 } |
216 client->RunWithDispatcher(dialog.get(), anchor, true); | 216 client->RunWithDispatcher(dialog.get(), anchor); |
217 return dialog->result(); | 217 return dialog->result(); |
218 } | 218 } |
219 | 219 |
220 } // namespace | 220 } // namespace |
221 | 221 |
222 MessageBoxResult ShowMessageBox(gfx::NativeWindow parent, | 222 MessageBoxResult ShowMessageBox(gfx::NativeWindow parent, |
223 const base::string16& title, | 223 const base::string16& title, |
224 const base::string16& message, | 224 const base::string16& message, |
225 MessageBoxType type) { | 225 MessageBoxType type) { |
226 return ShowMessageBoxImpl( | 226 return ShowMessageBoxImpl( |
227 parent, title, message, type, base::string16(), base::string16()); | 227 parent, title, message, type, base::string16(), base::string16()); |
228 } | 228 } |
229 | 229 |
230 MessageBoxResult ShowMessageBoxWithButtonText(gfx::NativeWindow parent, | 230 MessageBoxResult ShowMessageBoxWithButtonText(gfx::NativeWindow parent, |
231 const base::string16& title, | 231 const base::string16& title, |
232 const base::string16& message, | 232 const base::string16& message, |
233 const base::string16& yes_text, | 233 const base::string16& yes_text, |
234 const base::string16& no_text) { | 234 const base::string16& no_text) { |
235 return ShowMessageBoxImpl( | 235 return ShowMessageBoxImpl( |
236 parent, title, message, MESSAGE_BOX_TYPE_QUESTION, yes_text, no_text); | 236 parent, title, message, MESSAGE_BOX_TYPE_QUESTION, yes_text, no_text); |
237 } | 237 } |
238 | 238 |
239 } // namespace chrome | 239 } // namespace chrome |
OLD | NEW |