blob: 897c81146e89bc8ae687d95ed9d517d789c3e9c8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/app_modal_dialog.h"
#include "base/logging.h"
#include "chrome/browser/views/jsmessage_box_dialog.h"
#include "views/window/window.h"
AppModalDialog::~AppModalDialog() {
}
void AppModalDialog::CreateAndShowDialog() {
dialog_ = new JavascriptMessageBoxDialog(this, message_text_,
default_prompt_text_, display_suppress_checkbox_);
DCHECK(dialog_->IsModal());
dialog_->ShowModalDialog();
}
void AppModalDialog::ActivateModalDialog() {
dialog_->ActivateModalDialog();
}
void AppModalDialog::CloseModalDialog() {
dialog_->CloseModalDialog();
}
int AppModalDialog::GetDialogButtons() {
return dialog_->GetDialogButtons();
}
void AppModalDialog::AcceptWindow() {
views::DialogClientView* client_view =
dialog_->window()->GetClientView()->AsDialogClientView();
client_view->AcceptWindow();
}
void AppModalDialog::CancelWindow() {
views::DialogClientView* client_view =
dialog_->window()->GetClientView()->AsDialogClientView();
client_view->CancelWindow();
}
|