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_CONSTRAINED_WINDOW_CONSTRAINED_WINDOW_VIEWS_H_ | 5 #ifndef COMPONENTS_CONSTRAINED_WINDOW_CONSTRAINED_WINDOW_VIEWS_H_ |
6 #define COMPONENTS_CONSTRAINED_WINDOW_CONSTRAINED_WINDOW_VIEWS_H_ | 6 #define COMPONENTS_CONSTRAINED_WINDOW_CONSTRAINED_WINDOW_VIEWS_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "ui/gfx/native_widget_types.h" | 9 #include "ui/gfx/native_widget_types.h" |
10 | 10 |
(...skipping 23 matching lines...) Expand all Loading... |
34 // Update the position of dialog |widget| against |dialog_host|. This is used to | 34 // Update the position of dialog |widget| against |dialog_host|. This is used to |
35 // reposition widgets e.g. when the host dimensions change. | 35 // reposition widgets e.g. when the host dimensions change. |
36 void UpdateWebContentsModalDialogPosition( | 36 void UpdateWebContentsModalDialogPosition( |
37 views::Widget* widget, | 37 views::Widget* widget, |
38 web_modal::WebContentsModalDialogHost* dialog_host); | 38 web_modal::WebContentsModalDialogHost* dialog_host); |
39 | 39 |
40 void UpdateWidgetModalDialogPosition( | 40 void UpdateWidgetModalDialogPosition( |
41 views::Widget* widget, | 41 views::Widget* widget, |
42 web_modal::ModalDialogHost* dialog_host); | 42 web_modal::ModalDialogHost* dialog_host); |
43 | 43 |
| 44 // Returns popup manager, if any, for WebContents. |
| 45 bool HasTopLevelDialogManager(content::WebContents* web_contents); |
| 46 |
44 // Calls CreateWebModalDialogViews, shows the dialog, and returns its widget. | 47 // Calls CreateWebModalDialogViews, shows the dialog, and returns its widget. |
45 views::Widget* ShowWebModalDialogViews( | 48 views::Widget* ShowWebModalDialogViews( |
46 views::WidgetDelegate* dialog, | 49 views::WidgetDelegate* dialog, |
47 content::WebContents* initiator_web_contents); | 50 content::WebContents* initiator_web_contents); |
48 | 51 |
49 // Create a widget for |dialog| that is modal to |web_contents|. | 52 // Create a widget for |dialog| that is modal to |web_contents|. |
50 // The modal type of |dialog->GetModalType()| must be ui::MODAL_TYPE_CHILD. | 53 // The modal type of |dialog->GetModalType()| must be ui::MODAL_TYPE_CHILD. |
51 views::Widget* CreateWebModalDialogViews(views::WidgetDelegate* dialog, | 54 views::Widget* CreateWebModalDialogViews(views::WidgetDelegate* dialog, |
52 content::WebContents* web_contents); | 55 content::WebContents* web_contents); |
53 | 56 |
54 // Create a widget for |dialog| that has a modality given by | 57 // Create a widget for |dialog| that has a modality given by |
55 // |dialog->GetModalType()|. The modal type must be either | 58 // |dialog->GetModalType()|. The modal type must be either |
56 // ui::MODAL_TYPE_SYSTEM or ui::MODAL_TYPE_WINDOW. This places the | 59 // ui::MODAL_TYPE_SYSTEM or ui::MODAL_TYPE_WINDOW. This places the |
57 // dialog appropriately if |parent| is a valid browser window. | 60 // dialog appropriately if |parent| is a valid browser window. |
58 views::Widget* CreateBrowserModalDialogViews(views::DialogDelegate* dialog, | 61 views::Widget* CreateBrowserModalDialogViews(views::DialogDelegate* dialog, |
59 gfx::NativeWindow parent); | 62 gfx::NativeWindow parent); |
60 | 63 |
61 } // namespace constrained window | 64 } // namespace constrained window |
62 | 65 |
63 #endif // COMPONENTS_CONSTRAINED_WINDOW_CONSTRAINED_WINDOW_VIEWS_H_ | 66 #endif // COMPONENTS_CONSTRAINED_WINDOW_CONSTRAINED_WINDOW_VIEWS_H_ |
OLD | NEW |