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_NATIVE_WEB_CONTENTS_MODAL_DIALOG_MANAGER_H_ | |
6 #define CHROME_BROWSER_UI_NATIVE_WEB_CONTENTS_MODAL_DIALOG_MANAGER_H_ | |
7 | |
8 #include "chrome/browser/ui/native_web_contents_modal_dialog.h" | |
9 | |
10 namespace content { | |
11 class WebContents; | |
12 } // namespace content | |
13 | |
14 // Interface from NativeWebContentsModalDialogManager to | |
15 // WebContentsModalDialogManager. | |
16 class NativeWebContentsModalDialogManagerDelegate { | |
17 public: | |
18 NativeWebContentsModalDialogManagerDelegate() {} | |
19 virtual ~NativeWebContentsModalDialogManagerDelegate() {} | |
20 | |
21 virtual content::WebContents* GetWebContents() const = 0; | |
22 virtual void WillClose(NativeWebContentsModalDialog dialog) = 0; | |
23 | |
24 private: | |
25 DISALLOW_COPY_AND_ASSIGN(NativeWebContentsModalDialogManagerDelegate); | |
26 }; | |
27 | |
28 // Provides an interface for platform-specific UI implementation for the web | |
29 // contents modal dialog. | |
30 class NativeWebContentsModalDialogManager { | |
31 public: | |
32 virtual ~NativeWebContentsModalDialogManager() {} | |
33 | |
34 // Starts management of the modal aspects of the dialog. This function should | |
35 // also register to be notified when the dialog is closing, so that it can | |
36 // notify the manager. | |
37 virtual void ManageDialog(NativeWebContentsModalDialog dialog) = 0; | |
38 | |
39 // Makes the web contents modal dialog visible. Only one web contents modal | |
40 // dialog is shown at a time per tab. | |
41 virtual void ShowDialog(NativeWebContentsModalDialog dialog) = 0; | |
42 | |
43 // Hides the web contents modal dialog without closing it. | |
44 virtual void HideDialog(NativeWebContentsModalDialog dialog) = 0; | |
45 | |
46 // Closes the web contents modal dialog. | |
47 virtual void CloseDialog(NativeWebContentsModalDialog dialog) = 0; | |
48 | |
49 // Sets focus on the web contents modal dialog. | |
50 virtual void FocusDialog(NativeWebContentsModalDialog dialog) = 0; | |
51 | |
52 // Runs a pulse animation for the web contents modal dialog. | |
53 virtual void PulseDialog(NativeWebContentsModalDialog dialog) = 0; | |
54 | |
55 protected: | |
56 NativeWebContentsModalDialogManager() {} | |
57 | |
58 private: | |
59 DISALLOW_COPY_AND_ASSIGN(NativeWebContentsModalDialogManager); | |
60 }; | |
61 | |
62 #endif // CHROME_BROWSER_UI_NATIVE_WEB_CONTENTS_MODAL_DIALOG_MANAGER_H_ | |
OLD | NEW |