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 CHROME_BROWSER_UI_VIEWS_JAVASCRIPT_APP_MODAL_DIALOG_VIEWS_H_
6 #define CHROME_BROWSER_UI_VIEWS_JAVASCRIPT_APP_MODAL_DIALOG_VIEWS_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "chrome/browser/ui/app_modal_dialogs/native_app_modal_dialog.h"
10 #include "ui/views/window/dialog_delegate.h"
12 class JavaScriptAppModalDialog;
18 class JavaScriptAppModalDialogViews : public NativeAppModalDialog,
19 public views::DialogDelegate {
21 explicit JavaScriptAppModalDialogViews(JavaScriptAppModalDialog* parent);
22 virtual ~JavaScriptAppModalDialogViews();
24 // Overridden from NativeAppModalDialog:
25 virtual int GetAppModalDialogButtons() const OVERRIDE;
26 virtual void ShowAppModalDialog() OVERRIDE;
27 virtual void ActivateAppModalDialog() OVERRIDE;
28 virtual void CloseAppModalDialog() OVERRIDE;
29 virtual void AcceptAppModalDialog() OVERRIDE;
30 virtual void CancelAppModalDialog() OVERRIDE;
32 // Overridden from views::DialogDelegate:
33 virtual int GetDefaultDialogButton() const OVERRIDE;
34 virtual int GetDialogButtons() const OVERRIDE;
35 virtual string16 GetWindowTitle() const OVERRIDE;
36 virtual void WindowClosing() OVERRIDE;
37 virtual void DeleteDelegate() OVERRIDE;
38 virtual bool Cancel() OVERRIDE;
39 virtual bool Accept() OVERRIDE;
40 virtual string16 GetDialogButtonLabel(ui::DialogButton button) const OVERRIDE;
42 // Overridden from views::WidgetDelegate:
43 virtual ui::ModalType GetModalType() const OVERRIDE;
44 virtual views::View* GetContentsView() OVERRIDE;
45 virtual views::View* GetInitiallyFocusedView() OVERRIDE;
46 virtual void OnClosed() OVERRIDE;
47 virtual views::Widget* GetWidget() OVERRIDE;
48 virtual const views::Widget* GetWidget() const OVERRIDE;
51 // A pointer to the AppModalDialog that owns us.
52 scoped_ptr<JavaScriptAppModalDialog> parent_;
54 // The message box view whose commands we handle.
55 views::MessageBoxView* message_box_view_;
57 DISALLOW_COPY_AND_ASSIGN(JavaScriptAppModalDialogViews);
60 #endif // CHROME_BROWSER_UI_VIEWS_JAVASCRIPT_APP_MODAL_DIALOG_VIEWS_H_