OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef COMPONENTS_WEB_MODAL_WEB_CONTENTS_MODAL_DIALOG_MANAGER_H_ | 5 #ifndef COMPONENTS_WEB_MODAL_WEB_CONTENTS_MODAL_DIALOG_MANAGER_H_ |
6 #define COMPONENTS_WEB_MODAL_WEB_CONTENTS_MODAL_DIALOG_MANAGER_H_ | 6 #define COMPONENTS_WEB_MODAL_WEB_CONTENTS_MODAL_DIALOG_MANAGER_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 WebContentsModalDialogManagerDelegate* delegate() const { return delegate_; } | 31 WebContentsModalDialogManagerDelegate* delegate() const { return delegate_; } |
32 void SetDelegate(WebContentsModalDialogManagerDelegate* d); | 32 void SetDelegate(WebContentsModalDialogManagerDelegate* d); |
33 | 33 |
34 static NativeWebContentsModalDialogManager* CreateNativeManager( | 34 static NativeWebContentsModalDialogManager* CreateNativeManager( |
35 NativeWebContentsModalDialogManagerDelegate* native_delegate); | 35 NativeWebContentsModalDialogManagerDelegate* native_delegate); |
36 | 36 |
37 // Shows the dialog as a web contents modal dialog. The dialog will notify via | 37 // Shows the dialog as a web contents modal dialog. The dialog will notify via |
38 // WillClose() when it is being destroyed. | 38 // WillClose() when it is being destroyed. |
39 void ShowDialog(NativeWebContentsModalDialog dialog); | 39 void ShowDialog(NativeWebContentsModalDialog dialog); |
40 | 40 |
41 // Returns true if a dialog is currently being shown. | 41 // Returns true if any dialogs are active and not closed. |
| 42 // TODO(wittman): Give this a better name, since it can return true if no |
| 43 // dialogs are displayed. |
42 bool IsShowingDialog() const; | 44 bool IsShowingDialog() const; |
43 | 45 |
44 // Focus the topmost modal dialog. IsShowingDialog() must be true when | 46 // Focus the topmost modal dialog. IsShowingDialog() must be true when |
45 // calling this function. | 47 // calling this function. |
46 void FocusTopmostDialog(); | 48 void FocusTopmostDialog(); |
47 | 49 |
48 // Overriden from NativeWebContentsModalDialogManagerDelegate: | 50 // Overriden from NativeWebContentsModalDialogManagerDelegate: |
49 virtual content::WebContents* GetWebContents() const OVERRIDE; | 51 virtual content::WebContents* GetWebContents() const OVERRIDE; |
50 // Called when a WebContentsModalDialogs we own is about to be closed. | 52 // Called when a WebContentsModalDialogs we own is about to be closed. |
51 virtual void WillClose(NativeWebContentsModalDialog dialog) OVERRIDE; | 53 virtual void WillClose(NativeWebContentsModalDialog dialog) OVERRIDE; |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 | 109 |
108 // A scoped container for notification registries. | 110 // A scoped container for notification registries. |
109 content::NotificationRegistrar registrar_; | 111 content::NotificationRegistrar registrar_; |
110 | 112 |
111 DISALLOW_COPY_AND_ASSIGN(WebContentsModalDialogManager); | 113 DISALLOW_COPY_AND_ASSIGN(WebContentsModalDialogManager); |
112 }; | 114 }; |
113 | 115 |
114 } // namespace web_modal | 116 } // namespace web_modal |
115 | 117 |
116 #endif // COMPONENTS_WEB_MODAL_WEB_CONTENTS_MODAL_DIALOG_MANAGER_H_ | 118 #endif // COMPONENTS_WEB_MODAL_WEB_CONTENTS_MODAL_DIALOG_MANAGER_H_ |
OLD | NEW |