OLD | NEW |
| (Empty) |
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. | |
4 | |
5 #ifndef CHROME_BROWSER_UI_VIEWS_JAVASCRIPT_APP_MODAL_DIALOG_VIEWS_H_ | |
6 #define CHROME_BROWSER_UI_VIEWS_JAVASCRIPT_APP_MODAL_DIALOG_VIEWS_H_ | |
7 | |
8 #include "base/memory/scoped_ptr.h" | |
9 #include "components/app_modal_dialogs/native_app_modal_dialog.h" | |
10 #include "ui/views/window/dialog_delegate.h" | |
11 | |
12 class JavaScriptAppModalDialog; | |
13 | |
14 #if defined(USE_X11) && !defined(OS_CHROMEOS) | |
15 class JavascriptAppModalEventBlockerX11; | |
16 #endif | |
17 | |
18 namespace views { | |
19 class MessageBoxView; | |
20 } | |
21 | |
22 class JavaScriptAppModalDialogViews : public NativeAppModalDialog, | |
23 public views::DialogDelegate { | |
24 public: | |
25 explicit JavaScriptAppModalDialogViews(JavaScriptAppModalDialog* parent); | |
26 ~JavaScriptAppModalDialogViews() override; | |
27 | |
28 // Overridden from NativeAppModalDialog: | |
29 int GetAppModalDialogButtons() const override; | |
30 void ShowAppModalDialog() override; | |
31 void ActivateAppModalDialog() override; | |
32 void CloseAppModalDialog() override; | |
33 void AcceptAppModalDialog() override; | |
34 void CancelAppModalDialog() override; | |
35 | |
36 // Overridden from views::DialogDelegate: | |
37 int GetDefaultDialogButton() const override; | |
38 int GetDialogButtons() const override; | |
39 base::string16 GetWindowTitle() const override; | |
40 void WindowClosing() override; | |
41 void DeleteDelegate() override; | |
42 bool Cancel() override; | |
43 bool Accept() override; | |
44 base::string16 GetDialogButtonLabel(ui::DialogButton button) const override; | |
45 | |
46 // Overridden from views::WidgetDelegate: | |
47 ui::ModalType GetModalType() const override; | |
48 views::View* GetContentsView() override; | |
49 views::View* GetInitiallyFocusedView() override; | |
50 void OnClosed() override; | |
51 views::Widget* GetWidget() override; | |
52 const views::Widget* GetWidget() const override; | |
53 | |
54 private: | |
55 // A pointer to the AppModalDialog that owns us. | |
56 scoped_ptr<JavaScriptAppModalDialog> parent_; | |
57 | |
58 // The message box view whose commands we handle. | |
59 views::MessageBoxView* message_box_view_; | |
60 | |
61 #if defined(USE_X11) && !defined(OS_CHROMEOS) | |
62 // Blocks events to other browser windows while the dialog is open. | |
63 scoped_ptr<JavascriptAppModalEventBlockerX11> event_blocker_x11_; | |
64 #endif | |
65 | |
66 DISALLOW_COPY_AND_ASSIGN(JavaScriptAppModalDialogViews); | |
67 }; | |
68 | |
69 #endif // CHROME_BROWSER_UI_VIEWS_JAVASCRIPT_APP_MODAL_DIALOG_VIEWS_H_ | |
OLD | NEW |