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
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_APP_MODAL_VIEWS_JAVASCRIPT_APP_MODAL_DIALOG_VIEWS_H_
6 #define COMPONENTS_APP_MODAL_VIEWS_JAVASCRIPT_APP_MODAL_DIALOG_VIEWS_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "components/app_modal/native_app_modal_dialog.h"
10 #include "ui/views/window/dialog_delegate.h"
12 class JavaScriptAppModalDialog
;
20 class JavaScriptAppModalDialogViews
: public NativeAppModalDialog
,
21 public views::DialogDelegate
{
23 explicit JavaScriptAppModalDialogViews(JavaScriptAppModalDialog
* parent
);
24 ~JavaScriptAppModalDialogViews() override
;
26 // Overridden from NativeAppModalDialog:
27 int GetAppModalDialogButtons() const override
;
28 void ShowAppModalDialog() override
;
29 void ActivateAppModalDialog() override
;
30 void CloseAppModalDialog() override
;
31 void AcceptAppModalDialog() override
;
32 void CancelAppModalDialog() override
;
33 bool IsShowing() const override
;
35 // Overridden from views::DialogDelegate:
36 int GetDefaultDialogButton() const override
;
37 int GetDialogButtons() const override
;
38 base::string16
GetWindowTitle() const override
;
39 void DeleteDelegate() override
;
40 bool Cancel() override
;
41 bool Accept() override
;
42 base::string16
GetDialogButtonLabel(ui::DialogButton button
) const override
;
44 // Overridden from views::WidgetDelegate:
45 ui::ModalType
GetModalType() const override
;
46 views::View
* GetContentsView() override
;
47 views::View
* GetInitiallyFocusedView() override
;
48 void OnClosed() override
;
49 views::Widget
* GetWidget() override
;
50 const views::Widget
* GetWidget() const override
;
53 // A pointer to the AppModalDialog that owns us.
54 scoped_ptr
<JavaScriptAppModalDialog
> parent_
;
56 // The message box view whose commands we handle.
57 views::MessageBoxView
* message_box_view_
;
59 DISALLOW_COPY_AND_ASSIGN(JavaScriptAppModalDialogViews
);
62 } // namespace app_modal
64 #endif // COMPONENTS_APP_MODAL_VIEWS_JAVASCRIPT_APP_MODAL_DIALOG_VIEWS_H_