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