OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/app_modal_dialog.h" | 5 #include "chrome/browser/app_modal_dialog.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "chrome/browser/views/jsmessage_box_dialog.h" | 8 #include "chrome/browser/views/jsmessage_box_dialog.h" |
| 9 #include "views/window/dialog_delegate.h" |
9 #include "views/window/window.h" | 10 #include "views/window/window.h" |
10 | 11 |
11 AppModalDialog::~AppModalDialog() { | 12 AppModalDialog::~AppModalDialog() { |
12 } | 13 } |
13 | 14 |
14 void AppModalDialog::CreateAndShowDialog() { | 15 void AppModalDialog::CreateAndShowDialog() { |
15 dialog_ = new JavascriptMessageBoxDialog(this, message_text_, | 16 dialog_ = CreateNativeDialog(); |
16 default_prompt_text_, display_suppress_checkbox_); | |
17 DCHECK(dialog_->IsModal()); | 17 DCHECK(dialog_->IsModal()); |
18 dialog_->ShowModalDialog(); | 18 dialog_->ShowModalDialog(); |
19 } | 19 } |
20 | 20 |
21 void AppModalDialog::ActivateModalDialog() { | 21 void AppModalDialog::ActivateModalDialog() { |
22 dialog_->ActivateModalDialog(); | 22 dialog_->ActivateModalDialog(); |
23 } | 23 } |
24 | 24 |
25 void AppModalDialog::CloseModalDialog() { | 25 void AppModalDialog::CloseModalDialog() { |
26 dialog_->CloseModalDialog(); | 26 dialog_->CloseModalDialog(); |
27 } | 27 } |
28 | |
29 int AppModalDialog::GetDialogButtons() { | |
30 return dialog_->GetDialogButtons(); | |
31 } | |
32 | |
33 void AppModalDialog::AcceptWindow() { | |
34 views::DialogClientView* client_view = | |
35 dialog_->window()->GetClientView()->AsDialogClientView(); | |
36 client_view->AcceptWindow(); | |
37 } | |
38 | |
39 void AppModalDialog::CancelWindow() { | |
40 views::DialogClientView* client_view = | |
41 dialog_->window()->GetClientView()->AsDialogClientView(); | |
42 client_view->CancelWindow(); | |
43 } | |
OLD | NEW |